[FFmpeg-cvslog] ac3dec: use get_sbits() instead of manually sign-extending
Mans Rullgard
git at videolan.org
Mon Oct 10 03:59:52 CEST 2011
ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sun Oct 9 23:15:17 2011 +0100| [633ddb85192f1cc39d61fae98455eb6ae5638df0] | committer: Mans Rullgard
ac3dec: use get_sbits() instead of manually sign-extending
Signed-off-by: Mans Rullgard <mans at mansr.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=633ddb85192f1cc39d61fae98455eb6ae5638df0
---
libavcodec/ac3dec.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 5046a5c..956a7ac 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -505,9 +505,9 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
mantissa = b5_mantissas[get_bits(gbc, 4)];
break;
default: /* 6 to 15 */
- mantissa = get_bits(gbc, quantization_tab[bap]);
/* Shift mantissa and sign-extend it. */
- mantissa = (mantissa << (32-quantization_tab[bap]))>>8;
+ mantissa = get_sbits(gbc, quantization_tab[bap]);
+ mantissa <<= 24 - quantization_tab[bap];
break;
}
coeffs[freq] = mantissa >> exps[freq];
More information about the ffmpeg-cvslog
mailing list