summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2005-10-28 20:21:58 +0000
committerThom Johansen <thomj@rockbox.org>2005-10-28 20:21:58 +0000
commitc01b987ccafc4074292a063ef6fe0112ff30d12d (patch)
tree9e37541dd144e3cd55293254aa05a770ed44d144 /apps
parente12ab49b7318cee0674ba84d6376e80b0e6d7c18 (diff)
downloadrockbox-c01b987ccafc4074292a063ef6fe0112ff30d12d.tar.gz
rockbox-c01b987ccafc4074292a063ef6fe0112ff30d12d.tar.bz2
rockbox-c01b987ccafc4074292a063ef6fe0112ff30d12d.zip
Squeezed two very frequently used arrays in IRAM for a very nice performance boost.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7676 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libmusepack/decoder.h8
-rw-r--r--apps/codecs/libmusepack/mpc_decoder.c6
2 files changed, 12 insertions, 2 deletions
diff --git a/apps/codecs/libmusepack/decoder.h b/apps/codecs/libmusepack/decoder.h
index 9df0a849de..11acb7598b 100644
--- a/apps/codecs/libmusepack/decoder.h
+++ b/apps/codecs/libmusepack/decoder.h
@@ -136,8 +136,12 @@ typedef struct mpc_decoder_t {
unsigned char SCF_shift[256];
#endif
- MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960];
- MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960];
+ /* These two see very frequent use in synth_filter.c, so we'll put them
+ in IRAM for Rockbox use. Actual arrays are placed in mpc_decoder.c */
+ /* MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960]; */
+ /* MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960]; */
+ MPC_SAMPLE_FORMAT *V_L;
+ MPC_SAMPLE_FORMAT *V_R;
MPC_SAMPLE_FORMAT Y_L[36][32];
MPC_SAMPLE_FORMAT Y_R[36][32];
MPC_SAMPLE_FORMAT SCF[256]; ///< holds adapted scalefactors (for clipping prevention)
diff --git a/apps/codecs/libmusepack/mpc_decoder.c b/apps/codecs/libmusepack/mpc_decoder.c
index 166c9f7232..f8fdd8889e 100644
--- a/apps/codecs/libmusepack/mpc_decoder.c
+++ b/apps/codecs/libmusepack/mpc_decoder.c
@@ -1106,6 +1106,9 @@ mpc_decoder_read_bitstream_sv7(mpc_decoder *d)
}
}
+MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960] IBSS_ATTR;
+MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960] IBSS_ATTR;
+
void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r)
{
d->r = r;
@@ -1174,6 +1177,9 @@ void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r)
mpc_decoder_init_huffman_sv6(d);
mpc_decoder_init_huffman_sv7(d);
+ /* Link struct entries to actual tables which are placed in IRAM */
+ d->V_L = V_L;
+ d->V_R = V_R;
#if defined(CPU_COLDFIRE)&& !defined(SIMULATOR)
coldfire_set_macsr(EMAC_FRACTIONAL | EMAC_SATURATE);
#endif