annotate Plugins/Input/aac/libfaad2/sbr_qmf.c @ 553:82346a6312c2 trunk

[svn] make WMA plugin strings translatable
author nenolod
date Wed, 01 Feb 2006 13:09:00 -0800
parents 0a2ad94e8607
children 29feaace84d0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
4 **
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 ** This program is free software; you can redistribute it and/or modify
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 ** it under the terms of the GNU General Public License as published by
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 ** the Free Software Foundation; either version 2 of the License, or
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 ** (at your option) any later version.
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
9 **
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 ** This program is distributed in the hope that it will be useful,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 ** GNU General Public License for more details.
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
14 **
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 ** You should have received a copy of the GNU General Public License
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
16 ** along with this program; if not, write to the Free Software
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18 **
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 ** Any non-GPL usage of this software or parts of this software is strictly
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20 ** forbidden.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21 **
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22 ** Commercial non-GPL licensing of this software is possible.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
24 **
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
25 ** $Id: sbr_qmf.c,v 1.27 2004/09/04 14:56:28 menno Exp $
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26 **/
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
27
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
28 #include "common.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29 #include "structs.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
30
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31 #ifdef SBR_DEC
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34 #include <stdlib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35 #include <string.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
36 #include "sbr_dct.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37 #include "sbr_qmf.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38 #include "sbr_qmf_c.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39 #include "sbr_syntax.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41 qmfa_info *qmfa_init(uint8_t channels)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
42 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
43 qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
44
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
45 /* x is implemented as double ringbuffer */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
46 qmfa->x = (real_t*)faad_malloc(2 * channels * 10 * sizeof(real_t));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
47 memset(qmfa->x, 0, 2 * channels * 10 * sizeof(real_t));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
48
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
49 /* ringbuffer index */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
50 qmfa->x_index = 0;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
51
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
52 qmfa->channels = channels;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
53
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
54 return qmfa;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
55 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
56
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
57 void qmfa_end(qmfa_info *qmfa)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
58 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
59 if (qmfa)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
60 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
61 if (qmfa->x) faad_free(qmfa->x);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
62 faad_free(qmfa);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
63 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
64 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
65
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
66 void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
67 qmf_t X[MAX_NTSRHFG][64], uint8_t offset, uint8_t kx)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
68 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
69 ALIGN real_t u[64];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
70 #ifndef SBR_LOW_POWER
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
71 ALIGN real_t in_real[32], in_imag[32], out_real[32], out_imag[32];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
72 #else
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
73 ALIGN real_t y[32];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
74 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
75 uint16_t in = 0;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
76 uint8_t l;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
77
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
78 /* qmf subsample l */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
79 for (l = 0; l < sbr->numTimeSlotsRate; l++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
80 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
81 int16_t n;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
82
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
83 /* shift input buffer x */
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
84 /* input buffer is not shifted anymore, x is implemented as double ringbuffer */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
85 //memmove(qmfa->x + 32, qmfa->x, (320-32)*sizeof(real_t));
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
86
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
87 /* add new samples to input buffer x */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
88 for (n = 32 - 1; n >= 0; n--)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
89 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
90 #ifdef FIXED_POINT
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
91 qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = (input[in++]) >> 4;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
92 #else
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
93 qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = input[in++];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
94 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
95 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
96
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
97 /* window and summation to create array u */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
98 for (n = 0; n < 64; n++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
99 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
100 u[n] = MUL_F(qmfa->x[qmfa->x_index + n], qmf_c[2*n]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
101 MUL_F(qmfa->x[qmfa->x_index + n + 64], qmf_c[2*(n + 64)]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
102 MUL_F(qmfa->x[qmfa->x_index + n + 128], qmf_c[2*(n + 128)]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
103 MUL_F(qmfa->x[qmfa->x_index + n + 192], qmf_c[2*(n + 192)]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
104 MUL_F(qmfa->x[qmfa->x_index + n + 256], qmf_c[2*(n + 256)]);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
105 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
106
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
107 /* update ringbuffer index */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
108 qmfa->x_index -= 32;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
109 if (qmfa->x_index < 0)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
110 qmfa->x_index = (320-32);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
111
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
112 /* calculate 32 subband samples by introducing X */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
113 #ifdef SBR_LOW_POWER
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
114 y[0] = u[48];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
115 for (n = 1; n < 16; n++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
116 y[n] = u[n+48] + u[48-n];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
117 for (n = 16; n < 32; n++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
118 y[n] = -u[n-16] + u[48-n];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
119
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
120 DCT3_32_unscaled(u, y);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
121
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
122 for (n = 0; n < 32; n++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
123 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
124 if (n < kx)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
125 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
126 #ifdef FIXED_POINT
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
127 QMF_RE(X[l + offset][n]) = u[n] /*<< 1*/;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
128 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
129 QMF_RE(X[l + offset][n]) = 2. * u[n];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
130 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
131 } else {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
132 QMF_RE(X[l + offset][n]) = 0;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
133 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
134 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
135 #else
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
136
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
137 // Reordering of data moved from DCT_IV to here
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
138 in_imag[31] = u[1];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
139 in_real[0] = u[0];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
140 for (n = 1; n < 31; n++)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
141 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
142 in_imag[31 - n] = u[n+1];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
143 in_real[n] = -u[64-n];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
144 }
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
145 in_imag[0] = u[32];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
146 in_real[31] = -u[33];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
147
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
148 // dct4_kernel is DCT_IV without reordering which is done before and after FFT
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
149 dct4_kernel(in_real, in_imag, out_real, out_imag);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
150
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
151 // Reordering of data moved from DCT_IV to here
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
152 for (n = 0; n < 16; n++) {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
153 if (2*n+1 < kx) {
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
154 #ifdef FIXED_POINT
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
155 QMF_RE(X[l + offset][2*n]) = out_real[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
156 QMF_IM(X[l + offset][2*n]) = out_imag[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
157 QMF_RE(X[l + offset][2*n+1]) = -out_imag[31-n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
158 QMF_IM(X[l + offset][2*n+1]) = -out_real[31-n];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
159 #else
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
160 QMF_RE(X[l + offset][2*n]) = 2. * out_real[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
161 QMF_IM(X[l + offset][2*n]) = 2. * out_imag[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
162 QMF_RE(X[l + offset][2*n+1]) = -2. * out_imag[31-n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
163 QMF_IM(X[l + offset][2*n+1]) = -2. * out_real[31-n];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
164 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
165 } else {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
166 if (2*n < kx) {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
167 #ifdef FIXED_POINT
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
168 QMF_RE(X[l + offset][2*n]) = out_real[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
169 QMF_IM(X[l + offset][2*n]) = out_imag[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
170 #else
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
171 QMF_RE(X[l + offset][2*n]) = 2. * out_real[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
172 QMF_IM(X[l + offset][2*n]) = 2. * out_imag[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
173 #endif
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
174 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
175 else {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
176 QMF_RE(X[l + offset][2*n]) = 0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
177 QMF_IM(X[l + offset][2*n]) = 0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
178 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
179 QMF_RE(X[l + offset][2*n+1]) = 0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
180 QMF_IM(X[l + offset][2*n+1]) = 0;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
181 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
182 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
183 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
184 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
185 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
186
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
187 static const complex_t qmf32_pre_twiddle[] =
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
188 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
189 { FRAC_CONST(0.999924701839145), FRAC_CONST(-0.012271538285720) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
190 { FRAC_CONST(0.999322384588350), FRAC_CONST(-0.036807222941359) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
191 { FRAC_CONST(0.998118112900149), FRAC_CONST(-0.061320736302209) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
192 { FRAC_CONST(0.996312612182778), FRAC_CONST(-0.085797312344440) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
193 { FRAC_CONST(0.993906970002356), FRAC_CONST(-0.110222207293883) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
194 { FRAC_CONST(0.990902635427780), FRAC_CONST(-0.134580708507126) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
195 { FRAC_CONST(0.987301418157858), FRAC_CONST(-0.158858143333861) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
196 { FRAC_CONST(0.983105487431216), FRAC_CONST(-0.183039887955141) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
197 { FRAC_CONST(0.978317370719628), FRAC_CONST(-0.207111376192219) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
198 { FRAC_CONST(0.972939952205560), FRAC_CONST(-0.231058108280671) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
199 { FRAC_CONST(0.966976471044852), FRAC_CONST(-0.254865659604515) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
200 { FRAC_CONST(0.960430519415566), FRAC_CONST(-0.278519689385053) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
201 { FRAC_CONST(0.953306040354194), FRAC_CONST(-0.302005949319228) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
202 { FRAC_CONST(0.945607325380521), FRAC_CONST(-0.325310292162263) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
203 { FRAC_CONST(0.937339011912575), FRAC_CONST(-0.348418680249435) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
204 { FRAC_CONST(0.928506080473216), FRAC_CONST(-0.371317193951838) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
205 { FRAC_CONST(0.919113851690058), FRAC_CONST(-0.393992040061048) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
206 { FRAC_CONST(0.909167983090522), FRAC_CONST(-0.416429560097637) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
207 { FRAC_CONST(0.898674465693954), FRAC_CONST(-0.438616238538528) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
208 { FRAC_CONST(0.887639620402854), FRAC_CONST(-0.460538710958240) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
209 { FRAC_CONST(0.876070094195407), FRAC_CONST(-0.482183772079123) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
210 { FRAC_CONST(0.863972856121587), FRAC_CONST(-0.503538383725718) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
211 { FRAC_CONST(0.851355193105265), FRAC_CONST(-0.524589682678469) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
212 { FRAC_CONST(0.838224705554838), FRAC_CONST(-0.545324988422046) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
213 { FRAC_CONST(0.824589302785025), FRAC_CONST(-0.565731810783613) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
214 { FRAC_CONST(0.810457198252595), FRAC_CONST(-0.585797857456439) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
215 { FRAC_CONST(0.795836904608884), FRAC_CONST(-0.605511041404326) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
216 { FRAC_CONST(0.780737228572094), FRAC_CONST(-0.624859488142386) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
217 { FRAC_CONST(0.765167265622459), FRAC_CONST(-0.643831542889791) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
218 { FRAC_CONST(0.749136394523459), FRAC_CONST(-0.662415777590172) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
219 { FRAC_CONST(0.732654271672413), FRAC_CONST(-0.680600997795453) },
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
220 { FRAC_CONST(0.715730825283819), FRAC_CONST(-0.698376249408973) }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
221 };
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
222
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
223 qmfs_info *qmfs_init(uint8_t channels)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
224 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
225 qmfs_info *qmfs = (qmfs_info*)faad_malloc(sizeof(qmfs_info));
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
226
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
227 /* v is a double ringbuffer */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
228 qmfs->v = (real_t*)faad_malloc(2 * channels * 20 * sizeof(real_t));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
229 memset(qmfs->v, 0, 2 * channels * 20 * sizeof(real_t));
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
230
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
231 qmfs->v_index = 0;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
232
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
233 qmfs->channels = channels;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
234
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
235 return qmfs;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
236 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
237
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
238 void qmfs_end(qmfs_info *qmfs)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
239 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
240 if (qmfs)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
241 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
242 if (qmfs->v) faad_free(qmfs->v);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
243 faad_free(qmfs);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
244 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
245 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
246
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
247 #ifdef SBR_LOW_POWER
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
248
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
249 void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
250 real_t *output)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
251 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
252 ALIGN real_t x[16];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
253 ALIGN real_t y[16];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
254 int16_t n, k, out = 0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
255 uint8_t l;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
256
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
257 /* qmf subsample l */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
258 for (l = 0; l < sbr->numTimeSlotsRate; l++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
259 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
260 /* shift buffers */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
261 /* we are not shifting v, it is a double ringbuffer */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
262 //memmove(qmfs->v + 64, qmfs->v, (640-64)*sizeof(real_t));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
263
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
264 /* calculate 64 samples */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
265 for (k = 0; k < 16; k++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
266 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
267 #ifdef FIXED_POINT
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
268 y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][31 - k]));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
269 x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][31 - k]));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
270 #else
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
271 y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][31 - k])) / 32.0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
272 x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][31 - k])) / 32.0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
273 #endif
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
274 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
275
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
276 /* even n samples */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
277 DCT2_16_unscaled(x, x);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
278 /* odd n samples */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
279 DCT4_16(y, y);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
280
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
281 for (n = 8; n < 24; n++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
282 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
283 qmfs->v[qmfs->v_index + n*2] = qmfs->v[qmfs->v_index + 640 + n*2] = x[n-8];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
284 qmfs->v[qmfs->v_index + n*2+1] = qmfs->v[qmfs->v_index + 640 + n*2+1] = y[n-8];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
285 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
286 for (n = 0; n < 16; n++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
287 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
288 qmfs->v[qmfs->v_index + n] = qmfs->v[qmfs->v_index + 640 + n] = qmfs->v[qmfs->v_index + 32-n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
289 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
290 qmfs->v[qmfs->v_index + 48] = qmfs->v[qmfs->v_index + 640 + 48] = 0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
291 for (n = 1; n < 16; n++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
292 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
293 qmfs->v[qmfs->v_index + 48+n] = qmfs->v[qmfs->v_index + 640 + 48+n] = -qmfs->v[qmfs->v_index + 48-n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
294 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
295
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
296 /* calculate 32 output samples and window */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
297 for (k = 0; k < 32; k++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
298 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
299 output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
300 MUL_F(qmfs->v[qmfs->v_index + 96 + k], qmf_c[64 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
301 MUL_F(qmfs->v[qmfs->v_index + 128 + k], qmf_c[128 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
302 MUL_F(qmfs->v[qmfs->v_index + 224 + k], qmf_c[192 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
303 MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[256 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
304 MUL_F(qmfs->v[qmfs->v_index + 352 + k], qmf_c[320 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
305 MUL_F(qmfs->v[qmfs->v_index + 384 + k], qmf_c[384 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
306 MUL_F(qmfs->v[qmfs->v_index + 480 + k], qmf_c[448 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
307 MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[512 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
308 MUL_F(qmfs->v[qmfs->v_index + 608 + k], qmf_c[576 + 2*k]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
309 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
310
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
311 /* update the ringbuffer index */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
312 qmfs->v_index -= 64;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
313 if (qmfs->v_index < 0)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
314 qmfs->v_index = (640-64);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
315 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
316 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
317
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
318 void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
319 real_t *output)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
320 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
321 ALIGN real_t x[64];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
322 ALIGN real_t y[64];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
323 int16_t n, k, out = 0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
324 uint8_t l;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
325
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
326
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
327 /* qmf subsample l */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
328 for (l = 0; l < sbr->numTimeSlotsRate; l++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
329 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
330 /* shift buffers */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
331 /* we are not shifting v, it is a double ringbuffer */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
332 //memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
333
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
334 /* calculate 128 samples */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
335 for (k = 0; k < 32; k++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
336 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
337 #ifdef FIXED_POINT
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
338 y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][63 - k]));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
339 x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][63 - k]));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
340 #else
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
341 y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][63 - k])) / 32.0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
342 x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][63 - k])) / 32.0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
343 #endif
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
344 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
345
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
346 /* even n samples */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
347 DCT2_32_unscaled(x, x);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
348 /* odd n samples */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
349 DCT4_32(y, y);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
350
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
351 for (n = 16; n < 48; n++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
352 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
353 qmfs->v[qmfs->v_index + n*2] = qmfs->v[qmfs->v_index + 1280 + n*2] = x[n-16];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
354 qmfs->v[qmfs->v_index + n*2+1] = qmfs->v[qmfs->v_index + 1280 + n*2+1] = y[n-16];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
355 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
356 for (n = 0; n < 32; n++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
357 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
358 qmfs->v[qmfs->v_index + n] = qmfs->v[qmfs->v_index + 1280 + n] = qmfs->v[qmfs->v_index + 64-n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
359 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
360 qmfs->v[qmfs->v_index + 96] = qmfs->v[qmfs->v_index + 1280 + 96] = 0;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
361 for (n = 1; n < 32; n++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
362 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
363 qmfs->v[qmfs->v_index + 96+n] = qmfs->v[qmfs->v_index + 1280 + 96+n] = -qmfs->v[qmfs->v_index + 96-n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
364 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
365
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
366 /* calculate 64 output samples and window */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
367 for (k = 0; k < 64; k++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
368 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
369 output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
370 MUL_F(qmfs->v[qmfs->v_index + 192 + k], qmf_c[64 + k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
371 MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[128 + k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
372 MUL_F(qmfs->v[qmfs->v_index + 256 + 192 + k], qmf_c[128 + 64 + k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
373 MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[256 + k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
374 MUL_F(qmfs->v[qmfs->v_index + 512 + 192 + k], qmf_c[256 + 64 + k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
375 MUL_F(qmfs->v[qmfs->v_index + 768 + k], qmf_c[384 + k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
376 MUL_F(qmfs->v[qmfs->v_index + 768 + 192 + k], qmf_c[384 + 64 + k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
377 MUL_F(qmfs->v[qmfs->v_index + 1024 + k], qmf_c[512 + k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
378 MUL_F(qmfs->v[qmfs->v_index + 1024 + 192 + k], qmf_c[512 + 64 + k]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
379 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
380
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
381 /* update the ringbuffer index */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
382 qmfs->v_index -= 128;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
383 if (qmfs->v_index < 0)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
384 qmfs->v_index = (1280-128);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
385 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
386 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
387 #else
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
388 void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
389 real_t *output)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
390 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
391 ALIGN real_t x1[32], x2[32];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
392 #ifndef FIXED_POINT
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
393 real_t scale = 1.f/64.f;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
394 #endif
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
395 int16_t n, k, out = 0;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
396 uint8_t l;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
397
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
398
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
399 /* qmf subsample l */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
400 for (l = 0; l < sbr->numTimeSlotsRate; l++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
401 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
402 /* shift buffer v */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
403 /* buffer is not shifted, we are using a ringbuffer */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
404 //memmove(qmfs->v + 64, qmfs->v, (640-64)*sizeof(real_t));
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
405
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
406 /* calculate 64 samples */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
407 /* complex pre-twiddle */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
408 for (k = 0; k < 32; k++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
409 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
410 x1[k] = MUL_F(QMF_RE(X[l][k]), RE(qmf32_pre_twiddle[k])) - MUL_F(QMF_IM(X[l][k]), IM(qmf32_pre_twiddle[k]));
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
411 x2[k] = MUL_F(QMF_IM(X[l][k]), RE(qmf32_pre_twiddle[k])) + MUL_F(QMF_RE(X[l][k]), IM(qmf32_pre_twiddle[k]));
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
412
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
413 #ifndef FIXED_POINT
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
414 x1[k] *= scale;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
415 x2[k] *= scale;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
416 #else
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
417 x1[k] >>= 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
418 x2[k] >>= 1;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
419 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
420 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
421
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
422 /* transform */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
423 DCT4_32(x1, x1);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
424 DST4_32(x2, x2);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
425
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
426 for (n = 0; n < 32; n++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
427 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
428 qmfs->v[qmfs->v_index + n] = qmfs->v[qmfs->v_index + 640 + n] = -x1[n] + x2[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
429 qmfs->v[qmfs->v_index + 63 - n] = qmfs->v[qmfs->v_index + 640 + 63 - n] = x1[n] + x2[n];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
430 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
431
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
432 /* calculate 32 output samples and window */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
433 for (k = 0; k < 32; k++)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
434 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
435 output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
436 MUL_F(qmfs->v[qmfs->v_index + 96 + k], qmf_c[64 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
437 MUL_F(qmfs->v[qmfs->v_index + 128 + k], qmf_c[128 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
438 MUL_F(qmfs->v[qmfs->v_index + 224 + k], qmf_c[192 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
439 MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[256 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
440 MUL_F(qmfs->v[qmfs->v_index + 352 + k], qmf_c[320 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
441 MUL_F(qmfs->v[qmfs->v_index + 384 + k], qmf_c[384 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
442 MUL_F(qmfs->v[qmfs->v_index + 480 + k], qmf_c[448 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
443 MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[512 + 2*k]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
444 MUL_F(qmfs->v[qmfs->v_index + 608 + k], qmf_c[576 + 2*k]);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
445 }
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
446
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
447 /* update ringbuffer index */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
448 qmfs->v_index -= 64;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
449 if (qmfs->v_index < 0)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
450 qmfs->v_index = (640 - 64);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
451 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
452 }
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
453
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
454 void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
455 real_t *output)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
456 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
457 // ALIGN real_t x1[64], x2[64];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
458 #ifndef SBR_LOW_POWER
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
459 ALIGN real_t in_real1[32], in_imag1[32], out_real1[32], out_imag1[32];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
460 ALIGN real_t in_real2[32], in_imag2[32], out_real2[32], out_imag2[32];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
461 #endif
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
462 qmf_t * pX;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
463 real_t * pring_buffer_1, * pring_buffer_3;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
464 // real_t * ptemp_1, * ptemp_2;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
465 #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
466 // These pointers are used if target platform has autoinc address generators
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
467 real_t * pring_buffer_2, * pring_buffer_4;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
468 real_t * pring_buffer_5, * pring_buffer_6;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
469 real_t * pring_buffer_7, * pring_buffer_8;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
470 real_t * pring_buffer_9, * pring_buffer_10;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
471 const real_t * pqmf_c_1, * pqmf_c_2, * pqmf_c_3, * pqmf_c_4;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
472 const real_t * pqmf_c_5, * pqmf_c_6, * pqmf_c_7, * pqmf_c_8;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
473 const real_t * pqmf_c_9, * pqmf_c_10;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
474 #endif // #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
475 #ifndef FIXED_POINT
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
476 real_t scale = 1.f/64.f;
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
477 #endif
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
478 int16_t n, k, out = 0;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
479 uint8_t l;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
480
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
481
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
482 /* qmf subsample l */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
483 for (l = 0; l < sbr->numTimeSlotsRate; l++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
484 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
485 /* shift buffer v */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
486 /* buffer is not shifted, we use double ringbuffer */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
487 //memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t));
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
488
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
489 /* calculate 128 samples */
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
490 #ifndef FIXED_POINT
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
491
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
492 pX = X[l];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
493
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
494 in_imag1[31] = scale*QMF_RE(pX[1]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
495 in_real1[0] = scale*QMF_RE(pX[0]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
496 in_imag2[31] = scale*QMF_IM(pX[63-1]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
497 in_real2[0] = scale*QMF_IM(pX[63-0]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
498 for (k = 1; k < 31; k++)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
499 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
500 in_imag1[31 - k] = scale*QMF_RE(pX[2*k + 1]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
501 in_real1[ k] = scale*QMF_RE(pX[2*k ]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
502 in_imag2[31 - k] = scale*QMF_IM(pX[63 - (2*k + 1)]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
503 in_real2[ k] = scale*QMF_IM(pX[63 - (2*k )]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
504 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
505 in_imag1[0] = scale*QMF_RE(pX[63]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
506 in_real1[31] = scale*QMF_RE(pX[62]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
507 in_imag2[0] = scale*QMF_IM(pX[63-63]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
508 in_real2[31] = scale*QMF_IM(pX[63-62]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
509
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
510 #else
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
511
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
512 pX = X[l];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
513
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
514 in_imag1[31] = QMF_RE(pX[1]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
515 in_real1[0] = QMF_RE(pX[0]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
516 in_imag2[31] = QMF_IM(pX[62]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
517 in_real2[0] = QMF_IM(pX[63]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
518 for (k = 1; k < 31; k++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
519 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
520 in_imag1[31 - k] = QMF_RE(pX[2*k + 1]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
521 in_real1[ k] = QMF_RE(pX[2*k ]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
522 in_imag2[31 - k] = QMF_IM(pX[63 - (2*k + 1)]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
523 in_real2[ k] = QMF_IM(pX[63 - (2*k )]) >> 1;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
524 }
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
525 in_imag1[0] = QMF_RE(pX[63]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
526 in_real1[31] = QMF_RE(pX[62]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
527 in_imag2[0] = QMF_IM(pX[0]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
528 in_real2[31] = QMF_IM(pX[1]) >> 1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
529
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
530 #endif
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
531
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
532
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
533 // dct4_kernel is DCT_IV without reordering which is done before and after FFT
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
534 dct4_kernel(in_real1, in_imag1, out_real1, out_imag1);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
535 dct4_kernel(in_real2, in_imag2, out_real2, out_imag2);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
536
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
537
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
538 pring_buffer_1 = qmfs->v + qmfs->v_index;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
539 pring_buffer_3 = pring_buffer_1 + 1280;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
540 #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
541 pring_buffer_2 = pring_buffer_1 + 127;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
542 pring_buffer_4 = pring_buffer_1 + (1280 + 127);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
543 #endif // #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
544 // ptemp_1 = x1;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
545 // ptemp_2 = x2;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
546 #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
547 for (n = 0; n < 32; n ++)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
548 {
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
549 //real_t x1 = *ptemp_1++;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
550 //real_t x2 = *ptemp_2++;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
551 // pring_buffer_3 and pring_buffer_4 are needed only for double ring buffer
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
552 *pring_buffer_1++ = *pring_buffer_3++ = out_real2[n] - out_real1[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
553 *pring_buffer_2-- = *pring_buffer_4-- = out_real2[n] + out_real1[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
554 //x1 = *ptemp_1++;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
555 //x2 = *ptemp_2++;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
556 *pring_buffer_1++ = *pring_buffer_3++ = out_imag2[31-n] + out_imag1[31-n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
557 *pring_buffer_2-- = *pring_buffer_4-- = out_imag2[31-n] - out_imag1[31-n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
558 }
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
559 #else // #ifdef PREFER_POINTERS
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
560
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
561 for (n = 0; n < 32; n++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
562 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
563 // pring_buffer_3 and pring_buffer_4 are needed only for double ring buffer
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
564 pring_buffer_1[2*n] = pring_buffer_3[2*n] = out_real2[n] - out_real1[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
565 pring_buffer_1[127-2*n] = pring_buffer_3[127-2*n] = out_real2[n] + out_real1[n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
566 pring_buffer_1[2*n+1] = pring_buffer_3[2*n+1] = out_imag2[31-n] + out_imag1[31-n];
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
567 pring_buffer_1[127-(2*n+1)] = pring_buffer_3[127-(2*n+1)] = out_imag2[31-n] - out_imag1[31-n];
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
568 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
569
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
570 #endif // #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
571
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
572 pring_buffer_1 = qmfs->v + qmfs->v_index;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
573 #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
574 pring_buffer_2 = pring_buffer_1 + 192;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
575 pring_buffer_3 = pring_buffer_1 + 256;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
576 pring_buffer_4 = pring_buffer_1 + (256 + 192);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
577 pring_buffer_5 = pring_buffer_1 + 512;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
578 pring_buffer_6 = pring_buffer_1 + (512 + 192);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
579 pring_buffer_7 = pring_buffer_1 + 768;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
580 pring_buffer_8 = pring_buffer_1 + (768 + 192);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
581 pring_buffer_9 = pring_buffer_1 + 1024;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
582 pring_buffer_10 = pring_buffer_1 + (1024 + 192);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
583 pqmf_c_1 = qmf_c;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
584 pqmf_c_2 = qmf_c + 64;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
585 pqmf_c_3 = qmf_c + 128;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
586 pqmf_c_4 = qmf_c + 192;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
587 pqmf_c_5 = qmf_c + 256;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
588 pqmf_c_6 = qmf_c + 320;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
589 pqmf_c_7 = qmf_c + 384;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
590 pqmf_c_8 = qmf_c + 448;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
591 pqmf_c_9 = qmf_c + 512;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
592 pqmf_c_10 = qmf_c + 576;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
593 #endif // #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
594
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
595 /* calculate 64 output samples and window */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
596 for (k = 0; k < 64; k++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
597 {
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
598 #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
599 output[out++] =
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
600 MUL_F(*pring_buffer_1++, *pqmf_c_1++) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
601 MUL_F(*pring_buffer_2++, *pqmf_c_2++) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
602 MUL_F(*pring_buffer_3++, *pqmf_c_3++) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
603 MUL_F(*pring_buffer_4++, *pqmf_c_4++) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
604 MUL_F(*pring_buffer_5++, *pqmf_c_5++) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
605 MUL_F(*pring_buffer_6++, *pqmf_c_6++) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
606 MUL_F(*pring_buffer_7++, *pqmf_c_7++) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
607 MUL_F(*pring_buffer_8++, *pqmf_c_8++) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
608 MUL_F(*pring_buffer_9++, *pqmf_c_9++) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
609 MUL_F(*pring_buffer_10++, *pqmf_c_10++);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
610 #else // #ifdef PREFER_POINTERS
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
611 output[out++] =
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
612 MUL_F(pring_buffer_1[k+0], qmf_c[k+0]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
613 MUL_F(pring_buffer_1[k+192], qmf_c[k+64]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
614 MUL_F(pring_buffer_1[k+256], qmf_c[k+128]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
615 MUL_F(pring_buffer_1[k+(256+192)], qmf_c[k+192]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
616 MUL_F(pring_buffer_1[k+512], qmf_c[k+256]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
617 MUL_F(pring_buffer_1[k+(512+192)], qmf_c[k+320]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
618 MUL_F(pring_buffer_1[k+768], qmf_c[k+384]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
619 MUL_F(pring_buffer_1[k+(768+192)], qmf_c[k+448]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
620 MUL_F(pring_buffer_1[k+1024], qmf_c[k+512]) +
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
621 MUL_F(pring_buffer_1[k+(1024+192)], qmf_c[k+576]);
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
622 #endif // #ifdef PREFER_POINTERS
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
623 }
199
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
624
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
625 /* update ringbuffer index */
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
626 qmfs->v_index -= 128;
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
627 if (qmfs->v_index < 0)
0a2ad94e8607 [svn] Synced with bmp-mp4. Build system is fragile, but should work now.
chainsaw
parents: 61
diff changeset
628 qmfs->v_index = (1280 - 128);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
629 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
630 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
631 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
632
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
633 #endif