Musepack performance optimization for PP5022/PP5024/MCF5250 targets. Use IRAM for internal sample buffers and lookup tables. Speeds up decoding by ~7% on PP5022/PP5024 (Sansa: c200, e200 + iPod mini2G, nano, video) and by ~27% on MCF5250 (iaudio m5, x5).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17507 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2008-05-14 19:49:01 +00:00
parent 77087eba4e
commit 14698f5a20
2 changed files with 27 additions and 17 deletions

View file

@ -75,21 +75,21 @@ extern const HuffmanTyp mpc_table_Region_C [ 4];
#define HUFFMAN_DECODE_FASTEST(d,a,b,c) mpc_decoder_huffman_decode_fastest ( (d), (a), (b), 32-(c) )
#define HUFFMAN_DECODE_FASTERER(d,a,b,c) mpc_decoder_huffman_decode_fasterer ( (d), (a), (b), 32-(c) )
mpc_uint8_t LUT1_0 [1<< 6];
mpc_uint8_t LUT1_1 [1<< 9]; // 576 Bytes
mpc_uint8_t LUT2_0 [1<< 7];
mpc_uint8_t LUT2_1 [1<<10]; // 1152 Bytes
mpc_uint8_t LUT3_0 [1<< 4];
mpc_uint8_t LUT3_1 [1<< 5]; // 48 Bytes
mpc_uint8_t LUT4_0 [1<< 4];
mpc_uint8_t LUT4_1 [1<< 5]; // 48 Bytes
mpc_uint8_t LUT5_0 [1<< 6];
mpc_uint8_t LUT5_1 [1<< 8]; // 320 Bytes
mpc_uint8_t LUT6_0 [1<< 7];
mpc_uint8_t LUT6_1 [1<< 7]; // 256 Bytes
mpc_uint8_t LUT7_0 [1<< 8];
mpc_uint8_t LUT7_1 [1<< 8]; // 512 Bytes
mpc_uint8_t LUTDSCF [1<< 6]; // 64 Bytes = 2976 Bytes
mpc_uint8_t LUT1_0 [1<< 6] IBSS_ATTR_MPC_LARGE_IRAM;
mpc_uint8_t LUT1_1 [1<< 9] IBSS_ATTR_MPC_LARGE_IRAM; // 576 Bytes
mpc_uint8_t LUT2_0 [1<< 7] IBSS_ATTR_MPC_LARGE_IRAM;
mpc_uint8_t LUT2_1 [1<<10] IBSS_ATTR_MPC_LARGE_IRAM; // 1152 Bytes
mpc_uint8_t LUT3_0 [1<< 4] IBSS_ATTR_MPC_LARGE_IRAM;
mpc_uint8_t LUT3_1 [1<< 5] IBSS_ATTR_MPC_LARGE_IRAM; // 48 Bytes
mpc_uint8_t LUT4_0 [1<< 4] IBSS_ATTR_MPC_LARGE_IRAM;
mpc_uint8_t LUT4_1 [1<< 5] IBSS_ATTR_MPC_LARGE_IRAM; // 48 Bytes
mpc_uint8_t LUT5_0 [1<< 6] IBSS_ATTR_MPC_LARGE_IRAM;
mpc_uint8_t LUT5_1 [1<< 8] IBSS_ATTR_MPC_LARGE_IRAM; // 320 Bytes
mpc_uint8_t LUT6_0 [1<< 7] IBSS_ATTR_MPC_LARGE_IRAM;
mpc_uint8_t LUT6_1 [1<< 7] IBSS_ATTR_MPC_LARGE_IRAM; // 256 Bytes
mpc_uint8_t LUT7_0 [1<< 8] IBSS_ATTR_MPC_LARGE_IRAM;
mpc_uint8_t LUT7_1 [1<< 8] IBSS_ATTR_MPC_LARGE_IRAM; // 512 Bytes
mpc_uint8_t LUTDSCF [1<< 6] IBSS_ATTR_MPC_LARGE_IRAM; // 64 Bytes = 2976 Bytes
//------------------------------------------------------------------------------
// types
@ -119,8 +119,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];
MPC_SAMPLE_FORMAT Y_L[36][32] IBSS_ATTR_MPC_LARGE_IRAM;
MPC_SAMPLE_FORMAT Y_R[36][32] IBSS_ATTR_MPC_LARGE_IRAM;
//------------------------------------------------------------------------------
// utility functions

View file

@ -56,6 +56,16 @@ extern "C" {
#define IBSS_ATTR_MPC_SAMPLE_BUF IBSS_ATTR
#endif
#ifndef IBSS_ATTR_MPC_LARGE_IRAM
#if (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || (CONFIG_CPU == MCF5250)
/* PP5022/24 and MCF5250 have 128KB of IRAM */
#define IBSS_ATTR_MPC_LARGE_IRAM IBSS_ATTR
#else
/* other PP's and MCF5249 have 96KB of IRAM */
#define IBSS_ATTR_MPC_LARGE_IRAM
#endif
#endif
#ifdef ROCKBOX_LITTLE_ENDIAN
#define MPC_LITTLE_ENDIAN
#endif