diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-29 01:12:02 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-29 01:12:02 +0100 |
commit | c122e697fa90c83abfdc729228d736e15a91bcf9 (patch) | |
tree | 18a85532a0f9cfb4ecff36a6cf764924f20f53d5 /libavcodec/dcadec.c | |
parent | a7f8817720ea04ab9abf16a5b9d493d6a762cd8a (diff) | |
parent | 27245b4e1bbb7a863341db321b5bdc5792e427d9 (diff) | |
download | ffmpeg-c122e697fa90c83abfdc729228d736e15a91bcf9.tar.gz |
Merge commit '27245b4e1bbb7a863341db321b5bdc5792e427d9'
* commit '27245b4e1bbb7a863341db321b5bdc5792e427d9':
dca: remove embedded downmix coefficient extraction.
Conflicts:
libavcodec/dcadata.h
libavcodec/dcadec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dcadec.c')
-rw-r--r-- | libavcodec/dcadec.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index ddd5510133..f2d483df90 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -358,7 +358,6 @@ typedef struct { int bit_rate; ///< transmission bit rate int bit_rate_index; ///< transmission bit rate index - int downmix; ///< embedded downmix enabled int dynrange; ///< embedded dynamic range flag int timestamp; ///< embedded time stamp flag int aux_data; ///< auxiliary data flag @@ -724,7 +723,7 @@ static int dca_parse_frame_header(DCAContext *s) if (!s->bit_rate) return AVERROR_INVALIDDATA; - s->downmix = get_bits(&s->gb, 1); /* note: this is FixedBit == 0 */ + skip_bits1(&s->gb); // always 0 (reserved, cf. ETSI TS 102 114 V1.4.1) s->dynrange = get_bits(&s->gb, 1); s->timestamp = get_bits(&s->gb, 1); s->aux_data = get_bits(&s->gb, 1); @@ -771,7 +770,6 @@ static int dca_parse_frame_header(DCAContext *s) s->sample_rate); av_log(s->avctx, AV_LOG_DEBUG, "bit rate: %i bits/s\n", s->bit_rate); - av_log(s->avctx, AV_LOG_DEBUG, "downmix: %i\n", s->downmix); av_log(s->avctx, AV_LOG_DEBUG, "dynrange: %i\n", s->dynrange); av_log(s->avctx, AV_LOG_DEBUG, "timestamp: %i\n", s->timestamp); av_log(s->avctx, AV_LOG_DEBUG, "aux_data: %i\n", s->aux_data); @@ -956,28 +954,20 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index) /* Stereo downmix coefficients */ if (!base_channel && s->prim_channels > 2) { - if (s->downmix) { - for (j = base_channel; j < s->prim_channels; j++) { - s->downmix_coef[j][0] = dca_downmix_coeffs[get_bits(&s->gb, 7)]; - s->downmix_coef[j][1] = dca_downmix_coeffs[get_bits(&s->gb, 7)]; - } - } else { - int am = s->amode & DCA_CHANNEL_MASK; - if (am >= FF_ARRAY_ELEMS(dca_default_coeffs)) { - av_log(s->avctx, AV_LOG_ERROR, - "Invalid channel mode %d\n", am); - return AVERROR_INVALIDDATA; - } - if (s->prim_channels > FF_ARRAY_ELEMS(dca_default_coeffs[0])) { - avpriv_request_sample(s->avctx, "Downmixing %d channels", - s->prim_channels); - return AVERROR_PATCHWELCOME; - } - - for (j = base_channel; j < s->prim_channels; j++) { - s->downmix_coef[j][0] = dca_default_coeffs[am][j][0]; - s->downmix_coef[j][1] = dca_default_coeffs[am][j][1]; - } + int am = s->amode & DCA_CHANNEL_MASK; + if (am >= FF_ARRAY_ELEMS(dca_default_coeffs)) { + av_log(s->avctx, AV_LOG_ERROR, + "Invalid channel mode %d\n", am); + return AVERROR_INVALIDDATA; + } + if (s->prim_channels > FF_ARRAY_ELEMS(dca_default_coeffs[0])) { + avpriv_request_sample(s->avctx, "Downmixing %d channels", + s->prim_channels); + return AVERROR_PATCHWELCOME; + } + for (j = base_channel; j < s->prim_channels; j++) { + s->downmix_coef[j][0] = dca_default_coeffs[am][j][0]; + s->downmix_coef[j][1] = dca_default_coeffs[am][j][1]; } } @@ -1080,7 +1070,7 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index) av_log(s->avctx, AV_LOG_DEBUG, "\n"); } } - if (!base_channel && s->prim_channels > 2 && s->downmix) { + if (!base_channel && s->prim_channels > 2) { av_log(s->avctx, AV_LOG_DEBUG, "Downmix coeffs:\n"); for (j = 0; j < s->prim_channels; j++) { av_log(s->avctx, AV_LOG_DEBUG, "Channel 0, %d = %f\n", j, @@ -1480,7 +1470,7 @@ static int dca_subframe_footer(DCAContext *s, int base_channel) for (i = 0; i < aux_data_count; i++) get_bits(&s->gb, 8); - if (s->crc_present && (s->downmix || s->dynrange)) + if (s->crc_present && s->dynrange) get_bits(&s->gb, 16); } |