diff options
Diffstat (limited to 'apps/codecs/libgme/opltables.h')
-rw-r--r-- | apps/codecs/libgme/opltables.h | 242 |
1 files changed, 242 insertions, 0 deletions
diff --git a/apps/codecs/libgme/opltables.h b/apps/codecs/libgme/opltables.h new file mode 100644 index 0000000000..1414f2264b --- /dev/null +++ b/apps/codecs/libgme/opltables.h | |||
@@ -0,0 +1,242 @@ | |||
1 | #ifndef _OPLTABLES_H_ | ||
2 | #define _OPLTABLES_H_ | ||
3 | |||
4 | /* Precalculated emu8950 tables for use in Rockbox, | ||
5 | Calculated for 44Khz sampling rate */ | ||
6 | |||
7 | static const short ar_adjust_coeff[] ICONST_ATTR = { | ||
8 | 255, 227, 210, 198, 189, 181, 175, 170, 165, 161, 157, | ||
9 | 153, 150, 147, 144, 141, 139, 136, 134, 132, 130, 128, | ||
10 | 126, 125, 123, 121, 120, 118, 117, 115, 114, 113, 112, | ||
11 | 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, | ||
12 | 99, 98, 97, 96, 95, 94, 94, 93, 92, 91, 91, | ||
13 | 90, 89, 88, 88, 87, 86, 86, 85, 84, 84, 83, | ||
14 | 82, 82, 81, 81, 80, 79, 79, 78, 78, 77, 77, | ||
15 | 76, 76, 75, 75, 74, 74, 73, 73, 72, 72, 71, | ||
16 | 71, 70, 70, 69, 69, 69, 68, 68, 67, 67, 66, | ||
17 | 66, 66, 65, 65, 64, 64, 64, 63, 63, 62, 62, | ||
18 | 62, 61, 61, 61, 60, 60, 60, 59, 59, 59, 58, | ||
19 | 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55, | ||
20 | 54, 54, 54, 53, 53, 53, 53, 52, 52, 52, 51, | ||
21 | 51, 51, 50, 50, 50, 50, 49, 49, 49, 49, 48, | ||
22 | 48, 48, 48, 47, 47, 47, 46, 46, 46, 46, 45, | ||
23 | 45, 45, 45, 44, 44, 44, 44, 44, 43, 43, 43, | ||
24 | 43, 42, 42, 42, 42, 41, 41, 41, 41, 41, 40, | ||
25 | 40, 40, 40, 39, 39, 39, 39, 39, 38, 38, 38, | ||
26 | 38, 38, 37, 37, 37, 37, 37, 36, 36, 36, 36, | ||
27 | 36, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, | ||
28 | 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 32, | ||
29 | 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, | ||
30 | 30, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, | ||
31 | 28, 28, 27, 27, 27, 27, 27, 27, 26, 26, 26, | ||
32 | 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, | ||
33 | 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, | ||
34 | 23, 23, 22, 22, 22, 22, 22, 22, 22, 21, 21, | ||
35 | 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, | ||
36 | 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 18, | ||
37 | 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, | ||
38 | 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, | ||
39 | 16, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, | ||
40 | 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, | ||
41 | 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, | ||
42 | 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, | ||
43 | 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, | ||
44 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, | ||
45 | 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, | ||
46 | 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, | ||
47 | 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, | ||
48 | 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, | ||
49 | 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, | ||
50 | 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, | ||
51 | 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, | ||
52 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, | ||
53 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
54 | 0, 0, 0, 0, 0 | ||
55 | }; | ||
56 | |||
57 | static const short db2lin_coeff[] ICONST_ATTR = { | ||
58 | 2047, 2003, 1960, 1918, 1877, 1837, 1798, 1759, 1722, 1685, 1649, | ||
59 | 1614, 1579, 1546, 1513, 1480, 1449, 1418, 1387, 1358, 1329, 1300, | ||
60 | 1273, 1245, 1219, 1193, 1167, 1142, 1118, 1094, 1071, 1048, 1025, | ||
61 | 1004, 982, 961, 941, 920, 901, 882, 863, 844, 826, 809, | ||
62 | 791, 774, 758, 742, 726, 710, 695, 680, 666, 651, 638, | ||
63 | 624, 611, 598, 585, 572, 560, 548, 536, 525, 514, 503, | ||
64 | 492, 481, 471, 461, 451, 442, 432, 423, 414, 405, 396, | ||
65 | 388, 380, 371, 364, 356, 348, 341, 333, 326, 319, 312, | ||
66 | 306, 299, 293, 287, 280, 274, 269, 263, 257, 252, 246, | ||
67 | 241, 236, 231, 226, 221, 216, 212, 207, 203, 198, 194, | ||
68 | 190, 186, 182, 178, 174, 170, 167, 163, 160, 156, 153, | ||
69 | 150, 147, 143, 140, 137, 134, 131, 129, 126, 123, 121, | ||
70 | 118, 115, 113, 111, 108, 106, 104, 101, 99, 97, 95, | ||
71 | 93, 91, 89, 87, 85, 83, 82, 80, 78, 76, 75, | ||
72 | 73, 72, 70, 69, 67, 66, 64, 63, 61, 60, 59, | ||
73 | 58, 56, 55, 54, 53, 52, 51, 49, 48, 47, 46, | ||
74 | 45, 44, 43, 42, 42, 41, 40, 39, 38, 37, 36, | ||
75 | 36, 35, 34, 33, 33, 32, 31, 31, 30, 29, 29, | ||
76 | 28, 27, 27, 26, 26, 25, 25, 24, 23, 23, 22, | ||
77 | 22, 21, 21, 21, 20, 20, 19, 19, 18, 18, 18, | ||
78 | 17, 17, 16, 16, 16, 15, 15, 15, 14, 14, 14, | ||
79 | 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, | ||
80 | 11, 10, 10, 10, 10, 9, 9, 9, 9, 9, 8, | ||
81 | 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, | ||
82 | 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, | ||
83 | 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, | ||
84 | 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, | ||
85 | 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, | ||
86 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
87 | 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, | ||
88 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
89 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
90 | 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
91 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
92 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
93 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
94 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
95 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
96 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
97 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
98 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
99 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
100 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
101 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
102 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
103 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
104 | 0, 0, 0, 0, 0, 0 | ||
105 | }; | ||
106 | |||
107 | static const short sin_coeff[] ICONST_ATTR = { | ||
108 | 511, 235, 203, 185, 171, 161, 152, 145, 139, 134, 129, | ||
109 | 124, 120, 117, 113, 110, 107, 104, 102, 99, 97, 95, | ||
110 | 92, 90, 88, 87, 85, 83, 81, 80, 78, 77, 75, | ||
111 | 74, 72, 71, 70, 69, 67, 66, 65, 64, 63, 62, | ||
112 | 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 52, | ||
113 | 51, 50, 49, 48, 48, 47, 46, 45, 45, 44, 43, | ||
114 | 43, 42, 41, 41, 40, 39, 39, 38, 38, 37, 37, | ||
115 | 36, 35, 35, 34, 34, 33, 33, 32, 32, 31, 31, | ||
116 | 30, 30, 29, 29, 28, 28, 28, 27, 27, 26, 26, | ||
117 | 25, 25, 25, 24, 24, 23, 23, 23, 22, 22, 22, | ||
118 | 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, | ||
119 | 18, 17, 17, 17, 16, 16, 16, 16, 15, 15, 15, | ||
120 | 14, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, | ||
121 | 12, 11, 11, 11, 11, 11, 10, 10, 10, 10, 9, | ||
122 | 9, 9, 9, 9, 8, 8, 8, 8, 8, 7, 7, | ||
123 | 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, | ||
124 | 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, | ||
125 | 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, | ||
126 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
127 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
128 | 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, | ||
129 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
130 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
131 | 0, 0, 0, | ||
132 | }; | ||
133 | |||
134 | static const short pm0_coeff[] ICONST_ATTR = { | ||
135 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
136 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
137 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
138 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
139 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
140 | 256, 256, 257, 257, 257, 257, 257, 257, 257, 257, 257, | ||
141 | 257, 257, 257, 257, 257, 257, 256, 256, 256, 256, 256, | ||
142 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
143 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
144 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
145 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
146 | 256, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, | ||
147 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
148 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
149 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
150 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
151 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, | ||
152 | 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, | ||
153 | 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
154 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
155 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
156 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
157 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
158 | 255, 255, 255, | ||
159 | }; | ||
160 | |||
161 | static const short pm1_coeff[] ICONST_ATTR = { | ||
162 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
163 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 257, | ||
164 | 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, | ||
165 | 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, | ||
166 | 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, | ||
167 | 257, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, | ||
168 | 258, 258, 258, 258, 258, 258, 258, 257, 257, 257, 257, | ||
169 | 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, | ||
170 | 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, | ||
171 | 257, 257, 257, 257, 257, 257, 257, 257, 257, 256, 256, | ||
172 | 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, | ||
173 | 256, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, | ||
174 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
175 | 255, 255, 255, 255, 255, 255, 254, 254, 254, 254, 254, | ||
176 | 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, | ||
177 | 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, | ||
178 | 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 253, | ||
179 | 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, | ||
180 | 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, | ||
181 | 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, | ||
182 | 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, | ||
183 | 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, | ||
184 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | ||
185 | 255, 255, 255, | ||
186 | }; | ||
187 | |||
188 | static const short am0_coeff[] ICONST_ATTR = { | ||
189 | 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, | ||
190 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | ||
191 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, | ||
192 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, | ||
193 | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | ||
194 | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | ||
195 | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | ||
196 | 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, | ||
197 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, | ||
198 | 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, | ||
199 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | ||
200 | 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
201 | 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, | ||
202 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
203 | 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
204 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
205 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
206 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
207 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
208 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
209 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, | ||
210 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
211 | 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, | ||
212 | 2, 2, 2, | ||
213 | }; | ||
214 | |||
215 | static const short am1_coeff[] ICONST_ATTR = { | ||
216 | 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, | ||
217 | 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, | ||
218 | 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, | ||
219 | 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, | ||
220 | 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, | ||
221 | 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | ||
222 | 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | ||
223 | 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, | ||
224 | 23, 23, 23, 22, 22, 22, 22, 22, 21, 21, 21, | ||
225 | 21, 20, 20, 20, 20, 19, 19, 19, 19, 18, 18, | ||
226 | 18, 17, 17, 17, 17, 16, 16, 16, 15, 15, 15, | ||
227 | 14, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, | ||
228 | 11, 11, 10, 10, 10, 9, 9, 9, 9, 8, 8, | ||
229 | 8, 7, 7, 7, 7, 6, 6, 6, 5, 5, 5, | ||
230 | 5, 4, 4, 4, 4, 3, 3, 3, 3, 3, 2, | ||
231 | 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, | ||
232 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
233 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
234 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
235 | 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, | ||
236 | 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, | ||
237 | 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, | ||
238 | 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, | ||
239 | 11, 12, 12, | ||
240 | }; | ||
241 | |||
242 | #endif | ||