annotate libfaad2/cfft.c @ 17689:351c4f61140f

synced with 1.101
author gabrov
date Sun, 26 Feb 2006 12:39:17 +0000
parents 2ae5ab4331ca
children 59b6fa5b4201
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
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
4 **
10725
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.
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
9 **
10725
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.
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
14 **
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
15 ** You should have received a copy of the GNU General Public License
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
16 ** along with this program; if not, write to the Free Software
10725
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 **
14727
2ae5ab4331ca Remove modification notice from files that have not been locally modified.
diego
parents: 13453
diff changeset
25 ** $Id: cfft.c,v 1.27 2004/06/30 12:45:55 menno 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
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
42 #include "cfft.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
43 #include "cfft_tab.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
44
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
45
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
46 /* static function declarations */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
47 #ifdef USE_SSE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
48 static void passf2pos_sse(const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
49 complex_t *ch, const complex_t *wa);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
50 static void passf2pos_sse_ido(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
51 complex_t *ch, const complex_t *wa);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
52 static void passf4pos_sse_ido(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
53 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
54 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
55 static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
56 complex_t *ch, const complex_t *wa);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
57 static void passf2neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
58 complex_t *ch, const complex_t *wa);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
59 static void passf3(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
60 complex_t *ch, const complex_t *wa1, const complex_t *wa2, const int8_t isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
61 static void passf4pos(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
62 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
63 static void passf4neg(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
64 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
65 static void passf5(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
66 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
67 const complex_t *wa4, const int8_t isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
68 INLINE void cfftf1(uint16_t n, complex_t *c, complex_t *ch,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
69 const uint16_t *ifac, const complex_t *wa, const int8_t isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
70 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
71
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
72
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
73 /*----------------------------------------------------------------------
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
74 passf2, passf3, passf4, passf5. Complex FFT passes fwd and bwd.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
75 ----------------------------------------------------------------------*/
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
76
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
77 #if 0 //def USE_SSE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
78 static void passf2pos_sse(const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
79 complex_t *ch, const complex_t *wa)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
80 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
81 uint16_t k, ah, ac;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
82
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
83 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
84 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
85 ah = 2*k;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
86 ac = 4*k;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
87
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
88 RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
89 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
90
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
91 RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
92 IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
93 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
94 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
95
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
96 static void passf2pos_sse_ido(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
97 complex_t *ch, const complex_t *wa)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
98 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
99 uint16_t i, k, ah, ac;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
100
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
101 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
102 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
103 ah = k*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
104 ac = 2*k*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
105
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
106 for (i = 0; i < ido; i+=4)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
107 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
108 __m128 m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
109 __m128 m15, m16, m17, m18, m19, m20, m21, m22, m23, m24;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
110 __m128 w1, w2, w3, w4;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
111
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
112 m1 = _mm_load_ps(&RE(cc[ac+i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
113 m2 = _mm_load_ps(&RE(cc[ac+ido+i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
114 m5 = _mm_load_ps(&RE(cc[ac+i+2]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
115 m6 = _mm_load_ps(&RE(cc[ac+ido+i+2]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
116 w1 = _mm_load_ps(&RE(wa[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
117 w3 = _mm_load_ps(&RE(wa[i+2]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
118
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
119 m3 = _mm_add_ps(m1, m2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
120 m15 = _mm_add_ps(m5, m6);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
121
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
122 m4 = _mm_sub_ps(m1, m2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
123 m16 = _mm_sub_ps(m5, m6);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
124
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
125 _mm_store_ps(&RE(ch[ah+i]), m3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
126 _mm_store_ps(&RE(ch[ah+i+2]), m15);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
127
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
128
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
129 w2 = _mm_shuffle_ps(w1, w1, _MM_SHUFFLE(2, 3, 0, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
130 w4 = _mm_shuffle_ps(w3, w3, _MM_SHUFFLE(2, 3, 0, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
131
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
132 m7 = _mm_mul_ps(m4, w1);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
133 m17 = _mm_mul_ps(m16, w3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
134 m8 = _mm_mul_ps(m4, w2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
135 m18 = _mm_mul_ps(m16, w4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
136
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
137 m9 = _mm_shuffle_ps(m7, m8, _MM_SHUFFLE(2, 0, 2, 0));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
138 m19 = _mm_shuffle_ps(m17, m18, _MM_SHUFFLE(2, 0, 2, 0));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
139 m10 = _mm_shuffle_ps(m7, m8, _MM_SHUFFLE(3, 1, 3, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
140 m20 = _mm_shuffle_ps(m17, m18, _MM_SHUFFLE(3, 1, 3, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
141
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
142 m11 = _mm_add_ps(m9, m10);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
143 m21 = _mm_add_ps(m19, m20);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
144 m12 = _mm_sub_ps(m9, m10);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
145 m22 = _mm_sub_ps(m19, m20);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
146
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
147 m13 = _mm_shuffle_ps(m11, m11, _MM_SHUFFLE(0, 0, 3, 2));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
148 m23 = _mm_shuffle_ps(m21, m21, _MM_SHUFFLE(0, 0, 3, 2));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
149
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
150 m14 = _mm_unpacklo_ps(m12, m13);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
151 m24 = _mm_unpacklo_ps(m22, m23);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
152
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
153 _mm_store_ps(&RE(ch[ah+i+l1*ido]), m14);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
154 _mm_store_ps(&RE(ch[ah+i+2+l1*ido]), m24);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
155 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
156 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
157 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
158 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
159
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
160 static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
161 complex_t *ch, const complex_t *wa)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
162 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
163 uint16_t i, k, ah, ac;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
164
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
165 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
166 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
167 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
168 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
169 ah = 2*k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
170 ac = 4*k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
171
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
172 RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
173 RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
174 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
175 IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
176 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
177 } else {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
178 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
179 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
180 ah = k*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
181 ac = 2*k*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
182
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
183 for (i = 0; i < ido; i++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
184 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
185 complex_t t2;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
186
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
187 RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
188 RE(t2) = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
189
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
190 IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
191 IM(t2) = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
192
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
193 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
194 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
195 IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
196 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
197 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
198 RE(t2), IM(t2), RE(wa[i]), IM(wa[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
199 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
200 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
201 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
202 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
203 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
204
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
205 static void passf2neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
206 complex_t *ch, const complex_t *wa)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
207 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
208 uint16_t i, k, ah, ac;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
209
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
210 if (ido == 1)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
211 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
212 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
213 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
214 ah = 2*k;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
215 ac = 4*k;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
216
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
217 RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
218 RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
219 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
220 IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
221 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
222 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
223 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
224 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
225 ah = k*ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
226 ac = 2*k*ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
227
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
228 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
229 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
230 complex_t t2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
231
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
232 RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
233 RE(t2) = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
234
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
235 IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
236 IM(t2) = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
237
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
238 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
239 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
240 RE(t2), IM(t2), RE(wa[i]), IM(wa[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
241 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
242 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
243 IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
244 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
245 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
246 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
247 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
248 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
249
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
250
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
251 static void passf3(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
252 complex_t *ch, const complex_t *wa1, const complex_t *wa2,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
253 const int8_t isign)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
254 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
255 static real_t taur = FRAC_CONST(-0.5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
256 static real_t taui = FRAC_CONST(0.866025403784439);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
257 uint16_t i, k, ac, ah;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
258 complex_t c2, c3, d2, d3, t2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
259
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
260 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
261 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
262 if (isign == 1)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
263 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
264 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
265 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
266 ac = 3*k+1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
267 ah = k;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
268
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
269 RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
270 IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
271 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
272 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
273
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
274 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
275 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
276
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
277 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
278 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
279
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
280 RE(ch[ah+l1]) = RE(c2) - IM(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
281 IM(ch[ah+l1]) = IM(c2) + RE(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
282 RE(ch[ah+2*l1]) = RE(c2) + IM(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
283 IM(ch[ah+2*l1]) = IM(c2) - RE(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
284 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
285 } else {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
286 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
287 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
288 ac = 3*k+1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
289 ah = k;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
290
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
291 RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
292 IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
293 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
294 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
295
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
296 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
297 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
298
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
299 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
300 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
301
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
302 RE(ch[ah+l1]) = RE(c2) + IM(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
303 IM(ch[ah+l1]) = IM(c2) - RE(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
304 RE(ch[ah+2*l1]) = RE(c2) - IM(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
305 IM(ch[ah+2*l1]) = IM(c2) + RE(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
306 }
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
307 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
308 } else {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
309 if (isign == 1)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
310 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
311 for (k = 0; k < l1; k++)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
312 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
313 for (i = 0; i < ido; i++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
314 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
315 ac = i + (3*k+1)*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
316 ah = i + k * ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
317
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
318 RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
319 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
320 IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
321 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
322
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
323 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
324 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
325
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
326 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
327 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
328
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
329 RE(d2) = RE(c2) - IM(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
330 IM(d3) = IM(c2) - RE(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
331 RE(d3) = RE(c2) + IM(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
332 IM(d2) = IM(c2) + RE(c3);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
333
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
334 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
335 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
336 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
337 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
338 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
339 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
340 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
341 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
342 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
343 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
344 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
345 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
346 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
347 } else {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
348 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
349 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
350 for (i = 0; i < ido; i++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
351 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
352 ac = i + (3*k+1)*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
353 ah = i + k * ido;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
354
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
355 RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
356 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
357 IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
358 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
359
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
360 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
361 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
362
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
363 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
364 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
365
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
366 RE(d2) = RE(c2) + IM(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
367 IM(d3) = IM(c2) + RE(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
368 RE(d3) = RE(c2) - IM(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
369 IM(d2) = IM(c2) - RE(c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
370
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
371 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
372 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
373 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
374 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
375 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
376 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
377 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
378 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
379 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
380 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
381 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
382 }
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
383 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
384 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
385 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
386 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
387
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
388 #ifdef USE_SSE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
389 ALIGN static const int32_t negate[4] = { 0x0, 0x0, 0x0, 0x80000000 };
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
390
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
391 __declspec(naked) static void passf4pos_sse(const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
392 complex_t *ch, const complex_t *wa1, const complex_t *wa2,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
393 const complex_t *wa3)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
394 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
395 __asm {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
396 push ebx
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
397 mov ebx, esp
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
398 and esp, -16
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
399 push edi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
400 push esi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
401 sub esp, 8
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
402 movzx edi, WORD PTR [ebx+8]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
403
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
404 movaps xmm1, XMMWORD PTR negate
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
405
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
406 test edi, edi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
407 jle l1_is_zero
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
408
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
409 lea esi, DWORD PTR [edi+edi]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
410 add esi, esi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
411 sub esi, edi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
412 add esi, esi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
413 add esi, esi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
414 add esi, esi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
415 mov eax, DWORD PTR [ebx+16]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
416 add esi, eax
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
417 lea ecx, DWORD PTR [edi+edi]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
418 add ecx, ecx
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
419 add ecx, ecx
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
420 add ecx, ecx
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
421 add ecx, eax
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
422 lea edx, DWORD PTR [edi+edi]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
423 add edx, edx
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
424 add edx, edx
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
425 add edx, eax
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
426 xor eax, eax
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
427 mov DWORD PTR [esp], ebp
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
428 mov ebp, DWORD PTR [ebx+12]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
429
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
430 fftloop:
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
431 lea edi, DWORD PTR [eax+eax]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
432 add edi, edi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
433 movaps xmm2, XMMWORD PTR [ebp+edi*8]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
434 movaps xmm0, XMMWORD PTR [ebp+edi*8+16]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
435 movaps xmm7, XMMWORD PTR [ebp+edi*8+32]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
436 movaps xmm5, XMMWORD PTR [ebp+edi*8+48]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
437 movaps xmm6, xmm2
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
438 addps xmm6, xmm0
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
439 movaps xmm4, xmm1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
440 xorps xmm4, xmm7
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
441 movaps xmm3, xmm1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
442 xorps xmm3, xmm5
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
443 xorps xmm2, xmm1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
444 xorps xmm0, xmm1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
445 addps xmm7, xmm5
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
446 subps xmm2, xmm0
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
447 movaps xmm0, xmm6
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
448 shufps xmm0, xmm7, 68
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
449 subps xmm4, xmm3
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
450 shufps xmm6, xmm7, 238
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
451 movaps xmm5, xmm2
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
452 shufps xmm5, xmm4, 68
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
453 movaps xmm3, xmm0
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
454 addps xmm3, xmm6
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
455 shufps xmm2, xmm4, 187
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
456 subps xmm0, xmm6
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
457 movaps xmm4, xmm5
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
458 addps xmm4, xmm2
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
459 mov edi, DWORD PTR [ebx+16]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
460 movaps XMMWORD PTR [edi+eax*8], xmm3
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
461 subps xmm5, xmm2
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
462 movaps XMMWORD PTR [edx+eax*8], xmm4
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
463 movaps XMMWORD PTR [ecx+eax*8], xmm0
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
464 movaps XMMWORD PTR [esi+eax*8], xmm5
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
465 add eax, 2
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
466 movzx eax, ax
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
467 movzx edi, WORD PTR [ebx+8]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
468 cmp eax, edi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
469 jl fftloop
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
470
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
471 mov ebp, DWORD PTR [esp]
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
472
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
473 l1_is_zero:
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
474
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
475 add esp, 8
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
476 pop esi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
477 pop edi
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
478 mov esp, ebx
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
479 pop ebx
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
480 ret
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
481 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
482 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
483 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
484
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
485 #if 0
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
486 static void passf4pos_sse_ido(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
487 complex_t *ch, const complex_t *wa1, const complex_t *wa2,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
488 const complex_t *wa3)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
489 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
490 uint16_t i, k, ac, ah;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
491
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
492 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
493 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
494 ac = 4*k*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
495 ah = k*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
496
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
497 for (i = 0; i < ido; i+=2)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
498 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
499 __m128 m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15, m16;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
500 __m128 n1, n2, n3, n4, n5, n6, n7, n8, n9, m17, m18, m19, m20, m21, m22, m23;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
501 __m128 w1, w2, w3, w4, w5, w6, m24, m25, m26, m27, m28, m29, m30;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
502 __m128 neg1 = _mm_set_ps(-1.0, 1.0, -1.0, 1.0);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
503
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
504 m1 = _mm_load_ps(&RE(cc[ac+i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
505 m2 = _mm_load_ps(&RE(cc[ac+i+2*ido]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
506 m3 = _mm_add_ps(m1, m2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
507 m4 = _mm_sub_ps(m1, m2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
508
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
509 n1 = _mm_load_ps(&RE(cc[ac+i+ido]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
510 n2 = _mm_load_ps(&RE(cc[ac+i+3*ido]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
511 n3 = _mm_add_ps(n1, n2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
512
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
513 n4 = _mm_mul_ps(neg1, n1);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
514 n5 = _mm_mul_ps(neg1, n2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
515 n6 = _mm_sub_ps(n4, n5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
516
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
517 m5 = _mm_add_ps(m3, n3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
518
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
519 n7 = _mm_shuffle_ps(n6, n6, _MM_SHUFFLE(2, 3, 0, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
520 n8 = _mm_add_ps(m4, n7);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
521
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
522 m6 = _mm_sub_ps(m3, n3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
523 n9 = _mm_sub_ps(m4, n7);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
524
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
525 _mm_store_ps(&RE(ch[ah+i]), m5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
526
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
527 #if 0
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
528 static INLINE void ComplexMult(real_t *y1, real_t *y2,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
529 real_t x1, real_t x2, real_t c1, real_t c2)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
530 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
531 *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
532 *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
533 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
534
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
535 m7.0 = RE(c2)*RE(wa1[i])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
536 m7.1 = IM(c2)*IM(wa1[i])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
537 m7.2 = RE(c6)*RE(wa1[i+1])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
538 m7.3 = IM(c6)*IM(wa1[i+1])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
539
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
540 m8.0 = RE(c2)*IM(wa1[i])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
541 m8.1 = IM(c2)*RE(wa1[i])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
542 m8.2 = RE(c6)*IM(wa1[i+1])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
543 m8.3 = IM(c6)*RE(wa1[i+1])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
544
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
545 RE(0) = m7.0 - m7.1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
546 IM(0) = m8.0 + m8.1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
547 RE(1) = m7.2 - m7.3
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
548 IM(1) = m8.2 + m8.3
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
549
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
550 ////
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
551 RE(0) = RE(c2)*RE(wa1[i]) - IM(c2)*IM(wa1[i])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
552 IM(0) = RE(c2)*IM(wa1[i]) + IM(c2)*RE(wa1[i])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
553 RE(1) = RE(c6)*RE(wa1[i+1]) - IM(c6)*IM(wa1[i+1])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
554 IM(1) = RE(c6)*IM(wa1[i+1]) + IM(c6)*RE(wa1[i+1])
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
555 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
556
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
557 w1 = _mm_load_ps(&RE(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
558 w3 = _mm_load_ps(&RE(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
559 w5 = _mm_load_ps(&RE(wa3[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
560
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
561 w2 = _mm_shuffle_ps(w1, w1, _MM_SHUFFLE(2, 3, 0, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
562 w4 = _mm_shuffle_ps(w3, w3, _MM_SHUFFLE(2, 3, 0, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
563 w6 = _mm_shuffle_ps(w5, w5, _MM_SHUFFLE(2, 3, 0, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
564
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
565 m7 = _mm_mul_ps(n8, w1);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
566 m15 = _mm_mul_ps(m6, w3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
567 m23 = _mm_mul_ps(n9, w5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
568 m8 = _mm_mul_ps(n8, w2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
569 m16 = _mm_mul_ps(m6, w4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
570 m24 = _mm_mul_ps(n9, w6);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
571
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
572 m9 = _mm_shuffle_ps(m7, m8, _MM_SHUFFLE(2, 0, 2, 0));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
573 m17 = _mm_shuffle_ps(m15, m16, _MM_SHUFFLE(2, 0, 2, 0));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
574 m25 = _mm_shuffle_ps(m23, m24, _MM_SHUFFLE(2, 0, 2, 0));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
575 m10 = _mm_shuffle_ps(m7, m8, _MM_SHUFFLE(3, 1, 3, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
576 m18 = _mm_shuffle_ps(m15, m16, _MM_SHUFFLE(3, 1, 3, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
577 m26 = _mm_shuffle_ps(m23, m24, _MM_SHUFFLE(3, 1, 3, 1));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
578
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
579 m11 = _mm_add_ps(m9, m10);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
580 m19 = _mm_add_ps(m17, m18);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
581 m27 = _mm_add_ps(m25, m26);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
582 m12 = _mm_sub_ps(m9, m10);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
583 m20 = _mm_sub_ps(m17, m18);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
584 m28 = _mm_sub_ps(m25, m26);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
585
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
586 m13 = _mm_shuffle_ps(m11, m11, _MM_SHUFFLE(0, 0, 3, 2));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
587 m21 = _mm_shuffle_ps(m19, m19, _MM_SHUFFLE(0, 0, 3, 2));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
588 m29 = _mm_shuffle_ps(m27, m27, _MM_SHUFFLE(0, 0, 3, 2));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
589 m14 = _mm_unpacklo_ps(m12, m13);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
590 m22 = _mm_unpacklo_ps(m20, m21);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
591 m30 = _mm_unpacklo_ps(m28, m29);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
592
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
593 _mm_store_ps(&RE(ch[ah+i+l1*ido]), m14);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
594 _mm_store_ps(&RE(ch[ah+i+2*l1*ido]), m22);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
595 _mm_store_ps(&RE(ch[ah+i+3*l1*ido]), m30);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
596 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
597 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
598 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
599 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
600
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
601 static void passf4pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
602 complex_t *ch, const complex_t *wa1, const complex_t *wa2,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
603 const complex_t *wa3)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
604 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
605 uint16_t i, k, ac, ah;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
606
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
607 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
608 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
609 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
610 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
611 complex_t t1, t2, t3, t4;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
612
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
613 ac = 4*k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
614 ah = k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
615
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
616 RE(t2) = RE(cc[ac]) + RE(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
617 RE(t1) = RE(cc[ac]) - RE(cc[ac+2]);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
618 IM(t2) = IM(cc[ac]) + IM(cc[ac+2]);
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
619 IM(t1) = IM(cc[ac]) - IM(cc[ac+2]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
620 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
621 IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
622 IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
623 RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
624
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
625 RE(ch[ah]) = RE(t2) + RE(t3);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
626 RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
627
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
628 IM(ch[ah]) = IM(t2) + IM(t3);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
629 IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
630
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
631 RE(ch[ah+l1]) = RE(t1) + RE(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
632 RE(ch[ah+3*l1]) = RE(t1) - RE(t4);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
633
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
634 IM(ch[ah+l1]) = IM(t1) + IM(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
635 IM(ch[ah+3*l1]) = IM(t1) - IM(t4);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
636 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
637 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
638 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
639 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
640 ac = 4*k*ido;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
641 ah = k*ido;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
642
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
643 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
644 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
645 complex_t c2, c3, c4, t1, t2, t3, t4;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
646
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
647 RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
648 RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
649 IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
650 IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
651 RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
652 IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
653 IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
654 RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
655
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
656 RE(c2) = RE(t1) + RE(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
657 RE(c4) = RE(t1) - RE(t4);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
658
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
659 IM(c2) = IM(t1) + IM(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
660 IM(c4) = IM(t1) - IM(t4);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
661
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
662 RE(ch[ah+i]) = RE(t2) + RE(t3);
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
663 RE(c3) = RE(t2) - RE(t3);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
664
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
665 IM(ch[ah+i]) = IM(t2) + IM(t3);
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
666 IM(c3) = IM(t2) - IM(t3);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
667
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
668 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
669 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
670 IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
671 ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
672 IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
673 ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
674 IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
675 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
676 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
677 RE(c2), IM(c2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
678 ComplexMult(&RE(ch[ah+i+2*l1*ido]), &IM(ch[ah+i+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
679 RE(c3), IM(c3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
680 ComplexMult(&RE(ch[ah+i+3*l1*ido]), &IM(ch[ah+i+3*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
681 RE(c4), IM(c4), RE(wa3[i]), IM(wa3[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
682 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
683 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
684 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
685 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
686 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
687
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
688 static void passf4neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
689 complex_t *ch, const complex_t *wa1, const complex_t *wa2,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
690 const complex_t *wa3)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
691 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
692 uint16_t i, k, ac, ah;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
693
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
694 if (ido == 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
695 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
696 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
697 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
698 complex_t t1, t2, t3, t4;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
699
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
700 ac = 4*k;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
701 ah = k;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
702
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
703 RE(t2) = RE(cc[ac]) + RE(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
704 RE(t1) = RE(cc[ac]) - RE(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
705 IM(t2) = IM(cc[ac]) + IM(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
706 IM(t1) = IM(cc[ac]) - IM(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
707 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
708 IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
709 IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
710 RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
711
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
712 RE(ch[ah]) = RE(t2) + RE(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
713 RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
714
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
715 IM(ch[ah]) = IM(t2) + IM(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
716 IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
717
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
718 RE(ch[ah+l1]) = RE(t1) - RE(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
719 RE(ch[ah+3*l1]) = RE(t1) + RE(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
720
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
721 IM(ch[ah+l1]) = IM(t1) - IM(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
722 IM(ch[ah+3*l1]) = IM(t1) + IM(t4);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
723 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
724 } else {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
725 for (k = 0; k < l1; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
726 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
727 ac = 4*k*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
728 ah = k*ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
729
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
730 for (i = 0; i < ido; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
731 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
732 complex_t c2, c3, c4, t1, t2, t3, t4;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
733
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
734 RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
735 RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
736 IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
737 IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
738 RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
739 IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
740 IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
741 RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
742
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
743 RE(c2) = RE(t1) - RE(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
744 RE(c4) = RE(t1) + RE(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
745
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
746 IM(c2) = IM(t1) - IM(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
747 IM(c4) = IM(t1) + IM(t4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
748
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
749 RE(ch[ah+i]) = RE(t2) + RE(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
750 RE(c3) = RE(t2) - RE(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
751
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
752 IM(ch[ah+i]) = IM(t2) + IM(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
753 IM(c3) = IM(t2) - IM(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
754
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
755 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
756 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
757 RE(c2), IM(c2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
758 ComplexMult(&RE(ch[ah+i+2*l1*ido]), &IM(ch[ah+i+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
759 RE(c3), IM(c3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
760 ComplexMult(&RE(ch[ah+i+3*l1*ido]), &IM(ch[ah+i+3*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
761 RE(c4), IM(c4), RE(wa3[i]), IM(wa3[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
762 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
763 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
764 IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
765 ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
766 IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
767 ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
768 IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
769 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
770 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
771 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
772 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
773 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
774
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
775 static void passf5(const uint16_t ido, const uint16_t l1, const complex_t *cc,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
776 complex_t *ch, const complex_t *wa1, const complex_t *wa2, const complex_t *wa3,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
777 const complex_t *wa4, const int8_t isign)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
778 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
779 static real_t tr11 = FRAC_CONST(0.309016994374947);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
780 static real_t ti11 = FRAC_CONST(0.951056516295154);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
781 static real_t tr12 = FRAC_CONST(-0.809016994374947);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
782 static real_t ti12 = FRAC_CONST(0.587785252292473);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
783 uint16_t i, k, ac, ah;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
784 complex_t c2, c3, c4, c5, d3, d4, d5, d2, t2, t3, t4, t5;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
785
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
786 if (ido == 1)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
787 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
788 if (isign == 1)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
789 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
790 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
791 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
792 ac = 5*k + 1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
793 ah = k;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
794
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
795 RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
796 IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
797 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
798 IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
799 RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
800 IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
801 RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
802 IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
803
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
804 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
805 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
806
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
807 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
808 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
809 RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
810 IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
811
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
812 ComplexMult(&RE(c5), &RE(c4),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
813 ti11, ti12, RE(t5), RE(t4));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
814 ComplexMult(&IM(c5), &IM(c4),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
815 ti11, ti12, IM(t5), IM(t4));
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
816
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
817 RE(ch[ah+l1]) = RE(c2) - IM(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
818 IM(ch[ah+l1]) = IM(c2) + RE(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
819 RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
820 IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
821 RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
822 IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
823 RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
824 IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
825 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
826 } else {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
827 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
828 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
829 ac = 5*k + 1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
830 ah = k;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
831
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
832 RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
833 IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
834 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
835 IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
836 RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
837 IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
838 RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
839 IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
840
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
841 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
842 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
843
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
844 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
845 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
846 RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
847 IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
848
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
849 ComplexMult(&RE(c4), &RE(c5),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
850 ti12, ti11, RE(t5), RE(t4));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
851 ComplexMult(&IM(c4), &IM(c5),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
852 ti12, ti12, IM(t5), IM(t4));
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
853
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
854 RE(ch[ah+l1]) = RE(c2) + IM(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
855 IM(ch[ah+l1]) = IM(c2) - RE(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
856 RE(ch[ah+2*l1]) = RE(c3) + IM(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
857 IM(ch[ah+2*l1]) = IM(c3) - RE(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
858 RE(ch[ah+3*l1]) = RE(c3) - IM(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
859 IM(ch[ah+3*l1]) = IM(c3) + RE(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
860 RE(ch[ah+4*l1]) = RE(c2) - IM(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
861 IM(ch[ah+4*l1]) = IM(c2) + RE(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
862 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
863 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
864 } else {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
865 if (isign == 1)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
866 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
867 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
868 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
869 for (i = 0; i < ido; i++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
870 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
871 ac = i + (k*5 + 1) * ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
872 ah = i + k * ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
873
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
874 RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
875 IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
876 RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
877 IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
878 RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
879 IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
880 RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
881 IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
882
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
883 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
884 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
885
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
886 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
887 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
888 RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
889 IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
890
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
891 ComplexMult(&RE(c5), &RE(c4),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
892 ti11, ti12, RE(t5), RE(t4));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
893 ComplexMult(&IM(c5), &IM(c4),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
894 ti11, ti12, IM(t5), IM(t4));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
895
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
896 IM(d2) = IM(c2) + RE(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
897 IM(d3) = IM(c3) + RE(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
898 RE(d4) = RE(c3) + IM(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
899 RE(d5) = RE(c2) + IM(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
900 RE(d2) = RE(c2) - IM(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
901 IM(d5) = IM(c2) - RE(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
902 RE(d3) = RE(c3) - IM(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
903 IM(d4) = IM(c3) - RE(c4);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
904
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
905 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
906 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
907 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
908 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
909 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
910 ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
911 IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
912 ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
913 IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
914 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
915 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
916 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
917 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
918 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
919 ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
920 RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
921 ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
922 RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
923 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
924 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
925 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
926 } else {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
927 for (k = 0; k < l1; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
928 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
929 for (i = 0; i < ido; i++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
930 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
931 ac = i + (k*5 + 1) * ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
932 ah = i + k * ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
933
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
934 RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
935 IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
936 RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
937 IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
938 RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
939 IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
940 RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
941 IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
942
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
943 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
944 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
945
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
946 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
947 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
948 RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
949 IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
950
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
951 ComplexMult(&RE(c4), &RE(c5),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
952 ti12, ti11, RE(t5), RE(t4));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
953 ComplexMult(&IM(c4), &IM(c5),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
954 ti12, ti12, IM(t5), IM(t4));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
955
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
956 IM(d2) = IM(c2) - RE(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
957 IM(d3) = IM(c3) - RE(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
958 RE(d4) = RE(c3) - IM(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
959 RE(d5) = RE(c2) - IM(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
960 RE(d2) = RE(c2) + IM(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
961 IM(d5) = IM(c2) + RE(c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
962 RE(d3) = RE(c3) + IM(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
963 IM(d4) = IM(c3) + RE(c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
964
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
965 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
966 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
967 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
968 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
969 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
970 ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
971 RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
972 ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
973 RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
974 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
975 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
976 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
977 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
978 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
979 ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
980 IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
981 ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]),
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
982 IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
983 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
984 }
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
985 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
986 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
987 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
988 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
989
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
990
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
991 /*----------------------------------------------------------------------
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
992 cfftf1, cfftf, cfftb, cffti1, cffti. Complex FFTs.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
993 ----------------------------------------------------------------------*/
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
994
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
995 #ifdef USE_SSE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
996
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
997 #define CONV(A,B,C) ( (A<<2) | ((B & 0x1)<<1) | ((C==1)&0x1) )
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
998
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
999 static INLINE void cfftf1pos_sse(uint16_t n, complex_t *c, complex_t *ch,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1000 const uint16_t *ifac, const complex_t *wa,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1001 const int8_t isign)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1002 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1003 uint16_t i;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1004 uint16_t k1, l1, l2;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1005 uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1006
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1007 nf = ifac[1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1008 na = 0;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1009 l1 = 1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1010 iw = 0;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1011
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1012 for (k1 = 2; k1 <= nf+1; k1++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1013 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1014 ip = ifac[k1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1015 l2 = ip*l1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1016 ido = n / l2;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1017 idl1 = ido*l1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1018
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1019 ix2 = iw + ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1020 ix3 = ix2 + ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1021 ix4 = ix3 + ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1022
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1023 switch (CONV(ip,na,ido))
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1024 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1025 case CONV(4,0,0):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1026 //passf4pos_sse_ido((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1027 passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1028 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1029 case CONV(4,0,1):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1030 passf4pos_sse((const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1031 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1032 case CONV(4,1,0):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1033 passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1034 //passf4pos_sse_ido((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1035 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1036 case CONV(4,1,1):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1037 passf4pos_sse((const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1038 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1039 case CONV(2,0,0):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1040 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1041 //passf2pos_sse_ido((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1042 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1043 case CONV(2,0,1):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1044 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1045 //passf2pos_sse((const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1046 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1047 case CONV(2,1,0):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1048 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1049 //passf2pos_sse_ido((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1050 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1051 case CONV(2,1,1):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1052 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1053 //passf2pos_sse((const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1054 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1055 case CONV(3,0,0):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1056 case CONV(3,0,1):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1057 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1058 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1059 case CONV(3,1,0):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1060 case CONV(3,1,1):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1061 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1062 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1063 case CONV(5,0,0):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1064 case CONV(5,0,1):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1065 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1066 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1067 case CONV(5,1,0):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1068 case CONV(5,1,1):
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1069 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1070 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1071 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1072
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1073 na = 1 - na;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1074
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1075 l1 = l2;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1076 iw += (ip-1) * ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1077 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1078
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1079 if (na == 0)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1080 return;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1081
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1082 for (i = 0; i < n; i++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1083 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1084 RE(c[i]) = RE(ch[i]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1085 IM(c[i]) = IM(ch[i]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1086 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1087 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1088 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1089
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1090 static INLINE void cfftf1pos(uint16_t n, complex_t *c, complex_t *ch,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1091 const uint16_t *ifac, const complex_t *wa,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1092 const int8_t isign)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1093 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1094 uint16_t i;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1095 uint16_t k1, l1, l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1096 uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1097
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1098 nf = ifac[1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1099 na = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1100 l1 = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1101 iw = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1102
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1103 for (k1 = 2; k1 <= nf+1; k1++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1104 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1105 ip = ifac[k1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1106 l2 = ip*l1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1107 ido = n / l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1108 idl1 = ido*l1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1109
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1110 switch (ip)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1111 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1112 case 4:
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1113 ix2 = iw + ido;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1114 ix3 = ix2 + ido;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1115
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1116 if (na == 0)
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1117 passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1118 else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1119 passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1120
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1121 na = 1 - na;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1122 break;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1123 case 2:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1124 if (na == 0)
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1125 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1126 else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1127 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1128
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1129 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1130 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1131 case 3:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1132 ix2 = iw + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1133
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1134 if (na == 0)
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1135 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1136 else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1137 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1138
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1139 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1140 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1141 case 5:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1142 ix2 = iw + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1143 ix3 = ix2 + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1144 ix4 = ix3 + ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1145
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1146 if (na == 0)
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1147 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1148 else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1149 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1150
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1151 na = 1 - na;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1152 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1153 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1154
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1155 l1 = l2;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1156 iw += (ip-1) * ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1157 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1158
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1159 if (na == 0)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1160 return;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1161
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1162 for (i = 0; i < n; i++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1163 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1164 RE(c[i]) = RE(ch[i]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1165 IM(c[i]) = IM(ch[i]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1166 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1167 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1168
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1169 static INLINE void cfftf1neg(uint16_t n, complex_t *c, complex_t *ch,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1170 const uint16_t *ifac, const complex_t *wa,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1171 const int8_t isign)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1172 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1173 uint16_t i;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1174 uint16_t k1, l1, l2;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1175 uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1176
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1177 nf = ifac[1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1178 na = 0;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1179 l1 = 1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1180 iw = 0;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1181
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1182 for (k1 = 2; k1 <= nf+1; k1++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1183 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1184 ip = ifac[k1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1185 l2 = ip*l1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1186 ido = n / l2;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1187 idl1 = ido*l1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1188
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1189 switch (ip)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1190 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1191 case 4:
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1192 ix2 = iw + ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1193 ix3 = ix2 + ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1194
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1195 if (na == 0)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1196 passf4neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1197 else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1198 passf4neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1199
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1200 na = 1 - na;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1201 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1202 case 2:
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1203 if (na == 0)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1204 passf2neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1205 else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1206 passf2neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1207
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1208 na = 1 - na;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1209 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1210 case 3:
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1211 ix2 = iw + ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1212
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1213 if (na == 0)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1214 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1215 else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1216 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1217
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1218 na = 1 - na;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1219 break;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1220 case 5:
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1221 ix2 = iw + ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1222 ix3 = ix2 + ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1223 ix4 = ix3 + ido;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1224
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1225 if (na == 0)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1226 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1227 else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1228 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1229
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1230 na = 1 - na;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1231 break;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1232 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1233
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1234 l1 = l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1235 iw += (ip-1) * ido;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1236 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1237
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1238 if (na == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1239 return;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1240
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1241 for (i = 0; i < n; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1242 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1243 RE(c[i]) = RE(ch[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1244 IM(c[i]) = IM(ch[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1245 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1246 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1247
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1248 void cfftf(cfft_info *cfft, complex_t *c)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1249 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1250 cfftf1neg(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, -1);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1251 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1252
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1253 void cfftb(cfft_info *cfft, complex_t *c)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1254 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1255 cfftf1pos(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, +1);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1256 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1257
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1258 #ifdef USE_SSE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1259 void cfftb_sse(cfft_info *cfft, complex_t *c)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1260 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1261 cfftf1pos_sse(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, +1);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1262 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1263 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1264
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1265 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1266 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1267 static uint16_t ntryh[4] = {3, 4, 2, 5};
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1268 #ifndef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1269 real_t arg, argh, argld, fi;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1270 uint16_t ido, ipm;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1271 uint16_t i1, k1, l1, l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1272 uint16_t ld, ii, ip;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1273 #endif
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1274 uint16_t ntry = 0, i, j;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1275 uint16_t ib;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1276 uint16_t nf, nl, nq, nr;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1277
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1278 nl = n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1279 nf = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1280 j = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1281
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1282 startloop:
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1283 j++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1284
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1285 if (j <= 4)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1286 ntry = ntryh[j-1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1287 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1288 ntry += 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1289
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1290 do
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1291 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1292 nq = nl / ntry;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1293 nr = nl - ntry*nq;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1294
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1295 if (nr != 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1296 goto startloop;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1297
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1298 nf++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1299 ifac[nf+1] = ntry;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1300 nl = nq;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1301
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1302 if (ntry == 2 && nf != 1)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1303 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1304 for (i = 2; i <= nf; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1305 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1306 ib = nf - i + 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1307 ifac[ib+1] = ifac[ib];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1308 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1309 ifac[2] = 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1310 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1311 } while (nl != 1);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1312
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1313 ifac[0] = n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1314 ifac[1] = nf;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1315
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1316 #ifndef FIXED_POINT
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1317 argh = (real_t)2.0*(real_t)M_PI / (real_t)n;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1318 i = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1319 l1 = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1320
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1321 for (k1 = 1; k1 <= nf; k1++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1322 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1323 ip = ifac[k1+1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1324 ld = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1325 l2 = l1*ip;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1326 ido = n / l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1327 ipm = ip - 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1328
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1329 for (j = 0; j < ipm; j++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1330 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1331 i1 = i;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1332 RE(wa[i]) = 1.0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1333 IM(wa[i]) = 0.0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1334 ld += l1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1335 fi = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1336 argld = ld*argh;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1337
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1338 for (ii = 0; ii < ido; ii++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1339 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1340 i++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1341 fi++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1342 arg = fi * argld;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1343 RE(wa[i]) = (real_t)cos(arg);
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1344 #if 1
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1345 IM(wa[i]) = (real_t)sin(arg);
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1346 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1347 IM(wa[i]) = (real_t)-sin(arg);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1348 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1349 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1350
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1351 if (ip > 5)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1352 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1353 RE(wa[i1]) = RE(wa[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1354 IM(wa[i1]) = IM(wa[i]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1355 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1356 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1357 l1 = l2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1358 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1359 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1360 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1361
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1362 cfft_info *cffti(uint16_t n)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1363 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1364 cfft_info *cfft = (cfft_info*)faad_malloc(sizeof(cfft_info));
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1365
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1366 cfft->n = n;
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1367 cfft->work = (complex_t*)faad_malloc(n*sizeof(complex_t));
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1368
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1369 #ifndef FIXED_POINT
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1370 cfft->tab = (complex_t*)faad_malloc(n*sizeof(complex_t));
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1371
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1372 cffti1(n, cfft->tab, cfft->ifac);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1373 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1374 cffti1(n, NULL, cfft->ifac);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1375
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1376 switch (n)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1377 {
13453
6d50ef45a058 Update FAAD to a 2.1 beta CVS snapshot from 2004.07.12.
diego
parents: 12625
diff changeset
1378 case 64: cfft->tab = (complex_t*)cfft_tab_64; break;
6d50ef45a058 Update FAAD to a 2.1 beta CVS snapshot from 2004.07.12.
diego
parents: 12625
diff changeset
1379 case 512: cfft->tab = (complex_t*)cfft_tab_512; break;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1380 #ifdef LD_DEC
13453
6d50ef45a058 Update FAAD to a 2.1 beta CVS snapshot from 2004.07.12.
diego
parents: 12625
diff changeset
1381 case 256: cfft->tab = (complex_t*)cfft_tab_256; break;
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1382 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1383
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1384 #ifdef ALLOW_SMALL_FRAMELENGTH
13453
6d50ef45a058 Update FAAD to a 2.1 beta CVS snapshot from 2004.07.12.
diego
parents: 12625
diff changeset
1385 case 60: cfft->tab = (complex_t*)cfft_tab_60; break;
6d50ef45a058 Update FAAD to a 2.1 beta CVS snapshot from 2004.07.12.
diego
parents: 12625
diff changeset
1386 case 480: cfft->tab = (complex_t*)cfft_tab_480; break;
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1387 #ifdef LD_DEC
13453
6d50ef45a058 Update FAAD to a 2.1 beta CVS snapshot from 2004.07.12.
diego
parents: 12625
diff changeset
1388 case 240: cfft->tab = (complex_t*)cfft_tab_240; break;
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1389 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1390 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1391 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1392 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1393
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1394 return cfft;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1395 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1396
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1397 void cfftu(cfft_info *cfft)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1398 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1399 if (cfft->work) faad_free(cfft->work);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1400 #ifndef FIXED_POINT
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1401 if (cfft->tab) faad_free(cfft->tab);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1402 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1403
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1404 if (cfft) faad_free(cfft);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
1405 }
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
1406