Commit 633ddb85 authored by Mans Rullgard's avatar Mans Rullgard

ac3dec: use get_sbits() instead of manually sign-extending

Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent 84dda407
...@@ -505,9 +505,9 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma ...@@ -505,9 +505,9 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
mantissa = b5_mantissas[get_bits(gbc, 4)]; mantissa = b5_mantissas[get_bits(gbc, 4)];
break; break;
default: /* 6 to 15 */ default: /* 6 to 15 */
mantissa = get_bits(gbc, quantization_tab[bap]);
/* Shift mantissa and sign-extend it. */ /* 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; break;
} }
coeffs[freq] = mantissa >> exps[freq]; coeffs[freq] = mantissa >> exps[freq];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment