Mercurial > mplayer.hg
annotate mp3lib/dct64_altivec.c @ 26550:8a26190978a6
Force to uint64_t first to avoid direct conversion from double to unsigned int.
author | ulion |
---|---|
date | Mon, 28 Apr 2008 15:57:31 +0000 |
parents | dcb28cc9ca2c |
children | 2aadf9302854 |
rev | line source |
---|---|
9002 | 1 |
2 /* | |
11980 | 3 * Discrete Cosine Tansform (DCT) for Altivec |
4 * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org> | |
5 * based upon code from "mp3lib/dct64.c" | |
18848 | 6 * This file is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Lesser General Public License | |
9002 | 8 */ |
9 | |
10 #define real float | |
11 | |
25341 | 12 #include <stdio.h> |
9002 | 13 #include "mpg123.h" |
14 | |
25328
6f0309e575e0
There is a check for altivec.h in configure so use the preprocessor directive
diego
parents:
25327
diff
changeset
|
15 #ifdef HAVE_ALTIVEC_H |
9122 | 16 #include <altivec.h> |
17 #endif | |
18 | |
9002 | 19 // used to build registers permutation vectors (vcprm) |
20 // the 's' are for words in the _s_econd vector | |
21 #define WORD_0 0x00,0x01,0x02,0x03 | |
22 #define WORD_1 0x04,0x05,0x06,0x07 | |
23 #define WORD_2 0x08,0x09,0x0a,0x0b | |
24 #define WORD_3 0x0c,0x0d,0x0e,0x0f | |
25 #define WORD_s0 0x10,0x11,0x12,0x13 | |
26 #define WORD_s1 0x14,0x15,0x16,0x17 | |
27 #define WORD_s2 0x18,0x19,0x1a,0x1b | |
28 #define WORD_s3 0x1c,0x1d,0x1e,0x1f | |
29 | |
25327
a7b716b53e9f
Replace SYS_DARWIN conditional directive around gcc macros by __APPLE_CC__.
diego
parents:
25324
diff
changeset
|
30 #ifdef __APPLE_CC__ |
25996 | 31 #define AVV(x...) (x) |
9122 | 32 #else |
25996 | 33 #define AVV(x...) {x} |
9122 | 34 #endif |
9002 | 35 |
25996 | 36 #define vcprm(a,b,c,d) (const vector unsigned char)AVV(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d) |
37 #define vcii(a,b,c,d) (const vector float)AVV(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d) | |
38 | |
39 #define FOUROF(a) AVV(a,a,a,a) | |
40 | |
9002 | 41 // vcprmle is used to keep the same index as in the SSE version. |
42 // it's the same as vcprm, with the index inversed | |
43 // ('le' is Little Endian) | |
44 #define vcprmle(a,b,c,d) vcprm(d,c,b,a) | |
45 | |
46 // used to build inverse/identity vectors (vcii) | |
47 // n is _n_egative, p is _p_ositive | |
48 #define FLOAT_n -1. | |
49 #define FLOAT_p 1. | |
50 | |
51 void dct64_altivec(real *a,real *b,real *c) | |
52 { | |
53 real __attribute__ ((aligned(16))) b1[0x20]; | |
54 real __attribute__ ((aligned(16))) b2[0x20]; | |
55 | |
56 real *out0 = a; | |
57 real *out1 = b; | |
58 real *samples = c; | |
59 | |
9122 | 60 const vector float vczero = (const vector float)FOUROF(0.); |
9002 | 61 const vector unsigned char reverse = (const vector unsigned char)vcprm(3,2,1,0); |
62 | |
63 | |
64 if (((unsigned long)b1 & 0x0000000F) || | |
65 ((unsigned long)b2 & 0x0000000F)) | |
66 | |
67 { | |
68 printf("MISALIGNED:\t%p\t%p\t%p\t%p\t%p\n", | |
69 b1, b2, a, b, samples); | |
70 } | |
71 | |
72 | |
73 #ifdef ALTIVEC_USE_REFERENCE_C_CODE | |
74 | |
75 { | |
12131
d155623271e3
fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
alex
parents:
11980
diff
changeset
|
76 register real *costab = mp3lib_pnts[0]; |
9002 | 77 |
78 b1[0x00] = samples[0x00] + samples[0x1F]; | |
79 b1[0x01] = samples[0x01] + samples[0x1E]; | |
80 b1[0x02] = samples[0x02] + samples[0x1D]; | |
81 b1[0x03] = samples[0x03] + samples[0x1C]; | |
82 b1[0x04] = samples[0x04] + samples[0x1B]; | |
83 b1[0x05] = samples[0x05] + samples[0x1A]; | |
84 b1[0x06] = samples[0x06] + samples[0x19]; | |
85 b1[0x07] = samples[0x07] + samples[0x18]; | |
86 b1[0x08] = samples[0x08] + samples[0x17]; | |
87 b1[0x09] = samples[0x09] + samples[0x16]; | |
88 b1[0x0A] = samples[0x0A] + samples[0x15]; | |
89 b1[0x0B] = samples[0x0B] + samples[0x14]; | |
90 b1[0x0C] = samples[0x0C] + samples[0x13]; | |
91 b1[0x0D] = samples[0x0D] + samples[0x12]; | |
92 b1[0x0E] = samples[0x0E] + samples[0x11]; | |
93 b1[0x0F] = samples[0x0F] + samples[0x10]; | |
94 b1[0x10] = (samples[0x0F] - samples[0x10]) * costab[0xF]; | |
95 b1[0x11] = (samples[0x0E] - samples[0x11]) * costab[0xE]; | |
96 b1[0x12] = (samples[0x0D] - samples[0x12]) * costab[0xD]; | |
97 b1[0x13] = (samples[0x0C] - samples[0x13]) * costab[0xC]; | |
98 b1[0x14] = (samples[0x0B] - samples[0x14]) * costab[0xB]; | |
99 b1[0x15] = (samples[0x0A] - samples[0x15]) * costab[0xA]; | |
100 b1[0x16] = (samples[0x09] - samples[0x16]) * costab[0x9]; | |
101 b1[0x17] = (samples[0x08] - samples[0x17]) * costab[0x8]; | |
102 b1[0x18] = (samples[0x07] - samples[0x18]) * costab[0x7]; | |
103 b1[0x19] = (samples[0x06] - samples[0x19]) * costab[0x6]; | |
104 b1[0x1A] = (samples[0x05] - samples[0x1A]) * costab[0x5]; | |
105 b1[0x1B] = (samples[0x04] - samples[0x1B]) * costab[0x4]; | |
106 b1[0x1C] = (samples[0x03] - samples[0x1C]) * costab[0x3]; | |
107 b1[0x1D] = (samples[0x02] - samples[0x1D]) * costab[0x2]; | |
108 b1[0x1E] = (samples[0x01] - samples[0x1E]) * costab[0x1]; | |
109 b1[0x1F] = (samples[0x00] - samples[0x1F]) * costab[0x0]; | |
110 | |
111 } | |
112 { | |
12131
d155623271e3
fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
alex
parents:
11980
diff
changeset
|
113 register real *costab = mp3lib_pnts[1]; |
9002 | 114 |
115 b2[0x00] = b1[0x00] + b1[0x0F]; | |
116 b2[0x01] = b1[0x01] + b1[0x0E]; | |
117 b2[0x02] = b1[0x02] + b1[0x0D]; | |
118 b2[0x03] = b1[0x03] + b1[0x0C]; | |
119 b2[0x04] = b1[0x04] + b1[0x0B]; | |
120 b2[0x05] = b1[0x05] + b1[0x0A]; | |
121 b2[0x06] = b1[0x06] + b1[0x09]; | |
122 b2[0x07] = b1[0x07] + b1[0x08]; | |
123 b2[0x08] = (b1[0x07] - b1[0x08]) * costab[7]; | |
124 b2[0x09] = (b1[0x06] - b1[0x09]) * costab[6]; | |
125 b2[0x0A] = (b1[0x05] - b1[0x0A]) * costab[5]; | |
126 b2[0x0B] = (b1[0x04] - b1[0x0B]) * costab[4]; | |
127 b2[0x0C] = (b1[0x03] - b1[0x0C]) * costab[3]; | |
128 b2[0x0D] = (b1[0x02] - b1[0x0D]) * costab[2]; | |
129 b2[0x0E] = (b1[0x01] - b1[0x0E]) * costab[1]; | |
130 b2[0x0F] = (b1[0x00] - b1[0x0F]) * costab[0]; | |
131 b2[0x10] = b1[0x10] + b1[0x1F]; | |
132 b2[0x11] = b1[0x11] + b1[0x1E]; | |
133 b2[0x12] = b1[0x12] + b1[0x1D]; | |
134 b2[0x13] = b1[0x13] + b1[0x1C]; | |
135 b2[0x14] = b1[0x14] + b1[0x1B]; | |
136 b2[0x15] = b1[0x15] + b1[0x1A]; | |
137 b2[0x16] = b1[0x16] + b1[0x19]; | |
138 b2[0x17] = b1[0x17] + b1[0x18]; | |
139 b2[0x18] = (b1[0x18] - b1[0x17]) * costab[7]; | |
140 b2[0x19] = (b1[0x19] - b1[0x16]) * costab[6]; | |
141 b2[0x1A] = (b1[0x1A] - b1[0x15]) * costab[5]; | |
142 b2[0x1B] = (b1[0x1B] - b1[0x14]) * costab[4]; | |
143 b2[0x1C] = (b1[0x1C] - b1[0x13]) * costab[3]; | |
144 b2[0x1D] = (b1[0x1D] - b1[0x12]) * costab[2]; | |
145 b2[0x1E] = (b1[0x1E] - b1[0x11]) * costab[1]; | |
146 b2[0x1F] = (b1[0x1F] - b1[0x10]) * costab[0]; | |
147 | |
148 } | |
149 | |
150 { | |
12131
d155623271e3
fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
alex
parents:
11980
diff
changeset
|
151 register real *costab = mp3lib_pnts[2]; |
9002 | 152 |
153 b1[0x00] = b2[0x00] + b2[0x07]; | |
154 b1[0x01] = b2[0x01] + b2[0x06]; | |
155 b1[0x02] = b2[0x02] + b2[0x05]; | |
156 b1[0x03] = b2[0x03] + b2[0x04]; | |
157 b1[0x04] = (b2[0x03] - b2[0x04]) * costab[3]; | |
158 b1[0x05] = (b2[0x02] - b2[0x05]) * costab[2]; | |
159 b1[0x06] = (b2[0x01] - b2[0x06]) * costab[1]; | |
160 b1[0x07] = (b2[0x00] - b2[0x07]) * costab[0]; | |
161 b1[0x08] = b2[0x08] + b2[0x0F]; | |
162 b1[0x09] = b2[0x09] + b2[0x0E]; | |
163 b1[0x0A] = b2[0x0A] + b2[0x0D]; | |
164 b1[0x0B] = b2[0x0B] + b2[0x0C]; | |
165 b1[0x0C] = (b2[0x0C] - b2[0x0B]) * costab[3]; | |
166 b1[0x0D] = (b2[0x0D] - b2[0x0A]) * costab[2]; | |
167 b1[0x0E] = (b2[0x0E] - b2[0x09]) * costab[1]; | |
168 b1[0x0F] = (b2[0x0F] - b2[0x08]) * costab[0]; | |
169 b1[0x10] = b2[0x10] + b2[0x17]; | |
170 b1[0x11] = b2[0x11] + b2[0x16]; | |
171 b1[0x12] = b2[0x12] + b2[0x15]; | |
172 b1[0x13] = b2[0x13] + b2[0x14]; | |
173 b1[0x14] = (b2[0x13] - b2[0x14]) * costab[3]; | |
174 b1[0x15] = (b2[0x12] - b2[0x15]) * costab[2]; | |
175 b1[0x16] = (b2[0x11] - b2[0x16]) * costab[1]; | |
176 b1[0x17] = (b2[0x10] - b2[0x17]) * costab[0]; | |
177 b1[0x18] = b2[0x18] + b2[0x1F]; | |
178 b1[0x19] = b2[0x19] + b2[0x1E]; | |
179 b1[0x1A] = b2[0x1A] + b2[0x1D]; | |
180 b1[0x1B] = b2[0x1B] + b2[0x1C]; | |
181 b1[0x1C] = (b2[0x1C] - b2[0x1B]) * costab[3]; | |
182 b1[0x1D] = (b2[0x1D] - b2[0x1A]) * costab[2]; | |
183 b1[0x1E] = (b2[0x1E] - b2[0x19]) * costab[1]; | |
184 b1[0x1F] = (b2[0x1F] - b2[0x18]) * costab[0]; | |
185 } | |
186 | |
187 #else /* ALTIVEC_USE_REFERENCE_C_CODE */ | |
188 | |
189 // How does it work ? | |
190 // the first three passes are reproducted in the three block below | |
191 // all computations are done on a 4 elements vector | |
192 // 'reverse' is a special perumtation vector used to reverse | |
193 // the order of the elements inside a vector. | |
194 // note that all loads/stores to b1 (b2) between passes 1 and 2 (2 and 3) | |
195 // have been removed, all elements are stored inside b1vX (b2vX) | |
196 { | |
197 register vector float | |
198 b1v0, b1v1, b1v2, b1v3, | |
199 b1v4, b1v5, b1v6, b1v7; | |
200 register vector float | |
201 temp1, temp2; | |
202 | |
203 { | |
12131
d155623271e3
fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
alex
parents:
11980
diff
changeset
|
204 register real *costab = mp3lib_pnts[0]; |
9002 | 205 |
206 register vector float | |
207 samplesv1, samplesv2, samplesv3, samplesv4, | |
208 samplesv5, samplesv6, samplesv7, samplesv8, | |
209 samplesv9; | |
210 register vector unsigned char samples_perm = vec_lvsl(0, samples); | |
211 register vector float costabv1, costabv2, costabv3, costabv4, costabv5; | |
212 register vector unsigned char costab_perm = vec_lvsl(0, costab); | |
213 | |
214 samplesv1 = vec_ld(0, samples); | |
215 samplesv2 = vec_ld(16, samples); | |
216 samplesv1 = vec_perm(samplesv1, samplesv2, samples_perm); | |
217 samplesv3 = vec_ld(32, samples); | |
218 samplesv2 = vec_perm(samplesv2, samplesv3, samples_perm); | |
219 samplesv4 = vec_ld(48, samples); | |
220 samplesv3 = vec_perm(samplesv3, samplesv4, samples_perm); | |
221 samplesv5 = vec_ld(64, samples); | |
222 samplesv4 = vec_perm(samplesv4, samplesv5, samples_perm); | |
223 samplesv6 = vec_ld(80, samples); | |
224 samplesv5 = vec_perm(samplesv5, samplesv6, samples_perm); | |
225 samplesv7 = vec_ld(96, samples); | |
226 samplesv6 = vec_perm(samplesv6, samplesv7, samples_perm); | |
227 samplesv8 = vec_ld(112, samples); | |
228 samplesv7 = vec_perm(samplesv7, samplesv8, samples_perm); | |
229 samplesv9 = vec_ld(128, samples); | |
230 samplesv8 = vec_perm(samplesv8, samplesv9, samples_perm); | |
231 | |
232 temp1 = vec_add(samplesv1, | |
233 vec_perm(samplesv8, samplesv8, reverse)); | |
234 //vec_st(temp1, 0, b1); | |
235 b1v0 = temp1; | |
236 temp1 = vec_add(samplesv2, | |
237 vec_perm(samplesv7, samplesv7, reverse)); | |
238 //vec_st(temp1, 16, b1); | |
239 b1v1 = temp1; | |
240 temp1 = vec_add(samplesv3, | |
241 vec_perm(samplesv6, samplesv6, reverse)); | |
242 //vec_st(temp1, 32, b1); | |
243 b1v2 = temp1; | |
244 temp1 = vec_add(samplesv4, | |
245 vec_perm(samplesv5, samplesv5, reverse)); | |
246 //vec_st(temp1, 48, b1); | |
247 b1v3 = temp1; | |
248 | |
249 costabv1 = vec_ld(0, costab); | |
250 costabv2 = vec_ld(16, costab); | |
251 costabv1 = vec_perm(costabv1, costabv2, costab_perm); | |
252 costabv3 = vec_ld(32, costab); | |
253 costabv2 = vec_perm(costabv2, costabv3, costab_perm); | |
254 costabv4 = vec_ld(48, costab); | |
255 costabv3 = vec_perm(costabv3, costabv4, costab_perm); | |
256 costabv5 = vec_ld(64, costab); | |
257 costabv4 = vec_perm(costabv4, costabv5, costab_perm); | |
258 | |
259 temp1 = vec_sub(vec_perm(samplesv4, samplesv4, reverse), | |
260 samplesv5); | |
261 temp2 = vec_madd(temp1, | |
262 vec_perm(costabv4, costabv4, reverse), | |
263 vczero); | |
264 //vec_st(temp2, 64, b1); | |
265 b1v4 = temp2; | |
266 | |
267 temp1 = vec_sub(vec_perm(samplesv3, samplesv3, reverse), | |
268 samplesv6); | |
269 temp2 = vec_madd(temp1, | |
270 vec_perm(costabv3, costabv3, reverse), | |
271 vczero); | |
272 //vec_st(temp2, 80, b1); | |
273 b1v5 = temp2; | |
274 temp1 = vec_sub(vec_perm(samplesv2, samplesv2, reverse), | |
275 samplesv7); | |
276 temp2 = vec_madd(temp1, | |
277 vec_perm(costabv2, costabv2, reverse), | |
278 vczero); | |
279 //vec_st(temp2, 96, b1); | |
280 b1v6 = temp2; | |
281 | |
282 temp1 = vec_sub(vec_perm(samplesv1, samplesv1, reverse), | |
283 samplesv8); | |
284 temp2 = vec_madd(temp1, | |
285 vec_perm(costabv1, costabv1, reverse), | |
286 vczero); | |
287 //vec_st(temp2, 112, b1); | |
288 b1v7 = temp2; | |
289 | |
290 } | |
291 | |
292 { | |
293 register vector float | |
294 b2v0, b2v1, b2v2, b2v3, | |
295 b2v4, b2v5, b2v6, b2v7; | |
296 { | |
12131
d155623271e3
fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
alex
parents:
11980
diff
changeset
|
297 register real *costab = mp3lib_pnts[1]; |
9002 | 298 register vector float costabv1r, costabv2r, costabv1, costabv2, costabv3; |
299 register vector unsigned char costab_perm = vec_lvsl(0, costab); | |
300 | |
301 costabv1 = vec_ld(0, costab); | |
302 costabv2 = vec_ld(16, costab); | |
303 costabv1 = vec_perm(costabv1, costabv2, costab_perm); | |
304 costabv3 = vec_ld(32, costab); | |
305 costabv2 = vec_perm(costabv2, costabv3 , costab_perm); | |
306 costabv1r = vec_perm(costabv1, costabv1, reverse); | |
307 costabv2r = vec_perm(costabv2, costabv2, reverse); | |
308 | |
309 temp1 = vec_add(b1v0, vec_perm(b1v3, b1v3, reverse)); | |
310 //vec_st(temp1, 0, b2); | |
311 b2v0 = temp1; | |
312 temp1 = vec_add(b1v1, vec_perm(b1v2, b1v2, reverse)); | |
313 //vec_st(temp1, 16, b2); | |
314 b2v1 = temp1; | |
315 temp2 = vec_sub(vec_perm(b1v1, b1v1, reverse), b1v2); | |
316 temp1 = vec_madd(temp2, costabv2r, vczero); | |
317 //vec_st(temp1, 32, b2); | |
318 b2v2 = temp1; | |
319 temp2 = vec_sub(vec_perm(b1v0, b1v0, reverse), b1v3); | |
320 temp1 = vec_madd(temp2, costabv1r, vczero); | |
321 //vec_st(temp1, 48, b2); | |
322 b2v3 = temp1; | |
323 temp1 = vec_add(b1v4, vec_perm(b1v7, b1v7, reverse)); | |
324 //vec_st(temp1, 64, b2); | |
325 b2v4 = temp1; | |
326 temp1 = vec_add(b1v5, vec_perm(b1v6, b1v6, reverse)); | |
327 //vec_st(temp1, 80, b2); | |
328 b2v5 = temp1; | |
329 temp2 = vec_sub(b1v6, vec_perm(b1v5, b1v5, reverse)); | |
330 temp1 = vec_madd(temp2, costabv2r, vczero); | |
331 //vec_st(temp1, 96, b2); | |
332 b2v6 = temp1; | |
333 temp2 = vec_sub(b1v7, vec_perm(b1v4, b1v4, reverse)); | |
334 temp1 = vec_madd(temp2, costabv1r, vczero); | |
335 //vec_st(temp1, 112, b2); | |
336 b2v7 = temp1; | |
337 } | |
338 | |
339 { | |
12131
d155623271e3
fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
alex
parents:
11980
diff
changeset
|
340 register real *costab = mp3lib_pnts[2]; |
9002 | 341 |
342 | |
343 vector float costabv1r, costabv1, costabv2; | |
344 vector unsigned char costab_perm = vec_lvsl(0, costab); | |
345 | |
346 costabv1 = vec_ld(0, costab); | |
347 costabv2 = vec_ld(16, costab); | |
348 costabv1 = vec_perm(costabv1, costabv2, costab_perm); | |
349 costabv1r = vec_perm(costabv1, costabv1, reverse); | |
350 | |
351 temp1 = vec_add(b2v0, vec_perm(b2v1, b2v1, reverse)); | |
352 vec_st(temp1, 0, b1); | |
353 temp2 = vec_sub(vec_perm(b2v0, b2v0, reverse), b2v1); | |
354 temp1 = vec_madd(temp2, costabv1r, vczero); | |
355 vec_st(temp1, 16, b1); | |
356 | |
357 temp1 = vec_add(b2v2, vec_perm(b2v3, b2v3, reverse)); | |
358 vec_st(temp1, 32, b1); | |
359 temp2 = vec_sub(b2v3, vec_perm(b2v2, b2v2, reverse)); | |
360 temp1 = vec_madd(temp2, costabv1r, vczero); | |
361 vec_st(temp1, 48, b1); | |
362 | |
363 temp1 = vec_add(b2v4, vec_perm(b2v5, b2v5, reverse)); | |
364 vec_st(temp1, 64, b1); | |
365 temp2 = vec_sub(vec_perm(b2v4, b2v4, reverse), b2v5); | |
366 temp1 = vec_madd(temp2, costabv1r, vczero); | |
367 vec_st(temp1, 80, b1); | |
368 | |
369 temp1 = vec_add(b2v6, vec_perm(b2v7, b2v7, reverse)); | |
370 vec_st(temp1, 96, b1); | |
371 temp2 = vec_sub(b2v7, vec_perm(b2v6, b2v6, reverse)); | |
372 temp1 = vec_madd(temp2, costabv1r, vczero); | |
373 vec_st(temp1, 112, b1); | |
374 | |
375 } | |
376 } | |
377 } | |
378 | |
379 #endif /* ALTIVEC_USE_REFERENCE_C_CODE */ | |
380 | |
381 { | |
12131
d155623271e3
fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
alex
parents:
11980
diff
changeset
|
382 register real const cos0 = mp3lib_pnts[3][0]; |
d155623271e3
fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
alex
parents:
11980
diff
changeset
|
383 register real const cos1 = mp3lib_pnts[3][1]; |
9002 | 384 |
385 b2[0x00] = b1[0x00] + b1[0x03]; | |
386 b2[0x01] = b1[0x01] + b1[0x02]; | |
387 b2[0x02] = (b1[0x01] - b1[0x02]) * cos1; | |
388 b2[0x03] = (b1[0x00] - b1[0x03]) * cos0; | |
389 b2[0x04] = b1[0x04] + b1[0x07]; | |
390 b2[0x05] = b1[0x05] + b1[0x06]; | |
391 b2[0x06] = (b1[0x06] - b1[0x05]) * cos1; | |
392 b2[0x07] = (b1[0x07] - b1[0x04]) * cos0; | |
393 b2[0x08] = b1[0x08] + b1[0x0B]; | |
394 b2[0x09] = b1[0x09] + b1[0x0A]; | |
395 b2[0x0A] = (b1[0x09] - b1[0x0A]) * cos1; | |
396 b2[0x0B] = (b1[0x08] - b1[0x0B]) * cos0; | |
397 b2[0x0C] = b1[0x0C] + b1[0x0F]; | |
398 b2[0x0D] = b1[0x0D] + b1[0x0E]; | |
399 b2[0x0E] = (b1[0x0E] - b1[0x0D]) * cos1; | |
400 b2[0x0F] = (b1[0x0F] - b1[0x0C]) * cos0; | |
401 b2[0x10] = b1[0x10] + b1[0x13]; | |
402 b2[0x11] = b1[0x11] + b1[0x12]; | |
403 b2[0x12] = (b1[0x11] - b1[0x12]) * cos1; | |
404 b2[0x13] = (b1[0x10] - b1[0x13]) * cos0; | |
405 b2[0x14] = b1[0x14] + b1[0x17]; | |
406 b2[0x15] = b1[0x15] + b1[0x16]; | |
407 b2[0x16] = (b1[0x16] - b1[0x15]) * cos1; | |
408 b2[0x17] = (b1[0x17] - b1[0x14]) * cos0; | |
409 b2[0x18] = b1[0x18] + b1[0x1B]; | |
410 b2[0x19] = b1[0x19] + b1[0x1A]; | |
411 b2[0x1A] = (b1[0x19] - b1[0x1A]) * cos1; | |
412 b2[0x1B] = (b1[0x18] - b1[0x1B]) * cos0; | |
413 b2[0x1C] = b1[0x1C] + b1[0x1F]; | |
414 b2[0x1D] = b1[0x1D] + b1[0x1E]; | |
415 b2[0x1E] = (b1[0x1E] - b1[0x1D]) * cos1; | |
416 b2[0x1F] = (b1[0x1F] - b1[0x1C]) * cos0; | |
417 } | |
418 | |
419 { | |
12131
d155623271e3
fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
alex
parents:
11980
diff
changeset
|
420 register real const cos0 = mp3lib_pnts[4][0]; |
9002 | 421 |
422 b1[0x00] = b2[0x00] + b2[0x01]; | |
423 b1[0x01] = (b2[0x00] - b2[0x01]) * cos0; | |
424 b1[0x02] = b2[0x02] + b2[0x03]; | |
425 b1[0x03] = (b2[0x03] - b2[0x02]) * cos0; | |
426 b1[0x02] += b1[0x03]; | |
427 | |
428 b1[0x04] = b2[0x04] + b2[0x05]; | |
429 b1[0x05] = (b2[0x04] - b2[0x05]) * cos0; | |
430 b1[0x06] = b2[0x06] + b2[0x07]; | |
431 b1[0x07] = (b2[0x07] - b2[0x06]) * cos0; | |
432 b1[0x06] += b1[0x07]; | |
433 b1[0x04] += b1[0x06]; | |
434 b1[0x06] += b1[0x05]; | |
435 b1[0x05] += b1[0x07]; | |
436 | |
437 b1[0x08] = b2[0x08] + b2[0x09]; | |
438 b1[0x09] = (b2[0x08] - b2[0x09]) * cos0; | |
439 b1[0x0A] = b2[0x0A] + b2[0x0B]; | |
440 b1[0x0B] = (b2[0x0B] - b2[0x0A]) * cos0; | |
441 b1[0x0A] += b1[0x0B]; | |
442 | |
443 b1[0x0C] = b2[0x0C] + b2[0x0D]; | |
444 b1[0x0D] = (b2[0x0C] - b2[0x0D]) * cos0; | |
445 b1[0x0E] = b2[0x0E] + b2[0x0F]; | |
446 b1[0x0F] = (b2[0x0F] - b2[0x0E]) * cos0; | |
447 b1[0x0E] += b1[0x0F]; | |
448 b1[0x0C] += b1[0x0E]; | |
449 b1[0x0E] += b1[0x0D]; | |
450 b1[0x0D] += b1[0x0F]; | |
451 | |
452 b1[0x10] = b2[0x10] + b2[0x11]; | |
453 b1[0x11] = (b2[0x10] - b2[0x11]) * cos0; | |
454 b1[0x12] = b2[0x12] + b2[0x13]; | |
455 b1[0x13] = (b2[0x13] - b2[0x12]) * cos0; | |
456 b1[0x12] += b1[0x13]; | |
457 | |
458 b1[0x14] = b2[0x14] + b2[0x15]; | |
459 b1[0x15] = (b2[0x14] - b2[0x15]) * cos0; | |
460 b1[0x16] = b2[0x16] + b2[0x17]; | |
461 b1[0x17] = (b2[0x17] - b2[0x16]) * cos0; | |
462 b1[0x16] += b1[0x17]; | |
463 b1[0x14] += b1[0x16]; | |
464 b1[0x16] += b1[0x15]; | |
465 b1[0x15] += b1[0x17]; | |
466 | |
467 b1[0x18] = b2[0x18] + b2[0x19]; | |
468 b1[0x19] = (b2[0x18] - b2[0x19]) * cos0; | |
469 b1[0x1A] = b2[0x1A] + b2[0x1B]; | |
470 b1[0x1B] = (b2[0x1B] - b2[0x1A]) * cos0; | |
471 b1[0x1A] += b1[0x1B]; | |
472 | |
473 b1[0x1C] = b2[0x1C] + b2[0x1D]; | |
474 b1[0x1D] = (b2[0x1C] - b2[0x1D]) * cos0; | |
475 b1[0x1E] = b2[0x1E] + b2[0x1F]; | |
476 b1[0x1F] = (b2[0x1F] - b2[0x1E]) * cos0; | |
477 b1[0x1E] += b1[0x1F]; | |
478 b1[0x1C] += b1[0x1E]; | |
479 b1[0x1E] += b1[0x1D]; | |
480 b1[0x1D] += b1[0x1F]; | |
481 } | |
482 | |
483 out0[0x10*16] = b1[0x00]; | |
484 out0[0x10*12] = b1[0x04]; | |
485 out0[0x10* 8] = b1[0x02]; | |
486 out0[0x10* 4] = b1[0x06]; | |
487 out0[0x10* 0] = b1[0x01]; | |
488 out1[0x10* 0] = b1[0x01]; | |
489 out1[0x10* 4] = b1[0x05]; | |
490 out1[0x10* 8] = b1[0x03]; | |
491 out1[0x10*12] = b1[0x07]; | |
492 | |
493 b1[0x08] += b1[0x0C]; | |
494 out0[0x10*14] = b1[0x08]; | |
495 b1[0x0C] += b1[0x0a]; | |
496 out0[0x10*10] = b1[0x0C]; | |
497 b1[0x0A] += b1[0x0E]; | |
498 out0[0x10* 6] = b1[0x0A]; | |
499 b1[0x0E] += b1[0x09]; | |
500 out0[0x10* 2] = b1[0x0E]; | |
501 b1[0x09] += b1[0x0D]; | |
502 out1[0x10* 2] = b1[0x09]; | |
503 b1[0x0D] += b1[0x0B]; | |
504 out1[0x10* 6] = b1[0x0D]; | |
505 b1[0x0B] += b1[0x0F]; | |
506 out1[0x10*10] = b1[0x0B]; | |
507 out1[0x10*14] = b1[0x0F]; | |
508 | |
509 b1[0x18] += b1[0x1C]; | |
510 out0[0x10*15] = b1[0x10] + b1[0x18]; | |
511 out0[0x10*13] = b1[0x18] + b1[0x14]; | |
512 b1[0x1C] += b1[0x1a]; | |
513 out0[0x10*11] = b1[0x14] + b1[0x1C]; | |
514 out0[0x10* 9] = b1[0x1C] + b1[0x12]; | |
515 b1[0x1A] += b1[0x1E]; | |
516 out0[0x10* 7] = b1[0x12] + b1[0x1A]; | |
517 out0[0x10* 5] = b1[0x1A] + b1[0x16]; | |
518 b1[0x1E] += b1[0x19]; | |
519 out0[0x10* 3] = b1[0x16] + b1[0x1E]; | |
520 out0[0x10* 1] = b1[0x1E] + b1[0x11]; | |
521 b1[0x19] += b1[0x1D]; | |
522 out1[0x10* 1] = b1[0x11] + b1[0x19]; | |
523 out1[0x10* 3] = b1[0x19] + b1[0x15]; | |
524 b1[0x1D] += b1[0x1B]; | |
525 out1[0x10* 5] = b1[0x15] + b1[0x1D]; | |
526 out1[0x10* 7] = b1[0x1D] + b1[0x13]; | |
527 b1[0x1B] += b1[0x1F]; | |
528 out1[0x10* 9] = b1[0x13] + b1[0x1B]; | |
529 out1[0x10*11] = b1[0x1B] + b1[0x17]; | |
530 out1[0x10*13] = b1[0x17] + b1[0x1F]; | |
531 out1[0x10*15] = b1[0x1F]; | |
532 } |