1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Nils Wallménius 2010-07-17 10:40:00 +00:00
parent f98e80367d
commit 87b29215d5
2 changed files with 7 additions and 4 deletions

View file

@ -147,8 +147,8 @@ typedef struct WMADecodeContext
fixed32 noise_mult; /* XXX: suppress that and integrate it in the noise array */
/* lsp_to_curve tables */
fixed32 lsp_cos_table[BLOCK_MAX_SIZE];
fixed32 lsp_pow_m_table1[(1 << LSP_POW_BITS)];
fixed32 lsp_pow_m_table2[(1 << LSP_POW_BITS)];
fixed32 *lsp_pow_m_table1;
fixed32 *lsp_pow_m_table2;
/* State of current superframe decoding */
int bit_offset;

View file

@ -47,7 +47,6 @@ fixed32 stat0[2048], stat1[1024], stat2[512], stat3[256], stat4[128];
/*VLC lookup tables*/
uint16_t *runtabarray[2], *levtabarray[2];
/*these could be made smaller since only one can be 1336*/
uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[1072];
#define VLCBUF1SIZE 4598
@ -59,7 +58,8 @@ uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[10
VLC_TYPE vlcbuf1[VLCBUF1SIZE][2];
VLC_TYPE vlcbuf2[VLCBUF2SIZE][2];
VLC_TYPE vlcbuf3[VLCBUF3SIZE][2];
/* This buffer gets reused for lsp tables */
VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] __attribute__((aligned (sizeof(fixed32))));
VLC_TYPE vlcbuf4[VLCBUF4SIZE][2];
@ -617,6 +617,9 @@ static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len)
b = itofix32(1);
int ix = 0;
s->lsp_pow_m_table1 = (fixed32*)&vlcbuf3[0];
s->lsp_pow_m_table2 = (fixed32*)&vlcbuf3[VLCBUF3SIZE];
/*double check this later*/
for(i=(1 << LSP_POW_BITS) - 1;i>=0;i--)
{