36 #if !CONFIG_HARDCODED_TABLES
74 if(n <= 2)
return i&1;
84 #if !CONFIG_HARDCODED_TABLES
87 double freq = 2*
M_PI/
m;
90 tab[i] =
FIX15(cos(i*freq));
97 0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15
115 int n = 1 << s->
nbits;
117 for (i = 0; i < n; i += 16) {
120 for (k = 0; k < 16; k++)
125 for (k = 0; k < 16; k++) {
127 j = (j & ~7) | ((j >> 1) & 3) | ((j << 2) & 4);
138 if (nbits < 2 || nbits > 16)
171 for(j=4; j<=nbits; j++) {
181 j = (j&~3) | ((j>>1)&1) | ((j<<1)&2);
196 const uint16_t *revtab = s->
revtab;
199 for(j=0;j<np;j++) s->
tmp_buf[revtab[j]] = z[j];
209 #define BUTTERFLIES(a0,a1,a2,a3) {\
211 BF(a2.re, a0.re, a0.re, t5);\
212 BF(a3.im, a1.im, a1.im, t3);\
214 BF(a3.re, a1.re, a1.re, t4);\
215 BF(a2.im, a0.im, a0.im, t6);\
221 #define BUTTERFLIES_BIG(a0,a1,a2,a3) {\
222 FFTSample r0=a0.re, i0=a0.im, r1=a1.re, i1=a1.im;\
224 BF(a2.re, a0.re, r0, t5);\
225 BF(a3.im, a1.im, i1, t3);\
227 BF(a3.re, a1.re, r1, t4);\
228 BF(a2.im, a0.im, i0, t6);\
231 #define TRANSFORM(a0,a1,a2,a3,wre,wim) {\
232 CMUL(t1, t2, a2.re, a2.im, wre, -wim);\
233 CMUL(t5, t6, a3.re, a3.im, wre, wim);\
234 BUTTERFLIES(a0,a1,a2,a3)\
237 #define TRANSFORM_ZERO(a0,a1,a2,a3) {\
242 BUTTERFLIES(a0,a1,a2,a3)\
247 static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\
249 FFTDouble t1, t2, t3, t4, t5, t6;\
253 const FFTSample *wim = wre+o1;\
256 TRANSFORM_ZERO(z[0],z[o1],z[o2],z[o3]);\
257 TRANSFORM(z[1],z[o1+1],z[o2+1],z[o3+1],wre[1],wim[-1]);\
262 TRANSFORM(z[0],z[o1],z[o2],z[o3],wre[0],wim[0]);\
263 TRANSFORM(z[1],z[o1+1],z[o2+1],z[o3+1],wre[1],wim[-1]);\
269 #define BUTTERFLIES BUTTERFLIES_BIG
272 #define DECL_FFT(n,n2,n4)\
273 static void fft##n(FFTComplex *z)\
278 pass(z,FFT_NAME(ff_cos_##n),n4/2);\
285 BF(t3, t1, z[0].
re, z[1].re);
286 BF(t8, t6, z[3].re, z[2].re);
287 BF(z[2].re, z[0].re, t1, t6);
288 BF(t4, t2, z[0].
im, z[1].im);
289 BF(t7, t5, z[2].im, z[3].im);
290 BF(z[3].im, z[1].im, t4, t8);
291 BF(z[3].re, z[1].re, t3, t7);
292 BF(z[2].im, z[0].im, t2, t5);
301 BF(t1, z[5].
re, z[4].re, -z[5].re);
302 BF(t2, z[5].
im, z[4].im, -z[5].im);
303 BF(t5, z[7].re, z[6].re, -z[7].re);
304 BF(t6, z[7].im, z[6].im, -z[7].im);
323 TRANSFORM(z[1],z[5],z[9],z[13],cos_16_1,cos_16_3);
324 TRANSFORM(z[3],z[7],z[11],z[15],cos_16_3,cos_16_1);
335 #define pass pass_big
346 fft4,
fft8,
fft16, fft32, fft64, fft128, fft256, fft512, fft1024,
347 fft2048, fft4096, fft8192, fft16384, fft32768, fft65536,