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