From 331460c1f520ccc9c2e29fc1c2f228d737c148fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Sat, 17 Jul 2010 08:57:30 +0000 Subject: libwma: Reduce size of runtab and levtab buffers, only one set can get the worst case size so make the other set the second worst case size. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27459 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwma/wmadeci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'apps/codecs/libwma') diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c index d81b93ffe3..5a03a0a59c 100644 --- a/apps/codecs/libwma/wmadeci.c +++ b/apps/codecs/libwma/wmadeci.c @@ -48,7 +48,7 @@ fixed32 stat0[2048], stat1[1024], stat2[512], stat3[256], stat4[128]; uint16_t *runtabarray[2], *levtabarray[2]; /*these could be made smaller since only one can be 1336*/ -uint16_t runtab0[1336], runtab1[1336], levtab0[1336], levtab1[1336]; +uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[1072]; #define VLCBUF1SIZE 4598 #define VLCBUF2SIZE 3574 @@ -546,8 +546,10 @@ int wma_decode_init(WMADecodeContext* s, asf_waveformatex_t *wfx) coef_vlc_table = 1; } - runtabarray[0] = runtab0; runtabarray[1] = runtab1; - levtabarray[0] = levtab0; levtabarray[1] = levtab1; + /* since the coef2 table is the biggest and that has index 2 in coef_vlcs + it's safe to always assign like this */ + runtabarray[0] = runtab_big; runtabarray[1] = runtab_small; + levtabarray[0] = levtab_big; levtabarray[1] = levtab_small; s->coef_vlc[0].table = vlcbuf1; s->coef_vlc[0].table_allocated = VLCBUF1SIZE; -- cgit v1.2.3