annotate liba52/imdct.c @ 1095:c7604e6291c5 libavcodec

extended option for h263+ patch by (fixounet at free dot fr) with some minor modifications
author michaelni
date Wed, 05 Mar 2003 16:10:13 +0000
parents 68d0a38bd802
children e101d1cffec6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
1 /*
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
2 * imdct.c
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
3 * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
4 * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
5 *
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
6 * The ifft algorithms in this file have been largely inspired by Dan
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
7 * Bernstein's work, djbfft, available at http://cr.yp.to/djbfft.html
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
8 *
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
9 * This file is part of a52dec, a free ATSC A-52 stream decoder.
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
10 * See http://liba52.sourceforge.net/ for updates.
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
11 *
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
12 * a52dec is free software; you can redistribute it and/or modify
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
15 * (at your option) any later version.
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
16 *
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
17 * a52dec is distributed in the hope that it will be useful,
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
20 * GNU General Public License for more details.
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
21 *
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
25 */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
26
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
27 #include "config.h"
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
28
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
29 #include <math.h>
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
30 #include <stdio.h>
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
31 #ifdef LIBA52_DJBFFT
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
32 #include <fftc4.h>
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
33 #endif
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
34 #ifndef M_PI
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
35 #define M_PI 3.1415926535897932384626433832795029
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
36 #endif
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
37 #include <inttypes.h>
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
38
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
39 #include "a52.h"
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
40 #include "a52_internal.h"
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
41 #include "mm_accel.h"
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
42
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
43 typedef struct complex_s {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
44 sample_t real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
45 sample_t imag;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
46 } complex_t;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
47
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
48 static uint8_t fftorder[] = {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
49 0,128, 64,192, 32,160,224, 96, 16,144, 80,208,240,112, 48,176,
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
50 8,136, 72,200, 40,168,232,104,248,120, 56,184, 24,152,216, 88,
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
51 4,132, 68,196, 36,164,228,100, 20,148, 84,212,244,116, 52,180,
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
52 252,124, 60,188, 28,156,220, 92, 12,140, 76,204,236,108, 44,172,
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
53 2,130, 66,194, 34,162,226, 98, 18,146, 82,210,242,114, 50,178,
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
54 10,138, 74,202, 42,170,234,106,250,122, 58,186, 26,154,218, 90,
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
55 254,126, 62,190, 30,158,222, 94, 14,142, 78,206,238,110, 46,174,
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
56 6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
57 };
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
58
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
59 /* Root values for IFFT */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
60 static sample_t roots16[3];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
61 static sample_t roots32[7];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
62 static sample_t roots64[15];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
63 static sample_t roots128[31];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
64
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
65 /* Twiddle factors for IMDCT */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
66 static complex_t pre1[128];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
67 static complex_t post1[64];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
68 static complex_t pre2[64];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
69 static complex_t post2[32];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
70
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
71 static sample_t a52_imdct_window[256];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
72
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
73 static void (* ifft128) (complex_t * buf);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
74 static void (* ifft64) (complex_t * buf);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
75
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
76 static inline void ifft2 (complex_t * buf)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
77 {
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
78 sample_t r, i;
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
79
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
80 r = buf[0].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
81 i = buf[0].imag;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
82 buf[0].real += buf[1].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
83 buf[0].imag += buf[1].imag;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
84 buf[1].real = r - buf[1].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
85 buf[1].imag = i - buf[1].imag;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
86 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
87
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
88 static inline void ifft4 (complex_t * buf)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
89 {
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
90 sample_t tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8;
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
91
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
92 tmp1 = buf[0].real + buf[1].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
93 tmp2 = buf[3].real + buf[2].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
94 tmp3 = buf[0].imag + buf[1].imag;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
95 tmp4 = buf[2].imag + buf[3].imag;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
96 tmp5 = buf[0].real - buf[1].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
97 tmp6 = buf[0].imag - buf[1].imag;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
98 tmp7 = buf[2].imag - buf[3].imag;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
99 tmp8 = buf[3].real - buf[2].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
100
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
101 buf[0].real = tmp1 + tmp2;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
102 buf[0].imag = tmp3 + tmp4;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
103 buf[2].real = tmp1 - tmp2;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
104 buf[2].imag = tmp3 - tmp4;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
105 buf[1].real = tmp5 + tmp7;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
106 buf[1].imag = tmp6 + tmp8;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
107 buf[3].real = tmp5 - tmp7;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
108 buf[3].imag = tmp6 - tmp8;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
109 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
110
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
111 /* basic radix-2 ifft butterfly */
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
112
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
113 #define BUTTERFLY_0(t0,t1,W0,W1,d0,d1) do { \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
114 t0 = MUL (W1, d1) + MUL (W0, d0); \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
115 t1 = MUL (W0, d1) - MUL (W1, d0); \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
116 } while (0)
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
117
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
118 /* radix-2 ifft butterfly with bias */
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
119
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
120 #define BUTTERFLY_B(t0,t1,W0,W1,d0,d1) do { \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
121 t0 = BIAS (MUL (d1, W1) + MUL (d0, W0)); \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
122 t1 = BIAS (MUL (d1, W0) - MUL (d0, W1)); \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
123 } while (0)
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
124
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
125 /* the basic split-radix ifft butterfly */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
126
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
127 #define BUTTERFLY(a0,a1,a2,a3,wr,wi) do { \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
128 BUTTERFLY_0 (tmp5, tmp6, wr, wi, a2.real, a2.imag); \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
129 BUTTERFLY_0 (tmp8, tmp7, wr, wi, a3.imag, a3.real); \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
130 tmp1 = tmp5 + tmp7; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
131 tmp2 = tmp6 + tmp8; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
132 tmp3 = tmp6 - tmp8; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
133 tmp4 = tmp7 - tmp5; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
134 a2.real = a0.real - tmp1; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
135 a2.imag = a0.imag - tmp2; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
136 a3.real = a1.real - tmp3; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
137 a3.imag = a1.imag - tmp4; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
138 a0.real += tmp1; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
139 a0.imag += tmp2; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
140 a1.real += tmp3; \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
141 a1.imag += tmp4; \
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
142 } while (0)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
143
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
144 /* split-radix ifft butterfly, specialized for wr=1 wi=0 */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
145
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
146 #define BUTTERFLY_ZERO(a0,a1,a2,a3) do { \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
147 tmp1 = a2.real + a3.real; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
148 tmp2 = a2.imag + a3.imag; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
149 tmp3 = a2.imag - a3.imag; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
150 tmp4 = a3.real - a2.real; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
151 a2.real = a0.real - tmp1; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
152 a2.imag = a0.imag - tmp2; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
153 a3.real = a1.real - tmp3; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
154 a3.imag = a1.imag - tmp4; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
155 a0.real += tmp1; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
156 a0.imag += tmp2; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
157 a1.real += tmp3; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
158 a1.imag += tmp4; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
159 } while (0)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
160
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
161 /* split-radix ifft butterfly, specialized for wr=wi */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
162
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
163 #define BUTTERFLY_HALF(a0,a1,a2,a3,w) do { \
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
164 tmp5 = MUL (a2.real + a2.imag, w); \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
165 tmp6 = MUL (a2.imag - a2.real, w); \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
166 tmp7 = MUL (a3.real - a3.imag, w); \
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
167 tmp8 = MUL (a3.imag + a3.real, w); \
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
168 tmp1 = tmp5 + tmp7; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
169 tmp2 = tmp6 + tmp8; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
170 tmp3 = tmp6 - tmp8; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
171 tmp4 = tmp7 - tmp5; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
172 a2.real = a0.real - tmp1; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
173 a2.imag = a0.imag - tmp2; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
174 a3.real = a1.real - tmp3; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
175 a3.imag = a1.imag - tmp4; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
176 a0.real += tmp1; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
177 a0.imag += tmp2; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
178 a1.real += tmp3; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
179 a1.imag += tmp4; \
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
180 } while (0)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
181
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
182 static inline void ifft8 (complex_t * buf)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
183 {
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
184 sample_t tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8;
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
185
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
186 ifft4 (buf);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
187 ifft2 (buf + 4);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
188 ifft2 (buf + 6);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
189 BUTTERFLY_ZERO (buf[0], buf[2], buf[4], buf[6]);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
190 BUTTERFLY_HALF (buf[1], buf[3], buf[5], buf[7], roots16[1]);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
191 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
192
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
193 static void ifft_pass (complex_t * buf, sample_t * weight, int n)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
194 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
195 complex_t * buf1;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
196 complex_t * buf2;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
197 complex_t * buf3;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
198 sample_t tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8;
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
199 int i;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
200
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
201 buf++;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
202 buf1 = buf + n;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
203 buf2 = buf + 2 * n;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
204 buf3 = buf + 3 * n;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
205
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
206 BUTTERFLY_ZERO (buf[-1], buf1[-1], buf2[-1], buf3[-1]);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
207
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
208 i = n - 1;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
209
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
210 do {
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
211 BUTTERFLY (buf[0], buf1[0], buf2[0], buf3[0],
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
212 weight[0], weight[2*i-n]);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
213 buf++;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
214 buf1++;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
215 buf2++;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
216 buf3++;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
217 weight++;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
218 } while (--i);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
219 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
220
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
221 static void ifft16 (complex_t * buf)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
222 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
223 ifft8 (buf);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
224 ifft4 (buf + 8);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
225 ifft4 (buf + 12);
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
226 ifft_pass (buf, roots16, 4);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
227 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
228
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
229 static void ifft32 (complex_t * buf)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
230 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
231 ifft16 (buf);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
232 ifft8 (buf + 16);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
233 ifft8 (buf + 24);
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
234 ifft_pass (buf, roots32, 8);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
235 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
236
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
237 static void ifft64_c (complex_t * buf)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
238 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
239 ifft32 (buf);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
240 ifft16 (buf + 32);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
241 ifft16 (buf + 48);
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
242 ifft_pass (buf, roots64, 16);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
243 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
244
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
245 static void ifft128_c (complex_t * buf)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
246 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
247 ifft32 (buf);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
248 ifft16 (buf + 32);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
249 ifft16 (buf + 48);
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
250 ifft_pass (buf, roots64, 16);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
251
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
252 ifft32 (buf + 64);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
253 ifft32 (buf + 96);
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
254 ifft_pass (buf, roots128, 32);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
255 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
256
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
257 void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
258 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
259 int i, k;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
260 sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
261 const sample_t * window = a52_imdct_window;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
262 complex_t buf[128];
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
263
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
264 for (i = 0; i < 128; i++) {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
265 k = fftorder[i];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
266 t_r = pre1[i].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
267 t_i = pre1[i].imag;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
268 BUTTERFLY_0 (buf[i].real, buf[i].imag, t_r, t_i, data[k], data[255-k]);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
269 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
270
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
271 ifft128 (buf);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
272
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
273 /* Post IFFT complex multiply plus IFFT complex conjugate*/
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
274 /* Window and convert to real valued signal */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
275 for (i = 0; i < 64; i++) {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
276 /* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
277 t_r = post1[i].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
278 t_i = post1[i].imag;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
279 BUTTERFLY_0 (a_r, a_i, t_i, t_r, buf[i].imag, buf[i].real);
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
280 BUTTERFLY_0 (b_r, b_i, t_r, t_i, buf[127-i].imag, buf[127-i].real);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
281
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
282 w_1 = window[2*i];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
283 w_2 = window[255-2*i];
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
284 BUTTERFLY_B (data[255-2*i], data[2*i], w_2, w_1, a_r, delay[2*i]);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
285 delay[2*i] = a_i;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
286
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
287 w_1 = window[2*i+1];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
288 w_2 = window[254-2*i];
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
289 BUTTERFLY_B (data[2*i+1], data[254-2*i], w_1, w_2, b_r, delay[2*i+1]);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
290 delay[2*i+1] = b_i;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
291 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
292 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
293
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
294 void a52_imdct_256 (sample_t * data, sample_t * delay, sample_t bias)
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
295 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
296 int i, k;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
297 sample_t t_r, t_i, a_r, a_i, b_r, b_i, c_r, c_i, d_r, d_i, w_1, w_2;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
298 const sample_t * window = a52_imdct_window;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
299 complex_t buf1[64], buf2[64];
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
300
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
301 /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
302 for (i = 0; i < 64; i++) {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
303 k = fftorder[i];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
304 t_r = pre2[i].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
305 t_i = pre2[i].imag;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
306 BUTTERFLY_0 (buf1[i].real, buf1[i].imag, t_r, t_i, data[k], data[254-k]);
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
307 BUTTERFLY_0 (buf2[i].real, buf2[i].imag, t_r, t_i, data[k+1], data[255-k]);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
308 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
309
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
310 ifft64 (buf1);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
311 ifft64 (buf2);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
312
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
313 /* Post IFFT complex multiply */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
314 /* Window and convert to real valued signal */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
315 for (i = 0; i < 32; i++) {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
316 /* y1[n] = z1[n] * (xcos2[n] + j * xs in2[n]) ; */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
317 t_r = post2[i].real;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
318 t_i = post2[i].imag;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
319 BUTTERFLY_0 (a_r, a_i, t_i, t_r, buf1[i].imag, buf1[i].real);
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
320 BUTTERFLY_0 (b_r, b_i, t_r, t_i, buf1[63-i].imag, buf1[63-i].real);
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
321 BUTTERFLY_0 (c_r, c_i, t_i, t_r, buf2[i].imag, buf2[i].real);
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
322 BUTTERFLY_0 (d_r, d_i, t_r, t_i, buf2[63-i].imag, buf2[63-i].real);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
323
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
324 w_1 = window[2*i];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
325 w_2 = window[255-2*i];
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
326 BUTTERFLY_B (data[255-2*i], data[2*i], w_2, w_1, a_r, delay[2*i]);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
327 delay[2*i] = c_i;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
328
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
329 w_1 = window[128+2*i];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
330 w_2 = window[127-2*i];
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
331 BUTTERFLY_B (data[128+2*i], data[127-2*i], w_1, w_2, a_i, delay[127-2*i]);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
332 delay[127-2*i] = c_r;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
333
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
334 w_1 = window[2*i+1];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
335 w_2 = window[254-2*i];
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
336 BUTTERFLY_B (data[254-2*i], data[2*i+1], w_2, w_1, b_i, delay[2*i+1]);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
337 delay[2*i+1] = d_r;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
338
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
339 w_1 = window[129+2*i];
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
340 w_2 = window[126-2*i];
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
341 BUTTERFLY_B (data[129+2*i], data[126-2*i], w_1, w_2, b_r, delay[126-2*i]);
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
342 delay[126-2*i] = d_i;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
343 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
344 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
345
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
346 static double besselI0 (double x)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
347 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
348 double bessel = 1;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
349 int i = 100;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
350
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
351 do
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
352 bessel = bessel * x / (i * i) + 1;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
353 while (--i);
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
354 return bessel;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
355 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
356
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
357 void a52_imdct_init (uint32_t mm_accel)
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
358 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
359 int i, k;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
360 double sum;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
361 double local_imdct_window[256];
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
362
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
363 /* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
364 sum = 0;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
365 for (i = 0; i < 256; i++) {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
366 sum += besselI0 (i * (256 - i) * (5 * M_PI / 256) * (5 * M_PI / 256));
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
367 local_imdct_window[i] = sum;
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
368 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
369 sum++;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
370 for (i = 0; i < 256; i++)
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
371 a52_imdct_window[i] = SAMPLE (sqrt (local_imdct_window[i] / sum));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
372
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
373 for (i = 0; i < 3; i++)
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
374 roots16[i] = SAMPLE (cos ((M_PI / 8) * (i + 1)));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
375
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
376 for (i = 0; i < 7; i++)
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
377 roots32[i] = SAMPLE (cos ((M_PI / 16) * (i + 1)));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
378
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
379 for (i = 0; i < 15; i++)
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
380 roots64[i] = SAMPLE (cos ((M_PI / 32) * (i + 1)));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
381
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
382 for (i = 0; i < 31; i++)
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
383 roots128[i] = SAMPLE (cos ((M_PI / 64) * (i + 1)));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
384
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
385 for (i = 0; i < 64; i++) {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
386 k = fftorder[i] / 2 + 64;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
387 pre1[i].real = SAMPLE (cos ((M_PI / 256) * (k - 0.25)));
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
388 pre1[i].imag = SAMPLE (sin ((M_PI / 256) * (k - 0.25)));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
389 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
390
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
391 for (i = 64; i < 128; i++) {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
392 k = fftorder[i] / 2 + 64;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
393 pre1[i].real = SAMPLE (-cos ((M_PI / 256) * (k - 0.25)));
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
394 pre1[i].imag = SAMPLE (-sin ((M_PI / 256) * (k - 0.25)));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
395 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
396
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
397 for (i = 0; i < 64; i++) {
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
398 post1[i].real = SAMPLE (cos ((M_PI / 256) * (i + 0.5)));
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
399 post1[i].imag = SAMPLE (sin ((M_PI / 256) * (i + 0.5)));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
400 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
401
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
402 for (i = 0; i < 64; i++) {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
403 k = fftorder[i] / 4;
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
404 pre2[i].real = SAMPLE (cos ((M_PI / 128) * (k - 0.25)));
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
405 pre2[i].imag = SAMPLE (sin ((M_PI / 128) * (k - 0.25)));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
406 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
407
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
408 for (i = 0; i < 32; i++) {
1072
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
409 post2[i].real = SAMPLE (cos ((M_PI / 128) * (i + 0.5)));
68d0a38bd802 * sync with main liba52 sources
kabi
parents: 428
diff changeset
410 post2[i].imag = SAMPLE (sin ((M_PI / 128) * (i + 0.5)));
332
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
411 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
412
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
413 #ifdef LIBA52_DJBFFT
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
414 if (mm_accel & MM_ACCEL_DJBFFT) {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
415 ifft128 = (void (*) (complex_t *)) fftc4_un128;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
416 ifft64 = (void (*) (complex_t *)) fftc4_un64;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
417 } else
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
418 #endif
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
419 {
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
420 ifft128 = ifft128_c;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
421 ifft64 = ifft64_c;
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
422 }
207cc56d18f8 * add support for liba52
kabi
parents:
diff changeset
423 }