diff options
author | Peter Ross <pross@xvid.org> | 2011-02-20 12:24:25 +1100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-02-26 03:16:06 +0100 |
commit | 23d82139d2248fcc90c7bb324457629226b0a9ed (patch) | |
tree | c212949bcca96210d80cc735c53fd14ace5d3ce2 /libavcodec/binkaudio.c | |
parent | 777b365c8b39666856a5c4a7842f1c72f0b69d73 (diff) | |
download | ffmpeg-23d82139d2248fcc90c7bb324457629226b0a9ed.tar.gz |
binkaudio: perform band table scaling in decode_init
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 582ac86d19c61ad73c2e1a2d5ed54a5fe1e20bd1)
Diffstat (limited to 'libavcodec/binkaudio.c')
-rw-r--r-- | libavcodec/binkaudio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 39517f7eb4..fb442c00b2 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -114,10 +114,10 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); /* populate bands data */ - s->bands[0] = 1; + s->bands[0] = 2; for (i = 1; i < s->num_bands; i++) - s->bands[i] = ff_wma_critical_freqs[i - 1] * (s->frame_len / 2) / sample_rate_half; - s->bands[s->num_bands] = s->frame_len / 2; + s->bands[i] = (ff_wma_critical_freqs[i - 1] * s->frame_len / sample_rate_half) & ~1; + s->bands[s->num_bands] = s->frame_len; s->first = 1; avctx->sample_fmt = AV_SAMPLE_FMT_S16; @@ -194,11 +194,11 @@ static void decode_block(BinkAudioContext *s, short *out, int use_dct) if (width == 0) { memset(coeffs + i, 0, (j - i) * sizeof(*coeffs)); i = j; - while (s->bands[k] * 2 < i) + while (s->bands[k] < i) q = quant[k++]; } else { while (i < j) { - if (s->bands[k] * 2 == i) + if (s->bands[k] == i) q = quant[k++]; coeff = get_bits(gb, width); if (coeff) { |