summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libwmapro/quant.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libwmapro/quant.h')
-rw-r--r--lib/rbcodec/codecs/libwmapro/quant.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libwmapro/quant.h b/lib/rbcodec/codecs/libwmapro/quant.h
new file mode 100644
index 0000000000..3500615fde
--- /dev/null
+++ b/lib/rbcodec/codecs/libwmapro/quant.h
@@ -0,0 +1,53 @@
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,170). */
12const int32_t quant_tab[121] = {
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, 0x00989680, 0x00AB34D9,
36 0x00C018C6, 0x00D7893F, 0x00F1D5E4, 0x010F580A,
37 0x013073EF, 0x01559A0B, 0x017F4890, 0x01AE0D15,
38 0x01E28679, 0x021D66FB, 0x025F769D, 0x02A995C7,
39 0x02FCC043, 0x035A1095, 0x03C2C3B6, 0x04383D52,
40 0x04BC0C77, 0x054FF0E6, 0x05F5E100, 0x06B01075,
41 0x0780F7BD, 0x086B5C7A, 0x09725AE7, 0x0A997065,
42 0x0BE48757, 0x0D580472, 0x0EF8D5A3, 0x10CC82D5,
43 0x12D940B6
44};
45
46#define EXP_MIN 50
47#define EXP_MAX 170
48
49/* return the correct value of quant based on exp */
50#define QUANT(exp) quant_tab[exp - EXP_MIN]
51
52
53#endif /* _QUANT_H_ */