summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-07-17 10:40:00 +0000
committerNils Wallménius <nils@rockbox.org>2010-07-17 10:40:00 +0000
commit87b29215d5fb77313c8cb9cfe8b3f27ef22ec415 (patch)
tree1c4ae7d849870bda7ea7aee6727ef032feb790fd /apps/codecs
parentf98e80367dd743cea937ca1798ed8f2af26848e4 (diff)
downloadrockbox-87b29215d5fb77313c8cb9cfe8b3f27ef22ec415.tar.gz
rockbox-87b29215d5fb77313c8cb9cfe8b3f27ef22ec415.zip
libwma: Reuse a static buffer that was unused while decoding lsp files for some lsp related tables.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27462 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/libwma/wmadec.h4
-rw-r--r--apps/codecs/libwma/wmadeci.c7
2 files changed, 7 insertions, 4 deletions
diff --git a/apps/codecs/libwma/wmadec.h b/apps/codecs/libwma/wmadec.h
index 585e4b0aef..1f08e653cf 100644
--- a/apps/codecs/libwma/wmadec.h
+++ b/apps/codecs/libwma/wmadec.h
@@ -147,8 +147,8 @@ typedef struct WMADecodeContext
147 fixed32 noise_mult; /* XXX: suppress that and integrate it in the noise array */ 147 fixed32 noise_mult; /* XXX: suppress that and integrate it in the noise array */
148 /* lsp_to_curve tables */ 148 /* lsp_to_curve tables */
149 fixed32 lsp_cos_table[BLOCK_MAX_SIZE]; 149 fixed32 lsp_cos_table[BLOCK_MAX_SIZE];
150 fixed32 lsp_pow_m_table1[(1 << LSP_POW_BITS)]; 150 fixed32 *lsp_pow_m_table1;
151 fixed32 lsp_pow_m_table2[(1 << LSP_POW_BITS)]; 151 fixed32 *lsp_pow_m_table2;
152 152
153 /* State of current superframe decoding */ 153 /* State of current superframe decoding */
154 int bit_offset; 154 int bit_offset;
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c
index 5a03a0a59c..8172e33783 100644
--- a/apps/codecs/libwma/wmadeci.c
+++ b/apps/codecs/libwma/wmadeci.c
@@ -47,7 +47,6 @@ fixed32 stat0[2048], stat1[1024], stat2[512], stat3[256], stat4[128];
47/*VLC lookup tables*/ 47/*VLC lookup tables*/
48uint16_t *runtabarray[2], *levtabarray[2]; 48uint16_t *runtabarray[2], *levtabarray[2];
49 49
50/*these could be made smaller since only one can be 1336*/
51uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[1072]; 50uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[1072];
52 51
53#define VLCBUF1SIZE 4598 52#define VLCBUF1SIZE 4598
@@ -59,7 +58,8 @@ uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[10
59 58
60VLC_TYPE vlcbuf1[VLCBUF1SIZE][2]; 59VLC_TYPE vlcbuf1[VLCBUF1SIZE][2];
61VLC_TYPE vlcbuf2[VLCBUF2SIZE][2]; 60VLC_TYPE vlcbuf2[VLCBUF2SIZE][2];
62VLC_TYPE vlcbuf3[VLCBUF3SIZE][2]; 61/* This buffer gets reused for lsp tables */
62VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] __attribute__((aligned (sizeof(fixed32))));
63VLC_TYPE vlcbuf4[VLCBUF4SIZE][2]; 63VLC_TYPE vlcbuf4[VLCBUF4SIZE][2];
64 64
65 65
@@ -617,6 +617,9 @@ static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len)
617 b = itofix32(1); 617 b = itofix32(1);
618 int ix = 0; 618 int ix = 0;
619 619
620 s->lsp_pow_m_table1 = (fixed32*)&vlcbuf3[0];
621 s->lsp_pow_m_table2 = (fixed32*)&vlcbuf3[VLCBUF3SIZE];
622
620 /*double check this later*/ 623 /*double check this later*/
621 for(i=(1 << LSP_POW_BITS) - 1;i>=0;i--) 624 for(i=(1 << LSP_POW_BITS) - 1;i>=0;i--)
622 { 625 {