diff options
author | Mans Rullgard <mans@mansr.com> | 2011-10-09 23:15:17 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-10-09 23:21:31 +0100 |
commit | 633ddb85192f1cc39d61fae98455eb6ae5638df0 (patch) | |
tree | 7cd950894fbf803053126ba0b24c7e12e236c2aa | |
parent | 84dda407628e298f33d610e9e04a8b2945d24665 (diff) | |
download | ffmpeg-633ddb85192f1cc39d61fae98455eb6ae5638df0.tar.gz |
ac3dec: use get_sbits() instead of manually sign-extending
Signed-off-by: Mans Rullgard <mans@mansr.com>
-rw-r--r-- | libavcodec/ac3dec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 5046a5c644..956a7ac3ad 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]; |