summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-05-20 22:53:22 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-05-20 22:53:22 +0000
commit99494140daebe8ac854eedf6173ec363765193d8 (patch)
treead412d276f2bb7216c5dbbb3bfa1e59ec6c6c614
parent89e791cc4b7956e84459b71a398b037a089636c4 (diff)
downloadrockbox-99494140daebe8ac854eedf6173ec363765193d8.tar.gz
rockbox-99494140daebe8ac854eedf6173ec363765193d8.zip
Use more IRAM on S5L870x to speed up wma by ~3%.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29905 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libwma/wmadata.h6
-rw-r--r--apps/codecs/libwma/wmadec.h21
-rw-r--r--apps/codecs/libwma/wmadeci.c28
3 files changed, 36 insertions, 19 deletions
diff --git a/apps/codecs/libwma/wmadata.h b/apps/codecs/libwma/wmadata.h
index 343b6e9e92..07a55df19a 100644
--- a/apps/codecs/libwma/wmadata.h
+++ b/apps/codecs/libwma/wmadata.h
@@ -1426,7 +1426,7 @@ static const CoefVLCTable coef_vlcs[6] = {
1426}; 1426};
1427 1427
1428/*table of the values of 10^(index*.05)*/ 1428/*table of the values of 10^(index*.05)*/
1429const fixed64 pow_table[] = 1429const fixed64 pow_table[] ICONST_ATTR_WMA_XL_IRAM =
1430 { 0x199a, 0x1cb9, 0x203a, 0x2429, 0x2893, 0x2d86, 0x3314, 0x3950, 0x404e, 1430 { 0x199a, 0x1cb9, 0x203a, 0x2429, 0x2893, 0x2d86, 0x3314, 0x3950, 0x404e,
1431 0x4827, 0x50f4, 0x5ad5, 0x65ea, 0x725a, 0x804e, 0x8ff6, 0xa186, 0xb53c, 1431 0x4827, 0x50f4, 0x5ad5, 0x65ea, 0x725a, 0x804e, 0x8ff6, 0xa186, 0xb53c,
1432 0xcb59, 0xe429, 0x10000LL,0x11f3dLL,0x14249LL,0x1699cLL,0x195bcLL, 1432 0xcb59, 0xe429, 0x10000LL,0x11f3dLL,0x14249LL,0x1699cLL,0x195bcLL,
@@ -1499,7 +1499,7 @@ const fixed32 pow_10_to_yover16[] ICONST_ATTR=
1499 0x27100000, 0x2d1bd1e1, 0x341736de, 0x3c2743e8, 0x4576cb4a 1499 0x27100000, 0x2d1bd1e1, 0x341736de, 0x3c2743e8, 0x4576cb4a
1500}; 1500};
1501 1501
1502const fixed32 pow_a_table[] = 1502const fixed32 pow_a_table[] ICONST_ATTR_WMA_XL_IRAM =
1503{ 1503{
1504 0x1004,0x1008,0x100c,0x1010,0x1014,0x1018,0x101c,0x1021,0x1025,0x1029,0x102d, 1504 0x1004,0x1008,0x100c,0x1010,0x1014,0x1018,0x101c,0x1021,0x1025,0x1029,0x102d,
1505 0x1031,0x1036,0x103a,0x103e,0x1043,0x1047,0x104b,0x1050,0x1054,0x1059,0x105d, 1505 0x1031,0x1036,0x103a,0x103e,0x1043,0x1047,0x104b,0x1050,0x1054,0x1059,0x105d,
@@ -1522,7 +1522,7 @@ const fixed32 pow_a_table[] =
1522 */ 1522 */
1523 1523
1524 1524
1525const fixed64 lsp_pow_e_table[] = 1525const fixed64 lsp_pow_e_table[] ICONST_ATTR_WMA_XL_IRAM =
1526{ 1526{
1527 0xb504f30000000000LL, 0x9837f00000000000LL, 0x8000000000000000LL, 0x6ba27e8000000000LL, 0x5a82798000000000LL, 1527 0xb504f30000000000LL, 0x9837f00000000000LL, 0x8000000000000000LL, 0x6ba27e8000000000LL, 0x5a82798000000000LL,
1528 0x4c1bf80000000000LL, 0x4000000000000000LL, 0x35d13f4000000000LL, 0x2d413cc000000000LL, 0x260dfc0000000000LL, 1528 0x4c1bf80000000000LL, 0x4000000000000000LL, 0x35d13f4000000000LL, 0x2d413cc000000000LL, 0x260dfc0000000000LL,
diff --git a/apps/codecs/libwma/wmadec.h b/apps/codecs/libwma/wmadec.h
index d7fa79d268..76429dede1 100644
--- a/apps/codecs/libwma/wmadec.h
+++ b/apps/codecs/libwma/wmadec.h
@@ -51,16 +51,27 @@
51 51
52#define LSP_POW_BITS 7 52#define LSP_POW_BITS 7
53 53
54/*define IRAM for targets with 48k/80k IRAM split*/ 54
55#ifndef IBSS_ATTR_WMA_LARGE_IRAM 55#if (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || (CONFIG_CPU == MCF5250)
56#if (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || defined(CPU_S5L870X) || (CONFIG_CPU == MCF5250) 56/* PP5022/24 and MCF5250 have 128KB of IRAM. 80KB are allocated for codecs */
57/* PP5022/24, MCF5250 have 128KB of IRAM. 80KB are allocated for codecs */ 57#define IBSS_ATTR_WMA_LARGE_IRAM IBSS_ATTR
58#define IBSS_ATTR_WMA_XL_IRAM
59#define ICONST_ATTR_WMA_XL_IRAM
60
61#elif defined(CPU_S5L870X)
62/* S5L870x has even more IRAM. Use it. */
58#define IBSS_ATTR_WMA_LARGE_IRAM IBSS_ATTR 63#define IBSS_ATTR_WMA_LARGE_IRAM IBSS_ATTR
64#define IBSS_ATTR_WMA_XL_IRAM IBSS_ATTR
65#define ICONST_ATTR_WMA_XL_IRAM ICONST_ATTR
66
59#else 67#else
60/* other PP's and MCF5249 have 96KB of IRAM */ 68/* other PP's and MCF5249 have 96KB of IRAM */
61#define IBSS_ATTR_WMA_LARGE_IRAM 69#define IBSS_ATTR_WMA_LARGE_IRAM
70#define IBSS_ATTR_WMA_XL_IRAM
71#define ICONST_ATTR_WMA_XL_IRAM
72
62#endif 73#endif
63#endif 74
64 75
65#define VLCBITS 7 /*7 is the lowest without glitching*/ 76#define VLCBITS 7 /*7 is the lowest without glitching*/
66#define VLCMAX ((22+VLCBITS-1)/VLCBITS) 77#define VLCMAX ((22+VLCBITS-1)/VLCBITS)
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c
index 50a1b47405..d63a7641c9 100644
--- a/apps/codecs/libwma/wmadeci.c
+++ b/apps/codecs/libwma/wmadeci.c
@@ -33,19 +33,25 @@ 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 MEM_ALIGN_ATTR; 36static fixed32 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 MEM_ALIGN_ATTR; 38static fixed32 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] MEM_ALIGN_ATTR, stat1[1024] MEM_ALIGN_ATTR, 41static fixed32 stat0[2048] IBSS_ATTR_WMA_XL_IRAM MEM_ALIGN_ATTR;
42 stat2[512] MEM_ALIGN_ATTR, stat3[256] MEM_ALIGN_ATTR, stat4[128] MEM_ALIGN_ATTR; 42static fixed32 stat1[1024] IBSS_ATTR_WMA_XL_IRAM MEM_ALIGN_ATTR;
43static fixed32 stat2[ 512] IBSS_ATTR_WMA_XL_IRAM MEM_ALIGN_ATTR;
44static fixed32 stat3[ 256] IBSS_ATTR_WMA_XL_IRAM MEM_ALIGN_ATTR;
45static fixed32 stat4[ 128] IBSS_ATTR_WMA_XL_IRAM MEM_ALIGN_ATTR;
43 46
44/*VLC lookup tables*/ 47/*VLC lookup tables*/
45uint16_t *runtabarray[2], *levtabarray[2]; 48static uint16_t *runtabarray[2];
49static uint16_t *levtabarray[2];
46 50
47uint16_t runtab_big[1336] MEM_ALIGN_ATTR, runtab_small[1072] MEM_ALIGN_ATTR, 51static uint16_t runtab_big[1336] MEM_ALIGN_ATTR;
48 levtab_big[1336] MEM_ALIGN_ATTR, levtab_small[1072] MEM_ALIGN_ATTR; 52static uint16_t runtab_small[1072] MEM_ALIGN_ATTR;
53static uint16_t levtab_big[1336] MEM_ALIGN_ATTR;
54static uint16_t levtab_small[1072] MEM_ALIGN_ATTR;
49 55
50#define VLCBUF1SIZE 4598 56#define VLCBUF1SIZE 4598
51#define VLCBUF2SIZE 3574 57#define VLCBUF2SIZE 3574
@@ -54,11 +60,11 @@ uint16_t runtab_big[1336] MEM_ALIGN_ATTR, runtab_small[1072] MEM_ALIGN_ATTR,
54 60
55/*putting these in IRAM actually makes PP slower*/ 61/*putting these in IRAM actually makes PP slower*/
56 62
57VLC_TYPE vlcbuf1[VLCBUF1SIZE][2] MEM_ALIGN_ATTR; 63static VLC_TYPE vlcbuf1[VLCBUF1SIZE][2] IBSS_ATTR_WMA_XL_IRAM MEM_ALIGN_ATTR;
58VLC_TYPE vlcbuf2[VLCBUF2SIZE][2] MEM_ALIGN_ATTR; 64static VLC_TYPE vlcbuf2[VLCBUF2SIZE][2] MEM_ALIGN_ATTR;
59/* This buffer gets reused for lsp tables */ 65/* This buffer gets reused for lsp tables */
60VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] MEM_ALIGN_ATTR; 66static VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] MEM_ALIGN_ATTR;
61VLC_TYPE vlcbuf4[VLCBUF4SIZE][2] MEM_ALIGN_ATTR; 67static VLC_TYPE vlcbuf4[VLCBUF4SIZE][2] MEM_ALIGN_ATTR;
62 68
63 69
64 70