summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2006-09-01 12:09:20 +0000
committerThom Johansen <thomj@rockbox.org>2006-09-01 12:09:20 +0000
commit7197c0e588bef139327772e96c2ac74bf6540208 (patch)
tree8e3c39bb93e00b4e7e37bc035e3174634dd5e8a8 /apps/codecs
parent5e182e08620fd5aa7743bf83d759f6847cd76b45 (diff)
Put Musepack output data array back in IRAM for faster DSP processing. Patch by Andrew Cupper.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10844 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/libmusepack/decoder.h4
-rw-r--r--apps/codecs/libmusepack/mpc_decoder.c16
-rw-r--r--apps/codecs/mpc.c2
3 files changed, 13 insertions, 9 deletions
diff --git a/apps/codecs/libmusepack/decoder.h b/apps/codecs/libmusepack/decoder.h
index 7ffa572db2..d65f6dcfb3 100644
--- a/apps/codecs/libmusepack/decoder.h
+++ b/apps/codecs/libmusepack/decoder.h
@@ -124,8 +124,8 @@ typedef struct mpc_decoder_t {
MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960];
MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960];
- MPC_SAMPLE_FORMAT Y_L[36][32];
- MPC_SAMPLE_FORMAT Y_R[36][32];
+ MPC_SAMPLE_FORMAT (*Y_L)[32];
+ MPC_SAMPLE_FORMAT (*Y_R)[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 4bf36bddc6..89d7254356 100644
--- a/apps/codecs/libmusepack/mpc_decoder.c
+++ b/apps/codecs/libmusepack/mpc_decoder.c
@@ -121,6 +121,8 @@ static inline mpc_int32_t mpc_decoder_huffman_decode_fastest(mpc_decoder *d, con
static void mpc_move_next(mpc_decoder *d);
mpc_uint32_t Speicher[MPC_DECODER_MEMSIZE];
+MPC_SAMPLE_FORMAT Y_L[36][32];
+MPC_SAMPLE_FORMAT Y_R[36][32];
//------------------------------------------------------------------------------
// utility functions
@@ -380,8 +382,8 @@ mpc_decoder_reset_synthesis(mpc_decoder *d)
static void
mpc_decoder_reset_y(mpc_decoder *d)
{
- memset(d->Y_L, 0, sizeof d->Y_L);
- memset(d->Y_R, 0, sizeof d->Y_R);
+ memset(d->Y_L, 0, sizeof Y_L);
+ memset(d->Y_R, 0, sizeof Y_R);
}
static void
@@ -395,8 +397,8 @@ mpc_decoder_reset_globals(mpc_decoder *d)
d->StreamVersion = 0;
d->MS_used = 0;
- memset(d->Y_L , 0, sizeof d->Y_L );
- memset(d->Y_R , 0, sizeof d->Y_R );
+ memset(d->Y_L , 0, sizeof Y_L );
+ memset(d->Y_R , 0, sizeof Y_R );
memset(d->SCF_Index_L , 0, sizeof d->SCF_Index_L );
memset(d->SCF_Index_R , 0, sizeof d->SCF_Index_R );
memset(d->Res_L , 0, sizeof d->Res_L );
@@ -1487,6 +1489,8 @@ void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r)
LOOKUP ( mpc_table_HuffDSCF, 16, LUTDSCF );
d->Speicher = Speicher;
+ d->Y_L = Y_L;
+ d->Y_R = Y_R;
#if defined(CPU_COLDFIRE)&& !defined(SIMULATOR)
coldfire_set_macsr(EMAC_FRACTIONAL | EMAC_SATURATE);
@@ -1642,8 +1646,8 @@ mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *d, double seconds)
void mpc_decoder_reset_state(mpc_decoder *d) {
- memset(d->Y_L , 0, sizeof d->Y_L );
- memset(d->Y_R , 0, sizeof d->Y_R );
+ memset(d->Y_L , 0, sizeof Y_L );
+ memset(d->Y_R , 0, sizeof Y_R );
#ifdef SCF_HACK
memset(d->SCF_Index_L , -128, sizeof d->SCF_Index_L );
memset(d->SCF_Index_R , -128, sizeof d->SCF_Index_R );
diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c
index c1fa0d7a99..563b31355a 100644
--- a/apps/codecs/mpc.c
+++ b/apps/codecs/mpc.c
@@ -63,7 +63,7 @@ mpc_bool_t canseek_impl(void *data)
return true;
}
-MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
+MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH] IBSS_ATTR;
mpc_uint32_t seek_table[10000];
#ifdef USE_IRAM