diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-26 01:12:08 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-26 01:12:08 +0100 |
commit | 022f8d27dd0a61bfaae729d53d133b17418ea16b (patch) | |
tree | 351bff9edab8404f7850ee05a238c50e6364e19b /libavcodec/dca.c | |
parent | a11eeb921571b23d1c988f9a2ddda109792948a6 (diff) | |
parent | f32dfad9dc64acf0fd1bb867e127a9efe6380676 (diff) | |
download | ffmpeg-022f8d27dd0a61bfaae729d53d133b17418ea16b.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
swscale: Readd #define _SVID_SOURCE
Fix av_get_channel_layout_string() for positions >31
configure: Store vda lib flags in extralibs instead of ldflags
Make channel layout masks unsigned
dca: ARMv6 optimised decode_blockcode()
nullenc: drop AVFMT_RAWPICTURE from the flags
frame-mt: return consumed packet size in ff_thread_decode_frame
aacdec: add more fate tests covering SBR and PS
MK(BE)TAG: avoid undefined shifts
Conflicts:
configure
libavcodec/arm/dca.h
libavcodec/dca.c
libavcodec/mlp_parser.c
libavcodec/version.h
libavfilter/asrc_anullsrc.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/defaults.c
libavutil/audioconvert.c
libavutil/avutil.h
libswscale/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dca.c')
-rw-r--r-- | libavcodec/dca.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 37977e5c55..07a9c0a484 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -128,7 +128,7 @@ static const int dca_ext_audio_descr_mask[] = { * All 2 channel configurations -> AV_CH_LAYOUT_STEREO */ -static const int64_t dca_core_channel_layout[] = { +static const uint64_t dca_core_channel_layout[] = { AV_CH_FRONT_CENTER, ///< 1, A AV_CH_LAYOUT_STEREO, ///< 2, A + B (dual mono) AV_CH_LAYOUT_STEREO, ///< 2, L + R (stereo) @@ -1037,7 +1037,7 @@ static void dca_downmix(float *samples, int srcfmt, } -#ifndef decode_blockcode +#ifndef decode_blockcodes /* Very compact version of the block code decoder that does not use table * look-up but is slightly slower */ static int decode_blockcode(int code, int levels, int *values) @@ -1051,12 +1051,13 @@ static int decode_blockcode(int code, int levels, int *values) code = div; } - if (code == 0) - return 0; - else { - av_log(NULL, AV_LOG_ERROR, "ERROR: block code look-up failed\n"); - return AVERROR_INVALIDDATA; - } + return code; +} + +static int decode_blockcodes(int code1, int code2, int levels, int *values) +{ + return decode_blockcode(code1, levels, values) | + decode_blockcode(code2, levels, values + 4); } #endif @@ -1126,16 +1127,20 @@ static int dca_subsubframe(DCAContext * s, int base_channel, int block_index) if (abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table){ if (abits <= 7){ /* Block code */ - int block_code1, block_code2, size, levels; + int block_code1, block_code2, size, levels, err; size = abits_sizes[abits-1]; levels = abits_levels[abits-1]; block_code1 = get_bits(&s->gb, size); - /* FIXME Should test return value */ - decode_blockcode(block_code1, levels, block); block_code2 = get_bits(&s->gb, size); - decode_blockcode(block_code2, levels, &block[4]); + err = decode_blockcodes(block_code1, block_code2, + levels, block); + if (err) { + av_log(s->avctx, AV_LOG_ERROR, + "ERROR: block code look-up failed\n"); + return AVERROR_INVALIDDATA; + } }else{ /* no coding */ for (m = 0; m < 8; m++) |