/proc/self/cwd/libfaad/filtbank.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
3 | | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
4 | | ** |
5 | | ** This program is free software; you can redistribute it and/or modify |
6 | | ** it under the terms of the GNU General Public License as published by |
7 | | ** the Free Software Foundation; either version 2 of the License, or |
8 | | ** (at your option) any later version. |
9 | | ** |
10 | | ** This program is distributed in the hope that it will be useful, |
11 | | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | | ** GNU General Public License for more details. |
14 | | ** |
15 | | ** You should have received a copy of the GNU General Public License |
16 | | ** along with this program; if not, write to the Free Software |
17 | | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | | ** |
19 | | ** Any non-GPL usage of this software or parts of this software is strictly |
20 | | ** forbidden. |
21 | | ** |
22 | | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2 |
23 | | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com" |
24 | | ** |
25 | | ** Commercial non-GPL licensing of this software is possible. |
26 | | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com. |
27 | | ** |
28 | | ** $Id: filtbank.c,v 1.46 2009/01/26 23:51:15 menno Exp $ |
29 | | **/ |
30 | | |
31 | | #include "common.h" |
32 | | #include "structs.h" |
33 | | |
34 | | #include <stdlib.h> |
35 | | #ifdef _WIN32_WCE |
36 | | #define assert(x) |
37 | | #else |
38 | | #include <assert.h> |
39 | | #endif |
40 | | |
41 | | #include "filtbank.h" |
42 | | #include "syntax.h" |
43 | | #include "kbd_win.h" |
44 | | #include "sine_win.h" |
45 | | #include "mdct.h" |
46 | | |
47 | | |
48 | | fb_info *filter_bank_init(uint16_t frame_len) |
49 | 24.7k | { |
50 | 24.7k | uint16_t nshort = frame_len/8; |
51 | | #ifdef LD_DEC |
52 | | uint16_t frame_len_ld = frame_len/2; |
53 | | #endif |
54 | | |
55 | 24.7k | fb_info *fb = (fb_info*)faad_malloc(sizeof(fb_info)); |
56 | 24.7k | memset(fb, 0, sizeof(fb_info)); |
57 | | |
58 | | /* normal */ |
59 | 24.7k | fb->mdct256 = faad_mdct_init(2*nshort); |
60 | 24.7k | fb->mdct2048 = faad_mdct_init(2*frame_len); |
61 | | #ifdef LD_DEC |
62 | | /* LD */ |
63 | | fb->mdct1024 = faad_mdct_init(2*frame_len_ld); |
64 | | #endif |
65 | | |
66 | 24.7k | #ifdef ALLOW_SMALL_FRAMELENGTH |
67 | 24.7k | if (frame_len == 1024) |
68 | 19.4k | { |
69 | 19.4k | #endif |
70 | 19.4k | fb->long_window[0] = sine_long_1024; |
71 | 19.4k | fb->short_window[0] = sine_short_128; |
72 | 19.4k | fb->long_window[1] = kbd_long_1024; |
73 | 19.4k | fb->short_window[1] = kbd_short_128; |
74 | | #ifdef LD_DEC |
75 | | fb->ld_window[0] = sine_mid_512; |
76 | | fb->ld_window[1] = ld_mid_512; |
77 | | #endif |
78 | 19.4k | #ifdef ALLOW_SMALL_FRAMELENGTH |
79 | 19.4k | } else /* (frame_len == 960) */ { |
80 | 5.24k | fb->long_window[0] = sine_long_960; |
81 | 5.24k | fb->short_window[0] = sine_short_120; |
82 | 5.24k | fb->long_window[1] = kbd_long_960; |
83 | 5.24k | fb->short_window[1] = kbd_short_120; |
84 | | #ifdef LD_DEC |
85 | | fb->ld_window[0] = sine_mid_480; |
86 | | fb->ld_window[1] = ld_mid_480; |
87 | | #endif |
88 | 5.24k | } |
89 | 24.7k | #endif |
90 | | |
91 | 24.7k | return fb; |
92 | 24.7k | } |
93 | | |
94 | | void filter_bank_end(fb_info *fb) |
95 | 25.2k | { |
96 | 25.2k | if (fb != NULL) |
97 | 24.7k | { |
98 | | #ifdef PROFILE |
99 | | printf("FB: %I64d cycles\n", fb->cycles); |
100 | | #endif |
101 | | |
102 | 24.7k | faad_mdct_end(fb->mdct256); |
103 | 24.7k | faad_mdct_end(fb->mdct2048); |
104 | | #ifdef LD_DEC |
105 | | faad_mdct_end(fb->mdct1024); |
106 | | #endif |
107 | | |
108 | 24.7k | faad_free(fb); |
109 | 24.7k | } |
110 | 25.2k | } |
111 | | |
112 | | static INLINE void imdct_long(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t len) |
113 | 150k | { |
114 | | #ifdef LD_DEC |
115 | | mdct_info *mdct = NULL; |
116 | | |
117 | | switch (len) |
118 | | { |
119 | | case 2048: |
120 | | case 1920: |
121 | | mdct = fb->mdct2048; |
122 | | break; |
123 | | case 1024: |
124 | | case 960: |
125 | | mdct = fb->mdct1024; |
126 | | break; |
127 | | } |
128 | | |
129 | | faad_imdct(mdct, in_data, out_data); |
130 | | #else |
131 | 150k | (void)len; |
132 | 150k | faad_imdct(fb->mdct2048, in_data, out_data); |
133 | 150k | #endif |
134 | 150k | } |
135 | | |
136 | | |
137 | | #ifdef LTP_DEC |
138 | | static INLINE void mdct(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t len) |
139 | 12.6k | { |
140 | 12.6k | mdct_info *mdct = NULL; |
141 | | |
142 | 12.6k | switch (len) |
143 | 12.6k | { |
144 | 4.99k | case 2048: |
145 | 12.2k | case 1920: |
146 | 12.2k | mdct = fb->mdct2048; |
147 | 12.2k | break; |
148 | 0 | case 256: |
149 | 0 | case 240: |
150 | 0 | mdct = fb->mdct256; |
151 | 0 | break; |
152 | 0 | #ifdef LD_DEC |
153 | 277 | case 1024: |
154 | 377 | case 960: |
155 | 377 | mdct = fb->mdct1024; |
156 | 377 | break; |
157 | 12.6k | #endif |
158 | 12.6k | } |
159 | | |
160 | 12.6k | faad_mdct(mdct, in_data, out_data); |
161 | 12.6k | } |
162 | | #endif |
163 | | |
164 | | void ifilter_bank(fb_info *fb, uint8_t window_sequence, uint8_t window_shape, |
165 | | uint8_t window_shape_prev, real_t *freq_in, |
166 | | real_t *time_out, real_t *overlap, |
167 | | uint8_t object_type, uint16_t frame_len) |
168 | 1.25M | { |
169 | 1.25M | int16_t i; |
170 | 1.25M | ALIGN real_t transf_buf[2*1024] = {0}; |
171 | | |
172 | 1.25M | const real_t *window_long = NULL; |
173 | 1.25M | const real_t *window_long_prev = NULL; |
174 | 1.25M | const real_t *window_short = NULL; |
175 | 1.25M | const real_t *window_short_prev = NULL; |
176 | | |
177 | 1.25M | uint16_t nlong = frame_len; |
178 | 1.25M | uint16_t nshort = frame_len/8; |
179 | 1.25M | uint16_t trans = nshort/2; |
180 | | |
181 | 1.25M | uint16_t nflat_ls = (nlong-nshort)/2; |
182 | | |
183 | | #ifdef PROFILE |
184 | | int64_t count = faad_get_ts(); |
185 | | #endif |
186 | | |
187 | | /* select windows of current frame and previous frame (Sine or KBD) */ |
188 | | #ifdef LD_DEC |
189 | 900k | if (object_type == LD) |
190 | 8.11k | { |
191 | 8.11k | window_long = fb->ld_window[window_shape]; |
192 | 8.11k | window_long_prev = fb->ld_window[window_shape_prev]; |
193 | 892k | } else { |
194 | | #else |
195 | | (void)object_type; |
196 | | #endif |
197 | 892k | window_long = fb->long_window[window_shape]; |
198 | 892k | window_long_prev = fb->long_window[window_shape_prev]; |
199 | 892k | window_short = fb->short_window[window_shape]; |
200 | 892k | window_short_prev = fb->short_window[window_shape_prev]; |
201 | | #ifdef LD_DEC |
202 | | } |
203 | | #endif |
204 | | |
205 | | #if 0 |
206 | | for (i = 0; i < 1024; i++) |
207 | | { |
208 | | printf("%d\n", freq_in[i]); |
209 | | } |
210 | | #endif |
211 | | |
212 | | #if 0 |
213 | | printf("%d %d\n", window_sequence, window_shape); |
214 | | #endif |
215 | | |
216 | 1.25M | switch (window_sequence) |
217 | 1.25M | { |
218 | 1.01M | case ONLY_LONG_SEQUENCE: |
219 | | /* perform iMDCT */ |
220 | 1.01M | imdct_long(fb, freq_in, transf_buf, 2*nlong); |
221 | | |
222 | | /* add second half output of previous frame to windowed output of current frame */ |
223 | 258M | for (i = 0; i < nlong; i+=4) |
224 | 257M | { |
225 | 257M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); |
226 | 257M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); |
227 | 257M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); |
228 | 257M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); |
229 | 257M | } |
230 | | |
231 | | /* window the second half and save as overlap for next frame */ |
232 | 258M | for (i = 0; i < nlong; i+=4) |
233 | 257M | { |
234 | 257M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); |
235 | 257M | overlap[i+1] = MUL_F(transf_buf[nlong+i+1],window_long[nlong-2-i]); |
236 | 257M | overlap[i+2] = MUL_F(transf_buf[nlong+i+2],window_long[nlong-3-i]); |
237 | 257M | overlap[i+3] = MUL_F(transf_buf[nlong+i+3],window_long[nlong-4-i]); |
238 | 257M | } |
239 | 1.01M | break; |
240 | | |
241 | 71.5k | case LONG_START_SEQUENCE: |
242 | | /* perform iMDCT */ |
243 | 71.5k | imdct_long(fb, freq_in, transf_buf, 2*nlong); |
244 | | |
245 | | /* add second half output of previous frame to windowed output of current frame */ |
246 | 17.9M | for (i = 0; i < nlong; i+=4) |
247 | 17.8M | { |
248 | 17.8M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); |
249 | 17.8M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); |
250 | 17.8M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); |
251 | 17.8M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); |
252 | 17.8M | } |
253 | | |
254 | | /* window the second half and save as overlap for next frame */ |
255 | | /* construct second half window using padding with 1's and 0's */ |
256 | 31.3M | for (i = 0; i < nflat_ls; i++) |
257 | 31.2M | overlap[i] = transf_buf[nlong+i]; |
258 | 8.99M | for (i = 0; i < nshort; i++) |
259 | 8.92M | overlap[nflat_ls+i] = MUL_F(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]); |
260 | 31.3M | for (i = 0; i < nflat_ls; i++) |
261 | 31.2M | overlap[nflat_ls+nshort+i] = 0; |
262 | 71.5k | break; |
263 | | |
264 | 123k | case EIGHT_SHORT_SEQUENCE: |
265 | | /* perform iMDCT for each short block */ |
266 | 123k | faad_imdct(fb->mdct256, freq_in+0*nshort, transf_buf+2*nshort*0); |
267 | 123k | faad_imdct(fb->mdct256, freq_in+1*nshort, transf_buf+2*nshort*1); |
268 | 123k | faad_imdct(fb->mdct256, freq_in+2*nshort, transf_buf+2*nshort*2); |
269 | 123k | faad_imdct(fb->mdct256, freq_in+3*nshort, transf_buf+2*nshort*3); |
270 | 123k | faad_imdct(fb->mdct256, freq_in+4*nshort, transf_buf+2*nshort*4); |
271 | 123k | faad_imdct(fb->mdct256, freq_in+5*nshort, transf_buf+2*nshort*5); |
272 | 123k | faad_imdct(fb->mdct256, freq_in+6*nshort, transf_buf+2*nshort*6); |
273 | 123k | faad_imdct(fb->mdct256, freq_in+7*nshort, transf_buf+2*nshort*7); |
274 | | |
275 | | /* add second half output of previous frame to windowed output of current frame */ |
276 | 55.0M | for (i = 0; i < nflat_ls; i++) |
277 | 54.8M | time_out[i] = overlap[i]; |
278 | 15.8M | for(i = 0; i < nshort; i++) |
279 | 15.6M | { |
280 | 15.6M | time_out[nflat_ls+ i] = overlap[nflat_ls+ i] + MUL_F(transf_buf[nshort*0+i],window_short_prev[i]); |
281 | 15.6M | time_out[nflat_ls+1*nshort+i] = overlap[nflat_ls+nshort*1+i] + MUL_F(transf_buf[nshort*1+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*2+i],window_short[i]); |
282 | 15.6M | time_out[nflat_ls+2*nshort+i] = overlap[nflat_ls+nshort*2+i] + MUL_F(transf_buf[nshort*3+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*4+i],window_short[i]); |
283 | 15.6M | time_out[nflat_ls+3*nshort+i] = overlap[nflat_ls+nshort*3+i] + MUL_F(transf_buf[nshort*5+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*6+i],window_short[i]); |
284 | 15.6M | if (i < trans) |
285 | 7.83M | time_out[nflat_ls+4*nshort+i] = overlap[nflat_ls+nshort*4+i] + MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); |
286 | 15.6M | } |
287 | | |
288 | | /* window the second half and save as overlap for next frame */ |
289 | 15.8M | for(i = 0; i < nshort; i++) |
290 | 15.6M | { |
291 | 15.6M | if (i >= trans) |
292 | 7.83M | overlap[nflat_ls+4*nshort+i-nlong] = MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); |
293 | 15.6M | overlap[nflat_ls+5*nshort+i-nlong] = MUL_F(transf_buf[nshort*9+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*10+i],window_short[i]); |
294 | 15.6M | overlap[nflat_ls+6*nshort+i-nlong] = MUL_F(transf_buf[nshort*11+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*12+i],window_short[i]); |
295 | 15.6M | overlap[nflat_ls+7*nshort+i-nlong] = MUL_F(transf_buf[nshort*13+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*14+i],window_short[i]); |
296 | 15.6M | overlap[nflat_ls+8*nshort+i-nlong] = MUL_F(transf_buf[nshort*15+i],window_short[nshort-1-i]); |
297 | 15.6M | } |
298 | 55.0M | for (i = 0; i < nflat_ls; i++) |
299 | 54.8M | overlap[nflat_ls+nshort+i] = 0; |
300 | 123k | break; |
301 | | |
302 | 36.6k | case LONG_STOP_SEQUENCE: |
303 | | /* perform iMDCT */ |
304 | 36.6k | imdct_long(fb, freq_in, transf_buf, 2*nlong); |
305 | | |
306 | | /* add second half output of previous frame to windowed output of current frame */ |
307 | | /* construct first half window using padding with 1's and 0's */ |
308 | 16.2M | for (i = 0; i < nflat_ls; i++) |
309 | 16.1M | time_out[i] = overlap[i]; |
310 | 4.65M | for (i = 0; i < nshort; i++) |
311 | 4.61M | time_out[nflat_ls+i] = overlap[nflat_ls+i] + MUL_F(transf_buf[nflat_ls+i],window_short_prev[i]); |
312 | 16.2M | for (i = 0; i < nflat_ls; i++) |
313 | 16.1M | time_out[nflat_ls+nshort+i] = overlap[nflat_ls+nshort+i] + transf_buf[nflat_ls+nshort+i]; |
314 | | |
315 | | /* window the second half and save as overlap for next frame */ |
316 | 36.9M | for (i = 0; i < nlong; i++) |
317 | 36.9M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); |
318 | 36.6k | break; |
319 | 1.25M | } |
320 | | |
321 | | #if 0 |
322 | | for (i = 0; i < 1024; i++) |
323 | | { |
324 | | printf("%d\n", time_out[i]); |
325 | | //printf("0x%.8X\n", time_out[i]); |
326 | | } |
327 | | #endif |
328 | | |
329 | | |
330 | | #ifdef PROFILE |
331 | | count = faad_get_ts() - count; |
332 | | fb->cycles += count; |
333 | | #endif |
334 | 1.25M | } Line | Count | Source | 168 | 175k | { | 169 | 175k | int16_t i; | 170 | 175k | ALIGN real_t transf_buf[2*1024] = {0}; | 171 | | | 172 | 175k | const real_t *window_long = NULL; | 173 | 175k | const real_t *window_long_prev = NULL; | 174 | 175k | const real_t *window_short = NULL; | 175 | 175k | const real_t *window_short_prev = NULL; | 176 | | | 177 | 175k | uint16_t nlong = frame_len; | 178 | 175k | uint16_t nshort = frame_len/8; | 179 | 175k | uint16_t trans = nshort/2; | 180 | | | 181 | 175k | uint16_t nflat_ls = (nlong-nshort)/2; | 182 | | | 183 | | #ifdef PROFILE | 184 | | int64_t count = faad_get_ts(); | 185 | | #endif | 186 | | | 187 | | /* select windows of current frame and previous frame (Sine or KBD) */ | 188 | | #ifdef LD_DEC | 189 | | if (object_type == LD) | 190 | | { | 191 | | window_long = fb->ld_window[window_shape]; | 192 | | window_long_prev = fb->ld_window[window_shape_prev]; | 193 | | } else { | 194 | | #else | 195 | 175k | (void)object_type; | 196 | 175k | #endif | 197 | 175k | window_long = fb->long_window[window_shape]; | 198 | 175k | window_long_prev = fb->long_window[window_shape_prev]; | 199 | 175k | window_short = fb->short_window[window_shape]; | 200 | 175k | window_short_prev = fb->short_window[window_shape_prev]; | 201 | | #ifdef LD_DEC | 202 | | } | 203 | | #endif | 204 | | | 205 | | #if 0 | 206 | | for (i = 0; i < 1024; i++) | 207 | | { | 208 | | printf("%d\n", freq_in[i]); | 209 | | } | 210 | | #endif | 211 | | | 212 | | #if 0 | 213 | | printf("%d %d\n", window_sequence, window_shape); | 214 | | #endif | 215 | | | 216 | 175k | switch (window_sequence) | 217 | 175k | { | 218 | 132k | case ONLY_LONG_SEQUENCE: | 219 | | /* perform iMDCT */ | 220 | 132k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 221 | | | 222 | | /* add second half output of previous frame to windowed output of current frame */ | 223 | 33.6M | for (i = 0; i < nlong; i+=4) | 224 | 33.4M | { | 225 | 33.4M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); | 226 | 33.4M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); | 227 | 33.4M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); | 228 | 33.4M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); | 229 | 33.4M | } | 230 | | | 231 | | /* window the second half and save as overlap for next frame */ | 232 | 33.6M | for (i = 0; i < nlong; i+=4) | 233 | 33.4M | { | 234 | 33.4M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); | 235 | 33.4M | overlap[i+1] = MUL_F(transf_buf[nlong+i+1],window_long[nlong-2-i]); | 236 | 33.4M | overlap[i+2] = MUL_F(transf_buf[nlong+i+2],window_long[nlong-3-i]); | 237 | 33.4M | overlap[i+3] = MUL_F(transf_buf[nlong+i+3],window_long[nlong-4-i]); | 238 | 33.4M | } | 239 | 132k | break; | 240 | | | 241 | 9.59k | case LONG_START_SEQUENCE: | 242 | | /* perform iMDCT */ | 243 | 9.59k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 244 | | | 245 | | /* add second half output of previous frame to windowed output of current frame */ | 246 | 2.39M | for (i = 0; i < nlong; i+=4) | 247 | 2.38M | { | 248 | 2.38M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); | 249 | 2.38M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); | 250 | 2.38M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); | 251 | 2.38M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); | 252 | 2.38M | } | 253 | | | 254 | | /* window the second half and save as overlap for next frame */ | 255 | | /* construct second half window using padding with 1's and 0's */ | 256 | 4.18M | for (i = 0; i < nflat_ls; i++) | 257 | 4.17M | overlap[i] = transf_buf[nlong+i]; | 258 | 1.20M | for (i = 0; i < nshort; i++) | 259 | 1.19M | overlap[nflat_ls+i] = MUL_F(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]); | 260 | 4.18M | for (i = 0; i < nflat_ls; i++) | 261 | 4.17M | overlap[nflat_ls+nshort+i] = 0; | 262 | 9.59k | break; | 263 | | | 264 | 24.7k | case EIGHT_SHORT_SEQUENCE: | 265 | | /* perform iMDCT for each short block */ | 266 | 24.7k | faad_imdct(fb->mdct256, freq_in+0*nshort, transf_buf+2*nshort*0); | 267 | 24.7k | faad_imdct(fb->mdct256, freq_in+1*nshort, transf_buf+2*nshort*1); | 268 | 24.7k | faad_imdct(fb->mdct256, freq_in+2*nshort, transf_buf+2*nshort*2); | 269 | 24.7k | faad_imdct(fb->mdct256, freq_in+3*nshort, transf_buf+2*nshort*3); | 270 | 24.7k | faad_imdct(fb->mdct256, freq_in+4*nshort, transf_buf+2*nshort*4); | 271 | 24.7k | faad_imdct(fb->mdct256, freq_in+5*nshort, transf_buf+2*nshort*5); | 272 | 24.7k | faad_imdct(fb->mdct256, freq_in+6*nshort, transf_buf+2*nshort*6); | 273 | 24.7k | faad_imdct(fb->mdct256, freq_in+7*nshort, transf_buf+2*nshort*7); | 274 | | | 275 | | /* add second half output of previous frame to windowed output of current frame */ | 276 | 10.9M | for (i = 0; i < nflat_ls; i++) | 277 | 10.9M | time_out[i] = overlap[i]; | 278 | 3.14M | for(i = 0; i < nshort; i++) | 279 | 3.12M | { | 280 | 3.12M | time_out[nflat_ls+ i] = overlap[nflat_ls+ i] + MUL_F(transf_buf[nshort*0+i],window_short_prev[i]); | 281 | 3.12M | time_out[nflat_ls+1*nshort+i] = overlap[nflat_ls+nshort*1+i] + MUL_F(transf_buf[nshort*1+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*2+i],window_short[i]); | 282 | 3.12M | time_out[nflat_ls+2*nshort+i] = overlap[nflat_ls+nshort*2+i] + MUL_F(transf_buf[nshort*3+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*4+i],window_short[i]); | 283 | 3.12M | time_out[nflat_ls+3*nshort+i] = overlap[nflat_ls+nshort*3+i] + MUL_F(transf_buf[nshort*5+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*6+i],window_short[i]); | 284 | 3.12M | if (i < trans) | 285 | 1.56M | time_out[nflat_ls+4*nshort+i] = overlap[nflat_ls+nshort*4+i] + MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); | 286 | 3.12M | } | 287 | | | 288 | | /* window the second half and save as overlap for next frame */ | 289 | 3.14M | for(i = 0; i < nshort; i++) | 290 | 3.12M | { | 291 | 3.12M | if (i >= trans) | 292 | 1.56M | overlap[nflat_ls+4*nshort+i-nlong] = MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); | 293 | 3.12M | overlap[nflat_ls+5*nshort+i-nlong] = MUL_F(transf_buf[nshort*9+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*10+i],window_short[i]); | 294 | 3.12M | overlap[nflat_ls+6*nshort+i-nlong] = MUL_F(transf_buf[nshort*11+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*12+i],window_short[i]); | 295 | 3.12M | overlap[nflat_ls+7*nshort+i-nlong] = MUL_F(transf_buf[nshort*13+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*14+i],window_short[i]); | 296 | 3.12M | overlap[nflat_ls+8*nshort+i-nlong] = MUL_F(transf_buf[nshort*15+i],window_short[nshort-1-i]); | 297 | 3.12M | } | 298 | 10.9M | for (i = 0; i < nflat_ls; i++) | 299 | 10.9M | overlap[nflat_ls+nshort+i] = 0; | 300 | 24.7k | break; | 301 | | | 302 | 8.56k | case LONG_STOP_SEQUENCE: | 303 | | /* perform iMDCT */ | 304 | 8.56k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 305 | | | 306 | | /* add second half output of previous frame to windowed output of current frame */ | 307 | | /* construct first half window using padding with 1's and 0's */ | 308 | 3.80M | for (i = 0; i < nflat_ls; i++) | 309 | 3.79M | time_out[i] = overlap[i]; | 310 | 1.09M | for (i = 0; i < nshort; i++) | 311 | 1.08M | time_out[nflat_ls+i] = overlap[nflat_ls+i] + MUL_F(transf_buf[nflat_ls+i],window_short_prev[i]); | 312 | 3.80M | for (i = 0; i < nflat_ls; i++) | 313 | 3.79M | time_out[nflat_ls+nshort+i] = overlap[nflat_ls+nshort+i] + transf_buf[nflat_ls+nshort+i]; | 314 | | | 315 | | /* window the second half and save as overlap for next frame */ | 316 | 8.69M | for (i = 0; i < nlong; i++) | 317 | 8.68M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); | 318 | 8.56k | break; | 319 | 175k | } | 320 | | | 321 | | #if 0 | 322 | | for (i = 0; i < 1024; i++) | 323 | | { | 324 | | printf("%d\n", time_out[i]); | 325 | | //printf("0x%.8X\n", time_out[i]); | 326 | | } | 327 | | #endif | 328 | | | 329 | | | 330 | | #ifdef PROFILE | 331 | | count = faad_get_ts() - count; | 332 | | fb->cycles += count; | 333 | | #endif | 334 | 175k | } |
Line | Count | Source | 168 | 450k | { | 169 | 450k | int16_t i; | 170 | 450k | ALIGN real_t transf_buf[2*1024] = {0}; | 171 | | | 172 | 450k | const real_t *window_long = NULL; | 173 | 450k | const real_t *window_long_prev = NULL; | 174 | 450k | const real_t *window_short = NULL; | 175 | 450k | const real_t *window_short_prev = NULL; | 176 | | | 177 | 450k | uint16_t nlong = frame_len; | 178 | 450k | uint16_t nshort = frame_len/8; | 179 | 450k | uint16_t trans = nshort/2; | 180 | | | 181 | 450k | uint16_t nflat_ls = (nlong-nshort)/2; | 182 | | | 183 | | #ifdef PROFILE | 184 | | int64_t count = faad_get_ts(); | 185 | | #endif | 186 | | | 187 | | /* select windows of current frame and previous frame (Sine or KBD) */ | 188 | 450k | #ifdef LD_DEC | 189 | 450k | if (object_type == LD) | 190 | 4.05k | { | 191 | 4.05k | window_long = fb->ld_window[window_shape]; | 192 | 4.05k | window_long_prev = fb->ld_window[window_shape_prev]; | 193 | 446k | } else { | 194 | | #else | 195 | | (void)object_type; | 196 | | #endif | 197 | 446k | window_long = fb->long_window[window_shape]; | 198 | 446k | window_long_prev = fb->long_window[window_shape_prev]; | 199 | 446k | window_short = fb->short_window[window_shape]; | 200 | 446k | window_short_prev = fb->short_window[window_shape_prev]; | 201 | 446k | #ifdef LD_DEC | 202 | 446k | } | 203 | 450k | #endif | 204 | | | 205 | | #if 0 | 206 | | for (i = 0; i < 1024; i++) | 207 | | { | 208 | | printf("%d\n", freq_in[i]); | 209 | | } | 210 | | #endif | 211 | | | 212 | | #if 0 | 213 | | printf("%d %d\n", window_sequence, window_shape); | 214 | | #endif | 215 | | | 216 | 450k | switch (window_sequence) | 217 | 450k | { | 218 | 377k | case ONLY_LONG_SEQUENCE: | 219 | | /* perform iMDCT */ | 220 | 377k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 221 | | | 222 | | /* add second half output of previous frame to windowed output of current frame */ | 223 | 95.6M | for (i = 0; i < nlong; i+=4) | 224 | 95.3M | { | 225 | 95.3M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); | 226 | 95.3M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); | 227 | 95.3M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); | 228 | 95.3M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); | 229 | 95.3M | } | 230 | | | 231 | | /* window the second half and save as overlap for next frame */ | 232 | 95.6M | for (i = 0; i < nlong; i+=4) | 233 | 95.3M | { | 234 | 95.3M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); | 235 | 95.3M | overlap[i+1] = MUL_F(transf_buf[nlong+i+1],window_long[nlong-2-i]); | 236 | 95.3M | overlap[i+2] = MUL_F(transf_buf[nlong+i+2],window_long[nlong-3-i]); | 237 | 95.3M | overlap[i+3] = MUL_F(transf_buf[nlong+i+3],window_long[nlong-4-i]); | 238 | 95.3M | } | 239 | 377k | break; | 240 | | | 241 | 26.1k | case LONG_START_SEQUENCE: | 242 | | /* perform iMDCT */ | 243 | 26.1k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 244 | | | 245 | | /* add second half output of previous frame to windowed output of current frame */ | 246 | 6.56M | for (i = 0; i < nlong; i+=4) | 247 | 6.53M | { | 248 | 6.53M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); | 249 | 6.53M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); | 250 | 6.53M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); | 251 | 6.53M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); | 252 | 6.53M | } | 253 | | | 254 | | /* window the second half and save as overlap for next frame */ | 255 | | /* construct second half window using padding with 1's and 0's */ | 256 | 11.4M | for (i = 0; i < nflat_ls; i++) | 257 | 11.4M | overlap[i] = transf_buf[nlong+i]; | 258 | 3.29M | for (i = 0; i < nshort; i++) | 259 | 3.26M | overlap[nflat_ls+i] = MUL_F(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]); | 260 | 11.4M | for (i = 0; i < nflat_ls; i++) | 261 | 11.4M | overlap[nflat_ls+nshort+i] = 0; | 262 | 26.1k | break; | 263 | | | 264 | 37.2k | case EIGHT_SHORT_SEQUENCE: | 265 | | /* perform iMDCT for each short block */ | 266 | 37.2k | faad_imdct(fb->mdct256, freq_in+0*nshort, transf_buf+2*nshort*0); | 267 | 37.2k | faad_imdct(fb->mdct256, freq_in+1*nshort, transf_buf+2*nshort*1); | 268 | 37.2k | faad_imdct(fb->mdct256, freq_in+2*nshort, transf_buf+2*nshort*2); | 269 | 37.2k | faad_imdct(fb->mdct256, freq_in+3*nshort, transf_buf+2*nshort*3); | 270 | 37.2k | faad_imdct(fb->mdct256, freq_in+4*nshort, transf_buf+2*nshort*4); | 271 | 37.2k | faad_imdct(fb->mdct256, freq_in+5*nshort, transf_buf+2*nshort*5); | 272 | 37.2k | faad_imdct(fb->mdct256, freq_in+6*nshort, transf_buf+2*nshort*6); | 273 | 37.2k | faad_imdct(fb->mdct256, freq_in+7*nshort, transf_buf+2*nshort*7); | 274 | | | 275 | | /* add second half output of previous frame to windowed output of current frame */ | 276 | 16.5M | for (i = 0; i < nflat_ls; i++) | 277 | 16.5M | time_out[i] = overlap[i]; | 278 | 4.75M | for(i = 0; i < nshort; i++) | 279 | 4.71M | { | 280 | 4.71M | time_out[nflat_ls+ i] = overlap[nflat_ls+ i] + MUL_F(transf_buf[nshort*0+i],window_short_prev[i]); | 281 | 4.71M | time_out[nflat_ls+1*nshort+i] = overlap[nflat_ls+nshort*1+i] + MUL_F(transf_buf[nshort*1+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*2+i],window_short[i]); | 282 | 4.71M | time_out[nflat_ls+2*nshort+i] = overlap[nflat_ls+nshort*2+i] + MUL_F(transf_buf[nshort*3+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*4+i],window_short[i]); | 283 | 4.71M | time_out[nflat_ls+3*nshort+i] = overlap[nflat_ls+nshort*3+i] + MUL_F(transf_buf[nshort*5+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*6+i],window_short[i]); | 284 | 4.71M | if (i < trans) | 285 | 2.35M | time_out[nflat_ls+4*nshort+i] = overlap[nflat_ls+nshort*4+i] + MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); | 286 | 4.71M | } | 287 | | | 288 | | /* window the second half and save as overlap for next frame */ | 289 | 4.75M | for(i = 0; i < nshort; i++) | 290 | 4.71M | { | 291 | 4.71M | if (i >= trans) | 292 | 2.35M | overlap[nflat_ls+4*nshort+i-nlong] = MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); | 293 | 4.71M | overlap[nflat_ls+5*nshort+i-nlong] = MUL_F(transf_buf[nshort*9+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*10+i],window_short[i]); | 294 | 4.71M | overlap[nflat_ls+6*nshort+i-nlong] = MUL_F(transf_buf[nshort*11+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*12+i],window_short[i]); | 295 | 4.71M | overlap[nflat_ls+7*nshort+i-nlong] = MUL_F(transf_buf[nshort*13+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*14+i],window_short[i]); | 296 | 4.71M | overlap[nflat_ls+8*nshort+i-nlong] = MUL_F(transf_buf[nshort*15+i],window_short[nshort-1-i]); | 297 | 4.71M | } | 298 | 16.5M | for (i = 0; i < nflat_ls; i++) | 299 | 16.5M | overlap[nflat_ls+nshort+i] = 0; | 300 | 37.2k | break; | 301 | | | 302 | 9.77k | case LONG_STOP_SEQUENCE: | 303 | | /* perform iMDCT */ | 304 | 9.77k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 305 | | | 306 | | /* add second half output of previous frame to windowed output of current frame */ | 307 | | /* construct first half window using padding with 1's and 0's */ | 308 | 4.29M | for (i = 0; i < nflat_ls; i++) | 309 | 4.28M | time_out[i] = overlap[i]; | 310 | 1.23M | for (i = 0; i < nshort; i++) | 311 | 1.22M | time_out[nflat_ls+i] = overlap[nflat_ls+i] + MUL_F(transf_buf[nflat_ls+i],window_short_prev[i]); | 312 | 4.29M | for (i = 0; i < nflat_ls; i++) | 313 | 4.28M | time_out[nflat_ls+nshort+i] = overlap[nflat_ls+nshort+i] + transf_buf[nflat_ls+nshort+i]; | 314 | | | 315 | | /* window the second half and save as overlap for next frame */ | 316 | 9.79M | for (i = 0; i < nlong; i++) | 317 | 9.78M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); | 318 | 9.77k | break; | 319 | 450k | } | 320 | | | 321 | | #if 0 | 322 | | for (i = 0; i < 1024; i++) | 323 | | { | 324 | | printf("%d\n", time_out[i]); | 325 | | //printf("0x%.8X\n", time_out[i]); | 326 | | } | 327 | | #endif | 328 | | | 329 | | | 330 | | #ifdef PROFILE | 331 | | count = faad_get_ts() - count; | 332 | | fb->cycles += count; | 333 | | #endif | 334 | 450k | } |
Line | Count | Source | 168 | 450k | { | 169 | 450k | int16_t i; | 170 | 450k | ALIGN real_t transf_buf[2*1024] = {0}; | 171 | | | 172 | 450k | const real_t *window_long = NULL; | 173 | 450k | const real_t *window_long_prev = NULL; | 174 | 450k | const real_t *window_short = NULL; | 175 | 450k | const real_t *window_short_prev = NULL; | 176 | | | 177 | 450k | uint16_t nlong = frame_len; | 178 | 450k | uint16_t nshort = frame_len/8; | 179 | 450k | uint16_t trans = nshort/2; | 180 | | | 181 | 450k | uint16_t nflat_ls = (nlong-nshort)/2; | 182 | | | 183 | | #ifdef PROFILE | 184 | | int64_t count = faad_get_ts(); | 185 | | #endif | 186 | | | 187 | | /* select windows of current frame and previous frame (Sine or KBD) */ | 188 | 450k | #ifdef LD_DEC | 189 | 450k | if (object_type == LD) | 190 | 4.05k | { | 191 | 4.05k | window_long = fb->ld_window[window_shape]; | 192 | 4.05k | window_long_prev = fb->ld_window[window_shape_prev]; | 193 | 446k | } else { | 194 | | #else | 195 | | (void)object_type; | 196 | | #endif | 197 | 446k | window_long = fb->long_window[window_shape]; | 198 | 446k | window_long_prev = fb->long_window[window_shape_prev]; | 199 | 446k | window_short = fb->short_window[window_shape]; | 200 | 446k | window_short_prev = fb->short_window[window_shape_prev]; | 201 | 446k | #ifdef LD_DEC | 202 | 446k | } | 203 | 450k | #endif | 204 | | | 205 | | #if 0 | 206 | | for (i = 0; i < 1024; i++) | 207 | | { | 208 | | printf("%d\n", freq_in[i]); | 209 | | } | 210 | | #endif | 211 | | | 212 | | #if 0 | 213 | | printf("%d %d\n", window_sequence, window_shape); | 214 | | #endif | 215 | | | 216 | 450k | switch (window_sequence) | 217 | 450k | { | 218 | 377k | case ONLY_LONG_SEQUENCE: | 219 | | /* perform iMDCT */ | 220 | 377k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 221 | | | 222 | | /* add second half output of previous frame to windowed output of current frame */ | 223 | 95.6M | for (i = 0; i < nlong; i+=4) | 224 | 95.3M | { | 225 | 95.3M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); | 226 | 95.3M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); | 227 | 95.3M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); | 228 | 95.3M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); | 229 | 95.3M | } | 230 | | | 231 | | /* window the second half and save as overlap for next frame */ | 232 | 95.6M | for (i = 0; i < nlong; i+=4) | 233 | 95.3M | { | 234 | 95.3M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); | 235 | 95.3M | overlap[i+1] = MUL_F(transf_buf[nlong+i+1],window_long[nlong-2-i]); | 236 | 95.3M | overlap[i+2] = MUL_F(transf_buf[nlong+i+2],window_long[nlong-3-i]); | 237 | 95.3M | overlap[i+3] = MUL_F(transf_buf[nlong+i+3],window_long[nlong-4-i]); | 238 | 95.3M | } | 239 | 377k | break; | 240 | | | 241 | 26.1k | case LONG_START_SEQUENCE: | 242 | | /* perform iMDCT */ | 243 | 26.1k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 244 | | | 245 | | /* add second half output of previous frame to windowed output of current frame */ | 246 | 6.56M | for (i = 0; i < nlong; i+=4) | 247 | 6.53M | { | 248 | 6.53M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); | 249 | 6.53M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); | 250 | 6.53M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); | 251 | 6.53M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); | 252 | 6.53M | } | 253 | | | 254 | | /* window the second half and save as overlap for next frame */ | 255 | | /* construct second half window using padding with 1's and 0's */ | 256 | 11.4M | for (i = 0; i < nflat_ls; i++) | 257 | 11.4M | overlap[i] = transf_buf[nlong+i]; | 258 | 3.29M | for (i = 0; i < nshort; i++) | 259 | 3.26M | overlap[nflat_ls+i] = MUL_F(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]); | 260 | 11.4M | for (i = 0; i < nflat_ls; i++) | 261 | 11.4M | overlap[nflat_ls+nshort+i] = 0; | 262 | 26.1k | break; | 263 | | | 264 | 37.2k | case EIGHT_SHORT_SEQUENCE: | 265 | | /* perform iMDCT for each short block */ | 266 | 37.2k | faad_imdct(fb->mdct256, freq_in+0*nshort, transf_buf+2*nshort*0); | 267 | 37.2k | faad_imdct(fb->mdct256, freq_in+1*nshort, transf_buf+2*nshort*1); | 268 | 37.2k | faad_imdct(fb->mdct256, freq_in+2*nshort, transf_buf+2*nshort*2); | 269 | 37.2k | faad_imdct(fb->mdct256, freq_in+3*nshort, transf_buf+2*nshort*3); | 270 | 37.2k | faad_imdct(fb->mdct256, freq_in+4*nshort, transf_buf+2*nshort*4); | 271 | 37.2k | faad_imdct(fb->mdct256, freq_in+5*nshort, transf_buf+2*nshort*5); | 272 | 37.2k | faad_imdct(fb->mdct256, freq_in+6*nshort, transf_buf+2*nshort*6); | 273 | 37.2k | faad_imdct(fb->mdct256, freq_in+7*nshort, transf_buf+2*nshort*7); | 274 | | | 275 | | /* add second half output of previous frame to windowed output of current frame */ | 276 | 16.5M | for (i = 0; i < nflat_ls; i++) | 277 | 16.5M | time_out[i] = overlap[i]; | 278 | 4.75M | for(i = 0; i < nshort; i++) | 279 | 4.71M | { | 280 | 4.71M | time_out[nflat_ls+ i] = overlap[nflat_ls+ i] + MUL_F(transf_buf[nshort*0+i],window_short_prev[i]); | 281 | 4.71M | time_out[nflat_ls+1*nshort+i] = overlap[nflat_ls+nshort*1+i] + MUL_F(transf_buf[nshort*1+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*2+i],window_short[i]); | 282 | 4.71M | time_out[nflat_ls+2*nshort+i] = overlap[nflat_ls+nshort*2+i] + MUL_F(transf_buf[nshort*3+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*4+i],window_short[i]); | 283 | 4.71M | time_out[nflat_ls+3*nshort+i] = overlap[nflat_ls+nshort*3+i] + MUL_F(transf_buf[nshort*5+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*6+i],window_short[i]); | 284 | 4.71M | if (i < trans) | 285 | 2.35M | time_out[nflat_ls+4*nshort+i] = overlap[nflat_ls+nshort*4+i] + MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); | 286 | 4.71M | } | 287 | | | 288 | | /* window the second half and save as overlap for next frame */ | 289 | 4.75M | for(i = 0; i < nshort; i++) | 290 | 4.71M | { | 291 | 4.71M | if (i >= trans) | 292 | 2.35M | overlap[nflat_ls+4*nshort+i-nlong] = MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); | 293 | 4.71M | overlap[nflat_ls+5*nshort+i-nlong] = MUL_F(transf_buf[nshort*9+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*10+i],window_short[i]); | 294 | 4.71M | overlap[nflat_ls+6*nshort+i-nlong] = MUL_F(transf_buf[nshort*11+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*12+i],window_short[i]); | 295 | 4.71M | overlap[nflat_ls+7*nshort+i-nlong] = MUL_F(transf_buf[nshort*13+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*14+i],window_short[i]); | 296 | 4.71M | overlap[nflat_ls+8*nshort+i-nlong] = MUL_F(transf_buf[nshort*15+i],window_short[nshort-1-i]); | 297 | 4.71M | } | 298 | 16.5M | for (i = 0; i < nflat_ls; i++) | 299 | 16.5M | overlap[nflat_ls+nshort+i] = 0; | 300 | 37.2k | break; | 301 | | | 302 | 9.77k | case LONG_STOP_SEQUENCE: | 303 | | /* perform iMDCT */ | 304 | 9.77k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 305 | | | 306 | | /* add second half output of previous frame to windowed output of current frame */ | 307 | | /* construct first half window using padding with 1's and 0's */ | 308 | 4.29M | for (i = 0; i < nflat_ls; i++) | 309 | 4.28M | time_out[i] = overlap[i]; | 310 | 1.23M | for (i = 0; i < nshort; i++) | 311 | 1.22M | time_out[nflat_ls+i] = overlap[nflat_ls+i] + MUL_F(transf_buf[nflat_ls+i],window_short_prev[i]); | 312 | 4.29M | for (i = 0; i < nflat_ls; i++) | 313 | 4.28M | time_out[nflat_ls+nshort+i] = overlap[nflat_ls+nshort+i] + transf_buf[nflat_ls+nshort+i]; | 314 | | | 315 | | /* window the second half and save as overlap for next frame */ | 316 | 9.79M | for (i = 0; i < nlong; i++) | 317 | 9.78M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); | 318 | 9.77k | break; | 319 | 450k | } | 320 | | | 321 | | #if 0 | 322 | | for (i = 0; i < 1024; i++) | 323 | | { | 324 | | printf("%d\n", time_out[i]); | 325 | | //printf("0x%.8X\n", time_out[i]); | 326 | | } | 327 | | #endif | 328 | | | 329 | | | 330 | | #ifdef PROFILE | 331 | | count = faad_get_ts() - count; | 332 | | fb->cycles += count; | 333 | | #endif | 334 | 450k | } |
Line | Count | Source | 168 | 175k | { | 169 | 175k | int16_t i; | 170 | 175k | ALIGN real_t transf_buf[2*1024] = {0}; | 171 | | | 172 | 175k | const real_t *window_long = NULL; | 173 | 175k | const real_t *window_long_prev = NULL; | 174 | 175k | const real_t *window_short = NULL; | 175 | 175k | const real_t *window_short_prev = NULL; | 176 | | | 177 | 175k | uint16_t nlong = frame_len; | 178 | 175k | uint16_t nshort = frame_len/8; | 179 | 175k | uint16_t trans = nshort/2; | 180 | | | 181 | 175k | uint16_t nflat_ls = (nlong-nshort)/2; | 182 | | | 183 | | #ifdef PROFILE | 184 | | int64_t count = faad_get_ts(); | 185 | | #endif | 186 | | | 187 | | /* select windows of current frame and previous frame (Sine or KBD) */ | 188 | | #ifdef LD_DEC | 189 | | if (object_type == LD) | 190 | | { | 191 | | window_long = fb->ld_window[window_shape]; | 192 | | window_long_prev = fb->ld_window[window_shape_prev]; | 193 | | } else { | 194 | | #else | 195 | 175k | (void)object_type; | 196 | 175k | #endif | 197 | 175k | window_long = fb->long_window[window_shape]; | 198 | 175k | window_long_prev = fb->long_window[window_shape_prev]; | 199 | 175k | window_short = fb->short_window[window_shape]; | 200 | 175k | window_short_prev = fb->short_window[window_shape_prev]; | 201 | | #ifdef LD_DEC | 202 | | } | 203 | | #endif | 204 | | | 205 | | #if 0 | 206 | | for (i = 0; i < 1024; i++) | 207 | | { | 208 | | printf("%d\n", freq_in[i]); | 209 | | } | 210 | | #endif | 211 | | | 212 | | #if 0 | 213 | | printf("%d %d\n", window_sequence, window_shape); | 214 | | #endif | 215 | | | 216 | 175k | switch (window_sequence) | 217 | 175k | { | 218 | 132k | case ONLY_LONG_SEQUENCE: | 219 | | /* perform iMDCT */ | 220 | 132k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 221 | | | 222 | | /* add second half output of previous frame to windowed output of current frame */ | 223 | 33.6M | for (i = 0; i < nlong; i+=4) | 224 | 33.4M | { | 225 | 33.4M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); | 226 | 33.4M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); | 227 | 33.4M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); | 228 | 33.4M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); | 229 | 33.4M | } | 230 | | | 231 | | /* window the second half and save as overlap for next frame */ | 232 | 33.6M | for (i = 0; i < nlong; i+=4) | 233 | 33.4M | { | 234 | 33.4M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); | 235 | 33.4M | overlap[i+1] = MUL_F(transf_buf[nlong+i+1],window_long[nlong-2-i]); | 236 | 33.4M | overlap[i+2] = MUL_F(transf_buf[nlong+i+2],window_long[nlong-3-i]); | 237 | 33.4M | overlap[i+3] = MUL_F(transf_buf[nlong+i+3],window_long[nlong-4-i]); | 238 | 33.4M | } | 239 | 132k | break; | 240 | | | 241 | 9.59k | case LONG_START_SEQUENCE: | 242 | | /* perform iMDCT */ | 243 | 9.59k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 244 | | | 245 | | /* add second half output of previous frame to windowed output of current frame */ | 246 | 2.39M | for (i = 0; i < nlong; i+=4) | 247 | 2.38M | { | 248 | 2.38M | time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]); | 249 | 2.38M | time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]); | 250 | 2.38M | time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]); | 251 | 2.38M | time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]); | 252 | 2.38M | } | 253 | | | 254 | | /* window the second half and save as overlap for next frame */ | 255 | | /* construct second half window using padding with 1's and 0's */ | 256 | 4.18M | for (i = 0; i < nflat_ls; i++) | 257 | 4.17M | overlap[i] = transf_buf[nlong+i]; | 258 | 1.20M | for (i = 0; i < nshort; i++) | 259 | 1.19M | overlap[nflat_ls+i] = MUL_F(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]); | 260 | 4.18M | for (i = 0; i < nflat_ls; i++) | 261 | 4.17M | overlap[nflat_ls+nshort+i] = 0; | 262 | 9.59k | break; | 263 | | | 264 | 24.7k | case EIGHT_SHORT_SEQUENCE: | 265 | | /* perform iMDCT for each short block */ | 266 | 24.7k | faad_imdct(fb->mdct256, freq_in+0*nshort, transf_buf+2*nshort*0); | 267 | 24.7k | faad_imdct(fb->mdct256, freq_in+1*nshort, transf_buf+2*nshort*1); | 268 | 24.7k | faad_imdct(fb->mdct256, freq_in+2*nshort, transf_buf+2*nshort*2); | 269 | 24.7k | faad_imdct(fb->mdct256, freq_in+3*nshort, transf_buf+2*nshort*3); | 270 | 24.7k | faad_imdct(fb->mdct256, freq_in+4*nshort, transf_buf+2*nshort*4); | 271 | 24.7k | faad_imdct(fb->mdct256, freq_in+5*nshort, transf_buf+2*nshort*5); | 272 | 24.7k | faad_imdct(fb->mdct256, freq_in+6*nshort, transf_buf+2*nshort*6); | 273 | 24.7k | faad_imdct(fb->mdct256, freq_in+7*nshort, transf_buf+2*nshort*7); | 274 | | | 275 | | /* add second half output of previous frame to windowed output of current frame */ | 276 | 10.9M | for (i = 0; i < nflat_ls; i++) | 277 | 10.9M | time_out[i] = overlap[i]; | 278 | 3.14M | for(i = 0; i < nshort; i++) | 279 | 3.12M | { | 280 | 3.12M | time_out[nflat_ls+ i] = overlap[nflat_ls+ i] + MUL_F(transf_buf[nshort*0+i],window_short_prev[i]); | 281 | 3.12M | time_out[nflat_ls+1*nshort+i] = overlap[nflat_ls+nshort*1+i] + MUL_F(transf_buf[nshort*1+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*2+i],window_short[i]); | 282 | 3.12M | time_out[nflat_ls+2*nshort+i] = overlap[nflat_ls+nshort*2+i] + MUL_F(transf_buf[nshort*3+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*4+i],window_short[i]); | 283 | 3.12M | time_out[nflat_ls+3*nshort+i] = overlap[nflat_ls+nshort*3+i] + MUL_F(transf_buf[nshort*5+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*6+i],window_short[i]); | 284 | 3.12M | if (i < trans) | 285 | 1.56M | time_out[nflat_ls+4*nshort+i] = overlap[nflat_ls+nshort*4+i] + MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); | 286 | 3.12M | } | 287 | | | 288 | | /* window the second half and save as overlap for next frame */ | 289 | 3.14M | for(i = 0; i < nshort; i++) | 290 | 3.12M | { | 291 | 3.12M | if (i >= trans) | 292 | 1.56M | overlap[nflat_ls+4*nshort+i-nlong] = MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]); | 293 | 3.12M | overlap[nflat_ls+5*nshort+i-nlong] = MUL_F(transf_buf[nshort*9+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*10+i],window_short[i]); | 294 | 3.12M | overlap[nflat_ls+6*nshort+i-nlong] = MUL_F(transf_buf[nshort*11+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*12+i],window_short[i]); | 295 | 3.12M | overlap[nflat_ls+7*nshort+i-nlong] = MUL_F(transf_buf[nshort*13+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*14+i],window_short[i]); | 296 | 3.12M | overlap[nflat_ls+8*nshort+i-nlong] = MUL_F(transf_buf[nshort*15+i],window_short[nshort-1-i]); | 297 | 3.12M | } | 298 | 10.9M | for (i = 0; i < nflat_ls; i++) | 299 | 10.9M | overlap[nflat_ls+nshort+i] = 0; | 300 | 24.7k | break; | 301 | | | 302 | 8.56k | case LONG_STOP_SEQUENCE: | 303 | | /* perform iMDCT */ | 304 | 8.56k | imdct_long(fb, freq_in, transf_buf, 2*nlong); | 305 | | | 306 | | /* add second half output of previous frame to windowed output of current frame */ | 307 | | /* construct first half window using padding with 1's and 0's */ | 308 | 3.80M | for (i = 0; i < nflat_ls; i++) | 309 | 3.79M | time_out[i] = overlap[i]; | 310 | 1.09M | for (i = 0; i < nshort; i++) | 311 | 1.08M | time_out[nflat_ls+i] = overlap[nflat_ls+i] + MUL_F(transf_buf[nflat_ls+i],window_short_prev[i]); | 312 | 3.80M | for (i = 0; i < nflat_ls; i++) | 313 | 3.79M | time_out[nflat_ls+nshort+i] = overlap[nflat_ls+nshort+i] + transf_buf[nflat_ls+nshort+i]; | 314 | | | 315 | | /* window the second half and save as overlap for next frame */ | 316 | 8.69M | for (i = 0; i < nlong; i++) | 317 | 8.68M | overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]); | 318 | 8.56k | break; | 319 | 175k | } | 320 | | | 321 | | #if 0 | 322 | | for (i = 0; i < 1024; i++) | 323 | | { | 324 | | printf("%d\n", time_out[i]); | 325 | | //printf("0x%.8X\n", time_out[i]); | 326 | | } | 327 | | #endif | 328 | | | 329 | | | 330 | | #ifdef PROFILE | 331 | | count = faad_get_ts() - count; | 332 | | fb->cycles += count; | 333 | | #endif | 334 | 175k | } |
|
335 | | |
336 | | |
337 | | #ifdef LTP_DEC |
338 | | /* only works for LTP -> no overlapping, no short blocks */ |
339 | | void filter_bank_ltp(fb_info *fb, uint8_t window_sequence, uint8_t window_shape, |
340 | | uint8_t window_shape_prev, real_t *in_data, real_t *out_mdct, |
341 | | uint8_t object_type, uint16_t frame_len) |
342 | 25.2k | { |
343 | 25.2k | int16_t i; |
344 | 25.2k | ALIGN real_t windowed_buf[2*1024] = {0}; |
345 | | |
346 | 25.2k | const real_t *window_long = NULL; |
347 | 25.2k | const real_t *window_long_prev = NULL; |
348 | 25.2k | const real_t *window_short = NULL; |
349 | 25.2k | const real_t *window_short_prev = NULL; |
350 | | |
351 | 25.2k | uint16_t nlong = frame_len; |
352 | 25.2k | uint16_t nshort = frame_len/8; |
353 | 25.2k | uint16_t nflat_ls = (nlong-nshort)/2; |
354 | | |
355 | 25.2k | assert(window_sequence != EIGHT_SHORT_SEQUENCE); |
356 | | |
357 | 25.2k | #ifdef LD_DEC |
358 | 25.2k | if (object_type == LD) |
359 | 754 | { |
360 | 754 | window_long = fb->ld_window[window_shape]; |
361 | 754 | window_long_prev = fb->ld_window[window_shape_prev]; |
362 | 24.4k | } else { |
363 | 24.4k | #endif |
364 | 24.4k | window_long = fb->long_window[window_shape]; |
365 | 24.4k | window_long_prev = fb->long_window[window_shape_prev]; |
366 | 24.4k | window_short = fb->short_window[window_shape]; |
367 | 24.4k | window_short_prev = fb->short_window[window_shape_prev]; |
368 | 24.4k | #ifdef LD_DEC |
369 | 24.4k | } |
370 | 25.2k | #endif |
371 | | |
372 | 25.2k | switch(window_sequence) |
373 | 25.2k | { |
374 | 3.28k | case ONLY_LONG_SEQUENCE: |
375 | 2.92M | for (i = nlong-1; i >= 0; i--) |
376 | 2.92M | { |
377 | 2.92M | windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]); |
378 | 2.92M | windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]); |
379 | 2.92M | } |
380 | 3.28k | mdct(fb, windowed_buf, out_mdct, 2*nlong); |
381 | 3.28k | break; |
382 | | |
383 | 16.1k | case LONG_START_SEQUENCE: |
384 | 15.9M | for (i = 0; i < nlong; i++) |
385 | 15.9M | windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]); |
386 | 6.98M | for (i = 0; i < nflat_ls; i++) |
387 | 6.97M | windowed_buf[i+nlong] = in_data[i+nlong]; |
388 | 2.00M | for (i = 0; i < nshort; i++) |
389 | 1.99M | windowed_buf[i+nlong+nflat_ls] = MUL_F(in_data[i+nlong+nflat_ls], window_short[nshort-1-i]); |
390 | 6.98M | for (i = 0; i < nflat_ls; i++) |
391 | 6.97M | windowed_buf[i+nlong+nflat_ls+nshort] = 0; |
392 | 16.1k | mdct(fb, windowed_buf, out_mdct, 2*nlong); |
393 | 16.1k | break; |
394 | | |
395 | 5.78k | case LONG_STOP_SEQUENCE: |
396 | 2.47M | for (i = 0; i < nflat_ls; i++) |
397 | 2.47M | windowed_buf[i] = 0; |
398 | 711k | for (i = 0; i < nshort; i++) |
399 | 705k | windowed_buf[i+nflat_ls] = MUL_F(in_data[i+nflat_ls], window_short_prev[i]); |
400 | 2.47M | for (i = 0; i < nflat_ls; i++) |
401 | 2.47M | windowed_buf[i+nflat_ls+nshort] = in_data[i+nflat_ls+nshort]; |
402 | 5.65M | for (i = 0; i < nlong; i++) |
403 | 5.64M | windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]); |
404 | 5.78k | mdct(fb, windowed_buf, out_mdct, 2*nlong); |
405 | 5.78k | break; |
406 | 25.2k | } |
407 | 25.2k | } Line | Count | Source | 342 | 12.6k | { | 343 | 12.6k | int16_t i; | 344 | 12.6k | ALIGN real_t windowed_buf[2*1024] = {0}; | 345 | | | 346 | 12.6k | const real_t *window_long = NULL; | 347 | 12.6k | const real_t *window_long_prev = NULL; | 348 | 12.6k | const real_t *window_short = NULL; | 349 | 12.6k | const real_t *window_short_prev = NULL; | 350 | | | 351 | 12.6k | uint16_t nlong = frame_len; | 352 | 12.6k | uint16_t nshort = frame_len/8; | 353 | 12.6k | uint16_t nflat_ls = (nlong-nshort)/2; | 354 | | | 355 | 12.6k | assert(window_sequence != EIGHT_SHORT_SEQUENCE); | 356 | | | 357 | 12.6k | #ifdef LD_DEC | 358 | 12.6k | if (object_type == LD) | 359 | 377 | { | 360 | 377 | window_long = fb->ld_window[window_shape]; | 361 | 377 | window_long_prev = fb->ld_window[window_shape_prev]; | 362 | 12.2k | } else { | 363 | 12.2k | #endif | 364 | 12.2k | window_long = fb->long_window[window_shape]; | 365 | 12.2k | window_long_prev = fb->long_window[window_shape_prev]; | 366 | 12.2k | window_short = fb->short_window[window_shape]; | 367 | 12.2k | window_short_prev = fb->short_window[window_shape_prev]; | 368 | 12.2k | #ifdef LD_DEC | 369 | 12.2k | } | 370 | 12.6k | #endif | 371 | | | 372 | 12.6k | switch(window_sequence) | 373 | 12.6k | { | 374 | 1.64k | case ONLY_LONG_SEQUENCE: | 375 | 1.46M | for (i = nlong-1; i >= 0; i--) | 376 | 1.46M | { | 377 | 1.46M | windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]); | 378 | 1.46M | windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]); | 379 | 1.46M | } | 380 | 1.64k | mdct(fb, windowed_buf, out_mdct, 2*nlong); | 381 | 1.64k | break; | 382 | | | 383 | 8.07k | case LONG_START_SEQUENCE: | 384 | 7.97M | for (i = 0; i < nlong; i++) | 385 | 7.96M | windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]); | 386 | 3.49M | for (i = 0; i < nflat_ls; i++) | 387 | 3.48M | windowed_buf[i+nlong] = in_data[i+nlong]; | 388 | 1.00M | for (i = 0; i < nshort; i++) | 389 | 996k | windowed_buf[i+nlong+nflat_ls] = MUL_F(in_data[i+nlong+nflat_ls], window_short[nshort-1-i]); | 390 | 3.49M | for (i = 0; i < nflat_ls; i++) | 391 | 3.48M | windowed_buf[i+nlong+nflat_ls+nshort] = 0; | 392 | 8.07k | mdct(fb, windowed_buf, out_mdct, 2*nlong); | 393 | 8.07k | break; | 394 | | | 395 | 2.89k | case LONG_STOP_SEQUENCE: | 396 | 1.23M | for (i = 0; i < nflat_ls; i++) | 397 | 1.23M | windowed_buf[i] = 0; | 398 | 355k | for (i = 0; i < nshort; i++) | 399 | 352k | windowed_buf[i+nflat_ls] = MUL_F(in_data[i+nflat_ls], window_short_prev[i]); | 400 | 1.23M | for (i = 0; i < nflat_ls; i++) | 401 | 1.23M | windowed_buf[i+nflat_ls+nshort] = in_data[i+nflat_ls+nshort]; | 402 | 2.82M | for (i = 0; i < nlong; i++) | 403 | 2.82M | windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]); | 404 | 2.89k | mdct(fb, windowed_buf, out_mdct, 2*nlong); | 405 | 2.89k | break; | 406 | 12.6k | } | 407 | 12.6k | } |
Line | Count | Source | 342 | 12.6k | { | 343 | 12.6k | int16_t i; | 344 | 12.6k | ALIGN real_t windowed_buf[2*1024] = {0}; | 345 | | | 346 | 12.6k | const real_t *window_long = NULL; | 347 | 12.6k | const real_t *window_long_prev = NULL; | 348 | 12.6k | const real_t *window_short = NULL; | 349 | 12.6k | const real_t *window_short_prev = NULL; | 350 | | | 351 | 12.6k | uint16_t nlong = frame_len; | 352 | 12.6k | uint16_t nshort = frame_len/8; | 353 | 12.6k | uint16_t nflat_ls = (nlong-nshort)/2; | 354 | | | 355 | 12.6k | assert(window_sequence != EIGHT_SHORT_SEQUENCE); | 356 | | | 357 | 12.6k | #ifdef LD_DEC | 358 | 12.6k | if (object_type == LD) | 359 | 377 | { | 360 | 377 | window_long = fb->ld_window[window_shape]; | 361 | 377 | window_long_prev = fb->ld_window[window_shape_prev]; | 362 | 12.2k | } else { | 363 | 12.2k | #endif | 364 | 12.2k | window_long = fb->long_window[window_shape]; | 365 | 12.2k | window_long_prev = fb->long_window[window_shape_prev]; | 366 | 12.2k | window_short = fb->short_window[window_shape]; | 367 | 12.2k | window_short_prev = fb->short_window[window_shape_prev]; | 368 | 12.2k | #ifdef LD_DEC | 369 | 12.2k | } | 370 | 12.6k | #endif | 371 | | | 372 | 12.6k | switch(window_sequence) | 373 | 12.6k | { | 374 | 1.64k | case ONLY_LONG_SEQUENCE: | 375 | 1.46M | for (i = nlong-1; i >= 0; i--) | 376 | 1.46M | { | 377 | 1.46M | windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]); | 378 | 1.46M | windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]); | 379 | 1.46M | } | 380 | 1.64k | mdct(fb, windowed_buf, out_mdct, 2*nlong); | 381 | 1.64k | break; | 382 | | | 383 | 8.07k | case LONG_START_SEQUENCE: | 384 | 7.97M | for (i = 0; i < nlong; i++) | 385 | 7.96M | windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]); | 386 | 3.49M | for (i = 0; i < nflat_ls; i++) | 387 | 3.48M | windowed_buf[i+nlong] = in_data[i+nlong]; | 388 | 1.00M | for (i = 0; i < nshort; i++) | 389 | 996k | windowed_buf[i+nlong+nflat_ls] = MUL_F(in_data[i+nlong+nflat_ls], window_short[nshort-1-i]); | 390 | 3.49M | for (i = 0; i < nflat_ls; i++) | 391 | 3.48M | windowed_buf[i+nlong+nflat_ls+nshort] = 0; | 392 | 8.07k | mdct(fb, windowed_buf, out_mdct, 2*nlong); | 393 | 8.07k | break; | 394 | | | 395 | 2.89k | case LONG_STOP_SEQUENCE: | 396 | 1.23M | for (i = 0; i < nflat_ls; i++) | 397 | 1.23M | windowed_buf[i] = 0; | 398 | 355k | for (i = 0; i < nshort; i++) | 399 | 352k | windowed_buf[i+nflat_ls] = MUL_F(in_data[i+nflat_ls], window_short_prev[i]); | 400 | 1.23M | for (i = 0; i < nflat_ls; i++) | 401 | 1.23M | windowed_buf[i+nflat_ls+nshort] = in_data[i+nflat_ls+nshort]; | 402 | 2.82M | for (i = 0; i < nlong; i++) | 403 | 2.82M | windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]); | 404 | 2.89k | mdct(fb, windowed_buf, out_mdct, 2*nlong); | 405 | 2.89k | break; | 406 | 12.6k | } | 407 | 12.6k | } |
|
408 | | #endif |