summaryrefslogtreecommitdiff
path: root/apps/codecs/libatrac/atrac3.c
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-02-15 22:38:01 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-02-15 22:38:01 +0000
commit800e3d9a978b246c3a49bd51e65b4de94fa668e4 (patch)
tree6727bee5239af68e68123abf27a39a681b958f67 /apps/codecs/libatrac/atrac3.c
parent86fc47c33a63b1797219610aa55846adb2f0c19b (diff)
downloadrockbox-800e3d9a978b246c3a49bd51e65b4de94fa668e4.tar.gz
rockbox-800e3d9a978b246c3a49bd51e65b4de94fa668e4.zip
Major optimization of atrac3 codec for Coldfire targets. Moving several number cruncher arrays to IRAM. Decoder is sped up by +50% on h300, decoder now finally is realtime on Coldfire targets as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24677 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libatrac/atrac3.c')
-rw-r--r--apps/codecs/libatrac/atrac3.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/apps/codecs/libatrac/atrac3.c b/apps/codecs/libatrac/atrac3.c
index b2f675ef18..3c6ecc9197 100644
--- a/apps/codecs/libatrac/atrac3.c
+++ b/apps/codecs/libatrac/atrac3.c
@@ -55,9 +55,12 @@
55#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) 55#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
56#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0) 56#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
57 57
58static int32_t qmf_window[48] IBSS_ATTR; 58static VLC spectral_coeff_tab[7];
59static VLC spectral_coeff_tab[7]; 59static int32_t qmf_window[48] IBSS_ATTR;
60static channel_unit channel_units[2] IBSS_ATTR_LARGE_IRAM; 60static int32_t atrac3_spectrum [2][1024] IBSS_ATTR __attribute__((aligned(16)));
61static int32_t atrac3_IMDCT_buf[2][ 512] IBSS_ATTR __attribute__((aligned(16)));
62static int32_t atrac3_prevFrame[2][1024] IBSS_ATTR;
63static channel_unit channel_units[2] IBSS_ATTR_LARGE_IRAM;
61 64
62 65
63/** 66/**
@@ -425,7 +428,7 @@ static void inverseQuantizeSpectrum(int *mantissas, int32_t *pOut,
425 * @return outSubbands subband counter, fix for broken specification/files 428 * @return outSubbands subband counter, fix for broken specification/files
426 */ 429 */
427 430
428int decodeSpectrum (GetBitContext *gb, int32_t *pOut) ICODE_ATTR; 431int decodeSpectrum (GetBitContext *gb, int32_t *pOut) ICODE_ATTR_LARGE_IRAM;
429int decodeSpectrum (GetBitContext *gb, int32_t *pOut) 432int decodeSpectrum (GetBitContext *gb, int32_t *pOut)
430{ 433{
431 int numSubbands, codingMode, cnt, first, last, subbWidth; 434 int numSubbands, codingMode, cnt, first, last, subbWidth;
@@ -1228,7 +1231,14 @@ int atrac3_decode_init(ATRAC3Context *q, RMContext *rmctx)
1228 q->matrix_coeff_index_next[i] = 3; 1231 q->matrix_coeff_index_next[i] = 3;
1229 } 1232 }
1230 1233
1234 /* Link the iram'ed arrays to the decoder's data structure */
1231 q->pUnits = channel_units; 1235 q->pUnits = channel_units;
1236 q->pUnits[0].spectrum = &atrac3_spectrum [0][0];
1237 q->pUnits[1].spectrum = &atrac3_spectrum [1][0];
1238 q->pUnits[0].IMDCT_buf = &atrac3_IMDCT_buf[0][0];
1239 q->pUnits[1].IMDCT_buf = &atrac3_IMDCT_buf[1][0];
1240 q->pUnits[0].prevFrame = &atrac3_prevFrame[0][0];
1241 q->pUnits[1].prevFrame = &atrac3_prevFrame[1][0];
1232 1242
1233 return 0; 1243 return 0;
1234} 1244}