annotate libfaad2/cfft.c @ 10847:98dc548dbf2d

pass stream header FCC
author michael
date Thu, 11 Sep 2003 00:16:33 +0000
parents e989150f8216
children 3185f64f6350
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1 /*
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
3 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
4 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
5 ** This program is free software; you can redistribute it and/or modify
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
6 ** it under the terms of the GNU General Public License as published by
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
7 ** the Free Software Foundation; either version 2 of the License, or
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
8 ** (at your option) any later version.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
9 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
10 ** This program is distributed in the hope that it will be useful,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
13 ** GNU General Public License for more details.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
14 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
15 ** You should have received a copy of the GNU General Public License
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
16 ** along with this program; if not, write to the Free Software
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
18 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
19 ** Any non-GPL usage of this software or parts of this software is strictly
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
20 ** forbidden.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
21 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
22 ** Commercial non-GPL licensing of this software is possible.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
24 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
25 ** $Id: cfft.c,v 1.11 2003/07/29 08:20:12 menno Exp $
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
26 **/
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
27
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
28 /*
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
29 * Algorithmically based on Fortran-77 FFTPACK
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
30 * by Paul N. Swarztrauber(Version 4, 1985).
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
31 *
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
32 * Does even sized fft only
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
33 */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
34
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
35 /* isign is +1 for backward and -1 for forward transforms */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
36
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
37 #include "common.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
38 #include "structs.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
39
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
40 #include <stdlib.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
41 #ifdef _WIN32_WCE
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
42 #define assert(x)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
43 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
44 #include <assert.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
45 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
46
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
47 #include "cfft.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
48 #include "cfft_tab.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
49
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
50
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
51 /*----------------------------------------------------------------------
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
52 passf2, passf3, passf4, passf5. Complex FFT passes fwd and bwd.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
53 ----------------------------------------------------------------------*/
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
54
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
55 static void passf2(uint16_t ido, uint16_t l1, complex_t *cc, complex_t *ch,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
56 complex_t *wa, int8_t isign)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
57 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
58 uint16_t i, k, ah, ac;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
59
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
60 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
61 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
62 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
63 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
64 ah = 2*k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
65 ac = 4*k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
66
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
67 RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
68 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
69 RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
70 IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
71 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
72 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
73 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
74 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
75 ah = k*ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
76 ac = 2*k*ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
77
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
78 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
79 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
80 complex_t t2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
81
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
82 RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
83 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
84
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
85 RE(t2) = RE(cc[ac]) - RE(cc[ac+ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
86 IM(t2) = IM(cc[ac]) - IM(cc[ac+ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
87
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
88 RE(ch[ah+l1*ido]) = MUL_R_C(RE(t2),RE(wa[i])) - MUL_R_C(IM(t2),IM(wa[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
89 IM(ch[ah+l1*ido]) = MUL_R_C(IM(t2),RE(wa[i])) + MUL_R_C(RE(t2),IM(wa[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
90 ah++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
91 ac++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
92 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
93 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
94 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
95 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
96
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
97
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
98 static void passf3(uint16_t ido, uint16_t l1, complex_t *cc, complex_t *ch,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
99 complex_t *wa1, complex_t *wa2, int8_t isign)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
100 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
101 static real_t taur = COEF_CONST(-0.5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
102 static real_t taui = COEF_CONST(0.866025403784439);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
103 uint16_t i, k, ac, ah;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
104 complex_t c2, c3, d2, d3, t2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
105
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
106 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
107 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
108 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
109 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
110 ac = 3*k+1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
111 ah = k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
112
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
113 RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
114 IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
115 RE(c2) = RE(cc[ac-1]) + MUL_R_C(RE(t2),taur);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
116 IM(c2) = IM(cc[ac-1]) + MUL_R_C(IM(t2),taur);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
117
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
118 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
119 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
120
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
121 RE(c3) = MUL_R_C((RE(cc[ac]) - RE(cc[ac+1])), taui)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
122 IM(c3) = MUL_R_C((IM(cc[ac]) - IM(cc[ac+1])), taui)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
123
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
124 RE(ch[ah+l1]) = RE(c2) - IM(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
125 IM(ch[ah+l1]) = IM(c2) + RE(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
126 RE(ch[ah+2*l1]) = RE(c2) + IM(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
127 IM(ch[ah+2*l1]) = IM(c2) - RE(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
128 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
129 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
130 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
131 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
132 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
133 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
134 ac = i + (3*k+1)*ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
135 ah = i + k * ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
136
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
137 RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
138 RE(c2) = RE(cc[ac-ido]) + MUL_R_C(RE(t2),taur);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
139 IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
140 IM(c2) = IM(cc[ac-ido]) + MUL_R_C(IM(t2),taur);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
141
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
142 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
143 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
144
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
145 RE(c3) = MUL_R_C((RE(cc[ac]) - RE(cc[ac+ido])), taui)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
146 IM(c3) = MUL_R_C((IM(cc[ac]) - IM(cc[ac+ido])), taui)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
147
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
148 RE(d2) = RE(c2) - IM(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
149 IM(d3) = IM(c2) - RE(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
150 RE(d3) = RE(c2) + IM(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
151 IM(d2) = IM(c2) + RE(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
152
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
153 RE(ch[ah+l1*ido]) = MUL_R_C(RE(d2),RE(wa1[i])) - MUL_R_C(IM(d2),IM(wa1[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
154 IM(ch[ah+l1*ido]) = MUL_R_C(IM(d2),RE(wa1[i])) + MUL_R_C(RE(d2),IM(wa1[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
155 RE(ch[ah+l1*2*ido]) = MUL_R_C(RE(d3),RE(wa2[i])) - MUL_R_C(IM(d3),IM(wa2[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
156 IM(ch[ah+l1*2*ido]) = MUL_R_C(IM(d3),RE(wa2[i])) + MUL_R_C(RE(d3),IM(wa2[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
157 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
158 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
159 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
160 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
161
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
162
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
163 static void passf4(uint16_t ido, uint16_t l1, complex_t *cc, complex_t *ch,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
164 complex_t *wa1, complex_t *wa2, complex_t *wa3, int8_t isign)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
165 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
166 uint16_t i, k, ac, ah;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
167 complex_t c2, c3, c4, t1, t2, t3, t4;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
168
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
169 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
170 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
171 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
172 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
173 ac = 4*k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
174 ah = k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
175
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
176 RE(t2) = RE(cc[ac]) + RE(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
177 IM(t2) = IM(cc[ac]) + IM(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
178 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
179 IM(t3) = IM(cc[ac+1]) + IM(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
180 RE(t1) = RE(cc[ac]) - RE(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
181 IM(t1) = IM(cc[ac]) - IM(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
182 RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
183 IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
184
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
185 RE(ch[ah]) = RE(t2) + RE(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
186 IM(ch[ah]) = IM(t2) + IM(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
187 RE(ch[ah+l1]) = RE(t1) + RE(t4)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
188 IM(ch[ah+l1]) = IM(t1) + IM(t4)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
189 RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
190 IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
191 RE(ch[ah+3*l1]) = RE(t1) - RE(t4)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
192 IM(ch[ah+3*l1]) = IM(t1) - IM(t4)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
193 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
194 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
195 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
196 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
197 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
198 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
199 ac = i + 4*k*ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
200 ah = i + k*ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
201
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
202 RE(t2) = RE(cc[ac]) + RE(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
203 IM(t2) = IM(cc[ac]) + IM(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
204 RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
205 IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
206 RE(t1) = RE(cc[ac]) - RE(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
207 IM(t1) = IM(cc[ac]) - IM(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
208 RE(t4) = IM(cc[ac+3*ido]) - IM(cc[ac+ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
209 IM(t4) = RE(cc[ac+ido]) - RE(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
210
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
211 RE(ch[ah]) = RE(t2) + RE(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
212 IM(ch[ah]) = IM(t2) + IM(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
213
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
214 RE(c2) = RE(t1) + RE(t4)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
215 IM(c2) = IM(t1) + IM(t4)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
216 RE(c3) = RE(t2) - RE(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
217 IM(c3) = IM(t2) - IM(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
218 RE(c4) = RE(t1) - RE(t4)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
219 IM(c4) = IM(t1) - IM(t4)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
220
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
221 RE(ch[ah+l1*ido]) = MUL_R_C(RE(c2),RE(wa1[i])) - MUL_R_C(IM(c2),IM(wa1[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
222 IM(ch[ah+l1*ido]) = MUL_R_C(IM(c2),RE(wa1[i])) + MUL_R_C(RE(c2),IM(wa1[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
223 RE(ch[ah+2*l1*ido]) = MUL_R_C(RE(c3),RE(wa2[i])) - MUL_R_C(IM(c3),IM(wa2[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
224 IM(ch[ah+2*l1*ido]) = MUL_R_C(IM(c3),RE(wa2[i])) + MUL_R_C(RE(c3),IM(wa2[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
225 RE(ch[ah+3*l1*ido]) = MUL_R_C(RE(c4),RE(wa3[i])) - MUL_R_C(IM(c4),IM(wa3[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
226 IM(ch[ah+3*l1*ido]) = MUL_R_C(IM(c4),RE(wa3[i])) + MUL_R_C(RE(c4),IM(wa3[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
227 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
228 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
229 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
230 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
231
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
232
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
233 static void passf5(uint16_t ido, uint16_t l1, complex_t *cc, complex_t *ch,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
234 complex_t *wa1, complex_t *wa2, complex_t *wa3, complex_t *wa4,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
235 int8_t isign)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
236 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
237 static real_t tr11 = COEF_CONST(0.309016994374947);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
238 static real_t ti11 = COEF_CONST(0.951056516295154);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
239 static real_t tr12 = COEF_CONST(-0.809016994374947);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
240 static real_t ti12 = COEF_CONST(0.587785252292473);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
241 uint16_t i, k, ac, ah;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
242 complex_t c2, c3, c4, c5, d3, d4, d5, d2, t2, t3, t4, t5;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
243
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
244 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
245 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
246 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
247 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
248 ac = 5*k + 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
249 ah = k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
250
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
251 RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
252 IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
253 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
254 IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
255 RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
256 IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
257 RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
258 IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
259
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
260 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
261 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
262
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
263 RE(c2) = RE(cc[ac-1]) + MUL_R_C(RE(t2),tr11) + MUL_R_C(RE(t3),tr12);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
264 IM(c2) = IM(cc[ac-1]) + MUL_R_C(IM(t2),tr11) + MUL_R_C(IM(t3),tr12);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
265 RE(c3) = RE(cc[ac-1]) + MUL_R_C(RE(t2),tr12) + MUL_R_C(RE(t3),tr11);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
266 IM(c3) = IM(cc[ac-1]) + MUL_R_C(IM(t2),tr12) + MUL_R_C(IM(t3),tr11);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
267 RE(c4) = (MUL_R_C(RE(t5),ti12)*isign - MUL_R_C(RE(t4),ti11));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
268 IM(c4) = (MUL_R_C(IM(t5),ti12)*isign - MUL_R_C(IM(t4),ti11));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
269 RE(c5) = (MUL_R_C(RE(t5),ti11)*isign + MUL_R_C(RE(t4),ti12));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
270 IM(c5) = (MUL_R_C(IM(t5),ti11)*isign + MUL_R_C(IM(t4),ti12));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
271
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
272 RE(ch[ah+l1]) = RE(c2) - IM(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
273 IM(ch[ah+l1]) = IM(c2) + RE(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
274 RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
275 IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
276 RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
277 IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
278 RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
279 IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
280 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
281 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
282 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
283 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
284 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
285 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
286 ac = i + (k*5 + 1) * ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
287 ah = i + k * ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
288
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
289 RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
290 IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
291 RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
292 IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
293 RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
294 IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
295 RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
296 IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
297
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
298 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
299 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
300
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
301 RE(c2) = RE(cc[ac-ido]) + MUL_R_C(RE(t2),tr11) + MUL_R_C(RE(t3),tr12);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
302 IM(c2) = IM(cc[ac-ido]) + MUL_R_C(IM(t2),tr11) + MUL_R_C(IM(t3),tr12);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
303 RE(c3) = RE(cc[ac-ido]) + MUL_R_C(RE(t2),tr12) + MUL_R_C(RE(t3),tr11);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
304 IM(c3) = IM(cc[ac-ido]) + MUL_R_C(IM(t2),tr12) + MUL_R_C(IM(t3),tr11);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
305 RE(c4) = (MUL_R_C(RE(t5),ti12)*isign - MUL_R_C(RE(t4),ti11));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
306 IM(c4) = (MUL_R_C(IM(t5),ti12)*isign - MUL_R_C(IM(t4),ti11));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
307 RE(c5) = (MUL_R_C(RE(t5),ti11)*isign + MUL_R_C(RE(t4),ti12));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
308 IM(c5) = (MUL_R_C(IM(t5),ti11)*isign + MUL_R_C(IM(t4),ti12));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
309
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
310 IM(d2) = IM(c2) + RE(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
311 IM(d3) = IM(c3) + RE(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
312 RE(d4) = RE(c3) + IM(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
313 RE(d5) = RE(c2) + IM(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
314 RE(d2) = RE(c2) - IM(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
315 IM(d5) = IM(c2) - RE(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
316 RE(d3) = RE(c3) - IM(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
317 IM(d4) = IM(c3) - RE(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
318
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
319 RE(ch[ah+l1*ido]) = MUL_R_C(RE(d2),RE(wa1[i])) - MUL_R_C(IM(d2),IM(wa1[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
320 IM(ch[ah+l1*ido]) = MUL_R_C(IM(d2),RE(wa1[i])) + MUL_R_C(RE(d2),IM(wa1[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
321 RE(ch[ah+2*l1*ido]) = MUL_R_C(RE(d3),RE(wa2[i])) - MUL_R_C(IM(d3),IM(wa2[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
322 IM(ch[ah+2*l1*ido]) = MUL_R_C(IM(d3),RE(wa2[i])) + MUL_R_C(RE(d3),IM(wa2[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
323 RE(ch[ah+3*l1*ido]) = MUL_R_C(RE(d4),RE(wa3[i])) - MUL_R_C(IM(d4),IM(wa3[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
324 IM(ch[ah+3*l1*ido]) = MUL_R_C(IM(d4),RE(wa3[i])) + MUL_R_C(RE(d4),IM(wa3[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
325 RE(ch[ah+4*l1*ido]) = MUL_R_C(RE(d5),RE(wa4[i])) - MUL_R_C(IM(d5),IM(wa4[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
326 IM(ch[ah+4*l1*ido]) = MUL_R_C(IM(d5),RE(wa4[i])) + MUL_R_C(RE(d5),IM(wa4[i]))*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
327 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
328 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
329 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
330 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
331
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
332
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
333 /*----------------------------------------------------------------------
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
334 cfftf1, cfftf, cfftb, cffti1, cffti. Complex FFTs.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
335 ----------------------------------------------------------------------*/
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
336
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
337 INLINE void cfftf1(uint16_t n, complex_t *c, complex_t *ch,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
338 uint16_t *ifac, complex_t *wa, int8_t isign)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
339 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
340 uint16_t i;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
341 uint16_t k1, l1, l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
342 uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
343
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
344 nf = ifac[1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
345 na = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
346 l1 = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
347 iw = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
348
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
349 for (k1 = 2; k1 <= nf+1; k1++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
350 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
351 ip = ifac[k1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
352 l2 = ip*l1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
353 ido = n / l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
354 idl1 = ido*l1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
355
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
356 switch (ip)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
357 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
358 case 2:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
359 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
360 passf2(ido, l1, c, ch, &wa[iw], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
361 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
362 passf2(ido, l1, ch, c, &wa[iw], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
363
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
364 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
365 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
366 case 3:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
367 ix2 = iw + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
368
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
369 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
370 passf3(ido, l1, c, ch, &wa[iw], &wa[ix2], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
371 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
372 passf3(ido, l1, ch, c, &wa[iw], &wa[ix2], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
373
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
374 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
375 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
376 case 4:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
377 ix2 = iw + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
378 ix3 = ix2 + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
379
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
380 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
381 passf4(ido, l1, c, ch, &wa[iw], &wa[ix2], &wa[ix3], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
382 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
383 passf4(ido, l1, ch, c, &wa[iw], &wa[ix2], &wa[ix3], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
384
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
385 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
386 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
387 case 5:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
388 ix2 = iw + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
389 ix3 = ix2 + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
390 ix4 = ix3 + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
391
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
392 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
393 passf5(ido, l1, c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
394 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
395 passf5(ido, l1, ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
396
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
397 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
398 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
399 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
400
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
401 l1 = l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
402 iw += (ip-1) * ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
403 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
404
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
405 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
406 return;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
407
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
408 for (i = 0; i < n; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
409 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
410 RE(c[i]) = RE(ch[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
411 IM(c[i]) = IM(ch[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
412 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
413 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
414
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
415 void cfftf(cfft_info *cfft, complex_t *c)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
416 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
417 cfftf1(cfft->n, c, cfft->work, cfft->ifac, cfft->tab, -1);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
418 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
419
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
420 void cfftb(cfft_info *cfft, complex_t *c)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
421 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
422 cfftf1(cfft->n, c, cfft->work, cfft->ifac, cfft->tab, +1);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
423 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
424
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
425 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
426 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
427 static uint16_t ntryh[4] = {3, 4, 2, 5};
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
428 #ifndef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
429 real_t arg, argh, argld, fi;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
430 uint16_t ido, ipm;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
431 uint16_t i1, k1, l1, l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
432 uint16_t ld, ii, ip;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
433 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
434 uint16_t ntry, i, j;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
435 uint16_t ib;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
436 uint16_t nf, nl, nq, nr;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
437
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
438 nl = n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
439 nf = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
440 j = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
441
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
442 startloop:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
443 j++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
444
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
445 if (j <= 4)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
446 ntry = ntryh[j-1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
447 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
448 ntry += 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
449
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
450 do
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
451 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
452 nq = nl / ntry;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
453 nr = nl - ntry*nq;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
454
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
455 if (nr != 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
456 goto startloop;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
457
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
458 nf++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
459 ifac[nf+1] = ntry;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
460 nl = nq;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
461
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
462 if (ntry == 2 && nf != 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
463 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
464 for (i = 2; i <= nf; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
465 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
466 ib = nf - i + 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
467 ifac[ib+1] = ifac[ib];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
468 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
469 ifac[2] = 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
470 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
471 } while (nl != 1);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
472
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
473 ifac[0] = n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
474 ifac[1] = nf;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
475
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
476 #ifndef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
477 argh = 2.0*M_PI / (real_t)n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
478 i = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
479 l1 = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
480
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
481 for (k1 = 1; k1 <= nf; k1++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
482 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
483 ip = ifac[k1+1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
484 ld = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
485 l2 = l1*ip;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
486 ido = n / l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
487 ipm = ip - 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
488
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
489 for (j = 0; j < ipm; j++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
490 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
491 i1 = i;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
492 RE(wa[i]) = 1.0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
493 IM(wa[i]) = 0.0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
494 ld += l1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
495 fi = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
496 argld = ld*argh;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
497
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
498 for (ii = 0; ii < ido; ii++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
499 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
500 i++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
501 fi++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
502 arg = fi * argld;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
503 RE(wa[i]) = cos(arg);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
504 IM(wa[i]) = sin(arg);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
505 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
506
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
507 if (ip > 5)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
508 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
509 RE(wa[i1]) = RE(wa[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
510 IM(wa[i1]) = IM(wa[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
511 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
512 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
513 l1 = l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
514 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
515 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
516 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
517
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
518 cfft_info *cffti(uint16_t n)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
519 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
520 cfft_info *cfft = (cfft_info*)malloc(sizeof(cfft_info));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
521
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
522 cfft->n = n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
523 cfft->work = (complex_t*)malloc(n*sizeof(complex_t));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
524
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
525 #ifndef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
526 cfft->tab = (complex_t*)malloc(n*sizeof(complex_t));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
527
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
528 cffti1(n, cfft->tab, cfft->ifac);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
529 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
530 cffti1(n, NULL, cfft->ifac);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
531
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
532 switch (n)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
533 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
534 case 60: cfft->tab = cfft_tab_60; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
535 case 64: cfft->tab = cfft_tab_64; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
536 case 480: cfft->tab = cfft_tab_480; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
537 case 512: cfft->tab = cfft_tab_512; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
538 #ifdef LD_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
539 case 240: cfft->tab = cfft_tab_240; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
540 case 256: cfft->tab = cfft_tab_256; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
541 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
542 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
543 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
544
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
545 return cfft;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
546 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
547
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
548 void cfftu(cfft_info *cfft)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
549 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
550 if (cfft->work) free(cfft->work);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
551 #ifndef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
552 if (cfft->tab) free(cfft->tab);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
553 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
554
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
555 if (cfft) free(cfft);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
556 }