diff --git a/apps/codecs/libmusepack/decoder.h b/apps/codecs/libmusepack/decoder.h index e36425bd1e..1f78d53c8d 100644 --- a/apps/codecs/libmusepack/decoder.h +++ b/apps/codecs/libmusepack/decoder.h @@ -113,7 +113,7 @@ typedef struct mpc_decoder_t { mpc_uint8_t SeekTable_Step; #ifdef MPC_FIXED_POINT - unsigned char SCF_shift[256]; + mpc_uint8_t SCF_shift[256]; #endif MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960]; diff --git a/apps/codecs/libmusepack/musepack.h b/apps/codecs/libmusepack/musepack.h index 5d1ad0de3f..9bdebf8b04 100644 --- a/apps/codecs/libmusepack/musepack.h +++ b/apps/codecs/libmusepack/musepack.h @@ -66,6 +66,16 @@ extern "C" { #endif #endif +#ifndef ICODE_ATTR_MPC_LARGE_IRAM +#if (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) +/* PP5022/24 have 128KB of IRAM and have better performance with ICODE_ATTR */ +#define ICODE_ATTR_MPC_LARGE_IRAM ICODE_ATTR +#else +/* all other targets either haven't enough IRAM or performance suffers */ +#define ICODE_ATTR_MPC_LARGE_IRAM +#endif +#endif + #ifdef ROCKBOX_LITTLE_ENDIAN #define MPC_LITTLE_ENDIAN #endif diff --git a/apps/codecs/libmusepack/synth_filter.c b/apps/codecs/libmusepack/synth_filter.c index aed5d75fb1..faf014c90d 100644 --- a/apps/codecs/libmusepack/synth_filter.c +++ b/apps/codecs/libmusepack/synth_filter.c @@ -198,7 +198,11 @@ static const MPC_SAMPLE_FORMAT Di_opt [32] [16] ICONST_ATTR = { #define INVCOS30 MPC_MAKE_INVCOS( 684664578) #define INVCOS31 MPC_MAKE_INVCOS(1367679739) -static inline void +void +mpc_calculate_new_V ( const MPC_SAMPLE_FORMAT * Sample, MPC_SAMPLE_FORMAT * V ) +ICODE_ATTR_MPC_LARGE_IRAM; + +void mpc_calculate_new_V ( const MPC_SAMPLE_FORMAT * Sample, MPC_SAMPLE_FORMAT * V ) { // Calculating new V-buffer values for left channel @@ -453,7 +457,7 @@ mpc_calculate_new_V ( const MPC_SAMPLE_FORMAT * Sample, MPC_SAMPLE_FORMAT * V ) // total: 111 adds, 107 subs, 80 muls, 80 shifts } -static inline void +static void mpc_decoder_windowing_D(MPC_SAMPLE_FORMAT * Data, const MPC_SAMPLE_FORMAT * V) { const MPC_SAMPLE_FORMAT *D = (const MPC_SAMPLE_FORMAT *) &Di_opt;