summaryrefslogtreecommitdiffstats
path: root/apps/codecs/lib/codeclib.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2009-12-05 16:47:43 +0000
committerNils Wallménius <nils@rockbox.org>2009-12-05 16:47:43 +0000
commitb9d7f98f8c5653c9b5d945655cc64934da596142 (patch)
tree0a25d85df5377aa053287cdc53af6957ab140adf /apps/codecs/lib/codeclib.c
parent0651fe572b8fe1eb5457325f81a8c9986e479ef6 (diff)
downloadrockbox-b9d7f98f8c5653c9b5d945655cc64934da596142.tar.gz
rockbox-b9d7f98f8c5653c9b5d945655cc64934da596142.zip
Move av_log2 function and asociated table to the codec lib, remove 3 identical implementations, always have LUT in iram (gives a *tiny* speedup on coldfire), make the clz based function return the same value as the non clz based function for 0 input to be safe (slows down flac ~2% on the gigabeat S)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23858 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/lib/codeclib.c')
-rw-r--r--apps/codecs/lib/codeclib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c
index 8cc40894e3..1c624e0f8c 100644
--- a/apps/codecs/lib/codeclib.c
+++ b/apps/codecs/lib/codeclib.c
@@ -138,6 +138,18 @@ void qsort(void *base, size_t nmemb, size_t size,
ci->qsort(base,nmemb,size,compar);
}
+/* From ffmpeg - libavutil/common.h */
+const uint8_t ff_log2_tab[256] ICONST_ATTR = {
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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
+};
+
#ifdef RB_PROFILE
void __cyg_profile_func_enter(void *this_fn, void *call_site) {
#ifdef CPU_COLDFIRE