annotate libfaad2/sbr_qmf.c @ 13394:455a5056801f

New generic 'portable anymap' video output driver. It supports portable pixmaps and graymaps in both raw and ASCII mode. Besides PPM and PGM, it can also output PGMYUV files which are PGM files with the U and V plane appended to the bottom of the Y image (bottom left and bottom right). All files can be written to the current directory, to a specified output directory or to multiple subdirectories if the filesystem can't handle the amount of files in one directory anymore. Note: This driver is not yet activated and will not be compiled and linked to libvo. A separate patch will take care of that. This is just for adding the file to the repository.
author ivo
date Mon, 20 Sep 2004 00:54:57 +0000
parents d81145997036
children 6d50ef45a058
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
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
4 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
5 ** This program is free software; you can redistribute it and/or modify
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
6 ** it under the terms of the GNU General Public License as published by
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
7 ** the Free Software Foundation; either version 2 of the License, or
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
8 ** (at your option) any later version.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
9 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
10 ** This program is distributed in the hope that it will be useful,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
13 ** GNU General Public License for more details.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
14 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
15 ** You should have received a copy of the GNU General Public License
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
16 ** along with this program; if not, write to the Free Software
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
18 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
19 ** Any non-GPL usage of this software or parts of this software is strictly
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
20 ** forbidden.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
21 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
22 ** Commercial non-GPL licensing of this software is possible.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
24 **
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
d81145997036 More information about modifications to comply more closely with GPL 2a.
diego
parents: 12527
diff changeset
26 ** $Id: sbr_qmf.c,v 1.3 2004/06/02 22:59:03 diego Exp $
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 #include "common.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
31 #include "structs.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
32
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
33 #ifdef SBR_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
34
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
35
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
36 #include <stdlib.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
37 #include <string.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
38 #include "sbr_dct.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
39 #include "sbr_qmf.h"
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
40 #include "sbr_qmf_c.h"
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
41 #include "sbr_syntax.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
42
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
43
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
44 qmfa_info *qmfa_init(uint8_t channels)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
45 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
46 qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
47 qmfa->x = (real_t*)faad_malloc(channels * 10 * sizeof(real_t));
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
48 memset(qmfa->x, 0, channels * 10 * sizeof(real_t));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
49
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
50 qmfa->channels = channels;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
51
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
52 return qmfa;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
53 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
54
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
55 void qmfa_end(qmfa_info *qmfa)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
56 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
57 if (qmfa)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
58 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
59 if (qmfa->x) faad_free(qmfa->x);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
60 faad_free(qmfa);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
61 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
62 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
63
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
64 void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
65 qmf_t X[MAX_NTSRHFG][32], uint8_t offset, uint8_t kx)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
66 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
67 ALIGN real_t u[64];
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
68 #ifndef SBR_LOW_POWER
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
69 ALIGN real_t x[64], y[64];
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
70 #else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
71 ALIGN real_t y[32];
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
72 #endif
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
73 uint16_t in = 0;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
74 uint8_t l;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
75
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
76 /* qmf subsample l */
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
77 for (l = 0; l < sbr->numTimeSlotsRate; l++)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
78 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
79 int16_t n;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
80
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
81 /* shift input buffer x */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
82 memmove(qmfa->x + 32, qmfa->x, (320-32)*sizeof(real_t));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
83
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
84 /* add new samples to input buffer x */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
85 for (n = 32 - 1; n >= 0; n--)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
86 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
87 #ifdef FIXED_POINT
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
88 qmfa->x[n] = (input[in++]) >> 5;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
89 #else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
90 qmfa->x[n] = input[in++];
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
91 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
92 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
93
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
94 /* window and summation to create array u */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
95 for (n = 0; n < 64; n++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
96 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
97 u[n] = MUL_F(qmfa->x[n], qmf_c[2*n]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
98 MUL_F(qmfa->x[n + 64], qmf_c[2*(n + 64)]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
99 MUL_F(qmfa->x[n + 128], qmf_c[2*(n + 128)]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
100 MUL_F(qmfa->x[n + 192], qmf_c[2*(n + 192)]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
101 MUL_F(qmfa->x[n + 256], qmf_c[2*(n + 256)]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
102 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
103
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
104 /* calculate 32 subband samples by introducing X */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
105 #ifdef SBR_LOW_POWER
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
106 y[0] = u[48];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
107 for (n = 1; n < 16; n++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
108 y[n] = u[n+48] + u[48-n];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
109 for (n = 16; n < 32; n++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
110 y[n] = -u[n-16] + u[48-n];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
111
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
112 DCT3_32_unscaled(u, y);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
113
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
114 for (n = 0; n < 32; n++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
115 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
116 if (n < kx)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
117 {
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
118 #ifdef FIXED_POINT
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
119 QMF_RE(X[l + offset][n]) = u[n] << 1;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
120 #else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
121 QMF_RE(X[l + offset][n]) = 2. * u[n];
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
122 #endif
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
123 } else {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
124 QMF_RE(X[l + offset][n]) = 0;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
125 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
126 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
127 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
128 x[0] = u[0];
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
129 for (n = 0; n < 31; n++)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
130 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
131 x[2*n+1] = u[n+1] + u[63-n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
132 x[2*n+2] = u[n+1] - u[63-n];
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
133 }
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
134 x[63] = u[32];
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
135
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
136 DCT4_64_kernel(y, x);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
137
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
138 for (n = 0; n < 32; n++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
139 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
140 if (n < kx)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
141 {
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
142 #ifdef FIXED_POINT
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
143 QMF_RE(X[l + offset][n]) = y[n] << 1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
144 QMF_IM(X[l + offset][n]) = -y[63-n] << 1;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
145 #else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
146 QMF_RE(X[l + offset][n]) = 2. * y[n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
147 QMF_IM(X[l + offset][n]) = -2. * y[63-n];
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
148 #endif
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
149 } else {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
150 QMF_RE(X[l + offset][n]) = 0;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
151 QMF_IM(X[l + offset][n]) = 0;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
152 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
153 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
154 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
155 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
156 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
157
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
158 qmfs_info *qmfs_init(uint8_t channels)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
159 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
160 qmfs_info *qmfs = (qmfs_info*)faad_malloc(sizeof(qmfs_info));
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
161
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
162 #ifndef SBR_LOW_POWER
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
163 qmfs->v[0] = (real_t*)faad_malloc(channels * 10 * sizeof(real_t));
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
164 memset(qmfs->v[0], 0, channels * 10 * sizeof(real_t));
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
165 qmfs->v[1] = (real_t*)faad_malloc(channels * 10 * sizeof(real_t));
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
166 memset(qmfs->v[1], 0, channels * 10 * sizeof(real_t));
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
167 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
168 qmfs->v[0] = (real_t*)faad_malloc(channels * 20 * sizeof(real_t));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
169 memset(qmfs->v[0], 0, channels * 20 * sizeof(real_t));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
170 qmfs->v[1] = NULL;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
171 #endif
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
172
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
173 qmfs->v_index = 0;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
174
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
175 qmfs->channels = channels;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
176
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
177 #ifdef USE_SSE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
178 if (cpu_has_sse())
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
179 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
180 qmfs->qmf_func = sbr_qmf_synthesis_64_sse;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
181 } else {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
182 qmfs->qmf_func = sbr_qmf_synthesis_64;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
183 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
184 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
185
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
186 return qmfs;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
187 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
188
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
189 void qmfs_end(qmfs_info *qmfs)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
190 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
191 if (qmfs)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
192 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
193 if (qmfs->v[0]) faad_free(qmfs->v[0]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
194 #ifndef SBR_LOW_POWER
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
195 if (qmfs->v[1]) faad_free(qmfs->v[1]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
196 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
197 faad_free(qmfs);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
198 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
199 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
200
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
201 #ifdef SBR_LOW_POWER
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
202 void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
203 real_t *output)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
204 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
205 ALIGN real_t x[64];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
206 ALIGN real_t y[64];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
207 int16_t n, k, out = 0;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
208 uint8_t l;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
209
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
210
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
211 /* qmf subsample l */
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
212 for (l = 0; l < sbr->numTimeSlotsRate; l++)
12527
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 //real_t *v0, *v1;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
215
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
216 /* shift buffers */
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
217 //memmove(qmfs->v[0] + 64, qmfs->v[0], (640-64)*sizeof(real_t));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
218 //memmove(qmfs->v[1] + 64, qmfs->v[1], (640-64)*sizeof(real_t));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
219 memmove(qmfs->v[0] + 128, qmfs->v[0], (1280-128)*sizeof(real_t));
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
220
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
221 //v0 = qmfs->v[qmfs->v_index];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
222 //v1 = qmfs->v[(qmfs->v_index + 1) & 0x1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
223 //qmfs->v_index = (qmfs->v_index + 1) & 0x1;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
224
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
225 /* calculate 128 samples */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
226 for (k = 0; k < 64; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
227 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
228 #ifdef FIXED_POINT
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
229 x[k] = QMF_RE(X[l][k]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
230 #else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
231 x[k] = QMF_RE(X[l][k]) / 32.;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
232 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
233 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
234
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
235 for (n = 0; n < 32; n++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
236 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
237 y[2*n] = -x[2*n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
238 y[2*n+1] = x[2*n+1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
239 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
240
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
241 DCT2_64_unscaled(x, x);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
242
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
243 for (n = 0; n < 64; n++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
244 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
245 qmfs->v[0][n+32] = x[n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
246 }
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
247 for (n = 0; n < 32; n++)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
248 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
249 qmfs->v[0][31 - n] = x[n + 1];
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
250 }
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
251 DST2_64_unscaled(x, y);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
252 qmfs->v[0][96] = 0;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
253 for (n = 1; n < 32; n++)
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
254 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
255 qmfs->v[0][n + 96] = x[n-1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
256 }
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
257
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
258 /* calculate 64 output samples and window */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
259 for (k = 0; k < 64; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
260 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
261 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
262 output[out++] = MUL_F(qmfs->v[0][k], qmf_c[k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
263 MUL_F(qmfs->v[0][192 + k], qmf_c[64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
264 MUL_F(qmfs->v[0][256 + k], qmf_c[128 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
265 MUL_F(qmfs->v[0][256 + 192 + k], qmf_c[128 + 64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
266 MUL_F(qmfs->v[0][512 + k], qmf_c[256 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
267 MUL_F(qmfs->v[0][512 + 192 + k], qmf_c[256 + 64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
268 MUL_F(qmfs->v[0][768 + k], qmf_c[384 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
269 MUL_F(qmfs->v[0][768 + 192 + k], qmf_c[384 + 64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
270 MUL_F(qmfs->v[0][1024 + k], qmf_c[512 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
271 MUL_F(qmfs->v[0][1024 + 192 + k], qmf_c[512 + 64 + k]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
272 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
273 output[out++] = MUL_F(v0[k], qmf_c[k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
274 MUL_F(v0[64 + k], qmf_c[64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
275 MUL_F(v0[128 + k], qmf_c[128 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
276 MUL_F(v0[192 + k], qmf_c[192 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
277 MUL_F(v0[256 + k], qmf_c[256 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
278 MUL_F(v0[320 + k], qmf_c[320 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
279 MUL_F(v0[384 + k], qmf_c[384 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
280 MUL_F(v0[448 + k], qmf_c[448 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
281 MUL_F(v0[512 + k], qmf_c[512 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
282 MUL_F(v0[576 + k], qmf_c[576 + k]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
283 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
284 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
285 }
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
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
288 void sbr_qmf_synthesis_64_sse(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
289 real_t *output)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
290 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
291 ALIGN real_t x[64];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
292 ALIGN real_t y[64];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
293 ALIGN real_t y2[64];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
294 int16_t n, k, out = 0;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
295 uint8_t l;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
296
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
297 /* qmf subsample l */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
298 for (l = 0; l < sbr->numTimeSlotsRate; l++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
299 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
300 //real_t *v0, *v1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
301
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
302 /* shift buffers */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
303 //memmove(qmfs->v[0] + 64, qmfs->v[0], (640-64)*sizeof(real_t));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
304 //memmove(qmfs->v[1] + 64, qmfs->v[1], (640-64)*sizeof(real_t));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
305 memmove(qmfs->v[0] + 128, qmfs->v[0], (1280-128)*sizeof(real_t));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
306
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
307 //v0 = qmfs->v[qmfs->v_index];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
308 //v1 = qmfs->v[(qmfs->v_index + 1) & 0x1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
309 //qmfs->v_index = (qmfs->v_index + 1) & 0x1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
310
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
311 /* calculate 128 samples */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
312 for (k = 0; k < 64; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
313 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
314 #ifdef FIXED_POINT
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
315 x[k] = QMF_RE(X[l][k]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
316 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
317 x[k] = QMF_RE(X[l][k]) / 32.;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
318 #endif
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
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
321 for (n = 0; n < 32; n++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
322 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
323 y[2*n] = -x[2*n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
324 y[2*n+1] = x[2*n+1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
325 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
326
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
327 DCT2_64_unscaled(x, x);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
328
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
329 for (n = 0; n < 64; n++)
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 qmfs->v[0][n+32] = x[n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
332 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
333 for (n = 0; n < 32; n++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
334 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
335 qmfs->v[0][31 - n] = x[n + 1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
336 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
337
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
338 DST2_64_unscaled(x, y);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
339 qmfs->v[0][96] = 0;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
340 for (n = 1; n < 32; n++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
341 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
342 qmfs->v[0][n + 96] = x[n-1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
343 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
344
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
345 /* calculate 64 output samples and window */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
346 for (k = 0; k < 64; k++)
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 #if 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
349 output[out++] = MUL_F(qmfs->v[0][k], qmf_c[k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
350 MUL_F(qmfs->v[0][192 + k], qmf_c[64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
351 MUL_F(qmfs->v[0][256 + k], qmf_c[128 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
352 MUL_F(qmfs->v[0][256 + 192 + k], qmf_c[128 + 64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
353 MUL_F(qmfs->v[0][512 + k], qmf_c[256 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
354 MUL_F(qmfs->v[0][512 + 192 + k], qmf_c[256 + 64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
355 MUL_F(qmfs->v[0][768 + k], qmf_c[384 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
356 MUL_F(qmfs->v[0][768 + 192 + k], qmf_c[384 + 64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
357 MUL_F(qmfs->v[0][1024 + k], qmf_c[512 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
358 MUL_F(qmfs->v[0][1024 + 192 + k], qmf_c[512 + 64 + k]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
359 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
360 output[out++] = MUL_F(v0[k], qmf_c[k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
361 MUL_F(v0[64 + k], qmf_c[64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
362 MUL_F(v0[128 + k], qmf_c[128 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
363 MUL_F(v0[192 + k], qmf_c[192 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
364 MUL_F(v0[256 + k], qmf_c[256 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
365 MUL_F(v0[320 + k], qmf_c[320 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
366 MUL_F(v0[384 + k], qmf_c[384 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
367 MUL_F(v0[448 + k], qmf_c[448 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
368 MUL_F(v0[512 + k], qmf_c[512 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
369 MUL_F(v0[576 + k], qmf_c[576 + k]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
370 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
371 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
372 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
373 }
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
374 #else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
375 void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
376 real_t *output)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
377 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
378 ALIGN real_t x1[64], x2[64];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
379 real_t scale = 1.f/64.f;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
380 int16_t n, k, out = 0;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
381 uint8_t l;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
382
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
383
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
384 /* qmf subsample l */
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
385 for (l = 0; l < sbr->numTimeSlotsRate; l++)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
386 {
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
387 real_t *v0, *v1;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
388
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
389 /* shift buffers */
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
390 memmove(qmfs->v[0] + 64, qmfs->v[0], (640-64)*sizeof(real_t));
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
391 memmove(qmfs->v[1] + 64, qmfs->v[1], (640-64)*sizeof(real_t));
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
392
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
393 v0 = qmfs->v[qmfs->v_index];
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
394 v1 = qmfs->v[(qmfs->v_index + 1) & 0x1];
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
395 qmfs->v_index = (qmfs->v_index + 1) & 0x1;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
396
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
397 /* calculate 128 samples */
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
398 x1[0] = scale*QMF_RE(X[l][0]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
399 x2[63] = scale*QMF_IM(X[l][0]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
400 for (k = 0; k < 31; k++)
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
401 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
402 x1[2*k+1] = scale*(QMF_RE(X[l][2*k+1]) - QMF_RE(X[l][2*k+2]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
403 x1[2*k+2] = scale*(QMF_RE(X[l][2*k+1]) + QMF_RE(X[l][2*k+2]));
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
404
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
405 x2[61 - 2*k] = scale*(QMF_IM(X[l][2*k+2]) - QMF_IM(X[l][2*k+1]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
406 x2[62 - 2*k] = scale*(QMF_IM(X[l][2*k+2]) + QMF_IM(X[l][2*k+1]));
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 x1[63] = scale*QMF_RE(X[l][63]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
409 x2[0] = scale*QMF_IM(X[l][63]);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
410
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
411 DCT4_64_kernel(x1, x1);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
412 DCT4_64_kernel(x2, x2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
413
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
414 for (n = 0; n < 32; n++)
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
415 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
416 v0[ 2*n] = x2[2*n] - x1[2*n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
417 v1[63-2*n] = x2[2*n] + x1[2*n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
418 v0[ 2*n+1] = -x2[2*n+1] - x1[2*n+1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
419 v1[62-2*n] = -x2[2*n+1] + x1[2*n+1];
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
420 }
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
421
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
422 /* calculate 64 output samples and window */
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
423 for (k = 0; k < 64; k++)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
424 {
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
425 output[out++] = MUL_F(v0[k], qmf_c[k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
426 MUL_F(v0[64 + k], qmf_c[64 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
427 MUL_F(v0[128 + k], qmf_c[128 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
428 MUL_F(v0[192 + k], qmf_c[192 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
429 MUL_F(v0[256 + k], qmf_c[256 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
430 MUL_F(v0[320 + k], qmf_c[320 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
431 MUL_F(v0[384 + k], qmf_c[384 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
432 MUL_F(v0[448 + k], qmf_c[448 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
433 MUL_F(v0[512 + k], qmf_c[512 + k]) +
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
434 MUL_F(v0[576 + k], qmf_c[576 + k]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
435 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
436 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
437 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
438
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
439 #ifdef USE_SSE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
440 void memmove_sse_576(real_t *out, const real_t *in)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
441 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
442 __m128 m[144];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
443 uint16_t i;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
444
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
445 for (i = 0; i < 144; i++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
446 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
447 m[i] = _mm_load_ps(&in[i*4]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
448 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
449 for (i = 0; i < 144; i++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
450 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
451 _mm_store_ps(&out[i*4], m[i]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
452 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
453 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
454
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
455 void sbr_qmf_synthesis_64_sse(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
456 real_t *output)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
457 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
458 ALIGN real_t x1[64], x2[64];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
459 real_t scale = 1.f/64.f;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
460 int16_t n, k, out = 0;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
461 uint8_t l;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
462
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
463
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
464 /* qmf subsample l */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
465 for (l = 0; l < sbr->numTimeSlotsRate; l++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
466 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
467 real_t *v0, *v1;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
468
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
469 /* shift buffers */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
470 memmove_sse_576(qmfs->v[0] + 64, qmfs->v[0]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
471 memmove_sse_576(qmfs->v[1] + 64, qmfs->v[1]);
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 v0 = qmfs->v[qmfs->v_index];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
474 v1 = qmfs->v[(qmfs->v_index + 1) & 0x1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
475 qmfs->v_index = (qmfs->v_index + 1) & 0x1;
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 /* calculate 128 samples */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
478 x1[0] = scale*QMF_RE(X[l][0]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
479 x2[63] = scale*QMF_IM(X[l][0]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
480 for (k = 0; k < 31; k++)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
481 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
482 x1[2*k+1] = scale*(QMF_RE(X[l][2*k+1]) - QMF_RE(X[l][2*k+2]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
483 x1[2*k+2] = scale*(QMF_RE(X[l][2*k+1]) + QMF_RE(X[l][2*k+2]));
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 x2[61 - 2*k] = scale*(QMF_IM(X[l][2*k+2]) - QMF_IM(X[l][2*k+1]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
486 x2[62 - 2*k] = scale*(QMF_IM(X[l][2*k+2]) + QMF_IM(X[l][2*k+1]));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
487 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
488 x1[63] = scale*QMF_RE(X[l][63]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
489 x2[0] = scale*QMF_IM(X[l][63]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
490
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
491 DCT4_64_kernel(x1, x1);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
492 DCT4_64_kernel(x2, x2);
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 (n = 0; n < 32; n++)
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 v0[ 2*n ] = x2[2*n] - x1[2*n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
497 v1[63- 2*n ] = x2[2*n] + x1[2*n];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
498 v0[ 2*n+1 ] = -x2[2*n+1] - x1[2*n+1];
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
499 v1[63-(2*n+1)] = -x2[2*n+1] + x1[2*n+1];
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
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
502 /* calculate 64 output samples and window */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
503 for (k = 0; k < 64; k+=4)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
504 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
505 __m128 m0, m1, m2, m3, m4, m5, m6, m7, m8, m9;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
506 __m128 c0, c1, c2, c3, c4, c5, c6, c7, c8, c9;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
507 __m128 s1, s2, s3, s4, s5, s6, s7, s8, s9;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
508
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
509 m0 = _mm_load_ps(&v0[k]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
510 m1 = _mm_load_ps(&v0[k + 64]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
511 m2 = _mm_load_ps(&v0[k + 128]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
512 m3 = _mm_load_ps(&v0[k + 192]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
513 m4 = _mm_load_ps(&v0[k + 256]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
514 c0 = _mm_load_ps(&qmf_c[k]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
515 c1 = _mm_load_ps(&qmf_c[k + 64]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
516 c2 = _mm_load_ps(&qmf_c[k + 128]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
517 c3 = _mm_load_ps(&qmf_c[k + 192]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
518 c4 = _mm_load_ps(&qmf_c[k + 256]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
519
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
520 m0 = _mm_mul_ps(m0, c0);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
521 m1 = _mm_mul_ps(m1, c1);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
522 m2 = _mm_mul_ps(m2, c2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
523 m3 = _mm_mul_ps(m3, c3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
524 m4 = _mm_mul_ps(m4, c4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
525
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
526 s1 = _mm_add_ps(m0, m1);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
527 s2 = _mm_add_ps(m2, m3);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
528 s6 = _mm_add_ps(s1, s2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
529
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
530 m5 = _mm_load_ps(&v0[k + 320]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
531 m6 = _mm_load_ps(&v0[k + 384]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
532 m7 = _mm_load_ps(&v0[k + 448]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
533 m8 = _mm_load_ps(&v0[k + 512]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
534 m9 = _mm_load_ps(&v0[k + 576]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
535 c5 = _mm_load_ps(&qmf_c[k + 320]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
536 c6 = _mm_load_ps(&qmf_c[k + 384]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
537 c7 = _mm_load_ps(&qmf_c[k + 448]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
538 c8 = _mm_load_ps(&qmf_c[k + 512]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
539 c9 = _mm_load_ps(&qmf_c[k + 576]);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
540
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
541 m5 = _mm_mul_ps(m5, c5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
542 m6 = _mm_mul_ps(m6, c6);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
543 m7 = _mm_mul_ps(m7, c7);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
544 m8 = _mm_mul_ps(m8, c8);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
545 m9 = _mm_mul_ps(m9, c9);
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 s3 = _mm_add_ps(m4, m5);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
548 s4 = _mm_add_ps(m6, m7);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
549 s5 = _mm_add_ps(m8, m9);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
550 s7 = _mm_add_ps(s3, s4);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
551 s8 = _mm_add_ps(s5, s6);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
552 s9 = _mm_add_ps(s7, s8);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
553
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
554 _mm_store_ps(&output[out], s9);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
555 out += 4;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
556 }
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
557 }
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
558 }
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
559 #endif
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
560 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
561
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
562 #endif