aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-20 00:17:06 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-03 00:03:44 +0200
commitd4824eec3b45ad817ed0a3dc48009f56d4465c51 (patch)
tree4f57b8ed739b823664c5a17fbfd390cf18bd6f7c
parentaed40628d4e846f294147a7e0035f57e0b4908a5 (diff)
downloadffmpeg-d4824eec3b45ad817ed0a3dc48009f56d4465c51.tar.gz
avcodec/ac3enc: Fix invalid shift
Fixes the FATE-tests unknown_layout-ac3, ac3-fixed-encode, ac3-encode and eac3-encode. It furthermore fixes the ac3-encoder bugs mentioned in tickets #7994, #8144 and #8159. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2f289ec914cc7e8133858d4f9e8d91dab685ae44) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavcodec/ac3enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 636ca72050..032881724b 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1065,7 +1065,7 @@ static int bit_alloc(AC3EncodeContext *s, int snr_offset)
{
int blk, ch;
- snr_offset = (snr_offset - 240) << 2;
+ snr_offset = (snr_offset - 240) * 4;
reset_block_bap(s);
for (blk = 0; blk < s->num_blocks; blk++) {