40 #define CELT_MIN_IMDCT_SIZE 120
43 #define CMUL3(cre, cim, are, aim, bre, bim) \
45 cre = are * bre - aim * bim; \
46 cim = are * bim + aim * bre; \
49 #define CMUL(c, a, b) CMUL3((c).re, (c).im, (a).re, (a).im, (b).re, (b).im)
53 #define CMUL2(c, d, a, b) \
59 float rr = are * bre; \
60 float ri = are * bim; \
61 float ir = aim * bre; \
62 float ii = aim * bim; \
88 ptrdiff_t
stride,
float scale);
93 int len2 = 15 * (1 <<
N);
116 for (i = 0; i < s->
len4; i++) {
122 int N = 15 * (1 << i);
127 for (j = 0; j <
N; j++) {
134 for (j = 15; j < 19; j++)
153 static const FFTComplex fact[] = { { 0.30901699437494745, 0.95105651629515353 },
154 { -0.80901699437494734, 0.58778525229247325 } };
158 CMUL2(z[0][0], z[0][3], in[1 * stride], fact[0]);
159 CMUL2(z[0][1], z[0][2], in[1 * stride], fact[1]);
160 CMUL2(z[1][0], z[1][3], in[2 * stride], fact[0]);
161 CMUL2(z[1][1], z[1][2], in[2 * stride], fact[1]);
162 CMUL2(z[2][0], z[2][3], in[3 * stride], fact[0]);
163 CMUL2(z[2][1], z[2][2], in[3 * stride], fact[1]);
164 CMUL2(z[3][0], z[3][3], in[4 * stride], fact[0]);
165 CMUL2(z[3][1], z[3][2], in[4 * stride], fact[1]);
167 out[0].
re = in[0].
re + in[stride].
re + in[2 * stride].
re + in[3 * stride].
re + in[4 * stride].
re;
168 out[0].
im = in[0].
im + in[stride].
im + in[2 * stride].
im + in[3 * stride].
im + in[4 * stride].
im;
170 out[1].
re = in[0].
re + z[0][0].
re + z[1][1].
re + z[2][2].
re + z[3][3].
re;
171 out[1].
im = in[0].
im + z[0][0].
im + z[1][1].
im + z[2][2].
im + z[3][3].
im;
173 out[2].
re = in[0].
re + z[0][1].
re + z[1][3].
re + z[2][0].
re + z[3][2].
re;
174 out[2].
im = in[0].
im + z[0][1].
im + z[1][3].
im + z[2][0].
im + z[3][2].
im;
176 out[3].
re = in[0].
re + z[0][2].
re + z[1][0].
re + z[2][3].
re + z[3][1].
re;
177 out[3].
im = in[0].
im + z[0][2].
im + z[1][0].
im + z[2][3].
im + z[3][1].
im;
179 out[4].
re = in[0].
re + z[0][3].
re + z[1][2].
re + z[2][1].
re + z[3][0].
re;
180 out[4].
im = in[0].
im + z[0][3].
im + z[1][2].
im + z[2][1].
im + z[3][0].
im;
191 fft5(tmp, in, stride * 3);
192 fft5(tmp1, in + stride, stride * 3);
193 fft5(tmp2, in + 2 * stride, stride * 3);
195 for (k = 0; k < 5; k++) {
198 CMUL(t1, tmp1[k], exptab[k]);
199 CMUL(t2, tmp2[k], exptab[2 * k]);
200 out[k].
re = tmp[k].
re + t1.
re + t2.
re;
201 out[k].
im = tmp[k].
im + t1.
im + t2.
im;
203 CMUL(t1, tmp1[k], exptab[k + 5]);
204 CMUL(t2, tmp2[k], exptab[2 * (k + 5)]);
205 out[k + 5].
re = tmp[k].
re + t1.
re + t2.
re;
206 out[k + 5].
im = tmp[k].
im + t1.
im + t2.
im;
208 CMUL(t1, tmp1[k], exptab[k + 10]);
209 CMUL(t2, tmp2[k], exptab[2 * k + 5]);
210 out[k + 10].
re = tmp[k].
re + t1.
re + t2.
re;
211 out[k + 10].
im = tmp[k].
im + t1.
im + t2.
im;
223 const int len2 = 15 * (1 << (N - 1));
226 fft_calc(s, out, in, N - 1, stride * 2);
227 fft_calc(s, out + len2, in + stride, N - 1, stride * 2);
229 for (k = 0; k < len2; k++) {
232 CMUL(t, out[len2 + k], exptab[k]);
234 out[len2 + k].
re = out[k].
re - t.
re;
235 out[len2 + k].
im = out[k].
im - t.
im;
241 fft15(s, out, in, stride);
245 ptrdiff_t
stride,
float scale)
248 const int len8 = s->
len4 / 2;
249 const float *in1 =
src;
250 const float *in2 = src + (s->
len2 - 1) * stride;
253 for (i = 0; i < s->
len4; i++) {
262 for (i = 0; i < len8; i++) {
263 float r0, i0, r1, i1;
267 z[len8 - i - 1].
re = scale * r0;
268 z[len8 - i - 1].
im = scale * i0;
269 z[len8 + i].
re = scale * r1;
270 z[len8 + i].
im = scale * i1;