summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2010-11-22 07:04:32 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2010-11-22 07:04:32 +0000
commite5361590e7075298bb222535537e197cc6f99e7b (patch)
tree076f97048b0c3251f8e75f9fa4f324f6d8f1fdbd
parent0e53651062103f6270cc32a020bc59adcd3c4bf6 (diff)
downloadrockbox-e5361590e7075298bb222535537e197cc6f99e7b.tar.gz
rockbox-e5361590e7075298bb222535537e197cc6f99e7b.zip
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
-rw-r--r--apps/codecs/libwma/wmadec.h6
-rw-r--r--apps/codecs/libwma/wmadeci.c20
2 files changed, 14 insertions, 12 deletions
diff --git a/apps/codecs/libwma/wmadec.h b/apps/codecs/libwma/wmadec.h
index d84485ca0f..d7fa79d268 100644
--- a/apps/codecs/libwma/wmadec.h
+++ b/apps/codecs/libwma/wmadec.h
@@ -130,7 +130,7 @@ typedef struct WMADecodeContext
130 uint8_t ms_stereo; /* true if mid/side stereo mode */ 130 uint8_t ms_stereo; /* true if mid/side stereo mode */
131 uint8_t channel_coded[MAX_CHANNELS]; /* true if channel is coded */ 131 uint8_t channel_coded[MAX_CHANNELS]; /* true if channel is coded */
132 int exponents_bsize[MAX_CHANNELS]; // log2 ratio frame/exp. length 132 int exponents_bsize[MAX_CHANNELS]; // log2 ratio frame/exp. length
133 fixed32 exponents[MAX_CHANNELS][BLOCK_MAX_SIZE]; 133 fixed32 exponents[MAX_CHANNELS][BLOCK_MAX_SIZE] MEM_ALIGN_ATTR;
134 fixed32 max_exponent[MAX_CHANNELS]; 134 fixed32 max_exponent[MAX_CHANNELS];
135 int16_t coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE]; 135 int16_t coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE];
136 fixed32 (*coefs)[MAX_CHANNELS][BLOCK_MAX_SIZE]; 136 fixed32 (*coefs)[MAX_CHANNELS][BLOCK_MAX_SIZE];
@@ -139,14 +139,14 @@ typedef struct WMADecodeContext
139 fixed32 (*frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE*2]; 139 fixed32 (*frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE*2];
140 140
141 /* last frame info */ 141 /* last frame info */
142 uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + 4]; /* padding added */ 142 uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + 4] MEM_ALIGN_ATTR; /* padding added */
143 int last_bitoffset; 143 int last_bitoffset;
144 int last_superframe_len; 144 int last_superframe_len;
145 fixed32 *noise_table; 145 fixed32 *noise_table;
146 int noise_index; 146 int noise_index;
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] MEM_ALIGN_ATTR;
150 void *lsp_pow_m_table1; 150 void *lsp_pow_m_table1;
151 void *lsp_pow_m_table2; 151 void *lsp_pow_m_table2;
152 152
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c
index 9333f19ff1..98c10e486d 100644
--- a/apps/codecs/libwma/wmadeci.c
+++ b/apps/codecs/libwma/wmadeci.c
@@ -33,17 +33,19 @@ static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len);
33 33
34/*declarations of statically allocated variables used to remove malloc calls*/ 34/*declarations of statically allocated variables used to remove malloc calls*/
35 35
36fixed32 coefsarray[MAX_CHANNELS][BLOCK_MAX_SIZE] IBSS_ATTR; 36fixed32 coefsarray[MAX_CHANNELS][BLOCK_MAX_SIZE] IBSS_ATTR MEM_ALIGN_ATTR;
37/*decode and window into IRAM on targets with at least 80KB of codec IRAM*/ 37/*decode and window into IRAM on targets with at least 80KB of codec IRAM*/
38fixed32 frame_out_buf[MAX_CHANNELS][BLOCK_MAX_SIZE * 2] IBSS_ATTR_WMA_LARGE_IRAM; 38fixed32 frame_out_buf[MAX_CHANNELS][BLOCK_MAX_SIZE * 2] IBSS_ATTR_WMA_LARGE_IRAM MEM_ALIGN_ATTR;
39 39
40/*MDCT reconstruction windows*/ 40/*MDCT reconstruction windows*/
41fixed32 stat0[2048], stat1[1024], stat2[512], stat3[256], stat4[128]; 41fixed32 stat0[2048] MEM_ALIGN_ATTR, stat1[1024] MEM_ALIGN_ATTR,
42 stat2[512] MEM_ALIGN_ATTR, stat3[256] MEM_ALIGN_ATTR, stat4[128] MEM_ALIGN_ATTR;
42 43
43/*VLC lookup tables*/ 44/*VLC lookup tables*/
44uint16_t *runtabarray[2], *levtabarray[2]; 45uint16_t *runtabarray[2], *levtabarray[2];
45 46
46uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[1072]; 47uint16_t runtab_big[1336] MEM_ALIGN_ATTR, runtab_small[1072] MEM_ALIGN_ATTR,
48 levtab_big[1336] MEM_ALIGN_ATTR, levtab_small[1072] MEM_ALIGN_ATTR;
47 49
48#define VLCBUF1SIZE 4598 50#define VLCBUF1SIZE 4598
49#define VLCBUF2SIZE 3574 51#define VLCBUF2SIZE 3574
@@ -52,11 +54,11 @@ uint16_t runtab_big[1336], runtab_small[1072], levtab_big[1336], levtab_small[10
52 54
53/*putting these in IRAM actually makes PP slower*/ 55/*putting these in IRAM actually makes PP slower*/
54 56
55VLC_TYPE vlcbuf1[VLCBUF1SIZE][2]; 57VLC_TYPE vlcbuf1[VLCBUF1SIZE][2] MEM_ALIGN_ATTR;
56VLC_TYPE vlcbuf2[VLCBUF2SIZE][2]; 58VLC_TYPE vlcbuf2[VLCBUF2SIZE][2] MEM_ALIGN_ATTR;
57/* This buffer gets reused for lsp tables */ 59/* This buffer gets reused for lsp tables */
58VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] __attribute__((aligned (sizeof(fixed32)))); 60VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] MEM_ALIGN_ATTR;
59VLC_TYPE vlcbuf4[VLCBUF4SIZE][2]; 61VLC_TYPE vlcbuf4[VLCBUF4SIZE][2] MEM_ALIGN_ATTR;
60 62
61 63
62 64
@@ -1232,7 +1234,7 @@ static int wma_decode_block(WMADecodeContext *s)
1232 for(ch = 0; ch < s->nb_channels; ++ch) 1234 for(ch = 0; ch < s->nb_channels; ++ch)
1233 { 1235 {
1234 /* BLOCK_MAX_SIZE is 2048 (samples) and MAX_CHANNELS is 2. */ 1236 /* BLOCK_MAX_SIZE is 2048 (samples) and MAX_CHANNELS is 2. */
1235 static uint32_t scratch_buf[BLOCK_MAX_SIZE * MAX_CHANNELS] IBSS_ATTR; 1237 static uint32_t scratch_buf[BLOCK_MAX_SIZE * MAX_CHANNELS] IBSS_ATTR MEM_ALIGN_ATTR;
1236 if (s->channel_coded[ch]) 1238 if (s->channel_coded[ch])
1237 { 1239 {
1238 int n4, index; 1240 int n4, index;