TRANSFORM(z[1], z[5], z[9], z[13], ff_cos_16[1], ff_cos_16[3]);
TRANSFORM(z[3], z[7], z[11], z[15], ff_cos_16[3], ff_cos_16[1]);
}
+
DECL_FFT(32, 16, 8)
DECL_FFT(64, 32, 16)
DECL_FFT(128, 64, 32)
DECL_FFT(32768, 16384, 8192)
DECL_FFT(65536, 32768, 16384)
-static void (*fft_dispatch[]) (struct fft_complex *) =
-{
+static void (*fft_dispatch[]) (struct fft_complex *) = {
fft4, fft8, fft16, fft32, fft64, fft128, fft256, fft512, fft1024,
fft2048, fft4096, fft8192, fft16384, fft32768, fft65536,
};
/* complex multiplication: p = a * b */
#define CMUL(pre, pim, are, aim, bre, bim) \
{\
- fftsample_t _are = (are);\
- fftsample_t _aim = (aim);\
- fftsample_t _bre = (bre);\
- fftsample_t _bim = (bim);\
- (pre) = _are * _bre - _aim * _bim;\
- (pim) = _are * _bim + _aim * _bre;\
+ fftsample_t _are = (are);\
+ fftsample_t _aim = (aim);\
+ fftsample_t _bre = (bre);\
+ fftsample_t _bim = (bim);\
+ (pre) = _are * _bre - _aim * _bim;\
+ (pim) = _are * _bim + _aim * _bre;\
}
/**
nblocks = nblocks >> 1;
} while (nblocks != 0);
freep(&s->exptab);
-
/* compute bit reverse table */
for (i = 0; i < n; i++) {
m = 0;
- for (j = 0; j < nbits; j++) {
+ for (j = 0; j < nbits; j++)
m |= ((i >> j) & 1) << (nbits - j - 1);
- }
s->revtab[i] = m;
}
}
double alpha;
struct mdct_context *s;
- s = para_malloc(sizeof(*s));
- memset(s, 0, sizeof(*s));
+ s = para_calloc(sizeof(*s));
n = 1 << nbits;
s->nbits = nbits;
s->n = n;