Mercurial > audlegacy
annotate Plugins/Input/aac/libfaad2/cfft.c @ 254:5de006f3d342 trunk
[svn] Initialize two variables before use and remove an unused one. Squashes 3 warnings.
author | chainsaw |
---|---|
date | Sun, 04 Dec 2005 06:48:27 -0800 |
parents | 0a2ad94e8607 |
children | 29feaace84d0 |
rev | line source |
---|---|
61 | 1 /* |
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com |
61 | 4 ** |
5 ** This program is free software; you can redistribute it and/or modify | |
6 ** it under the terms of the GNU General Public License as published by | |
7 ** the Free Software Foundation; either version 2 of the License, or | |
8 ** (at your option) any later version. | |
9 ** | |
10 ** This program is distributed in the hope that it will be useful, | |
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 ** GNU General Public License for more details. | |
14 ** | |
15 ** You should have received a copy of the GNU General Public License | |
16 ** along with this program; if not, write to the Free Software | |
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
18 ** | |
19 ** Any non-GPL usage of this software or parts of this software is strictly | |
20 ** forbidden. | |
21 ** | |
22 ** Commercial non-GPL licensing of this software is possible. | |
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | |
24 ** | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
25 ** $Id: cfft.c,v 1.30 2004/09/08 09:43:11 gcp Exp $ |
61 | 26 **/ |
27 | |
28 /* | |
29 * Algorithmically based on Fortran-77 FFTPACK | |
30 * by Paul N. Swarztrauber(Version 4, 1985). | |
31 * | |
32 * Does even sized fft only | |
33 */ | |
34 | |
35 /* isign is +1 for backward and -1 for forward transforms */ | |
36 | |
37 #include "common.h" | |
38 #include "structs.h" | |
39 | |
40 #include <stdlib.h> | |
41 | |
42 #include "cfft.h" | |
43 #include "cfft_tab.h" | |
44 | |
45 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
46 /* static function declarations */ |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
47 static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
48 complex_t *ch, const complex_t *wa); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
49 static void passf2neg(const uint16_t ido, const uint16_t l1, const complex_t *cc, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
50 complex_t *ch, const complex_t *wa); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
51 static void passf3(const uint16_t ido, const uint16_t l1, const complex_t *cc, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
52 complex_t *ch, const complex_t *wa1, const complex_t *wa2, const int8_t isign); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
53 static void passf4pos(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
54 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
55 static void passf4neg(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
56 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
57 static void passf5(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
58 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
59 const complex_t *wa4, const int8_t isign); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
60 INLINE void cfftf1(uint16_t n, complex_t *c, complex_t *ch, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
61 const uint16_t *ifac, const complex_t *wa, const int8_t isign); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
62 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
63 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
64 |
61 | 65 /*---------------------------------------------------------------------- |
66 passf2, passf3, passf4, passf5. Complex FFT passes fwd and bwd. | |
67 ----------------------------------------------------------------------*/ | |
68 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
69 static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
70 complex_t *ch, const complex_t *wa) |
61 | 71 { |
72 uint16_t i, k, ah, ac; | |
73 | |
74 if (ido == 1) | |
75 { | |
76 for (k = 0; k < l1; k++) | |
77 { | |
78 ah = 2*k; | |
79 ac = 4*k; | |
80 | |
81 RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]); | |
82 RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]); | |
83 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]); | |
84 IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]); | |
85 } | |
86 } else { | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
87 for (k = 0; k < l1; k++) |
61 | 88 { |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
89 ah = k*ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
90 ac = 2*k*ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
91 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
92 for (i = 0; i < ido; i++) |
61 | 93 { |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
94 complex_t t2; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
95 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
96 RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
97 RE(t2) = RE(cc[ac+i]) - RE(cc[ac+i+ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
98 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
99 IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
100 IM(t2) = IM(cc[ac+i]) - IM(cc[ac+i+ido]); |
61 | 101 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
102 #if 1 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
103 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
104 IM(t2), RE(t2), RE(wa[i]), IM(wa[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
105 #else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
106 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
107 RE(t2), IM(t2), RE(wa[i]), IM(wa[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
108 #endif |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
109 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
110 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
111 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
112 } |
61 | 113 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
114 static void passf2neg(const uint16_t ido, const uint16_t l1, const complex_t *cc, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
115 complex_t *ch, const complex_t *wa) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
116 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
117 uint16_t i, k, ah, ac; |
61 | 118 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
119 if (ido == 1) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
120 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
121 for (k = 0; k < l1; k++) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
122 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
123 ah = 2*k; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
124 ac = 4*k; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
125 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
126 RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
127 RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
128 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
129 IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
130 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
131 } else { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
132 for (k = 0; k < l1; k++) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
133 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
134 ah = k*ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
135 ac = 2*k*ido; |
61 | 136 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
137 for (i = 0; i < ido; i++) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
138 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
139 complex_t t2; |
61 | 140 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
141 RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
142 RE(t2) = RE(cc[ac+i]) - RE(cc[ac+i+ido]); |
61 | 143 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
144 IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
145 IM(t2) = IM(cc[ac+i]) - IM(cc[ac+i+ido]); |
61 | 146 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
147 #if 1 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
148 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
149 RE(t2), IM(t2), RE(wa[i]), IM(wa[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
150 #else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
151 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
152 IM(t2), RE(t2), RE(wa[i]), IM(wa[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
153 #endif |
61 | 154 } |
155 } | |
156 } | |
157 } | |
158 | |
159 | |
160 static void passf3(const uint16_t ido, const uint16_t l1, const complex_t *cc, | |
161 complex_t *ch, const complex_t *wa1, const complex_t *wa2, | |
162 const int8_t isign) | |
163 { | |
164 static real_t taur = FRAC_CONST(-0.5); | |
165 static real_t taui = FRAC_CONST(0.866025403784439); | |
166 uint16_t i, k, ac, ah; | |
167 complex_t c2, c3, d2, d3, t2; | |
168 | |
169 if (ido == 1) | |
170 { | |
171 if (isign == 1) | |
172 { | |
173 for (k = 0; k < l1; k++) | |
174 { | |
175 ac = 3*k+1; | |
176 ah = k; | |
177 | |
178 RE(t2) = RE(cc[ac]) + RE(cc[ac+1]); | |
179 IM(t2) = IM(cc[ac]) + IM(cc[ac+1]); | |
180 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur); | |
181 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur); | |
182 | |
183 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2); | |
184 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2); | |
185 | |
186 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui); | |
187 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui); | |
188 | |
189 RE(ch[ah+l1]) = RE(c2) - IM(c3); | |
190 IM(ch[ah+l1]) = IM(c2) + RE(c3); | |
191 RE(ch[ah+2*l1]) = RE(c2) + IM(c3); | |
192 IM(ch[ah+2*l1]) = IM(c2) - RE(c3); | |
193 } | |
194 } else { | |
195 for (k = 0; k < l1; k++) | |
196 { | |
197 ac = 3*k+1; | |
198 ah = k; | |
199 | |
200 RE(t2) = RE(cc[ac]) + RE(cc[ac+1]); | |
201 IM(t2) = IM(cc[ac]) + IM(cc[ac+1]); | |
202 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur); | |
203 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur); | |
204 | |
205 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2); | |
206 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2); | |
207 | |
208 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui); | |
209 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui); | |
210 | |
211 RE(ch[ah+l1]) = RE(c2) + IM(c3); | |
212 IM(ch[ah+l1]) = IM(c2) - RE(c3); | |
213 RE(ch[ah+2*l1]) = RE(c2) - IM(c3); | |
214 IM(ch[ah+2*l1]) = IM(c2) + RE(c3); | |
215 } | |
216 } | |
217 } else { | |
218 if (isign == 1) | |
219 { | |
220 for (k = 0; k < l1; k++) | |
221 { | |
222 for (i = 0; i < ido; i++) | |
223 { | |
224 ac = i + (3*k+1)*ido; | |
225 ah = i + k * ido; | |
226 | |
227 RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]); | |
228 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur); | |
229 IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]); | |
230 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur); | |
231 | |
232 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2); | |
233 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2); | |
234 | |
235 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui); | |
236 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui); | |
237 | |
238 RE(d2) = RE(c2) - IM(c3); | |
239 IM(d3) = IM(c2) - RE(c3); | |
240 RE(d3) = RE(c2) + IM(c3); | |
241 IM(d2) = IM(c2) + RE(c3); | |
242 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
243 #if 1 |
61 | 244 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]), |
245 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i])); | |
246 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]), | |
247 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i])); | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
248 #else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
249 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
250 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
251 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
252 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
253 #endif |
61 | 254 } |
255 } | |
256 } else { | |
257 for (k = 0; k < l1; k++) | |
258 { | |
259 for (i = 0; i < ido; i++) | |
260 { | |
261 ac = i + (3*k+1)*ido; | |
262 ah = i + k * ido; | |
263 | |
264 RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]); | |
265 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur); | |
266 IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]); | |
267 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur); | |
268 | |
269 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2); | |
270 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2); | |
271 | |
272 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui); | |
273 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui); | |
274 | |
275 RE(d2) = RE(c2) + IM(c3); | |
276 IM(d3) = IM(c2) + RE(c3); | |
277 RE(d3) = RE(c2) - IM(c3); | |
278 IM(d2) = IM(c2) - RE(c3); | |
279 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
280 #if 1 |
61 | 281 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]), |
282 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i])); | |
283 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]), | |
284 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i])); | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
285 #else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
286 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
287 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
288 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
289 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
290 #endif |
61 | 291 } |
292 } | |
293 } | |
294 } | |
295 } | |
296 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
297 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
298 static void passf4pos(const uint16_t ido, const uint16_t l1, const complex_t *cc, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
299 complex_t *ch, const complex_t *wa1, const complex_t *wa2, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
300 const complex_t *wa3) |
61 | 301 { |
302 uint16_t i, k, ac, ah; | |
303 | |
304 if (ido == 1) | |
305 { | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
306 for (k = 0; k < l1; k++) |
61 | 307 { |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
308 complex_t t1, t2, t3, t4; |
61 | 309 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
310 ac = 4*k; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
311 ah = k; |
61 | 312 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
313 RE(t2) = RE(cc[ac]) + RE(cc[ac+2]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
314 RE(t1) = RE(cc[ac]) - RE(cc[ac+2]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
315 IM(t2) = IM(cc[ac]) + IM(cc[ac+2]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
316 IM(t1) = IM(cc[ac]) - IM(cc[ac+2]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
317 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
318 IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
319 IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
320 RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]); |
61 | 321 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
322 RE(ch[ah]) = RE(t2) + RE(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
323 RE(ch[ah+2*l1]) = RE(t2) - RE(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
324 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
325 IM(ch[ah]) = IM(t2) + IM(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
326 IM(ch[ah+2*l1]) = IM(t2) - IM(t3); |
61 | 327 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
328 RE(ch[ah+l1]) = RE(t1) + RE(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
329 RE(ch[ah+3*l1]) = RE(t1) - RE(t4); |
61 | 330 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
331 IM(ch[ah+l1]) = IM(t1) + IM(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
332 IM(ch[ah+3*l1]) = IM(t1) - IM(t4); |
61 | 333 } |
334 } else { | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
335 for (k = 0; k < l1; k++) |
61 | 336 { |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
337 ac = 4*k*ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
338 ah = k*ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
339 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
340 for (i = 0; i < ido; i++) |
61 | 341 { |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
342 complex_t c2, c3, c4, t1, t2, t3, t4; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
343 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
344 RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
345 RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
346 IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
347 IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
348 RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
349 IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
350 IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
351 RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]); |
61 | 352 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
353 RE(c2) = RE(t1) + RE(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
354 RE(c4) = RE(t1) - RE(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
355 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
356 IM(c2) = IM(t1) + IM(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
357 IM(c4) = IM(t1) - IM(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
358 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
359 RE(ch[ah+i]) = RE(t2) + RE(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
360 RE(c3) = RE(t2) - RE(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
361 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
362 IM(ch[ah+i]) = IM(t2) + IM(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
363 IM(c3) = IM(t2) - IM(t3); |
61 | 364 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
365 #if 1 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
366 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
367 IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
368 ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
369 IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
370 ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
371 IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
372 #else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
373 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
374 RE(c2), IM(c2), RE(wa1[i]), IM(wa1[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
375 ComplexMult(&RE(ch[ah+i+2*l1*ido]), &IM(ch[ah+i+2*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
376 RE(c3), IM(c3), RE(wa2[i]), IM(wa2[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
377 ComplexMult(&RE(ch[ah+i+3*l1*ido]), &IM(ch[ah+i+3*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
378 RE(c4), IM(c4), RE(wa3[i]), IM(wa3[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
379 #endif |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
380 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
381 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
382 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
383 } |
61 | 384 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
385 static void passf4neg(const uint16_t ido, const uint16_t l1, const complex_t *cc, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
386 complex_t *ch, const complex_t *wa1, const complex_t *wa2, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
387 const complex_t *wa3) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
388 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
389 uint16_t i, k, ac, ah; |
61 | 390 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
391 if (ido == 1) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
392 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
393 for (k = 0; k < l1; k++) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
394 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
395 complex_t t1, t2, t3, t4; |
61 | 396 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
397 ac = 4*k; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
398 ah = k; |
61 | 399 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
400 RE(t2) = RE(cc[ac]) + RE(cc[ac+2]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
401 RE(t1) = RE(cc[ac]) - RE(cc[ac+2]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
402 IM(t2) = IM(cc[ac]) + IM(cc[ac+2]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
403 IM(t1) = IM(cc[ac]) - IM(cc[ac+2]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
404 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
405 IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
406 IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
407 RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
408 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
409 RE(ch[ah]) = RE(t2) + RE(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
410 RE(ch[ah+2*l1]) = RE(t2) - RE(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
411 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
412 IM(ch[ah]) = IM(t2) + IM(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
413 IM(ch[ah+2*l1]) = IM(t2) - IM(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
414 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
415 RE(ch[ah+l1]) = RE(t1) - RE(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
416 RE(ch[ah+3*l1]) = RE(t1) + RE(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
417 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
418 IM(ch[ah+l1]) = IM(t1) - IM(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
419 IM(ch[ah+3*l1]) = IM(t1) + IM(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
420 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
421 } else { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
422 for (k = 0; k < l1; k++) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
423 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
424 ac = 4*k*ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
425 ah = k*ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
426 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
427 for (i = 0; i < ido; i++) |
61 | 428 { |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
429 complex_t c2, c3, c4, t1, t2, t3, t4; |
61 | 430 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
431 RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
432 RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
433 IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
434 IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
435 RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
436 IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
437 IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
438 RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]); |
61 | 439 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
440 RE(c2) = RE(t1) - RE(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
441 RE(c4) = RE(t1) + RE(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
442 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
443 IM(c2) = IM(t1) - IM(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
444 IM(c4) = IM(t1) + IM(t4); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
445 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
446 RE(ch[ah+i]) = RE(t2) + RE(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
447 RE(c3) = RE(t2) - RE(t3); |
61 | 448 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
449 IM(ch[ah+i]) = IM(t2) + IM(t3); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
450 IM(c3) = IM(t2) - IM(t3); |
61 | 451 |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
452 #if 1 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
453 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
454 RE(c2), IM(c2), RE(wa1[i]), IM(wa1[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
455 ComplexMult(&RE(ch[ah+i+2*l1*ido]), &IM(ch[ah+i+2*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
456 RE(c3), IM(c3), RE(wa2[i]), IM(wa2[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
457 ComplexMult(&RE(ch[ah+i+3*l1*ido]), &IM(ch[ah+i+3*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
458 RE(c4), IM(c4), RE(wa3[i]), IM(wa3[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
459 #else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
460 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
461 IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
462 ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
463 IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
464 ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
465 IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
466 #endif |
61 | 467 } |
468 } | |
469 } | |
470 } | |
471 | |
472 static void passf5(const uint16_t ido, const uint16_t l1, const complex_t *cc, | |
473 complex_t *ch, const complex_t *wa1, const complex_t *wa2, const complex_t *wa3, | |
474 const complex_t *wa4, const int8_t isign) | |
475 { | |
476 static real_t tr11 = FRAC_CONST(0.309016994374947); | |
477 static real_t ti11 = FRAC_CONST(0.951056516295154); | |
478 static real_t tr12 = FRAC_CONST(-0.809016994374947); | |
479 static real_t ti12 = FRAC_CONST(0.587785252292473); | |
480 uint16_t i, k, ac, ah; | |
481 complex_t c2, c3, c4, c5, d3, d4, d5, d2, t2, t3, t4, t5; | |
482 | |
483 if (ido == 1) | |
484 { | |
485 if (isign == 1) | |
486 { | |
487 for (k = 0; k < l1; k++) | |
488 { | |
489 ac = 5*k + 1; | |
490 ah = k; | |
491 | |
492 RE(t2) = RE(cc[ac]) + RE(cc[ac+3]); | |
493 IM(t2) = IM(cc[ac]) + IM(cc[ac+3]); | |
494 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]); | |
495 IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]); | |
496 RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]); | |
497 IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]); | |
498 RE(t5) = RE(cc[ac]) - RE(cc[ac+3]); | |
499 IM(t5) = IM(cc[ac]) - IM(cc[ac+3]); | |
500 | |
501 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3); | |
502 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3); | |
503 | |
504 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12); | |
505 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12); | |
506 RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11); | |
507 IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11); | |
508 | |
509 ComplexMult(&RE(c5), &RE(c4), | |
510 ti11, ti12, RE(t5), RE(t4)); | |
511 ComplexMult(&IM(c5), &IM(c4), | |
512 ti11, ti12, IM(t5), IM(t4)); | |
513 | |
514 RE(ch[ah+l1]) = RE(c2) - IM(c5); | |
515 IM(ch[ah+l1]) = IM(c2) + RE(c5); | |
516 RE(ch[ah+2*l1]) = RE(c3) - IM(c4); | |
517 IM(ch[ah+2*l1]) = IM(c3) + RE(c4); | |
518 RE(ch[ah+3*l1]) = RE(c3) + IM(c4); | |
519 IM(ch[ah+3*l1]) = IM(c3) - RE(c4); | |
520 RE(ch[ah+4*l1]) = RE(c2) + IM(c5); | |
521 IM(ch[ah+4*l1]) = IM(c2) - RE(c5); | |
522 } | |
523 } else { | |
524 for (k = 0; k < l1; k++) | |
525 { | |
526 ac = 5*k + 1; | |
527 ah = k; | |
528 | |
529 RE(t2) = RE(cc[ac]) + RE(cc[ac+3]); | |
530 IM(t2) = IM(cc[ac]) + IM(cc[ac+3]); | |
531 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]); | |
532 IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]); | |
533 RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]); | |
534 IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]); | |
535 RE(t5) = RE(cc[ac]) - RE(cc[ac+3]); | |
536 IM(t5) = IM(cc[ac]) - IM(cc[ac+3]); | |
537 | |
538 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3); | |
539 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3); | |
540 | |
541 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12); | |
542 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12); | |
543 RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11); | |
544 IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11); | |
545 | |
546 ComplexMult(&RE(c4), &RE(c5), | |
547 ti12, ti11, RE(t5), RE(t4)); | |
548 ComplexMult(&IM(c4), &IM(c5), | |
549 ti12, ti12, IM(t5), IM(t4)); | |
550 | |
551 RE(ch[ah+l1]) = RE(c2) + IM(c5); | |
552 IM(ch[ah+l1]) = IM(c2) - RE(c5); | |
553 RE(ch[ah+2*l1]) = RE(c3) + IM(c4); | |
554 IM(ch[ah+2*l1]) = IM(c3) - RE(c4); | |
555 RE(ch[ah+3*l1]) = RE(c3) - IM(c4); | |
556 IM(ch[ah+3*l1]) = IM(c3) + RE(c4); | |
557 RE(ch[ah+4*l1]) = RE(c2) - IM(c5); | |
558 IM(ch[ah+4*l1]) = IM(c2) + RE(c5); | |
559 } | |
560 } | |
561 } else { | |
562 if (isign == 1) | |
563 { | |
564 for (k = 0; k < l1; k++) | |
565 { | |
566 for (i = 0; i < ido; i++) | |
567 { | |
568 ac = i + (k*5 + 1) * ido; | |
569 ah = i + k * ido; | |
570 | |
571 RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]); | |
572 IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]); | |
573 RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]); | |
574 IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]); | |
575 RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]); | |
576 IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]); | |
577 RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]); | |
578 IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]); | |
579 | |
580 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3); | |
581 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3); | |
582 | |
583 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12); | |
584 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12); | |
585 RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11); | |
586 IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11); | |
587 | |
588 ComplexMult(&RE(c5), &RE(c4), | |
589 ti11, ti12, RE(t5), RE(t4)); | |
590 ComplexMult(&IM(c5), &IM(c4), | |
591 ti11, ti12, IM(t5), IM(t4)); | |
592 | |
593 IM(d2) = IM(c2) + RE(c5); | |
594 IM(d3) = IM(c3) + RE(c4); | |
595 RE(d4) = RE(c3) + IM(c4); | |
596 RE(d5) = RE(c2) + IM(c5); | |
597 RE(d2) = RE(c2) - IM(c5); | |
598 IM(d5) = IM(c2) - RE(c5); | |
599 RE(d3) = RE(c3) - IM(c4); | |
600 IM(d4) = IM(c3) - RE(c4); | |
601 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
602 #if 1 |
61 | 603 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]), |
604 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i])); | |
605 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]), | |
606 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i])); | |
607 ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]), | |
608 IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i])); | |
609 ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]), | |
610 IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i])); | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
611 #else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
612 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
613 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
614 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
615 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
616 ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
617 RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
618 ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
619 RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
620 #endif |
61 | 621 } |
622 } | |
623 } else { | |
624 for (k = 0; k < l1; k++) | |
625 { | |
626 for (i = 0; i < ido; i++) | |
627 { | |
628 ac = i + (k*5 + 1) * ido; | |
629 ah = i + k * ido; | |
630 | |
631 RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]); | |
632 IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]); | |
633 RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]); | |
634 IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]); | |
635 RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]); | |
636 IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]); | |
637 RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]); | |
638 IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]); | |
639 | |
640 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3); | |
641 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3); | |
642 | |
643 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12); | |
644 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12); | |
645 RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11); | |
646 IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11); | |
647 | |
648 ComplexMult(&RE(c4), &RE(c5), | |
649 ti12, ti11, RE(t5), RE(t4)); | |
650 ComplexMult(&IM(c4), &IM(c5), | |
651 ti12, ti12, IM(t5), IM(t4)); | |
652 | |
653 IM(d2) = IM(c2) - RE(c5); | |
654 IM(d3) = IM(c3) - RE(c4); | |
655 RE(d4) = RE(c3) - IM(c4); | |
656 RE(d5) = RE(c2) - IM(c5); | |
657 RE(d2) = RE(c2) + IM(c5); | |
658 IM(d5) = IM(c2) + RE(c5); | |
659 RE(d3) = RE(c3) + IM(c4); | |
660 IM(d4) = IM(c3) + RE(c4); | |
661 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
662 #if 1 |
61 | 663 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]), |
664 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i])); | |
665 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]), | |
666 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i])); | |
667 ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]), | |
668 RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i])); | |
669 ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]), | |
670 RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i])); | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
671 #else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
672 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
673 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
674 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
675 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
676 ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
677 IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
678 ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]), |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
679 IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i])); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
680 #endif |
61 | 681 } |
682 } | |
683 } | |
684 } | |
685 } | |
686 | |
687 | |
688 /*---------------------------------------------------------------------- | |
689 cfftf1, cfftf, cfftb, cffti1, cffti. Complex FFTs. | |
690 ----------------------------------------------------------------------*/ | |
691 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
692 static INLINE void cfftf1pos(uint16_t n, complex_t *c, complex_t *ch, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
693 const uint16_t *ifac, const complex_t *wa, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
694 const int8_t isign) |
61 | 695 { |
696 uint16_t i; | |
697 uint16_t k1, l1, l2; | |
698 uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1; | |
699 | |
700 nf = ifac[1]; | |
701 na = 0; | |
702 l1 = 1; | |
703 iw = 0; | |
704 | |
705 for (k1 = 2; k1 <= nf+1; k1++) | |
706 { | |
707 ip = ifac[k1]; | |
708 l2 = ip*l1; | |
709 ido = n / l2; | |
710 idl1 = ido*l1; | |
711 | |
712 switch (ip) | |
713 { | |
714 case 4: | |
715 ix2 = iw + ido; | |
716 ix3 = ix2 + ido; | |
717 | |
718 if (na == 0) | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
719 passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]); |
61 | 720 else |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
721 passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]); |
61 | 722 |
723 na = 1 - na; | |
724 break; | |
725 case 2: | |
726 if (na == 0) | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
727 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]); |
61 | 728 else |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
729 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]); |
61 | 730 |
731 na = 1 - na; | |
732 break; | |
733 case 3: | |
734 ix2 = iw + ido; | |
735 | |
736 if (na == 0) | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
737 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign); |
61 | 738 else |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
739 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign); |
61 | 740 |
741 na = 1 - na; | |
742 break; | |
743 case 5: | |
744 ix2 = iw + ido; | |
745 ix3 = ix2 + ido; | |
746 ix4 = ix3 + ido; | |
747 | |
748 if (na == 0) | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
749 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign); |
61 | 750 else |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
751 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
752 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
753 na = 1 - na; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
754 break; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
755 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
756 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
757 l1 = l2; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
758 iw += (ip-1) * ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
759 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
760 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
761 if (na == 0) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
762 return; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
763 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
764 for (i = 0; i < n; i++) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
765 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
766 RE(c[i]) = RE(ch[i]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
767 IM(c[i]) = IM(ch[i]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
768 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
769 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
770 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
771 static INLINE void cfftf1neg(uint16_t n, complex_t *c, complex_t *ch, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
772 const uint16_t *ifac, const complex_t *wa, |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
773 const int8_t isign) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
774 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
775 uint16_t i; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
776 uint16_t k1, l1, l2; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
777 uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
778 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
779 nf = ifac[1]; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
780 na = 0; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
781 l1 = 1; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
782 iw = 0; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
783 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
784 for (k1 = 2; k1 <= nf+1; k1++) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
785 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
786 ip = ifac[k1]; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
787 l2 = ip*l1; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
788 ido = n / l2; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
789 idl1 = ido*l1; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
790 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
791 switch (ip) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
792 { |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
793 case 4: |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
794 ix2 = iw + ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
795 ix3 = ix2 + ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
796 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
797 if (na == 0) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
798 passf4neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
799 else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
800 passf4neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
801 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
802 na = 1 - na; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
803 break; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
804 case 2: |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
805 if (na == 0) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
806 passf2neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
807 else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
808 passf2neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
809 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
810 na = 1 - na; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
811 break; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
812 case 3: |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
813 ix2 = iw + ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
814 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
815 if (na == 0) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
816 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
817 else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
818 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
819 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
820 na = 1 - na; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
821 break; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
822 case 5: |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
823 ix2 = iw + ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
824 ix3 = ix2 + ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
825 ix4 = ix3 + ido; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
826 |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
827 if (na == 0) |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
828 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
829 else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
830 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign); |
61 | 831 |
832 na = 1 - na; | |
833 break; | |
834 } | |
835 | |
836 l1 = l2; | |
837 iw += (ip-1) * ido; | |
838 } | |
839 | |
840 if (na == 0) | |
841 return; | |
842 | |
843 for (i = 0; i < n; i++) | |
844 { | |
845 RE(c[i]) = RE(ch[i]); | |
846 IM(c[i]) = IM(ch[i]); | |
847 } | |
848 } | |
849 | |
850 void cfftf(cfft_info *cfft, complex_t *c) | |
851 { | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
852 cfftf1neg(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, -1); |
61 | 853 } |
854 | |
855 void cfftb(cfft_info *cfft, complex_t *c) | |
856 { | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
857 cfftf1pos(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, +1); |
61 | 858 } |
859 | |
860 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac) | |
861 { | |
862 static uint16_t ntryh[4] = {3, 4, 2, 5}; | |
863 #ifndef FIXED_POINT | |
864 real_t arg, argh, argld, fi; | |
865 uint16_t ido, ipm; | |
866 uint16_t i1, k1, l1, l2; | |
867 uint16_t ld, ii, ip; | |
868 #endif | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
869 uint16_t ntry = 0, i, j; |
61 | 870 uint16_t ib; |
871 uint16_t nf, nl, nq, nr; | |
872 | |
873 nl = n; | |
874 nf = 0; | |
875 j = 0; | |
876 | |
877 startloop: | |
878 j++; | |
879 | |
880 if (j <= 4) | |
881 ntry = ntryh[j-1]; | |
882 else | |
883 ntry += 2; | |
884 | |
885 do | |
886 { | |
887 nq = nl / ntry; | |
888 nr = nl - ntry*nq; | |
889 | |
890 if (nr != 0) | |
891 goto startloop; | |
892 | |
893 nf++; | |
894 ifac[nf+1] = ntry; | |
895 nl = nq; | |
896 | |
897 if (ntry == 2 && nf != 1) | |
898 { | |
899 for (i = 2; i <= nf; i++) | |
900 { | |
901 ib = nf - i + 2; | |
902 ifac[ib+1] = ifac[ib]; | |
903 } | |
904 ifac[2] = 2; | |
905 } | |
906 } while (nl != 1); | |
907 | |
908 ifac[0] = n; | |
909 ifac[1] = nf; | |
910 | |
911 #ifndef FIXED_POINT | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
912 argh = (real_t)2.0*(real_t)M_PI / (real_t)n; |
61 | 913 i = 0; |
914 l1 = 1; | |
915 | |
916 for (k1 = 1; k1 <= nf; k1++) | |
917 { | |
918 ip = ifac[k1+1]; | |
919 ld = 0; | |
920 l2 = l1*ip; | |
921 ido = n / l2; | |
922 ipm = ip - 1; | |
923 | |
924 for (j = 0; j < ipm; j++) | |
925 { | |
926 i1 = i; | |
927 RE(wa[i]) = 1.0; | |
928 IM(wa[i]) = 0.0; | |
929 ld += l1; | |
930 fi = 0; | |
931 argld = ld*argh; | |
932 | |
933 for (ii = 0; ii < ido; ii++) | |
934 { | |
935 i++; | |
936 fi++; | |
937 arg = fi * argld; | |
938 RE(wa[i]) = (real_t)cos(arg); | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
939 #if 1 |
61 | 940 IM(wa[i]) = (real_t)sin(arg); |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
941 #else |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
942 IM(wa[i]) = (real_t)-sin(arg); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
943 #endif |
61 | 944 } |
945 | |
946 if (ip > 5) | |
947 { | |
948 RE(wa[i1]) = RE(wa[i]); | |
949 IM(wa[i1]) = IM(wa[i]); | |
950 } | |
951 } | |
952 l1 = l2; | |
953 } | |
954 #endif | |
955 } | |
956 | |
957 cfft_info *cffti(uint16_t n) | |
958 { | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
959 cfft_info *cfft = (cfft_info*)faad_malloc(sizeof(cfft_info)); |
61 | 960 |
961 cfft->n = n; | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
962 cfft->work = (complex_t*)faad_malloc(n*sizeof(complex_t)); |
61 | 963 |
964 #ifndef FIXED_POINT | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
965 cfft->tab = (complex_t*)faad_malloc(n*sizeof(complex_t)); |
61 | 966 |
967 cffti1(n, cfft->tab, cfft->ifac); | |
968 #else | |
969 cffti1(n, NULL, cfft->ifac); | |
970 | |
971 switch (n) | |
972 { | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
973 case 64: cfft->tab = (complex_t*)cfft_tab_64; break; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
974 case 512: cfft->tab = (complex_t*)cfft_tab_512; break; |
61 | 975 #ifdef LD_DEC |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
976 case 256: cfft->tab = (complex_t*)cfft_tab_256; break; |
61 | 977 #endif |
978 | |
979 #ifdef ALLOW_SMALL_FRAMELENGTH | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
980 case 60: cfft->tab = (complex_t*)cfft_tab_60; break; |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
981 case 480: cfft->tab = (complex_t*)cfft_tab_480; break; |
61 | 982 #ifdef LD_DEC |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
983 case 240: cfft->tab = (complex_t*)cfft_tab_240; break; |
61 | 984 #endif |
985 #endif | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
986 case 128: cfft->tab = (complex_t*)cfft_tab_128; break; |
61 | 987 } |
988 #endif | |
989 | |
990 return cfft; | |
991 } | |
992 | |
993 void cfftu(cfft_info *cfft) | |
994 { | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
995 if (cfft->work) faad_free(cfft->work); |
61 | 996 #ifndef FIXED_POINT |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
997 if (cfft->tab) faad_free(cfft->tab); |
61 | 998 #endif |
999 | |
199
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
1000 if (cfft) faad_free(cfft); |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
1001 } |
0a2ad94e8607
[svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents:
61
diff
changeset
|
1002 |