From 1df051e1974f0eee69a31c653f840bef37732f85 Mon Sep 17 00:00:00 2001
From: Justin Ruggles <justin.ruggles@gmail.com>
Date: Sun, 3 Sep 2006 15:59:08 +0000
Subject: [PATCH] Fix 2 bit allocation bugs.  One fix enables using a higher
 bandwidth code.  The other fixes an issue with floorcod=7.

Originally committed as revision 6156 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/ac3enc.c | 2 +-
 libavcodec/ac3tab.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 5ec8b4f5ac6..aac6a578fd1 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -804,7 +804,7 @@ void ac3_common_init(void)
         for(j=0;j<v;j++) masktab[k++]=i;
         l += v;
     }
-    bndtab[50] = 0;
+    bndtab[50] = l;
 }
 
 
diff --git a/libavcodec/ac3tab.h b/libavcodec/ac3tab.h
index d8771fbeee8..7232ca6a41f 100644
--- a/libavcodec/ac3tab.h
+++ b/libavcodec/ac3tab.h
@@ -160,7 +160,7 @@ static const uint16_t dbkneetab[4]= {
     0x000, 0x700, 0x900, 0xb00,
 };
 
-static const uint16_t floortab[8]= {
+static const int16_t floortab[8]= {
     0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf800,
 };
 
-- 
GitLab