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