35 # define RSCALE(x) (x)
38 # define RSCALE(x) (((x) + 32) >> 6)
40 # define RSCALE(x) ((x) >> 1)
53 memset(s, 0,
sizeof(*s));
80 theta = 1.0 / 8.0 + (scale < 0 ? n4 : 0);
81 scale = sqrt(fabs(scale));
83 alpha = 2 *
M_PI * (i + theta) / n;
84 s->
tcos[i*tstep] =
FIX15(-cos(alpha) * scale);
85 s->
tsin[i*tstep] =
FIX15(-sin(alpha) * scale);
101 int k, n8, n4, n2,
n, j;
102 const uint16_t *revtab = s->
revtab;
115 in2 = input + n2 - 1;
116 for(k = 0; k < n4; k++) {
118 CMUL(z[j].
re, z[j].
im, *in2, *in1, tcos[k], tsin[k]);
125 for(k = 0; k < n8; k++) {
127 CMUL(r0, i1, z[n8-k-1].
im, z[n8-k-1].
re, tsin[n8-k-1], tcos[n8-k-1]);
128 CMUL(r1, i0, z[n8+k ].
im, z[n8+k ].
re, tsin[n8+k ], tcos[n8+k ]);
150 for(k = 0; k < n4; k++) {
151 output[k] = -output[n2-k-1];
152 output[n-k-1] = output[n2+k];
163 int i, j,
n, n8, n4, n2, n3;
165 const uint16_t *revtab = s->
revtab;
178 re =
RSCALE(-input[2*i+n3] - input[n3-1-2*i]);
179 im =
RSCALE(-input[n4+2*i] + input[n4-1-2*i]);
181 CMUL(x[j].re, x[j].im, re, im, -tcos[i], tsin[i]);
183 re =
RSCALE( input[2*i] - input[n2-1-2*i]);
184 im =
RSCALE(-input[n2+2*i] - input[ n-1-2*i]);
186 CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]);
194 CMUL(i1, r0, x[n8-i-1].re, x[n8-i-1].im, -tsin[n8-i-1], -tcos[n8-i-1]);
195 CMUL(i0, r1, x[n8+i ].re, x[n8+i ].im, -tsin[n8+i ], -tcos[n8+i ]);