summaryrefslogtreecommitdiff
path: root/apps/codecs/demac/libdemac/entropy.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2010-03-10 21:39:12 +0000
committerJens Arnold <amiconn@rockbox.org>2010-03-10 21:39:12 +0000
commit029e74866a6ed43f3b8833a06f28f4506210a99e (patch)
treedce150e1a1b2552fa696ed408665747448ff0b0f /apps/codecs/demac/libdemac/entropy.c
parent20f5a533aed5c0a502f89eca3992f66a70d5d746 (diff)
downloadrockbox-029e74866a6ed43f3b8833a06f28f4506210a99e.tar.gz
rockbox-029e74866a6ed43f3b8833a06f28f4506210a99e.zip
Move (small) data into DRAM on PP5020, it's ~4.5% faster that way. Closes about half of the performance gap towards PP5022. The (relatively large) buffers for decoded data stay in IRAM, as does the reciprocal table. Clarify some comments.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25108 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/demac/libdemac/entropy.c')
-rw-r--r--apps/codecs/demac/libdemac/entropy.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/codecs/demac/libdemac/entropy.c b/apps/codecs/demac/libdemac/entropy.c
index 24f5932de6..a09ba8f540 100644
--- a/apps/codecs/demac/libdemac/entropy.c
+++ b/apps/codecs/demac/libdemac/entropy.c
@@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
36 hard-coded in the Monkey's Audio decoder. 36 hard-coded in the Monkey's Audio decoder.
37*/ 37*/
38 38
39static const int counts_3970[65] ICONST_ATTR = 39static const int counts_3970[65] ICONST_ATTR_DEMAC =
40{ 40{
41 0,14824,28224,39348,47855,53994,58171,60926, 41 0,14824,28224,39348,47855,53994,58171,60926,
42 62682,63786,64463,64878,65126,65276,65365,65419, 42 62682,63786,64463,64878,65126,65276,65365,65419,
@@ -50,7 +50,7 @@ static const int counts_3970[65] ICONST_ATTR =
50}; 50};
51 51
52/* counts_diff_3970[i] = counts_3970[i+1] - counts_3970[i] */ 52/* counts_diff_3970[i] = counts_3970[i+1] - counts_3970[i] */
53static const int counts_diff_3970[64] ICONST_ATTR = 53static const int counts_diff_3970[64] ICONST_ATTR_DEMAC =
54{ 54{
55 14824,13400,11124,8507,6139,4177,2755,1756, 55 14824,13400,11124,8507,6139,4177,2755,1756,
56 1104,677,415,248,150,89,54,31, 56 1104,677,415,248,150,89,54,31,
@@ -62,7 +62,7 @@ static const int counts_diff_3970[64] ICONST_ATTR =
62 1,1,1,1,1,1,1,1 62 1,1,1,1,1,1,1,1
63}; 63};
64 64
65static const int counts_3980[65] ICONST_ATTR = 65static const int counts_3980[65] ICONST_ATTR_DEMAC =
66{ 66{
67 0,19578,36160,48417,56323,60899,63265,64435, 67 0,19578,36160,48417,56323,60899,63265,64435,
68 64971,65232,65351,65416,65447,65466,65476,65482, 68 64971,65232,65351,65416,65447,65466,65476,65482,
@@ -77,7 +77,7 @@ static const int counts_3980[65] ICONST_ATTR =
77 77
78/* counts_diff_3980[i] = counts_3980[i+1] - counts_3980[i] */ 78/* counts_diff_3980[i] = counts_3980[i+1] - counts_3980[i] */
79 79
80static const int counts_diff_3980[64] ICONST_ATTR = 80static const int counts_diff_3980[64] ICONST_ATTR_DEMAC =
81{ 81{
82 19578,16582,12257,7906,4576,2366,1170,536, 82 19578,16582,12257,7906,4576,2366,1170,536,
83 261,119,65,31,19,10,6,3, 83 261,119,65,31,19,10,6,3,
@@ -122,8 +122,8 @@ each function (and the RNGC macro)).
122 for aligned reads. 122 for aligned reads.
123*/ 123*/
124 124
125static unsigned char* bytebuffer IBSS_ATTR; 125static unsigned char* bytebuffer IBSS_ATTR_DEMAC;
126static int bytebufferoffset IBSS_ATTR; 126static int bytebufferoffset IBSS_ATTR_DEMAC;
127 127
128static inline void skip_byte(void) 128static inline void skip_byte(void)
129{ 129{
@@ -159,7 +159,7 @@ struct rangecoder_t
159 unsigned int buffer; /* buffer for input/output */ 159 unsigned int buffer; /* buffer for input/output */
160}; 160};
161 161
162static struct rangecoder_t rc IBSS_ATTR; 162static struct rangecoder_t rc IBSS_ATTR_DEMAC;
163 163
164/* Start the decoder */ 164/* Start the decoder */
165static inline void range_start_decoding(void) 165static inline void range_start_decoding(void)
@@ -276,8 +276,8 @@ struct rice_t
276 uint32_t ksum; 276 uint32_t ksum;
277}; 277};
278 278
279static struct rice_t riceX IBSS_ATTR; 279static struct rice_t riceX IBSS_ATTR_DEMAC;
280static struct rice_t riceY IBSS_ATTR; 280static struct rice_t riceY IBSS_ATTR_DEMAC;
281 281
282static inline void update_rice(struct rice_t* rice, int x) 282static inline void update_rice(struct rice_t* rice, int x)
283{ 283{