1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  flvenc: silence bogus warning
  configure: include flags in nm variable
  alsdec: fix misplaced parentheses.
  alsdec: check return values.
  alsdec: fix number of decoded samples in first sub-block in BGMC mode.
  alsdec: Fix out of ltp_gain_values read.
  alsdec: Check that quantized parcor coeffs are within range.
  alsdec: check opt_order.

Conflicts:
	configure
	libavcodec/alsdec.c
	libavformat/flvenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-09-18 15:06:43 +02:00
commit 4cdc337b5d
2 changed files with 22 additions and 19 deletions

10
configure vendored
View File

@ -2015,14 +2015,13 @@ cxx_default="g++"
host_cc_default="gcc" host_cc_default="gcc"
install="install" install="install"
ln_s="ln -sf" ln_s="ln -sf"
nm_default="nm" nm_default="nm -g"
objformat="elf" objformat="elf"
pkg_config_default=pkg-config pkg_config_default=pkg-config
ranlib="ranlib" ranlib="ranlib"
strip_default="strip" strip_default="strip"
yasmexe_default="yasm" yasmexe_default="yasm"
nm_opts='-g'
nogas=":" nogas=":"
# machine # machine
@ -2309,7 +2308,7 @@ strip_default="${cross_prefix}${strip_default}"
sysinclude_default="${sysroot}/usr/include" sysinclude_default="${sysroot}/usr/include"
set_default cc cxx nm pkg_config strip sysinclude yasmexe set_default cc cxx pkg_config strip sysinclude yasmexe
enabled cross_compile || host_cc_default=$cc enabled cross_compile || host_cc_default=$cc
set_default host_cc set_default host_cc
@ -2988,7 +2987,7 @@ case $target_os in
# guards for processor-specific code, instead suppress # guards for processor-specific code, instead suppress
# generation of the HWCAPS ELF section on Solaris x86 only. # generation of the HWCAPS ELF section on Solaris x86 only.
enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile
nm_opts='-P -g' nm_default='nm -P -g'
;; ;;
netbsd) netbsd)
disable symver disable symver
@ -3191,6 +3190,7 @@ echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFI
check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
set_default $PATHS_LIST set_default $PATHS_LIST
set_default nm
# we need to build at least one lib type # we need to build at least one lib type
if ! enabled_any static shared; then if ! enabled_any static shared; then
@ -3244,7 +3244,7 @@ enabled pic && enable_pic
check_cc <<EOF || die "Symbol mangling check failed." check_cc <<EOF || die "Symbol mangling check failed."
int ff_extern; int ff_extern;
EOF EOF
sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }') sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
extern_prefix=${sym%%ff_extern*} extern_prefix=${sym%%ff_extern*}
check_cc <<EOF && enable_weak inline_asm check_cc <<EOF && enable_weak inline_asm

View File

@ -671,7 +671,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
if (*bd->opt_order > sconf->max_order) { if (*bd->opt_order > sconf->max_order) {
*bd->opt_order = sconf->max_order; *bd->opt_order = sconf->max_order;
av_log(avctx, AV_LOG_ERROR, "Predictor order too large!\n"); av_log(avctx, AV_LOG_ERROR, "Predictor order too large!\n");
return -1; return AVERROR_INVALIDDATA;
} }
} else { } else {
*bd->opt_order = sconf->max_order; *bd->opt_order = sconf->max_order;
@ -706,7 +706,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
int offset = parcor_rice_table[sconf->coef_table][k][0]; int offset = parcor_rice_table[sconf->coef_table][k][0];
quant_cof[k] = decode_rice(gb, rice_param) + offset; quant_cof[k] = decode_rice(gb, rice_param) + offset;
if (quant_cof[k] < -64 || quant_cof[k] > 63) { if (quant_cof[k] < -64 || quant_cof[k] > 63) {
av_log(avctx, AV_LOG_ERROR, "Quantization coefficient %d is out of range!\n", quant_cof[k]); av_log(avctx, AV_LOG_ERROR, "quant_cof %d is out of range\n", quant_cof[k]);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
} }
@ -770,7 +770,6 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
int delta[8]; int delta[8];
unsigned int k [8]; unsigned int k [8];
unsigned int b = av_clip((av_ceil_log2(bd->block_length) - 3) >> 1, 0, 5); unsigned int b = av_clip((av_ceil_log2(bd->block_length) - 3) >> 1, 0, 5);
unsigned int i = start;
// read most significant bits // read most significant bits
unsigned int high; unsigned int high;
@ -781,29 +780,30 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
current_res = bd->raw_samples + start; current_res = bd->raw_samples + start;
for (sb = 0; sb < sub_blocks; sb++, i = 0) { for (sb = 0; sb < sub_blocks; sb++) {
unsigned int sb_len = sb_length - (sb ? 0 : start);
k [sb] = s[sb] > b ? s[sb] - b : 0; k [sb] = s[sb] > b ? s[sb] - b : 0;
delta[sb] = 5 - s[sb] + k[sb]; delta[sb] = 5 - s[sb] + k[sb];
ff_bgmc_decode(gb, sb_length - i, current_res, ff_bgmc_decode(gb, sb_len, current_res,
delta[sb], sx[sb], &high, &low, &value, ctx->bgmc_lut, ctx->bgmc_lut_status); delta[sb], sx[sb], &high, &low, &value, ctx->bgmc_lut, ctx->bgmc_lut_status);
current_res += sb_length - i; current_res += sb_len;
} }
ff_bgmc_decode_end(gb); ff_bgmc_decode_end(gb);
// read least significant bits and tails // read least significant bits and tails
i = start;
current_res = bd->raw_samples + start; current_res = bd->raw_samples + start;
for (sb = 0; sb < sub_blocks; sb++, i = 0) { for (sb = 0; sb < sub_blocks; sb++, start = 0) {
unsigned int cur_tail_code = tail_code[sx[sb]][delta[sb]]; unsigned int cur_tail_code = tail_code[sx[sb]][delta[sb]];
unsigned int cur_k = k[sb]; unsigned int cur_k = k[sb];
unsigned int cur_s = s[sb]; unsigned int cur_s = s[sb];
for (; i < sb_length; i++) { for (; start < sb_length; start++) {
int32_t res = *current_res; int32_t res = *current_res;
if (res == cur_tail_code) { if (res == cur_tail_code) {
@ -1348,7 +1348,7 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
} }
} else { // multi-channel coding } else { // multi-channel coding
ALSBlockData bd = { 0 }; ALSBlockData bd = { 0 };
int b; int b, ret;
int *reverted_channels = ctx->reverted_channels; int *reverted_channels = ctx->reverted_channels;
unsigned int offset = 0; unsigned int offset = 0;
@ -1381,8 +1381,10 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
bd.raw_samples = ctx->raw_samples[c] + offset; bd.raw_samples = ctx->raw_samples[c] + offset;
bd.raw_other = NULL; bd.raw_other = NULL;
if (read_block(ctx, &bd) || read_channel_data(ctx, ctx->chan_data[c], c)) if ((ret = read_block(ctx, &bd)) < 0)
return -1; return ret;
if ((ret = read_channel_data(ctx, ctx->chan_data[c], c)) < 0)
return ret;
} }
for (c = 0; c < avctx->channels; c++) for (c = 0; c < avctx->channels; c++)
@ -1401,8 +1403,9 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
bd.lpc_cof = ctx->lpc_cof[c]; bd.lpc_cof = ctx->lpc_cof[c];
bd.quant_cof = ctx->quant_cof[c]; bd.quant_cof = ctx->quant_cof[c];
bd.raw_samples = ctx->raw_samples[c] + offset; bd.raw_samples = ctx->raw_samples[c] + offset;
if (decode_block(ctx, &bd))
return -1; if ((ret = decode_block(ctx, &bd)) < 0)
return ret;
} }
memset(reverted_channels, 0, avctx->channels * sizeof(*reverted_channels)); memset(reverted_channels, 0, avctx->channels * sizeof(*reverted_channels));