summaryrefslogtreecommitdiffstats
path: root/apps/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs')
-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