diff options
Diffstat (limited to 'apps/codecs/lib/fft-ffmpeg.c')
-rw-r--r-- | apps/codecs/lib/fft-ffmpeg.c | 473 |
1 files changed, 0 insertions, 473 deletions
diff --git a/apps/codecs/lib/fft-ffmpeg.c b/apps/codecs/lib/fft-ffmpeg.c deleted file mode 100644 index 807f606038..0000000000 --- a/apps/codecs/lib/fft-ffmpeg.c +++ /dev/null | |||
@@ -1,473 +0,0 @@ | |||
1 | /* | ||
2 | * FFT/IFFT transforms converted to integer precision | ||
3 | * Copyright (c) 2010 Dave Hooper, Mohamed Tarek, Michael Giacomelli | ||
4 | * Copyright (c) 2008 Loren Merritt | ||
5 | * Copyright (c) 2002 Fabrice Bellard | ||
6 | * Partly based on libdjbfft by D. J. Bernstein | ||
7 | * | ||
8 | * This file is part of FFmpeg. | ||
9 | * | ||
10 | * FFmpeg is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU Lesser General Public | ||
12 | * License as published by the Free Software Foundation; either | ||
13 | * version 2.1 of the License, or (at your option) any later version. | ||
14 | * | ||
15 | * FFmpeg is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | * Lesser General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU Lesser General Public | ||
21 | * License along with FFmpeg; if not, write to the Free Software | ||
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
23 | */ | ||
24 | |||
25 | /** | ||
26 | * @file libavcodec/fft.c | ||
27 | * FFT/IFFT transforms. | ||
28 | */ | ||
29 | |||
30 | |||
31 | #ifdef CPU_ARM | ||
32 | // we definitely want CONFIG_SMALL undefined for ipod | ||
33 | // so we get the inlined version of fft16 (which is measurably faster) | ||
34 | #undef CONFIG_SMALL | ||
35 | #else | ||
36 | #undef CONFIG_SMALL | ||
37 | #endif | ||
38 | |||
39 | #include "fft.h" | ||
40 | #include <string.h> | ||
41 | #include <stdlib.h> | ||
42 | #include <math.h> | ||
43 | #include <inttypes.h> | ||
44 | #include <time.h> | ||
45 | #include <codecs/lib/codeclib.h> | ||
46 | |||
47 | #include "codeclib_misc.h" | ||
48 | #include "mdct_lookup.h" | ||
49 | |||
50 | /* constants for fft_16 (same constants as in mdct_arm.S ... ) */ | ||
51 | #define cPI1_8 (0x7641af3d) /* cos(pi/8) s.31 */ | ||
52 | #define cPI2_8 (0x5a82799a) /* cos(2pi/8) = 1/sqrt(2) s.31 */ | ||
53 | #define cPI3_8 (0x30fbc54d) /* cos(3pi/8) s.31 */ | ||
54 | |||
55 | /* asm-optimised functions and/or macros */ | ||
56 | #include "fft-ffmpeg_arm.h" | ||
57 | #include "fft-ffmpeg_cf.h" | ||
58 | |||
59 | #ifndef ICODE_ATTR_TREMOR_MDCT | ||
60 | #define ICODE_ATTR_TREMOR_MDCT ICODE_ATTR | ||
61 | #endif | ||
62 | |||
63 | #if 0 | ||
64 | static int split_radix_permutation(int i, int n, int inverse) | ||
65 | { | ||
66 | int m; | ||
67 | if(n <= 2) return i&1; | ||
68 | m = n >> 1; | ||
69 | if(!(i&m)) return split_radix_permutation(i, m, inverse)*2; | ||
70 | m >>= 1; | ||
71 | if(inverse == !(i&m)) return split_radix_permutation(i, m, inverse)*4 + 1; | ||
72 | else return split_radix_permutation(i, m, inverse)*4 - 1; | ||
73 | } | ||
74 | |||
75 | static void ff_fft_permute_c(FFTContext *s, FFTComplex *z) | ||
76 | { | ||
77 | int j, k, np; | ||
78 | FFTComplex tmp; | ||
79 | //const uint16_t *revtab = s->revtab; | ||
80 | np = 1 << s->nbits; | ||
81 | |||
82 | const int revtab_shift = (12 - s->nbits); | ||
83 | |||
84 | /* reverse */ | ||
85 | for(j=0;j<np;j++) { | ||
86 | k = revtab[j]>>revtab_shift; | ||
87 | if (k < j) { | ||
88 | tmp = z[k]; | ||
89 | z[k] = z[j]; | ||
90 | z[j] = tmp; | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | #endif | ||
95 | |||
96 | #define BF(x,y,a,b) {\ | ||
97 | x = a - b;\ | ||
98 | y = a + b;\ | ||
99 | } | ||
100 | |||
101 | #define BF_REV(x,y,a,b) {\ | ||
102 | x = a + b;\ | ||
103 | y = a - b;\ | ||
104 | } | ||
105 | |||
106 | #ifndef FFT_FFMPEG_INCL_OPTIMISED_BUTTERFLIES | ||
107 | #define BUTTERFLIES(a0,a1,a2,a3) {\ | ||
108 | {\ | ||
109 | FFTSample temp1,temp2;\ | ||
110 | BF(temp1, temp2, t5, t1);\ | ||
111 | BF(a2.re, a0.re, a0.re, temp2);\ | ||
112 | BF(a3.im, a1.im, a1.im, temp1);\ | ||
113 | }\ | ||
114 | {\ | ||
115 | FFTSample temp1,temp2;\ | ||
116 | BF(temp1, temp2, t2, t6);\ | ||
117 | BF(a3.re, a1.re, a1.re, temp1);\ | ||
118 | BF(a2.im, a0.im, a0.im, temp2);\ | ||
119 | }\ | ||
120 | } | ||
121 | |||
122 | // force loading all the inputs before storing any. | ||
123 | // this is slightly slower for small data, but avoids store->load aliasing | ||
124 | // for addresses separated by large powers of 2. | ||
125 | #define BUTTERFLIES_BIG(a0,a1,a2,a3) {\ | ||
126 | FFTSample r0=a0.re, i0=a0.im, r1=a1.re, i1=a1.im;\ | ||
127 | {\ | ||
128 | FFTSample temp1, temp2;\ | ||
129 | BF(temp1, temp2, t5, t1);\ | ||
130 | BF(a2.re, a0.re, r0, temp2);\ | ||
131 | BF(a3.im, a1.im, i1, temp1);\ | ||
132 | }\ | ||
133 | {\ | ||
134 | FFTSample temp1, temp2;\ | ||
135 | BF(temp1, temp2, t2, t6);\ | ||
136 | BF(a3.re, a1.re, r1, temp1);\ | ||
137 | BF(a2.im, a0.im, i0, temp2);\ | ||
138 | }\ | ||
139 | } | ||
140 | #endif | ||
141 | |||
142 | /* | ||
143 | see conjugate pair description in | ||
144 | http://www.fftw.org/newsplit.pdf | ||
145 | |||
146 | a0 = z[k] | ||
147 | a1 = z[k+N/4] | ||
148 | a2 = z[k+2N/4] | ||
149 | a3 = z[k+3N/4] | ||
150 | |||
151 | result: | ||
152 | y[k] = z[k]+w(z[k+2N/4])+w'(z[k+3N/4]) | ||
153 | y[k+N/4] = z[k+N/4]-iw(z[k+2N/4])+iw'(z[k+3N/4]) | ||
154 | y[k+2N/4] = z[k]-w(z[k+2N/4])-w'(z[k+3N/4]) | ||
155 | y[k+3N/4] = z[k+N/4]+iw(z[k+2N/4])-iw'(z[k+3N/4]) | ||
156 | |||
157 | i.e. | ||
158 | |||
159 | a0 = a0 + (w.a2 + w'.a3) | ||
160 | a1 = a1 - i(w.a2 - w'.a3) | ||
161 | a2 = a0 - (w.a2 + w'.a3) | ||
162 | a3 = a1 + i(w.a2 - w'.a3) | ||
163 | |||
164 | note re(w') = re(w) and im(w') = -im(w) | ||
165 | |||
166 | so therefore | ||
167 | |||
168 | re(a0) = re(a0) + re(w.a2) + re(w.a3) | ||
169 | im(a0) = im(a0) + im(w.a2) - im(w.a3) etc | ||
170 | |||
171 | and remember also that | ||
172 | Re([s+it][u+iv]) = su-tv | ||
173 | Im([s+it][u+iv]) = sv+tu | ||
174 | |||
175 | so | ||
176 | Re(w'.(s+it)) = Re(w').s - Im(w').t = Re(w).s + Im(w).t | ||
177 | Im(w'.(s+it)) = Re(w').t + Im(w').s = Re(w).t - Im(w).s | ||
178 | |||
179 | For inverse dft we take the complex conjugate of all twiddle factors. | ||
180 | Hence | ||
181 | |||
182 | a0 = a0 + (w'.a2 + w.a3) | ||
183 | a1 = a1 - i(w'.a2 - w.a3) | ||
184 | a2 = a0 - (w'.a2 + w.a3) | ||
185 | a3 = a1 + i(w'.a2 - w.a3) | ||
186 | |||
187 | Define t1 = Re(w'.a2) = Re(w)*Re(a2) + Im(w)*Im(a2) | ||
188 | t2 = Im(w'.a2) = Re(w)*Im(a2) - Im(w)*Re(a2) | ||
189 | t5 = Re(w.a3) = Re(w)*Re(a3) - Im(w)*Im(a3) | ||
190 | t6 = Im(w.a3) = Re(w)*Im(a3) + Im(w)*Re(a3) | ||
191 | |||
192 | Then we just output: | ||
193 | a0.re = a0.re + ( t1 + t5 ) | ||
194 | a0.im = a0.im + ( t2 + t6 ) | ||
195 | a1.re = a1.re + ( t2 - t6 ) // since we multiply by -i and i(-i) = 1 | ||
196 | a1.im = a1.im - ( t1 - t5 ) // since we multiply by -i and 1(-i) = -i | ||
197 | a2.re = a0.re - ( t1 + t5 ) | ||
198 | a2.im = a0.im - ( t1 + t5 ) | ||
199 | a3.re = a1.re - ( t2 - t6 ) // since we multiply by +i and i(+i) = -1 | ||
200 | a3.im = a1.im + ( t1 - t5 ) // since we multiply by +i and 1(+i) = i | ||
201 | |||
202 | |||
203 | */ | ||
204 | |||
205 | #ifndef FFT_FFMPEG_INCL_OPTIMISED_TRANSFORM | ||
206 | static inline FFTComplex* TRANSFORM(FFTComplex * z, unsigned int n, FFTSample wre, FFTSample wim) | ||
207 | { | ||
208 | register FFTSample t1,t2,t5,t6,r_re,r_im; | ||
209 | r_re = z[n*2].re; | ||
210 | r_im = z[n*2].im; | ||
211 | XPROD31_R(r_re, r_im, wre, wim, t1,t2); | ||
212 | r_re = z[n*3].re; | ||
213 | r_im = z[n*3].im; | ||
214 | XNPROD31_R(r_re, r_im, wre, wim, t5,t6); | ||
215 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | ||
216 | return z+1; | ||
217 | } | ||
218 | |||
219 | static inline FFTComplex* TRANSFORM_W01(FFTComplex * z, unsigned int n, const FFTSample * w) | ||
220 | { | ||
221 | register const FFTSample wre=w[0],wim=w[1]; | ||
222 | register FFTSample t1,t2,t5,t6,r_re,r_im; | ||
223 | r_re = z[n*2].re; | ||
224 | r_im = z[n*2].im; | ||
225 | XPROD31_R(r_re, r_im, wre, wim, t1,t2); | ||
226 | r_re = z[n*3].re; | ||
227 | r_im = z[n*3].im; | ||
228 | XNPROD31_R(r_re, r_im, wre, wim, t5,t6); | ||
229 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | ||
230 | return z+1; | ||
231 | } | ||
232 | |||
233 | static inline FFTComplex* TRANSFORM_W10(FFTComplex * z, unsigned int n, const FFTSample * w) | ||
234 | { | ||
235 | register const FFTSample wim=w[0],wre=w[1]; | ||
236 | register FFTSample t1,t2,t5,t6,r_re,r_im; | ||
237 | r_re = z[n*2].re; | ||
238 | r_im = z[n*2].im; | ||
239 | XPROD31_R(r_re, r_im, wre, wim, t1,t2); | ||
240 | r_re = z[n*3].re; | ||
241 | r_im = z[n*3].im; | ||
242 | XNPROD31_R(r_re, r_im, wre, wim, t5,t6); | ||
243 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | ||
244 | return z+1; | ||
245 | } | ||
246 | |||
247 | static inline FFTComplex* TRANSFORM_EQUAL(FFTComplex * z, unsigned int n) | ||
248 | { | ||
249 | register FFTSample t1,t2,t5,t6,temp1,temp2; | ||
250 | register FFTSample * my_z = (FFTSample *)(z); | ||
251 | my_z += n*4; | ||
252 | t2 = MULT31(my_z[0], cPI2_8); | ||
253 | temp1 = MULT31(my_z[1], cPI2_8); | ||
254 | my_z += n*2; | ||
255 | temp2 = MULT31(my_z[0], cPI2_8); | ||
256 | t5 = MULT31(my_z[1], cPI2_8); | ||
257 | t1 = ( temp1 + t2 ); | ||
258 | t2 = ( temp1 - t2 ); | ||
259 | t6 = ( temp2 + t5 ); | ||
260 | t5 = ( temp2 - t5 ); | ||
261 | my_z -= n*6; | ||
262 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | ||
263 | return z+1; | ||
264 | } | ||
265 | |||
266 | static inline FFTComplex* TRANSFORM_ZERO(FFTComplex * z, unsigned int n) | ||
267 | { | ||
268 | FFTSample t1,t2,t5,t6; | ||
269 | t1 = z[n*2].re; | ||
270 | t2 = z[n*2].im; | ||
271 | t5 = z[n*3].re; | ||
272 | t6 = z[n*3].im; | ||
273 | BUTTERFLIES(z[0],z[n],z[n*2],z[n*3]); | ||
274 | return z+1; | ||
275 | } | ||
276 | #endif | ||
277 | |||
278 | /* z[0...8n-1], w[1...2n-1] */ | ||
279 | static void pass(FFTComplex *z_arg, unsigned int STEP_arg, unsigned int n_arg) ICODE_ATTR_TREMOR_MDCT; | ||
280 | static void pass(FFTComplex *z_arg, unsigned int STEP_arg, unsigned int n_arg) | ||
281 | { | ||
282 | register FFTComplex * z = z_arg; | ||
283 | register unsigned int STEP = STEP_arg; | ||
284 | register unsigned int n = n_arg; | ||
285 | |||
286 | register const FFTSample *w = sincos_lookup0+STEP; | ||
287 | /* wre = *(wim+1) . ordering is sin,cos */ | ||
288 | register const FFTSample *w_end = sincos_lookup0+1024; | ||
289 | |||
290 | /* first two are special (well, first one is special, but we need to do pairs) */ | ||
291 | z = TRANSFORM_ZERO(z,n); | ||
292 | z = TRANSFORM_W10(z,n,w); | ||
293 | w += STEP; | ||
294 | /* first pass forwards through sincos_lookup0*/ | ||
295 | do { | ||
296 | z = TRANSFORM_W10(z,n,w); | ||
297 | w += STEP; | ||
298 | z = TRANSFORM_W10(z,n,w); | ||
299 | w += STEP; | ||
300 | } while(LIKELY(w < w_end)); | ||
301 | /* second half: pass backwards through sincos_lookup0*/ | ||
302 | /* wim and wre are now in opposite places so ordering now [0],[1] */ | ||
303 | w_end=sincos_lookup0; | ||
304 | while(LIKELY(w>w_end)) | ||
305 | { | ||
306 | z = TRANSFORM_W01(z,n,w); | ||
307 | w -= STEP; | ||
308 | z = TRANSFORM_W01(z,n,w); | ||
309 | w -= STEP; | ||
310 | } | ||
311 | } | ||
312 | |||
313 | /* what is STEP? | ||
314 | sincos_lookup0 has sin,cos pairs for 1/4 cycle, in 1024 points | ||
315 | so half cycle would be 2048 points | ||
316 | ff_cos_16 has 8 elements corresponding to 4 cos points and 4 sin points | ||
317 | so each of the 4 points pairs corresponds to a 256*2-byte jump in sincos_lookup0 | ||
318 | 8192/16 (from "ff_cos_16") is 512 bytes. | ||
319 | i.e. for fft16, STEP = 8192/16 */ | ||
320 | #define DECL_FFT(n,n2,n4)\ | ||
321 | static void fft##n(FFTComplex *z) ICODE_ATTR_TREMOR_MDCT;\ | ||
322 | static void fft##n(FFTComplex *z)\ | ||
323 | {\ | ||
324 | fft##n2(z);\ | ||
325 | fft##n4(z+n4*2);\ | ||
326 | fft##n4(z+n4*3);\ | ||
327 | pass(z,8192/n,n4);\ | ||
328 | } | ||
329 | |||
330 | #ifndef FFT_FFMPEG_INCL_OPTIMISED_FFT4 | ||
331 | static inline void fft4(FFTComplex *z) | ||
332 | { | ||
333 | FFTSample t1, t2, t3, t4, t5, t6, t7, t8; | ||
334 | |||
335 | BF(t3, t1, z[0].re, z[1].re); // t3=r1-r3 ; t1 = r1+r3 | ||
336 | BF(t8, t6, z[3].re, z[2].re); // t8=r7-r5 ; t6 = r7+r5 | ||
337 | |||
338 | BF(z[2].re, z[0].re, t1, t6); // r5=t1-t6 ; r1 = t1+t6 | ||
339 | |||
340 | BF(t4, t2, z[0].im, z[1].im); // t4=r2-r4 ; t2 = r2+r4 | ||
341 | BF(t7, t5, z[2].im, z[3].im); // t7=r6-r8 ; t5 = r6+r8 | ||
342 | |||
343 | BF(z[3].im, z[1].im, t4, t8); // r8=t4-t8 ; r4 = t4+t8 | ||
344 | BF(z[3].re, z[1].re, t3, t7); // r7=t3-t7 ; r3 = t3+t7 | ||
345 | BF(z[2].im, z[0].im, t2, t5); // r6=t2-t5 ; r2 = t2+t5 | ||
346 | } | ||
347 | #endif | ||
348 | |||
349 | static void fft4_dispatch(FFTComplex *z) | ||
350 | { | ||
351 | fft4(z); | ||
352 | } | ||
353 | |||
354 | #ifndef FFT_FFMPEG_INCL_OPTIMISED_FFT8 | ||
355 | static inline void fft8(FFTComplex *z) | ||
356 | { | ||
357 | fft4(z); | ||
358 | FFTSample t1,t2,t3,t4,t7,t8; | ||
359 | |||
360 | BF(t1, z[5].re, z[4].re, -z[5].re); | ||
361 | BF(t2, z[5].im, z[4].im, -z[5].im); | ||
362 | BF(t3, z[7].re, z[6].re, -z[7].re); | ||
363 | BF(t4, z[7].im, z[6].im, -z[7].im); | ||
364 | BF(t8, t1, t3, t1); | ||
365 | BF(t7, t2, t2, t4); | ||
366 | BF(z[4].re, z[0].re, z[0].re, t1); | ||
367 | BF(z[4].im, z[0].im, z[0].im, t2); | ||
368 | BF(z[6].re, z[2].re, z[2].re, t7); | ||
369 | BF(z[6].im, z[2].im, z[2].im, t8); | ||
370 | |||
371 | z++; | ||
372 | TRANSFORM_EQUAL(z,2); | ||
373 | } | ||
374 | #endif | ||
375 | |||
376 | static void fft8_dispatch(FFTComplex *z) | ||
377 | { | ||
378 | fft8(z); | ||
379 | } | ||
380 | |||
381 | #ifndef CONFIG_SMALL | ||
382 | static void fft16(FFTComplex *z) ICODE_ATTR_TREMOR_MDCT; | ||
383 | static void fft16(FFTComplex *z) | ||
384 | { | ||
385 | fft8(z); | ||
386 | fft4(z+8); | ||
387 | fft4(z+12); | ||
388 | |||
389 | TRANSFORM_ZERO(z,4); | ||
390 | z+=2; | ||
391 | TRANSFORM_EQUAL(z,4); | ||
392 | z-=1; | ||
393 | TRANSFORM(z,4,cPI1_8,cPI3_8); | ||
394 | z+=2; | ||
395 | TRANSFORM(z,4,cPI3_8,cPI1_8); | ||
396 | } | ||
397 | #else | ||
398 | DECL_FFT(16,8,4) | ||
399 | #endif | ||
400 | DECL_FFT(32,16,8) | ||
401 | DECL_FFT(64,32,16) | ||
402 | DECL_FFT(128,64,32) | ||
403 | DECL_FFT(256,128,64) | ||
404 | DECL_FFT(512,256,128) | ||
405 | DECL_FFT(1024,512,256) | ||
406 | DECL_FFT(2048,1024,512) | ||
407 | DECL_FFT(4096,2048,1024) | ||
408 | |||
409 | static void (*fft_dispatch[])(FFTComplex*) = { | ||
410 | fft4_dispatch, fft8_dispatch, fft16, fft32, fft64, fft128, fft256, fft512, fft1024, | ||
411 | fft2048, fft4096 | ||
412 | }; | ||
413 | |||
414 | void ff_fft_calc_c(int nbits, FFTComplex *z) | ||
415 | { | ||
416 | fft_dispatch[nbits-2](z); | ||
417 | } | ||
418 | |||
419 | #if 0 | ||
420 | int main (void) | ||
421 | { | ||
422 | #define PRECISION 16 | ||
423 | #define FFT_SIZE 1024 | ||
424 | #define ftofix32(x) ((fixed32)((x) * (float)(1 << PRECISION) + ((x) < 0 ? -0.5 : 0.5))) | ||
425 | #define itofix32(x) ((x) << PRECISION) | ||
426 | #define fixtoi32(x) ((x) >> PRECISION) | ||
427 | |||
428 | int j; | ||
429 | const long N = FFT_SIZE; | ||
430 | double r[FFT_SIZE] = {0.0}, i[FFT_SIZE] = {0.0}; | ||
431 | long n; | ||
432 | double t; | ||
433 | double amp, phase; | ||
434 | clock_t start, end; | ||
435 | double exec_time = 0; | ||
436 | FFTContext s; | ||
437 | FFTComplex z[FFT_SIZE]; | ||
438 | memset(z, 0, 64*sizeof(FFTComplex)); | ||
439 | |||
440 | /* Generate saw-tooth test data */ | ||
441 | for (n = 0; n < FFT_SIZE; n++) | ||
442 | { | ||
443 | t = (2 * M_PI * n)/N; | ||
444 | /*z[n].re = 1.1 + sin( t) + | ||
445 | 0.5 * sin(2.0 * t) + | ||
446 | (1.0/3.0) * sin(3.0 * t) + | ||
447 | 0.25 * sin(4.0 * t) + | ||
448 | 0.2 * sin(5.0 * t) + | ||
449 | (1.0/6.0) * sin(6.0 * t) + | ||
450 | (1.0/7.0) * sin(7.0 * t) ;*/ | ||
451 | z[n].re = ftofix32(cos(2*M_PI*n/64)); | ||
452 | //printf("z[%d] = %f\n", n, z[n].re); | ||
453 | //getchar(); | ||
454 | } | ||
455 | |||
456 | ff_fft_init(&s, 10, 1); | ||
457 | //start = clock(); | ||
458 | //for(n = 0; n < 1000000; n++) | ||
459 | ff_fft_permute_c(&s, z); | ||
460 | ff_fft_calc_c(&s, z); | ||
461 | //end = clock(); | ||
462 | //exec_time = (((double)end-(double)start)/CLOCKS_PER_SEC); | ||
463 | for(j = 0; j < FFT_SIZE; j++) | ||
464 | { | ||
465 | printf("%8.4f\n", sqrt(pow(fixtof32(z[j].re),2)+ pow(fixtof32(z[j].im), 2))); | ||
466 | //getchar(); | ||
467 | } | ||
468 | printf("muls = %d, adds = %d\n", muls, adds); | ||
469 | //printf(" Time elapsed = %f\n", exec_time); | ||
470 | //ff_fft_end(&s); | ||
471 | |||
472 | } | ||
473 | #endif | ||