summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2008-05-14 19:49:01 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2008-05-14 19:49:01 +0000
commit14698f5a20fe67606df35ccf279b02c81f4959d5 (patch)
tree26d7d06a500b7fd82003401333fd4ca06ac83fba
parent77087eba4ec1e35a7a0e0804cbb167118abac2ea (diff)
downloadrockbox-14698f5a20fe67606df35ccf279b02c81f4959d5.tar.gz
rockbox-14698f5a20fe67606df35ccf279b02c81f4959d5.zip
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
-rw-r--r--apps/codecs/libmusepack/mpc_decoder.c34
-rw-r--r--apps/codecs/libmusepack/musepack.h10
2 files changed, 27 insertions, 17 deletions
diff --git a/apps/codecs/libmusepack/mpc_decoder.c b/apps/codecs/libmusepack/mpc_decoder.c
index c41b17c54c..f7687c5bad 100644
--- a/apps/codecs/libmusepack/mpc_decoder.c
+++ b/apps/codecs/libmusepack/mpc_decoder.c
@@ -75,21 +75,21 @@ extern const HuffmanTyp mpc_table_Region_C [ 4];
75#define HUFFMAN_DECODE_FASTEST(d,a,b,c) mpc_decoder_huffman_decode_fastest ( (d), (a), (b), 32-(c) ) 75#define HUFFMAN_DECODE_FASTEST(d,a,b,c) mpc_decoder_huffman_decode_fastest ( (d), (a), (b), 32-(c) )
76#define HUFFMAN_DECODE_FASTERER(d,a,b,c) mpc_decoder_huffman_decode_fasterer ( (d), (a), (b), 32-(c) ) 76#define HUFFMAN_DECODE_FASTERER(d,a,b,c) mpc_decoder_huffman_decode_fasterer ( (d), (a), (b), 32-(c) )
77 77
78mpc_uint8_t LUT1_0 [1<< 6]; 78mpc_uint8_t LUT1_0 [1<< 6] IBSS_ATTR_MPC_LARGE_IRAM;
79mpc_uint8_t LUT1_1 [1<< 9]; // 576 Bytes 79mpc_uint8_t LUT1_1 [1<< 9] IBSS_ATTR_MPC_LARGE_IRAM; // 576 Bytes
80mpc_uint8_t LUT2_0 [1<< 7]; 80mpc_uint8_t LUT2_0 [1<< 7] IBSS_ATTR_MPC_LARGE_IRAM;
81mpc_uint8_t LUT2_1 [1<<10]; // 1152 Bytes 81mpc_uint8_t LUT2_1 [1<<10] IBSS_ATTR_MPC_LARGE_IRAM; // 1152 Bytes
82mpc_uint8_t LUT3_0 [1<< 4]; 82mpc_uint8_t LUT3_0 [1<< 4] IBSS_ATTR_MPC_LARGE_IRAM;
83mpc_uint8_t LUT3_1 [1<< 5]; // 48 Bytes 83mpc_uint8_t LUT3_1 [1<< 5] IBSS_ATTR_MPC_LARGE_IRAM; // 48 Bytes
84mpc_uint8_t LUT4_0 [1<< 4]; 84mpc_uint8_t LUT4_0 [1<< 4] IBSS_ATTR_MPC_LARGE_IRAM;
85mpc_uint8_t LUT4_1 [1<< 5]; // 48 Bytes 85mpc_uint8_t LUT4_1 [1<< 5] IBSS_ATTR_MPC_LARGE_IRAM; // 48 Bytes
86mpc_uint8_t LUT5_0 [1<< 6]; 86mpc_uint8_t LUT5_0 [1<< 6] IBSS_ATTR_MPC_LARGE_IRAM;
87mpc_uint8_t LUT5_1 [1<< 8]; // 320 Bytes 87mpc_uint8_t LUT5_1 [1<< 8] IBSS_ATTR_MPC_LARGE_IRAM; // 320 Bytes
88mpc_uint8_t LUT6_0 [1<< 7]; 88mpc_uint8_t LUT6_0 [1<< 7] IBSS_ATTR_MPC_LARGE_IRAM;
89mpc_uint8_t LUT6_1 [1<< 7]; // 256 Bytes 89mpc_uint8_t LUT6_1 [1<< 7] IBSS_ATTR_MPC_LARGE_IRAM; // 256 Bytes
90mpc_uint8_t LUT7_0 [1<< 8]; 90mpc_uint8_t LUT7_0 [1<< 8] IBSS_ATTR_MPC_LARGE_IRAM;
91mpc_uint8_t LUT7_1 [1<< 8]; // 512 Bytes 91mpc_uint8_t LUT7_1 [1<< 8] IBSS_ATTR_MPC_LARGE_IRAM; // 512 Bytes
92mpc_uint8_t LUTDSCF [1<< 6]; // 64 Bytes = 2976 Bytes 92mpc_uint8_t LUTDSCF [1<< 6] IBSS_ATTR_MPC_LARGE_IRAM; // 64 Bytes = 2976 Bytes
93 93
94//------------------------------------------------------------------------------ 94//------------------------------------------------------------------------------
95// types 95// types
@@ -119,8 +119,8 @@ static inline mpc_int32_t mpc_decoder_huffman_decode_fastest(mpc_decoder *d, con
119static void mpc_move_next(mpc_decoder *d); 119static void mpc_move_next(mpc_decoder *d);
120 120
121mpc_uint32_t Speicher[MPC_DECODER_MEMSIZE]; 121mpc_uint32_t Speicher[MPC_DECODER_MEMSIZE];
122MPC_SAMPLE_FORMAT Y_L[36][32]; 122MPC_SAMPLE_FORMAT Y_L[36][32] IBSS_ATTR_MPC_LARGE_IRAM;
123MPC_SAMPLE_FORMAT Y_R[36][32]; 123MPC_SAMPLE_FORMAT Y_R[36][32] IBSS_ATTR_MPC_LARGE_IRAM;
124 124
125//------------------------------------------------------------------------------ 125//------------------------------------------------------------------------------
126// utility functions 126// utility functions
diff --git a/apps/codecs/libmusepack/musepack.h b/apps/codecs/libmusepack/musepack.h
index 8233f21f91..5d1ad0de3f 100644
--- a/apps/codecs/libmusepack/musepack.h
+++ b/apps/codecs/libmusepack/musepack.h
@@ -56,6 +56,16 @@ extern "C" {
56#define IBSS_ATTR_MPC_SAMPLE_BUF IBSS_ATTR 56#define IBSS_ATTR_MPC_SAMPLE_BUF IBSS_ATTR
57#endif 57#endif
58 58
59#ifndef IBSS_ATTR_MPC_LARGE_IRAM
60#if (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || (CONFIG_CPU == MCF5250)
61/* PP5022/24 and MCF5250 have 128KB of IRAM */
62#define IBSS_ATTR_MPC_LARGE_IRAM IBSS_ATTR
63#else
64/* other PP's and MCF5249 have 96KB of IRAM */
65#define IBSS_ATTR_MPC_LARGE_IRAM
66#endif
67#endif
68
59#ifdef ROCKBOX_LITTLE_ENDIAN 69#ifdef ROCKBOX_LITTLE_ENDIAN
60#define MPC_LITTLE_ENDIAN 70#define MPC_LITTLE_ENDIAN
61#endif 71#endif