diff options
Diffstat (limited to 'apps/codecs/lib/codeclib.c')
-rw-r--r-- | apps/codecs/lib/codeclib.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c index 1c624e0f8c..3a137068ba 100644 --- a/apps/codecs/lib/codeclib.c +++ b/apps/codecs/lib/codeclib.c | |||
@@ -33,6 +33,15 @@ unsigned char* mp3buf; // The actual MP3 buffer from Rockbox | |||
33 | unsigned char* mallocbuf; // 512K from the start of MP3 buffer | 33 | unsigned char* mallocbuf; // 512K from the start of MP3 buffer |
34 | unsigned char* filebuf; // The rest of the MP3 buffer | 34 | unsigned char* filebuf; // The rest of the MP3 buffer |
35 | 35 | ||
36 | unsigned bs_log2(unsigned x) | ||
37 | { return bs_generic(x, BS_LOG2); } | ||
38 | unsigned bs_log2_0(unsigned x) | ||
39 | { return bs_generic(x, BS_LOG2|BS_0_0); } | ||
40 | unsigned bs_clz(unsigned x) | ||
41 | { return bs_generic(x, BS_CLZ); } | ||
42 | unsigned bs_clz_0(unsigned x) | ||
43 | { return bs_generic(x, BS_CLZ|BS_0_0); } | ||
44 | |||
36 | int codec_init(void) | 45 | int codec_init(void) |
37 | { | 46 | { |
38 | mem_ptr = 0; | 47 | mem_ptr = 0; |
@@ -139,7 +148,7 @@ void qsort(void *base, size_t nmemb, size_t size, | |||
139 | } | 148 | } |
140 | 149 | ||
141 | /* From ffmpeg - libavutil/common.h */ | 150 | /* From ffmpeg - libavutil/common.h */ |
142 | const uint8_t ff_log2_tab[256] ICONST_ATTR = { | 151 | const uint8_t bs_log2_tab[256] ICONST_ATTR = { |
143 | 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, | 152 | 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, |
144 | 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, | 153 | 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, |
145 | 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, | 154 | 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, |
@@ -150,6 +159,17 @@ const uint8_t ff_log2_tab[256] ICONST_ATTR = { | |||
150 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 | 159 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 |
151 | }; | 160 | }; |
152 | 161 | ||
162 | const uint8_t bs_clz_tab[256] ICONST_ATTR = { | ||
163 | 8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, | ||
164 | 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, | ||
165 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, | ||
166 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, | ||
167 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
168 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
169 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
170 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | ||
171 | }; | ||
172 | |||
153 | #ifdef RB_PROFILE | 173 | #ifdef RB_PROFILE |
154 | void __cyg_profile_func_enter(void *this_fn, void *call_site) { | 174 | void __cyg_profile_func_enter(void *this_fn, void *call_site) { |
155 | #ifdef CPU_COLDFIRE | 175 | #ifdef CPU_COLDFIRE |