summaryrefslogtreecommitdiff
path: root/apps/codecs/libwma/wmadeci.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/libwma/wmadeci.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/libwma/wmadeci.c')
-rw-r--r--apps/codecs/libwma/wmadeci.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c
index 87af30b518..ae1a93ecf2 100644
--- a/apps/codecs/libwma/wmadeci.c
+++ b/apps/codecs/libwma/wmadeci.c
@@ -29,35 +29,6 @@
29#include "wmafixed.h" 29#include "wmafixed.h"
30#include "wmadata.h" 30#include "wmadata.h"
31 31
32static const uint8_t ff_log2_tab[256]={
33 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,
34 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,
35 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,
36 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,
37 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,
38 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,
39 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,
40 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
41};
42
43static inline int av_log2(unsigned int v)
44{
45 int n;
46
47 n = 0;
48 if (v & 0xffff0000) {
49 v >>= 16;
50 n += 16;
51 }
52 if (v & 0xff00) {
53 v >>= 8;
54 n += 8;
55 }
56 n += ff_log2_tab[v];
57
58 return n;
59}
60
61static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len); 32static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len);
62inline void vector_fmul_add_add(fixed32 *dst, const fixed32 *data, 33inline void vector_fmul_add_add(fixed32 *dst, const fixed32 *data,
63 const fixed32 *window, int n); 34 const fixed32 *window, int n);