From 56161967c64656574f601721c1f91eaec11dd7fe Mon Sep 17 00:00:00 2001 From: Mohamed Tarek Date: Sat, 17 Jul 2010 09:13:55 +0000 Subject: Increase the size of quant table in libwmapro to accomodate more values for exp. Fixes wma pro failure on test files in download.rockbox.org/test_files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27460 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwmapro/quant.h | 16 ++++++++++++---- apps/codecs/libwmapro/wmaprodec.c | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/codecs/libwmapro/quant.h b/apps/codecs/libwmapro/quant.h index dba2d071aa..d20b2f58ee 100644 --- a/apps/codecs/libwmapro/quant.h +++ b/apps/codecs/libwmapro/quant.h @@ -8,8 +8,8 @@ * floating point value is : * quant = pow(10.0, exp/20) * 'exp' is an integer value which I have exmerimentally found to fall in the - * range (50,139). */ -const int32_t quant_tab[90] = { + * range (50,170). */ +const int32_t quant_tab[121] = { 0x0000013C, 0x00000163, 0x0000018E, 0x000001BF, 0x000001F5, 0x00000232, 0x00000277, 0x000002C4, 0x0000031A, 0x0000037B, 0x000003E8, 0x00000462, @@ -32,11 +32,19 @@ const int32_t quant_tab[90] = { 0x001E71FE, 0x00222901, 0x0026540E, 0x002B014F, 0x003040A6, 0x003623E6, 0x003CBF10, 0x00442894, 0x004C79A0, 0x0055CE75, 0x006046C5, 0x006C0622, - 0x00793472, 0x0087FE7D, + 0x00793472, 0x0087FE7D, 0x00989680, 0x00AB34D9, + 0x00C018C6, 0x00D7893F, 0x00F1D5E4, 0x010F580A, + 0x013073F0, 0x01559A0C, 0x017F4890, 0x01AE0D16, + 0x01E28678, 0x021D66FC, 0x025F769C, 0x02A995C8, + 0x02FCC044, 0x035A1094, 0x03C2C3B8, 0x04383D50, + 0x04BC0C78, 0x054FF0E8, 0x05F5E100, 0x06B01078, + 0x0780F7C0, 0x086B5C80, 0x09725AE0, 0x0A997060, + 0x0BE48750, 0x0D580470, 0x0EF8D5A0, 0x10CC82E0, + 0x12D940C0, }; #define EXP_MIN 50 -#define EXP_MAX 139 +#define EXP_MAX 170 /* return the correct value of quant based on exp */ #define QUANT(exp) quant_tab[exp - EXP_MIN] diff --git a/apps/codecs/libwmapro/wmaprodec.c b/apps/codecs/libwmapro/wmaprodec.c index 8b2043a682..88becb7af6 100644 --- a/apps/codecs/libwmapro/wmaprodec.c +++ b/apps/codecs/libwmapro/wmaprodec.c @@ -1249,7 +1249,7 @@ static int decode_subframe(WMAProDecodeCtx *s) s->channel[c].scale_factor_step; if(exp < EXP_MIN || exp > EXP_MAX) { - DEBUGF("in wmaprodec.c : unhandled value for exp, please report sample.\n"); + DEBUGF("in wmaprodec.c : unhandled value for exp (%d), please report sample.\n", exp); return -1; } const int32_t quant = QUANT(exp); -- cgit v1.2.3