forked from len0rd/rockbox
Align various libwma buffers. Saves about 1 MHz on the Gigabeat S.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28640 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0e53651062
commit
e5361590e7
2 changed files with 14 additions and 12 deletions
|
|
@ -130,7 +130,7 @@ typedef struct WMADecodeContext
|
|||
uint8_t ms_stereo; /* true if mid/side stereo mode */
|
||||
uint8_t channel_coded[MAX_CHANNELS]; /* true if channel is coded */
|
||||
int exponents_bsize[MAX_CHANNELS]; // log2 ratio frame/exp. length
|
||||
fixed32 exponents[MAX_CHANNELS][BLOCK_MAX_SIZE];
|
||||
fixed32 exponents[MAX_CHANNELS][BLOCK_MAX_SIZE] MEM_ALIGN_ATTR;
|
||||
fixed32 max_exponent[MAX_CHANNELS];
|
||||
int16_t coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE];
|
||||
fixed32 (*coefs)[MAX_CHANNELS][BLOCK_MAX_SIZE];
|
||||
|
|
@ -139,14 +139,14 @@ typedef struct WMADecodeContext
|
|||
fixed32 (*frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE*2];
|
||||
|
||||
/* last frame info */
|
||||
uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + 4]; /* padding added */
|
||||
uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + 4] MEM_ALIGN_ATTR; /* padding added */
|
||||
int last_bitoffset;
|
||||
int last_superframe_len;
|
||||
fixed32 *noise_table;
|
||||
int noise_index;
|
||||
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_cos_table[BLOCK_MAX_SIZE] MEM_ALIGN_ATTR;
|
||||
void *lsp_pow_m_table1;
|
||||
void *lsp_pow_m_table2;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,17 +33,19 @@ static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len);
|
|||
|
||||
/*declarations of statically allocated variables used to remove malloc calls*/
|
||||
|
||||
fixed32 coefsarray[MAX_CHANNELS][BLOCK_MAX_SIZE] IBSS_ATTR;
|
||||
fixed32 coefsarray[MAX_CHANNELS][BLOCK_MAX_SIZE] IBSS_ATTR MEM_ALIGN_ATTR;
|
||||
/*decode and window into IRAM on targets with at least 80KB of codec IRAM*/
|
||||
fixed32 frame_out_buf[MAX_CHANNELS][BLOCK_MAX_SIZE * 2] IBSS_ATTR_WMA_LARGE_IRAM;
|
||||
fixed32 frame_out_buf[MAX_CHANNELS][BLOCK_MAX_SIZE * 2] IBSS_ATTR_WMA_LARGE_IRAM MEM_ALIGN_ATTR;
|
||||
|
||||
/*MDCT reconstruction windows*/
|
||||
fixed32 stat0[2048], stat1[1024], stat2[512], stat3[256], stat4[128];
|
||||
fixed32 stat0[2048] MEM_ALIGN_ATTR, stat1[1024] MEM_ALIGN_ATTR,
|
||||
stat2[512] MEM_ALIGN_ATTR, stat3[256] MEM_ALIGN_ATTR, stat4[128] MEM_ALIGN_ATTR;
|
||||
|
||||
/*VLC lookup tables*/
|
||||
uint16_t *runtabarray[2], *levtabarray[2];
|
||||
|
||||
uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[1072];
|
||||
uint16_t runtab_big[1336] MEM_ALIGN_ATTR, runtab_small[1072] MEM_ALIGN_ATTR,
|
||||
levtab_big[1336] MEM_ALIGN_ATTR, levtab_small[1072] MEM_ALIGN_ATTR;
|
||||
|
||||
#define VLCBUF1SIZE 4598
|
||||
#define VLCBUF2SIZE 3574
|
||||
|
|
@ -52,11 +54,11 @@ uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[10
|
|||
|
||||
/*putting these in IRAM actually makes PP slower*/
|
||||
|
||||
VLC_TYPE vlcbuf1[VLCBUF1SIZE][2];
|
||||
VLC_TYPE vlcbuf2[VLCBUF2SIZE][2];
|
||||
VLC_TYPE vlcbuf1[VLCBUF1SIZE][2] MEM_ALIGN_ATTR;
|
||||
VLC_TYPE vlcbuf2[VLCBUF2SIZE][2] MEM_ALIGN_ATTR;
|
||||
/* This buffer gets reused for lsp tables */
|
||||
VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] __attribute__((aligned (sizeof(fixed32))));
|
||||
VLC_TYPE vlcbuf4[VLCBUF4SIZE][2];
|
||||
VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] MEM_ALIGN_ATTR;
|
||||
VLC_TYPE vlcbuf4[VLCBUF4SIZE][2] MEM_ALIGN_ATTR;
|
||||
|
||||
|
||||
|
||||
|
|
@ -1232,7 +1234,7 @@ static int wma_decode_block(WMADecodeContext *s)
|
|||
for(ch = 0; ch < s->nb_channels; ++ch)
|
||||
{
|
||||
/* BLOCK_MAX_SIZE is 2048 (samples) and MAX_CHANNELS is 2. */
|
||||
static uint32_t scratch_buf[BLOCK_MAX_SIZE * MAX_CHANNELS] IBSS_ATTR;
|
||||
static uint32_t scratch_buf[BLOCK_MAX_SIZE * MAX_CHANNELS] IBSS_ATTR MEM_ALIGN_ATTR;
|
||||
if (s->channel_coded[ch])
|
||||
{
|
||||
int n4, index;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue