annotate libfaad2/cfft.c @ 11530:6d4ffbc33238

Added a patch from Anders Rune Jensen to support the latest em8300 CVS changes
author mswitch
date Fri, 28 Nov 2003 20:49:34 +0000
parents 3185f64f6350
children 4a370c80fe5c
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 **
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
25 ** $Id: cfft.c,v 1.1 2003/08/30 22:30:21 arpi Exp $
10725
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 RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
69 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
10725
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
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
82 RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
83 RE(t2) = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
84
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
85 IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
86 IM(t2) = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
87
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
88 RE(ch[ah+i+l1*ido]) = MUL_R_C(RE(t2),RE(wa[i])) - MUL_R_C(IM(t2),IM(wa[i]))*isign;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
89 IM(ch[ah+i+l1*ido]) = MUL_R_C(IM(t2),RE(wa[i])) + MUL_R_C(RE(t2),IM(wa[i]))*isign;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
90 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
91 }
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 static void passf3(uint16_t ido, uint16_t l1, complex_t *cc, complex_t *ch,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
97 complex_t *wa1, complex_t *wa2, int8_t isign)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
98 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
99 static real_t taur = COEF_CONST(-0.5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
100 static real_t taui = COEF_CONST(0.866025403784439);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
101 uint16_t i, k, ac, ah;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
102 complex_t c2, c3, d2, d3, t2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
103
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
104 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
105 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
106 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
107 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
108 ac = 3*k+1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
109 ah = k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
110
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
111 RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
112 IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
113 RE(c2) = RE(cc[ac-1]) + MUL_R_C(RE(t2),taur);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
114 IM(c2) = IM(cc[ac-1]) + MUL_R_C(IM(t2),taur);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
115
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
116 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
117 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
118
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
119 RE(c3) = MUL_R_C((RE(cc[ac]) - RE(cc[ac+1])), taui)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
120 IM(c3) = MUL_R_C((IM(cc[ac]) - IM(cc[ac+1])), taui)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
121
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
122 RE(ch[ah+l1]) = RE(c2) - IM(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
123 IM(ch[ah+l1]) = IM(c2) + RE(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
124 RE(ch[ah+2*l1]) = RE(c2) + IM(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
125 IM(ch[ah+2*l1]) = IM(c2) - RE(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
126 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
127 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
128 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
129 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
130 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
131 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
132 ac = i + (3*k+1)*ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
133 ah = i + k * ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
134
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
135 RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
136 RE(c2) = RE(cc[ac-ido]) + MUL_R_C(RE(t2),taur);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
137 IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
138 IM(c2) = IM(cc[ac-ido]) + MUL_R_C(IM(t2),taur);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
139
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
140 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
141 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
142
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
143 RE(c3) = MUL_R_C((RE(cc[ac]) - RE(cc[ac+ido])), taui)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
144 IM(c3) = MUL_R_C((IM(cc[ac]) - IM(cc[ac+ido])), taui)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
145
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
146 RE(d2) = RE(c2) - IM(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
147 IM(d3) = IM(c2) - RE(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
148 RE(d3) = RE(c2) + IM(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
149 IM(d2) = IM(c2) + RE(c3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
150
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
151 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
152 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
153 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
154 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
155 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
156 }
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 static void passf4(uint16_t ido, uint16_t l1, complex_t *cc, complex_t *ch,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
162 complex_t *wa1, complex_t *wa2, complex_t *wa3, int8_t isign)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
163 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
164 uint16_t i, k, ac, ah;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
165
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
166 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
167 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
168 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
169 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
170 complex_t t1, t2, t3, t4;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
171
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
172 ac = 4*k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
173 ah = k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
174
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
175 RE(t2) = RE(cc[ac]) + RE(cc[ac+2]);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
176 RE(t1) = RE(cc[ac]) - RE(cc[ac+2]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
177 IM(t2) = IM(cc[ac]) + IM(cc[ac+2]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
178 IM(t1) = IM(cc[ac]) - IM(cc[ac+2]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
179 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
180 IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
181 IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
10725
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
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
184 RE(ch[ah]) = RE(t2) + RE(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
185 RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
186
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
187 IM(ch[ah]) = IM(t2) + IM(t3);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
188 IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
189
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
190 RE(ch[ah+l1]) = RE(t1) + RE(t4)*isign;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
191 RE(ch[ah+3*l1]) = RE(t1) - RE(t4)*isign;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
192
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
193 IM(ch[ah+l1]) = IM(t1) + IM(t4)*isign;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
194 IM(ch[ah+3*l1]) = IM(t1) - IM(t4)*isign;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
195 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
196 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
197 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
198 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
199 ac = 4*k*ido;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
200 ah = k*ido;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
201
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
202 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
203 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
204 complex_t c2, c3, c4, t1, t2, t3, t4;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
205
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
206 RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
207 RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
208 IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
209 IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
210 RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
211 IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
212 IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
213 RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
214
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
215 RE(c2) = RE(t1) + RE(t4)*isign;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
216 RE(c4) = RE(t1) - RE(t4)*isign;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
217
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
218 IM(c2) = IM(t1) + IM(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
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
221 RE(ch[ah+i]) = RE(t2) + RE(t3);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
222 RE(c3) = RE(t2) - RE(t3);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
223
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
224 IM(ch[ah+i]) = IM(t2) + IM(t3);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
225 IM(c3) = IM(t2) - IM(t3);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
226
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
227 IM(ch[ah+i+l1*ido]) = MUL_R_C(IM(c2),RE(wa1[i])) + MUL_R_C(RE(c2),IM(wa1[i]))*isign;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
228 RE(ch[ah+i+l1*ido]) = MUL_R_C(RE(c2),RE(wa1[i])) - MUL_R_C(IM(c2),IM(wa1[i]))*isign;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
229 IM(ch[ah+i+2*l1*ido]) = MUL_R_C(IM(c3),RE(wa2[i])) + MUL_R_C(RE(c3),IM(wa2[i]))*isign;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
230 RE(ch[ah+i+2*l1*ido]) = MUL_R_C(RE(c3),RE(wa2[i])) - MUL_R_C(IM(c3),IM(wa2[i]))*isign;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
231 IM(ch[ah+i+3*l1*ido]) = MUL_R_C(IM(c4),RE(wa3[i])) + MUL_R_C(RE(c4),IM(wa3[i]))*isign;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
232 RE(ch[ah+i+3*l1*ido]) = MUL_R_C(RE(c4),RE(wa3[i])) - MUL_R_C(IM(c4),IM(wa3[i]))*isign;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
233 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
234 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
235 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
236 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
237
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
238
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
239 static void passf5(uint16_t ido, uint16_t l1, complex_t *cc, complex_t *ch,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
240 complex_t *wa1, complex_t *wa2, complex_t *wa3, complex_t *wa4,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
241 int8_t isign)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
242 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
243 static real_t tr11 = COEF_CONST(0.309016994374947);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
244 static real_t ti11 = COEF_CONST(0.951056516295154);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
245 static real_t tr12 = COEF_CONST(-0.809016994374947);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
246 static real_t ti12 = COEF_CONST(0.587785252292473);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
247 uint16_t i, k, ac, ah;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
248 complex_t c2, c3, c4, c5, d3, d4, d5, d2, t2, t3, t4, t5;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
249
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
250 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
251 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
252 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
253 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
254 ac = 5*k + 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
255 ah = k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
256
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
257 RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
258 IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
259 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
260 IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
261 RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
262 IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
263 RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
264 IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
265
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
266 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
267 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
268
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
269 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
270 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
271 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
272 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
273 RE(c4) = (MUL_R_C(RE(t5),ti12)*isign - MUL_R_C(RE(t4),ti11));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
274 IM(c4) = (MUL_R_C(IM(t5),ti12)*isign - MUL_R_C(IM(t4),ti11));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
275 RE(c5) = (MUL_R_C(RE(t5),ti11)*isign + MUL_R_C(RE(t4),ti12));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
276 IM(c5) = (MUL_R_C(IM(t5),ti11)*isign + MUL_R_C(IM(t4),ti12));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
277
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
278 RE(ch[ah+l1]) = RE(c2) - IM(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
279 IM(ch[ah+l1]) = IM(c2) + RE(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
280 RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
281 IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
282 RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
283 IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
284 RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
285 IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
286 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
287 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
288 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
289 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
290 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
291 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
292 ac = i + (k*5 + 1) * ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
293 ah = i + k * ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
294
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
295 RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
296 IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
297 RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
298 IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
299 RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
300 IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
301 RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
302 IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
303
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
304 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
305 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
306
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
307 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
308 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
309 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
310 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
311 RE(c4) = (MUL_R_C(RE(t5),ti12)*isign - MUL_R_C(RE(t4),ti11));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
312 IM(c4) = (MUL_R_C(IM(t5),ti12)*isign - MUL_R_C(IM(t4),ti11));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
313 RE(c5) = (MUL_R_C(RE(t5),ti11)*isign + MUL_R_C(RE(t4),ti12));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
314 IM(c5) = (MUL_R_C(IM(t5),ti11)*isign + MUL_R_C(IM(t4),ti12));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
315
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
316 IM(d2) = IM(c2) + RE(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
317 IM(d3) = IM(c3) + RE(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
318 RE(d4) = RE(c3) + IM(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
319 RE(d5) = RE(c2) + IM(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
320 RE(d2) = RE(c2) - IM(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
321 IM(d5) = IM(c2) - RE(c5);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
322 RE(d3) = RE(c3) - IM(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
323 IM(d4) = IM(c3) - RE(c4);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
324
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
325 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
326 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
327 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
328 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
329 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
330 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
331 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
332 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
333 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
334 }
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
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
338
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
339 /*----------------------------------------------------------------------
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
340 cfftf1, cfftf, cfftb, cffti1, cffti. Complex FFTs.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
341 ----------------------------------------------------------------------*/
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
342
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
343 INLINE void cfftf1(uint16_t n, complex_t *c, complex_t *ch,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
344 uint16_t *ifac, complex_t *wa, int8_t isign)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
345 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
346 uint16_t i;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
347 uint16_t k1, l1, l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
348 uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
349
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
350 nf = ifac[1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
351 na = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
352 l1 = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
353 iw = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
354
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
355 for (k1 = 2; k1 <= nf+1; k1++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
356 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
357 ip = ifac[k1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
358 l2 = ip*l1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
359 ido = n / l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
360 idl1 = ido*l1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
361
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
362 switch (ip)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
363 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
364 case 4:
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
365 ix2 = iw + ido;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
366 ix3 = ix2 + ido;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
367
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
368 if (na == 0)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
369 passf4(ido, l1, c, ch, &wa[iw], &wa[ix2], &wa[ix3], isign);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
370 else
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
371 passf4(ido, l1, ch, c, &wa[iw], &wa[ix2], &wa[ix3], isign);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
372
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
373 na = 1 - na;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
374 break;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
375 case 2:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
376 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
377 passf2(ido, l1, c, ch, &wa[iw], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
378 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
379 passf2(ido, l1, ch, c, &wa[iw], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
380
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
381 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
382 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
383 case 3:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
384 ix2 = iw + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
385
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
386 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
387 passf3(ido, l1, c, ch, &wa[iw], &wa[ix2], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
388 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
389 passf3(ido, l1, ch, c, &wa[iw], &wa[ix2], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
390
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
391 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
392 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
393 case 5:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
394 ix2 = iw + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
395 ix3 = ix2 + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
396 ix4 = ix3 + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
397
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
398 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
399 passf5(ido, l1, c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
400 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
401 passf5(ido, l1, ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
402
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
403 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
404 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
405 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
406
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
407 l1 = l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
408 iw += (ip-1) * ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
409 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
410
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
411 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
412 return;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
413
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
414 for (i = 0; i < n; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
415 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
416 RE(c[i]) = RE(ch[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
417 IM(c[i]) = IM(ch[i]);
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
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
421 void cfftf(cfft_info *cfft, complex_t *c)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
422 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
423 cfftf1(cfft->n, c, cfft->work, cfft->ifac, cfft->tab, -1);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
424 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
425
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
426 void cfftb(cfft_info *cfft, complex_t *c)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
427 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
428 cfftf1(cfft->n, c, cfft->work, cfft->ifac, cfft->tab, +1);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
429 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
430
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
431 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
432 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
433 static uint16_t ntryh[4] = {3, 4, 2, 5};
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
434 #ifndef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
435 real_t arg, argh, argld, fi;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
436 uint16_t ido, ipm;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
437 uint16_t i1, k1, l1, l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
438 uint16_t ld, ii, ip;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
439 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
440 uint16_t ntry, i, j;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
441 uint16_t ib;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
442 uint16_t nf, nl, nq, nr;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
443
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
444 nl = n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
445 nf = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
446 j = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
447
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
448 startloop:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
449 j++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
450
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
451 if (j <= 4)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
452 ntry = ntryh[j-1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
453 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
454 ntry += 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
455
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
456 do
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
457 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
458 nq = nl / ntry;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
459 nr = nl - ntry*nq;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
460
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
461 if (nr != 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
462 goto startloop;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
463
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
464 nf++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
465 ifac[nf+1] = ntry;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
466 nl = nq;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
467
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
468 if (ntry == 2 && nf != 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
469 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
470 for (i = 2; i <= nf; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
471 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
472 ib = nf - i + 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
473 ifac[ib+1] = ifac[ib];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
474 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
475 ifac[2] = 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
476 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
477 } while (nl != 1);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
478
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
479 ifac[0] = n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
480 ifac[1] = nf;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
481
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
482 #ifndef FIXED_POINT
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
483 argh = (real_t)2.0*M_PI / (real_t)n;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
484 i = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
485 l1 = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
486
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
487 for (k1 = 1; k1 <= nf; k1++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
488 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
489 ip = ifac[k1+1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
490 ld = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
491 l2 = l1*ip;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
492 ido = n / l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
493 ipm = ip - 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
494
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
495 for (j = 0; j < ipm; j++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
496 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
497 i1 = i;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
498 RE(wa[i]) = 1.0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
499 IM(wa[i]) = 0.0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
500 ld += l1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
501 fi = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
502 argld = ld*argh;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
503
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
504 for (ii = 0; ii < ido; ii++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
505 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
506 i++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
507 fi++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
508 arg = fi * argld;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
509 RE(wa[i]) = (real_t)cos(arg);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
510 IM(wa[i]) = (real_t)sin(arg);
10725
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 if (ip > 5)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
514 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
515 RE(wa[i1]) = RE(wa[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
516 IM(wa[i1]) = IM(wa[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
517 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
518 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
519 l1 = l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
520 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
521 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
522 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
523
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
524 cfft_info *cffti(uint16_t n)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
525 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
526 cfft_info *cfft = (cfft_info*)malloc(sizeof(cfft_info));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
527
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
528 cfft->n = n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
529 cfft->work = (complex_t*)malloc(n*sizeof(complex_t));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
530
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
531 #ifndef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
532 cfft->tab = (complex_t*)malloc(n*sizeof(complex_t));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
533
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
534 cffti1(n, cfft->tab, cfft->ifac);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
535 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
536 cffti1(n, NULL, cfft->ifac);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
537
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
538 switch (n)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
539 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
540 case 60: cfft->tab = cfft_tab_60; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
541 case 64: cfft->tab = cfft_tab_64; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
542 case 480: cfft->tab = cfft_tab_480; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
543 case 512: cfft->tab = cfft_tab_512; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
544 #ifdef LD_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
545 case 240: cfft->tab = cfft_tab_240; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
546 case 256: cfft->tab = cfft_tab_256; break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
547 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
548 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
549 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
550
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
551 return cfft;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
552 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
553
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
554 void cfftu(cfft_info *cfft)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
555 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
556 if (cfft->work) free(cfft->work);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
557 #ifndef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
558 if (cfft->tab) free(cfft->tab);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
559 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
560
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
561 if (cfft) free(cfft);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
562 }