[FFmpeg-devel,11/11] avcodec/ac3enc: Fix invalid shift

Submitted by Andreas Rheinhardt on Sept. 19, 2019, 10:17 p.m.

Details

Message ID 20190919221706.16529-12-andreas.rheinhardt@gmail.com
State Accepted
Commit 2f289ec914cc7e8133858d4f9e8d91dab685ae44
Headers show

Commit Message

Andreas Rheinhardt Sept. 19, 2019, 10:17 p.m.
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>
---
 libavcodec/ac3enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Sept. 20, 2019, 9:13 p.m.
On Fri, Sep 20, 2019 at 12:17:06AM +0200, Andreas Rheinhardt wrote:
> 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>
> ---
>  libavcodec/ac3enc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index f1c95ce877..76872a8fe0 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++) {