summaryrefslogtreecommitdiff
path: root/apps/codecs/libwmapro/quant.h
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-07-05 22:33:37 +0000
committerMohamed Tarek <mt@rockbox.org>2010-07-05 22:33:37 +0000
commitd884af2b9992f12e98a3e8548aff76b232b5bfb3 (patch)
treed3aefbc2195382025105b252c16b00087778beed /apps/codecs/libwmapro/quant.h
parent6a04479d63dd4d7dfc54849e4c925d360d55fa9c (diff)
downloadrockbox-d884af2b9992f12e98a3e8548aff76b232b5bfb3.tar.gz
rockbox-d884af2b9992f12e98a3e8548aff76b232b5bfb3.zip
Partial conversion of the wmapro decoder to fixed point arithmetic. Currently inverse quantization & rescaling,
imdct and windowing are all in fixed point. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27302 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwmapro/quant.h')
-rw-r--r--apps/codecs/libwmapro/quant.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/apps/codecs/libwmapro/quant.h b/apps/codecs/libwmapro/quant.h
new file mode 100644
index 0000000000..dba2d071aa
--- /dev/null
+++ b/apps/codecs/libwmapro/quant.h
@@ -0,0 +1,45 @@
1#ifndef _QUANT_H_
2#define _QUANT_H_
3
4#include <inttypes.h>
5
6/* This table contains unscaled integer casts of the floating point inverse
7 * quantization factors used by wma pro. The formula for calculating the
8 * floating point value is :
9 * quant = pow(10.0, exp/20)
10 * 'exp' is an integer value which I have exmerimentally found to fall in the
11 * range (50,139). */
12const int32_t quant_tab[90] = {
13 0x0000013C, 0x00000163, 0x0000018E, 0x000001BF,
14 0x000001F5, 0x00000232, 0x00000277, 0x000002C4,
15 0x0000031A, 0x0000037B, 0x000003E8, 0x00000462,
16 0x000004EB, 0x00000585, 0x00000631, 0x000006F2,
17 0x000007CB, 0x000008BF, 0x000009D0, 0x00000B02,
18 0x00000C5A, 0x00000DDC, 0x00000F8D, 0x00001173,
19 0x00001394, 0x000015F7, 0x000018A6, 0x00001BA7,
20 0x00001F07, 0x000022D1, 0x00002710, 0x00002BD4,
21 0x0000312D, 0x0000372D, 0x00003DE9, 0x00004577,
22 0x00004DF1, 0x00005773, 0x0000621F, 0x00006E18,
23 0x00007B87, 0x00008A99, 0x00009B83, 0x0000AE7C,
24 0x0000C3C7, 0x0000DBAA, 0x0000F678, 0x0001148B,
25 0x00013649, 0x00015C25, 0x000186A0, 0x0001B64A,
26 0x0001EBC5, 0x000227C6, 0x00026B19, 0x0002B6A4,
27 0x00030B66, 0x00036A80, 0x0003D535, 0x00044CEE,
28 0x0004D344, 0x000569FD, 0x0006131B, 0x0006D0DC,
29 0x0007A5C3, 0x000894A5, 0x0009A0AD, 0x000ACD6A,
30 0x000C1ED8, 0x000D9973, 0x000F4240, 0x00111EE2,
31 0x001335AD, 0x00158DBA, 0x00182EFD, 0x001B2267,
32 0x001E71FE, 0x00222901, 0x0026540E, 0x002B014F,
33 0x003040A6, 0x003623E6, 0x003CBF10, 0x00442894,
34 0x004C79A0, 0x0055CE75, 0x006046C5, 0x006C0622,
35 0x00793472, 0x0087FE7D,
36};
37
38#define EXP_MIN 50
39#define EXP_MAX 139
40
41/* return the correct value of quant based on exp */
42#define QUANT(exp) quant_tab[exp - EXP_MIN]
43
44
45#endif /* _QUANT_H_ */