summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Midgley <bmidgley@xmission.com>2008-02-29 03:56:22 +0000
committerBrad Midgley <bmidgley@xmission.com>2008-02-29 03:56:22 +0000
commit7a68b05beaed5944dcd88f23002c9f55a2f74ba6 (patch)
tree1160d40f382b5182057ed32b54b49ee07fd9922a
parent7ae45c5a353a3e6a32044263cb1a367f237e6505 (diff)
Cidorvan's 4-subband overflow fixes
-rw-r--r--sbc/sbc.c2
-rw-r--r--sbc/sbc_math.h12
2 files changed, 7 insertions, 7 deletions
diff --git a/sbc/sbc.c b/sbc/sbc.c
index 21a68063..5fc4752f 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -375,7 +375,7 @@ static int sbc_unpack_frame(const uint8_t *data, struct sbc_frame *frame,
int ch, sb, blk, bit; /* channel, subband, block and bit standard
counters */
int bits[2][8]; /* bits distribution */
- int levels[2][8]; /* levels derived from that */
+ uint32_t levels[2][8]; /* levels derived from that */
if (len < 4)
return -1;
diff --git a/sbc/sbc_math.h b/sbc/sbc_math.h
index 5d3da8d9..b3d87a62 100644
--- a/sbc/sbc_math.h
+++ b/sbc/sbc_math.h
@@ -30,16 +30,16 @@
((int32_t)(val)) >> (bits) : ((int32_t) (val)) / (1 << (bits)))
#define SCALE_PROTO4_TBL 15
-#define SCALE_ANA4_TBL 16
+#define SCALE_ANA4_TBL 17
#define SCALE_PROTO8_TBL 16
#define SCALE_ANA8_TBL 17
-#define SCALE_SPROTO4_TBL 15
+#define SCALE_SPROTO4_TBL 12
#define SCALE_SPROTO8_TBL 14
-#define SCALE_NPROTO4_TBL 13
+#define SCALE_NPROTO4_TBL 11
#define SCALE_NPROTO8_TBL 11
-#define SCALE4_STAGE1_BITS 16
-#define SCALE4_STAGE2_BITS 15
-#define SCALE4_STAGED1_BITS 12
+#define SCALE4_STAGE1_BITS 15
+#define SCALE4_STAGE2_BITS 16
+#define SCALE4_STAGED1_BITS 15
#define SCALE4_STAGED2_BITS 16
#define SCALE8_STAGE1_BITS 15
#define SCALE8_STAGE2_BITS 15