annotate libfaad2/cfft.c @ 14236:2dc4595c3998

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