summaryrefslogtreecommitdiff
path: root/apps/codecs/libwma
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-07-17 08:57:30 +0000
committerNils Wallménius <nils@rockbox.org>2010-07-17 08:57:30 +0000
commit331460c1f520ccc9c2e29fc1c2f228d737c148fa (patch)
tree53aed4aa42604e2cb198c57f64aa2ba62d0c3576 /apps/codecs/libwma
parentf2a1d92030a3dab73cd36b735d5e1b374943a57b (diff)
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
Diffstat (limited to 'apps/codecs/libwma')
-rw-r--r--apps/codecs/libwma/wmadeci.c8
1 files changed, 5 insertions, 3 deletions
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;