/src/libxaac/decoder/ixheaacd_qmf_dec.c
Line | Count | Source (jump to first uncovered line) |
1 | | /****************************************************************************** |
2 | | * * |
3 | | * Copyright (C) 2018 The Android Open Source Project |
4 | | * |
5 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | | * you may not use this file except in compliance with the License. |
7 | | * You may obtain a copy of the License at: |
8 | | * |
9 | | * http://www.apache.org/licenses/LICENSE-2.0 |
10 | | * |
11 | | * Unless required by applicable law or agreed to in writing, software |
12 | | * distributed under the License is distributed on an "AS IS" BASIS, |
13 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | | * See the License for the specific language governing permissions and |
15 | | * limitations under the License. |
16 | | * |
17 | | ***************************************************************************** |
18 | | * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore |
19 | | */ |
20 | | #include <string.h> |
21 | | |
22 | | #include "ixheaacd_sbr_common.h" |
23 | | #include "ixheaac_type_def.h" |
24 | | |
25 | | #include "ixheaac_constants.h" |
26 | | #include "ixheaac_basic_ops32.h" |
27 | | #include "ixheaac_basic_ops16.h" |
28 | | #include "ixheaac_basic_ops40.h" |
29 | | #include "ixheaac_basic_ops.h" |
30 | | |
31 | | #include "ixheaacd_intrinsics.h" |
32 | | #include "ixheaacd_common_rom.h" |
33 | | #include "ixheaacd_bitbuffer.h" |
34 | | #include "ixheaacd_sbrdecsettings.h" |
35 | | #include "ixheaacd_sbr_scale.h" |
36 | | #include "ixheaacd_lpp_tran.h" |
37 | | #include "ixheaacd_env_extr_part.h" |
38 | | #include "ixheaacd_sbr_rom.h" |
39 | | #include "ixheaacd_hybrid.h" |
40 | | #include "ixheaacd_ps_dec.h" |
41 | | #include "ixheaacd_env_extr.h" |
42 | | #include "ixheaacd_qmf_dec.h" |
43 | | |
44 | | #include "ixheaac_basic_op.h" |
45 | | #include "ixheaacd_env_calc.h" |
46 | | #include "ixheaacd_interface.h" |
47 | | |
48 | | #include "ixheaacd_function_selector.h" |
49 | | #include "ixheaacd_audioobjtypes.h" |
50 | | |
51 | | #define DCT3_LEN (32) |
52 | 0 | #define DCT2_LEN (64) |
53 | | |
54 | | #define LP_SHIFT_VAL 7 |
55 | | #define HQ_SHIFT_64 4 |
56 | | #define RADIXSHIFT 1 |
57 | | #define ROUNDING_SPECTRA 1 |
58 | | #define HQ_SHIFT_VAL 4 |
59 | | |
60 | | static PLATFORM_INLINE WORD32 ixheaacd_mult32x32in32_shift25(WORD32 a, |
61 | 110M | WORD32 b) { |
62 | 110M | WORD32 result; |
63 | 110M | WORD64 temp_result; |
64 | | |
65 | 110M | temp_result = (WORD64)a * (WORD64)b; |
66 | | |
67 | 110M | result = (WORD32)(temp_result >> 25); |
68 | | |
69 | 110M | return (result); |
70 | 110M | } |
71 | | |
72 | 0 | VOID ixheaacd_pretwdct2(WORD32 *inp, WORD32 *out_fwd) { |
73 | 0 | WORD32 n; |
74 | 0 | WORD32 *out_rev = out_fwd + DCT2_LEN - 1; |
75 | |
|
76 | 0 | for (n = 0; n < DCT2_LEN / 2; n++) { |
77 | 0 | *out_fwd = *inp; |
78 | 0 | inp++; |
79 | 0 | *out_rev = *inp; |
80 | 0 | out_fwd++; |
81 | |
|
82 | 0 | out_rev--; |
83 | 0 | inp++; |
84 | 0 | } |
85 | |
|
86 | 0 | return; |
87 | 0 | } |
88 | | |
89 | | static PLATFORM_INLINE VOID ixheaacd_pretwdct2_32(WORD32 *inp, WORD32 *out_fwd, |
90 | 0 | int dct2_len) { |
91 | 0 | WORD32 n; |
92 | |
|
93 | 0 | WORD32 *out_rev = out_fwd + dct2_len - 1; |
94 | 0 | for (n = dct2_len / 2 - 1; n >= 0; n--) { |
95 | 0 | *out_fwd = *inp; |
96 | 0 | inp++; |
97 | 0 | *out_rev = *inp; |
98 | 0 | out_fwd++; |
99 | |
|
100 | 0 | out_rev--; |
101 | 0 | inp++; |
102 | 0 | } |
103 | |
|
104 | 0 | return; |
105 | 0 | } |
106 | | |
107 | | VOID ixheaacd_fftposttw(WORD32 *out, |
108 | 0 | ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) { |
109 | 0 | int k; |
110 | 0 | WORD32 *p_out_fwd, *ptr_out_rev; |
111 | 0 | const WORD16 *twidle_fwd, *twidle_rev; |
112 | 0 | WORD32 in1, in2, val1, val2; |
113 | |
|
114 | 0 | twidle_fwd = qmf_dec_tables_ptr->post_fft_tbl + 1; |
115 | 0 | twidle_rev = qmf_dec_tables_ptr->post_fft_tbl + 15; |
116 | |
|
117 | 0 | p_out_fwd = out; |
118 | 0 | ptr_out_rev = out + DCT2_LEN - 1; |
119 | |
|
120 | 0 | in1 = ((*p_out_fwd++) << 1); |
121 | 0 | val1 = ((*p_out_fwd--) << 1); |
122 | |
|
123 | 0 | *p_out_fwd++ = in1; |
124 | 0 | *p_out_fwd++ = val1; |
125 | |
|
126 | 0 | for (k = 1; k <= DCT2_LEN / 4; k++) { |
127 | 0 | WORD32 temp[4]; |
128 | 0 | WORD16 twid_re, twid_im; |
129 | |
|
130 | 0 | temp[0] = *p_out_fwd++; |
131 | 0 | temp[1] = *p_out_fwd--; |
132 | 0 | temp[3] = *ptr_out_rev--; |
133 | 0 | temp[2] = *ptr_out_rev++; |
134 | |
|
135 | 0 | in2 = ixheaac_sub32_sat(temp[3], temp[1]); |
136 | 0 | in1 = ixheaac_add32_sat(temp[3], temp[1]); |
137 | |
|
138 | 0 | temp[1] = ixheaac_sub32_sat(temp[0], temp[2]); |
139 | 0 | temp[3] = ixheaac_add32_sat(temp[0], temp[2]); |
140 | |
|
141 | 0 | twid_re = *twidle_fwd++; |
142 | 0 | twid_im = *twidle_rev--; |
143 | 0 | val1 = ixheaac_mult32x16in32(in1, twid_re) - |
144 | 0 | ixheaac_mult32x16in32(temp[1], twid_im); |
145 | 0 | val2 = ixheaac_mult32x16in32(temp[1], twid_re) + |
146 | 0 | ixheaac_mult32x16in32(in1, twid_im); |
147 | 0 | val1 = val1 << 1; |
148 | 0 | val2 = val2 << 1; |
149 | |
|
150 | 0 | *p_out_fwd++ = ixheaac_add32_sat(temp[3], val1); |
151 | 0 | *p_out_fwd++ = ixheaac_add32_sat(in2, val2); |
152 | |
|
153 | 0 | *ptr_out_rev-- = ixheaac_sub32_sat(val2, in2); |
154 | 0 | *ptr_out_rev-- = ixheaac_sub32_sat(temp[3], val1); |
155 | 0 | } |
156 | |
|
157 | 0 | return; |
158 | 0 | } |
159 | | |
160 | | VOID ixheaacd_posttwdct2(WORD32 *inp, WORD16 *out_fwd, |
161 | 0 | ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) { |
162 | 0 | WORD32 k; |
163 | 0 | WORD32 inp_re, inp_im, out_re, out_im, last_val, out_re1; |
164 | 0 | WORD16 *out_fwd2, *out_rev2, *out_rev; |
165 | 0 | WORD16 twid_re, twid_im; |
166 | 0 | const WORD16 *twidle_fwd; |
167 | 0 | WORD16 re1, im1, im2; |
168 | |
|
169 | 0 | out_rev = out_fwd + DCT2_LEN - 1; |
170 | 0 | out_rev2 = out_fwd - 1; |
171 | 0 | out_fwd2 = out_fwd + 65; |
172 | 0 | out_re = *inp++; |
173 | 0 | out_im = *inp++; |
174 | 0 | out_re1 = |
175 | 0 | ixheaac_sat64_32(ixheaac_add64((WORD64)out_re, (WORD64)out_im) >> 1); |
176 | 0 | re1 = ixheaac_round16(ixheaac_shl32(out_re1, (5 - 1))); |
177 | |
|
178 | 0 | *out_fwd++ = re1; |
179 | |
|
180 | 0 | last_val = ixheaac_sub32_sat(out_re, out_im); |
181 | |
|
182 | 0 | twidle_fwd = qmf_dec_tables_ptr->dct23_tw + 2; |
183 | 0 | for (k = DCT2_LEN / 2 - 2; k >= 0; k--) { |
184 | 0 | inp_re = *inp++; |
185 | 0 | inp_im = *inp++; |
186 | |
|
187 | 0 | twid_re = *twidle_fwd++; |
188 | 0 | twid_im = *twidle_fwd++; |
189 | 0 | out_re = ixheaac_sub32_sat(ixheaac_mult32x16in32(inp_re, twid_re), |
190 | 0 | ixheaac_mult32x16in32(inp_im, twid_im)); |
191 | 0 | out_im = ixheaac_add32_sat(ixheaac_mult32x16in32(inp_im, twid_re), |
192 | 0 | ixheaac_mult32x16in32(inp_re, twid_im)); |
193 | 0 | re1 = ixheaac_round16(ixheaac_shl32(out_re, (5 - 1))); |
194 | 0 | im1 = ixheaac_round16(ixheaac_shl32(out_im, (5 - 1))); |
195 | 0 | im2 = ixheaac_negate16(im1); |
196 | |
|
197 | 0 | *out_fwd++ = re1; |
198 | 0 | *out_rev2-- = re1; |
199 | 0 | *out_rev-- = im1; |
200 | 0 | *out_fwd2++ = im2; |
201 | 0 | } |
202 | 0 | twid_re = *twidle_fwd++; |
203 | |
|
204 | 0 | out_re = ixheaac_mult32x16in32(last_val, twid_re); |
205 | 0 | re1 = ixheaac_round16(ixheaac_shl32(out_re, (5 - 1))); |
206 | |
|
207 | 0 | *out_fwd++ = re1; |
208 | 0 | *out_rev2-- = re1; |
209 | |
|
210 | 0 | return; |
211 | 0 | } |
212 | | |
213 | | static PLATFORM_INLINE VOID ixheaacd_fftposttw_32( |
214 | 0 | WORD32 *out, int dct2_len, ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) { |
215 | 0 | int k; |
216 | 0 | WORD32 *ptr_out_fwd, *ptr_out_rev; |
217 | 0 | const WORD16 *twidle_fwd, *twidle_rev; |
218 | 0 | WORD32 in1, in2, val1, val2; |
219 | |
|
220 | 0 | twidle_fwd = qmf_dec_tables_ptr->post_fft_tbl + 2; |
221 | 0 | twidle_rev = qmf_dec_tables_ptr->post_fft_tbl + 14; |
222 | |
|
223 | 0 | ptr_out_fwd = out; |
224 | 0 | ptr_out_rev = out + dct2_len - 1; |
225 | |
|
226 | 0 | in1 = ((*ptr_out_fwd++) << 1); |
227 | 0 | val1 = ((*ptr_out_fwd--) << 1); |
228 | |
|
229 | 0 | *ptr_out_fwd++ = in1; |
230 | 0 | *ptr_out_fwd++ = val1; |
231 | |
|
232 | 0 | for (k = dct2_len / 4 - 1; k >= 0; k--) { |
233 | 0 | WORD32 temp0, temp1, temp2, temp3; |
234 | 0 | WORD16 twid_re, twid_im; |
235 | |
|
236 | 0 | temp0 = *ptr_out_fwd++; |
237 | 0 | temp1 = *ptr_out_fwd--; |
238 | 0 | temp3 = *ptr_out_rev--; |
239 | 0 | temp2 = *ptr_out_rev++; |
240 | |
|
241 | 0 | in1 = ixheaac_add32_sat(temp1, temp3); |
242 | 0 | in2 = ixheaac_sub32_sat(temp3, temp1); |
243 | |
|
244 | 0 | temp1 = ixheaac_sub32_sat(temp0, temp2); |
245 | 0 | temp3 = ixheaac_add32_sat(temp0, temp2); |
246 | |
|
247 | 0 | twid_re = *twidle_fwd; |
248 | 0 | twidle_fwd += 2; |
249 | |
|
250 | 0 | twid_im = *twidle_rev; |
251 | 0 | twidle_rev -= 2; |
252 | |
|
253 | 0 | val1 = ixheaac_mult32x16in32(in1, twid_re) - |
254 | 0 | ixheaac_mult32x16in32(temp1, twid_im); |
255 | 0 | val2 = ixheaac_mult32x16in32(temp1, twid_re) + |
256 | 0 | ixheaac_mult32x16in32(in1, twid_im); |
257 | |
|
258 | 0 | val1 = val1 << 1; |
259 | 0 | val2 = val2 << 1; |
260 | |
|
261 | 0 | *ptr_out_fwd++ = ixheaac_add32_sat(temp3, val1); |
262 | 0 | *ptr_out_fwd++ = ixheaac_add32_sat(in2, val2); |
263 | |
|
264 | 0 | *ptr_out_rev-- = ixheaac_sub32_sat(val2, in2); |
265 | 0 | *ptr_out_rev-- = ixheaac_sub32_sat(temp3, val1); |
266 | 0 | } |
267 | |
|
268 | 0 | return; |
269 | 0 | } |
270 | | |
271 | | static PLATFORM_INLINE VOID |
272 | | ixheaacd_posttwdct2_32(WORD32 *inp, WORD16 *out_fwd, |
273 | 0 | ia_qmf_dec_tables_struct *qmf_dec_tables_ptr) { |
274 | 0 | int k; |
275 | 0 | WORD32 inp_re, out_re, out_im, last_val, out_re1; |
276 | 0 | WORD16 *out_rev, *out_rev2, *out_fwd2; |
277 | 0 | WORD16 twid_re, twid_im; |
278 | 0 | const WORD16 *twidle_fwd; |
279 | 0 | WORD16 re1, im1, im2; |
280 | 0 | WORD32 rounding_fac = 0x8000; |
281 | |
|
282 | 0 | out_rev = out_fwd + 32 - 1; |
283 | 0 | out_rev2 = out_fwd - 1; |
284 | 0 | out_fwd2 = out_fwd + 32 + 1; |
285 | 0 | out_fwd[32] = 0; |
286 | |
|
287 | 0 | out_re = *inp++; |
288 | 0 | out_im = *inp++; |
289 | |
|
290 | 0 | out_re1 = |
291 | 0 | ixheaac_sat64_32(ixheaac_add64((WORD64)out_re, (WORD64)out_im) >> 1); |
292 | 0 | re1 = ixheaac_round16(ixheaac_shl32_sat(out_re1, (5 - 1))); |
293 | 0 | *out_fwd++ = re1; |
294 | 0 | last_val = ixheaac_sub32_sat(out_re, out_im); |
295 | |
|
296 | 0 | twidle_fwd = qmf_dec_tables_ptr->dct23_tw + 4; |
297 | 0 | for (k = 14; k >= 0; k--) { |
298 | 0 | WORD32 temp1, temp2; |
299 | 0 | inp_re = *inp++; |
300 | 0 | twid_re = *twidle_fwd++; |
301 | 0 | twid_im = *twidle_fwd; |
302 | 0 | twidle_fwd += 3; |
303 | |
|
304 | 0 | temp1 = ixheaac_mult32x16in32(inp_re, twid_re); |
305 | 0 | temp2 = ixheaac_mult32x16in32(inp_re, twid_im); |
306 | |
|
307 | 0 | inp_re = *inp++; |
308 | |
|
309 | 0 | out_re = ixheaac_sub32_sat(temp1, ixheaac_mult32x16in32(inp_re, twid_im)); |
310 | 0 | out_im = ixheaac_add32_sat(ixheaac_mult32x16in32(inp_re, twid_re), temp2); |
311 | |
|
312 | 0 | out_re = ixheaac_add32_sat(out_re, out_re); |
313 | 0 | out_im = ixheaac_add32_sat(out_im, out_im); |
314 | 0 | out_re = ixheaac_add32_sat(out_re, out_re); |
315 | 0 | out_im = ixheaac_add32_sat(out_im, out_im); |
316 | 0 | out_re = ixheaac_add32_sat(out_re, out_re); |
317 | 0 | out_im = ixheaac_add32_sat(out_im, out_im); |
318 | 0 | out_re = ixheaac_add32_sat(out_re, out_re); |
319 | 0 | out_im = ixheaac_add32_sat(out_im, out_im); |
320 | 0 | out_re = ixheaac_add32_sat(out_re, rounding_fac); |
321 | 0 | out_im = ixheaac_add32_sat(out_im, rounding_fac); |
322 | 0 | re1 = (out_re >> 16); |
323 | 0 | im1 = (out_im >> 16); |
324 | 0 | im2 = ixheaac_negate16(im1); |
325 | |
|
326 | 0 | *out_fwd++ = re1; |
327 | 0 | *out_rev2-- = re1; |
328 | 0 | *out_rev-- = im1; |
329 | 0 | *out_fwd2++ = im2; |
330 | 0 | } |
331 | 0 | twid_re = *twidle_fwd++; |
332 | |
|
333 | 0 | out_re = ixheaac_mult32x16in32(last_val, twid_re); |
334 | 0 | re1 = ixheaac_round16(ixheaac_shl32_sat(out_re, (5 - 1))); |
335 | 0 | *out_fwd++ = re1; |
336 | 0 | *out_rev2-- = re1; |
337 | |
|
338 | 0 | return; |
339 | 0 | } |
340 | | |
341 | | VOID ixheaacd_dct2_32(WORD32 *inp, WORD32 *out, |
342 | | ia_qmf_dec_tables_struct *qmf_dec_tables_ptr, |
343 | 0 | WORD16 *filter_states) { |
344 | 0 | WORD32 *output; |
345 | |
|
346 | 0 | output = out + 16; |
347 | 0 | filter_states = filter_states + 16; |
348 | 0 | ixheaacd_pretwdct2_32(inp, output, 32); |
349 | |
|
350 | 0 | ixheaacd_radix4bfly(qmf_dec_tables_ptr->w_16, output, 1, 4); |
351 | 0 | ixheaacd_postradixcompute4(inp, output, qmf_dec_tables_ptr->dig_rev_table4_16, |
352 | 0 | 16); |
353 | 0 | ixheaacd_fftposttw_32(inp, 32, qmf_dec_tables_ptr); |
354 | |
|
355 | 0 | ixheaacd_posttwdct2_32(inp, filter_states, qmf_dec_tables_ptr); |
356 | |
|
357 | 0 | return; |
358 | 0 | } |
359 | | |
360 | | VOID ixheaacd_sbr_qmfanal32_winadd_eld_mps(WORD32 *inp1, WORD32 *inp2, |
361 | | const WORD32 *p_qmf1, |
362 | | const WORD32 *p_qmf2, |
363 | 1.01k | WORD32 *p_out) { |
364 | 1.01k | WORD32 n; |
365 | 1.01k | WORD32 resolution = 64; |
366 | | |
367 | 33.4k | for (n = 0; n < 64; n += 2) { |
368 | 32.4k | WORD32 accu; |
369 | 32.4k | accu = ixheaac_mul32_sh(inp1[n + 0], p_qmf1[(n + 0)], 31); |
370 | 32.4k | accu = ixheaac_add32_sat( |
371 | 32.4k | accu, ixheaac_mul32_sh(inp1[n + 2 * resolution], |
372 | 32.4k | p_qmf1[(n + 2 * resolution)], 31)); |
373 | 32.4k | accu = ixheaac_add32_sat( |
374 | 32.4k | accu, ixheaac_mul32_sh(inp1[n + 4 * resolution], |
375 | 32.4k | p_qmf1[(n + 4 * resolution)], 31)); |
376 | 32.4k | accu = ixheaac_add32_sat( |
377 | 32.4k | accu, ixheaac_mul32_sh(inp1[n + 6 * resolution], |
378 | 32.4k | p_qmf1[(n + 6 * resolution)], 31)); |
379 | 32.4k | accu = ixheaac_add32_sat( |
380 | 32.4k | accu, ixheaac_mul32_sh(inp1[n + 8 * resolution], |
381 | 32.4k | p_qmf1[(n + 8 * resolution)], 31)); |
382 | 32.4k | p_out[n] = accu; |
383 | | |
384 | 32.4k | accu = ixheaac_mul32_sh(inp1[n + 1 + 0], p_qmf1[(n + 1 + 0)], 31); |
385 | 32.4k | accu = ixheaac_add32_sat( |
386 | 32.4k | accu, ixheaac_mul32_sh(inp1[n + 1 + 2 * resolution], |
387 | 32.4k | p_qmf1[(n + 1 + 2 * resolution)], 31)); |
388 | 32.4k | accu = ixheaac_add32_sat( |
389 | 32.4k | accu, ixheaac_mul32_sh(inp1[n + 1 + 4 * resolution], |
390 | 32.4k | p_qmf1[(n + 1 + 4 * resolution)], 31)); |
391 | 32.4k | accu = ixheaac_add32_sat( |
392 | 32.4k | accu, ixheaac_mul32_sh(inp1[n + 1 + 6 * resolution], |
393 | 32.4k | p_qmf1[(n + 1 + 6 * resolution)], 31)); |
394 | 32.4k | accu = ixheaac_add32_sat( |
395 | 32.4k | accu, ixheaac_mul32_sh(inp1[n + 1 + 8 * resolution], |
396 | 32.4k | p_qmf1[(n + 1 + 8 * resolution)], 31)); |
397 | 32.4k | p_out[n + 1] = accu; |
398 | | |
399 | 32.4k | accu = ixheaac_mul32_sh(inp2[n + 0], p_qmf2[(n + 0)], 31); |
400 | 32.4k | accu = ixheaac_add32_sat( |
401 | 32.4k | accu, ixheaac_mul32_sh(inp2[n + 2 * resolution], |
402 | 32.4k | p_qmf2[(n + 2 * resolution)], 31)); |
403 | 32.4k | accu = ixheaac_add32_sat( |
404 | 32.4k | accu, ixheaac_mul32_sh(inp2[n + 4 * resolution], |
405 | 32.4k | p_qmf2[(n + 4 * resolution)], 31)); |
406 | 32.4k | accu = ixheaac_add32_sat( |
407 | 32.4k | accu, ixheaac_mul32_sh(inp2[n + 6 * resolution], |
408 | 32.4k | p_qmf2[(n + 6 * resolution)], 31)); |
409 | 32.4k | accu = ixheaac_add32_sat( |
410 | 32.4k | accu, ixheaac_mul32_sh(inp2[n + 8 * resolution], |
411 | 32.4k | p_qmf2[(n + 8 * resolution)], 31)); |
412 | 32.4k | p_out[n + 64] = accu; |
413 | | |
414 | 32.4k | accu = ixheaac_mul32_sh(inp2[n + 1 + 0], p_qmf2[(n + 1 + 0)], 31); |
415 | 32.4k | accu = ixheaac_add32_sat( |
416 | 32.4k | accu, ixheaac_mul32_sh(inp2[n + 1 + 2 * resolution], |
417 | 32.4k | p_qmf2[(n + 1 + 2 * resolution)], 31)); |
418 | 32.4k | accu = ixheaac_add32_sat( |
419 | 32.4k | accu, ixheaac_mul32_sh(inp2[n + 1 + 4 * resolution], |
420 | 32.4k | p_qmf2[(n + 1 + 4 * resolution)], 31)); |
421 | 32.4k | accu = ixheaac_add32_sat( |
422 | 32.4k | accu, ixheaac_mul32_sh(inp2[n + 1 + 6 * resolution], |
423 | 32.4k | p_qmf2[(n + 1 + 6 * resolution)], 31)); |
424 | 32.4k | accu = ixheaac_add32_sat( |
425 | 32.4k | accu, ixheaac_mul32_sh(inp2[n + 1 + 8 * resolution], |
426 | 32.4k | p_qmf2[(n + 1 + 8 * resolution)], 31)); |
427 | 32.4k | p_out[n + 1 + 64] = accu; |
428 | 32.4k | } |
429 | 1.01k | } |
430 | | |
431 | | VOID ixheaacd_sbr_qmfanal32_winadd_eld_32(WORD32 *inp1, WORD32 *inp2, |
432 | | const WORD32 *p_qmf1, |
433 | 73.1k | const WORD32 *p_qmf2, WORD32 *p_out) { |
434 | 73.1k | WORD32 n; |
435 | | |
436 | 1.24M | for (n = 0; n < 32; n += 2) { |
437 | 1.17M | WORD32 accu; |
438 | 1.17M | accu = ixheaac_mul32_sh(inp1[n + 0], p_qmf1[(n + 0)], 31); |
439 | 1.17M | accu = ixheaac_add32_sat( |
440 | 1.17M | accu, ixheaac_mul32_sh(inp1[n + 64], p_qmf1[(n + 64)], 31)); |
441 | 1.17M | accu = ixheaac_add32_sat( |
442 | 1.17M | accu, ixheaac_mul32_sh(inp1[n + 128], p_qmf1[(n + 128)], 31)); |
443 | 1.17M | accu = ixheaac_add32_sat( |
444 | 1.17M | accu, ixheaac_mul32_sh(inp1[n + 192], p_qmf1[(n + 192)], 31)); |
445 | 1.17M | accu = ixheaac_add32_sat( |
446 | 1.17M | accu, ixheaac_mul32_sh(inp1[n + 256], p_qmf1[(n + 256)], 31)); |
447 | 1.17M | p_out[n] = accu; |
448 | | |
449 | 1.17M | accu = ixheaac_mul32_sh(inp1[n + 1 + 0], p_qmf1[(n + 1 + 0)], 31); |
450 | 1.17M | accu = ixheaac_add32_sat( |
451 | 1.17M | accu, ixheaac_mul32_sh(inp1[n + 1 + 64], p_qmf1[(n + 1 + 64)], 31)); |
452 | 1.17M | accu = ixheaac_add32_sat( |
453 | 1.17M | accu, ixheaac_mul32_sh(inp1[n + 1 + 128], p_qmf1[(n + 1 + 128)], 31)); |
454 | 1.17M | accu = ixheaac_add32_sat( |
455 | 1.17M | accu, ixheaac_mul32_sh(inp1[n + 1 + 192], p_qmf1[(n + 1 + 192)], 31)); |
456 | 1.17M | accu = ixheaac_add32_sat( |
457 | 1.17M | accu, ixheaac_mul32_sh(inp1[n + 1 + 256], p_qmf1[(n + 1 + 256)], 31)); |
458 | 1.17M | p_out[n + 1] = accu; |
459 | | |
460 | 1.17M | accu = ixheaac_mul32_sh(inp2[n + 0], p_qmf2[(n + 0)], 31); |
461 | 1.17M | accu = ixheaac_add32_sat( |
462 | 1.17M | accu, ixheaac_mul32_sh(inp2[n + 64], p_qmf2[(n + 64)], 31)); |
463 | 1.17M | accu = ixheaac_add32_sat( |
464 | 1.17M | accu, ixheaac_mul32_sh(inp2[n + 128], p_qmf2[(n + 128)], 31)); |
465 | 1.17M | accu = ixheaac_add32_sat( |
466 | 1.17M | accu, ixheaac_mul32_sh(inp2[n + 192], p_qmf2[(n + 192)], 31)); |
467 | 1.17M | accu = ixheaac_add32_sat( |
468 | 1.17M | accu, ixheaac_mul32_sh(inp2[n + 256], p_qmf2[(n + 256)], 31)); |
469 | 1.17M | p_out[n + 32] = accu; |
470 | | |
471 | 1.17M | accu = ixheaac_mul32_sh(inp2[n + 1 + 0], p_qmf2[(n + 1 + 0)], 31); |
472 | 1.17M | accu = ixheaac_add32_sat( |
473 | 1.17M | accu, ixheaac_mul32_sh(inp2[n + 1 + 64], p_qmf2[(n + 1 + 64)], 31)); |
474 | 1.17M | accu = ixheaac_add32_sat( |
475 | 1.17M | accu, ixheaac_mul32_sh(inp2[n + 1 + 128], p_qmf2[(n + 1 + 128)], 31)); |
476 | 1.17M | accu = ixheaac_add32_sat( |
477 | 1.17M | accu, ixheaac_mul32_sh(inp2[n + 1 + 192], p_qmf2[(n + 1 + 192)], 31)); |
478 | 1.17M | accu = ixheaac_add32_sat( |
479 | 1.17M | accu, ixheaac_mul32_sh(inp2[n + 1 + 256], p_qmf2[(n + 1 + 256)], 31)); |
480 | 1.17M | p_out[n + 1 + 32] = accu; |
481 | 1.17M | } |
482 | 73.1k | } |
483 | | |
484 | | VOID ixheaacd_sbr_qmfanal32_winadd_eld(WORD16 *inp1, WORD16 *inp2, |
485 | | const WORD16 *p_qmf1, |
486 | 846k | const WORD16 *p_qmf2, WORD32 *p_out) { |
487 | 846k | WORD32 n; |
488 | | |
489 | 14.3M | for (n = 0; n < 32; n += 2) { |
490 | 13.5M | WORD32 accu; |
491 | 13.5M | accu = ixheaac_mult16x16in32(inp1[n + 0], p_qmf1[(n + 0)]); |
492 | 13.5M | accu = ixheaac_add32_sat( |
493 | 13.5M | accu, ixheaac_mult16x16in32(inp1[n + 64], p_qmf1[(n + 64)])); |
494 | 13.5M | accu = ixheaac_add32_sat( |
495 | 13.5M | accu, ixheaac_mult16x16in32(inp1[n + 128], p_qmf1[(n + 128)])); |
496 | 13.5M | accu = ixheaac_add32_sat( |
497 | 13.5M | accu, ixheaac_mult16x16in32(inp1[n + 192], p_qmf1[(n + 192)])); |
498 | 13.5M | accu = ixheaac_add32_sat( |
499 | 13.5M | accu, ixheaac_mult16x16in32(inp1[n + 256], p_qmf1[(n + 256)])); |
500 | 13.5M | p_out[n] = accu; |
501 | | |
502 | 13.5M | accu = ixheaac_mult16x16in32(inp1[n + 1 + 0], p_qmf1[(n + 1 + 0)]); |
503 | 13.5M | accu = ixheaac_add32_sat( |
504 | 13.5M | accu, ixheaac_mult16x16in32(inp1[n + 1 + 64], p_qmf1[(n + 1 + 64)])); |
505 | 13.5M | accu = ixheaac_add32_sat( |
506 | 13.5M | accu, ixheaac_mult16x16in32(inp1[n + 1 + 128], p_qmf1[(n + 1 + 128)])); |
507 | 13.5M | accu = ixheaac_add32_sat( |
508 | 13.5M | accu, ixheaac_mult16x16in32(inp1[n + 1 + 192], p_qmf1[(n + 1 + 192)])); |
509 | 13.5M | accu = ixheaac_add32_sat( |
510 | 13.5M | accu, ixheaac_mult16x16in32(inp1[n + 1 + 256], p_qmf1[(n + 1 + 256)])); |
511 | 13.5M | p_out[n + 1] = accu; |
512 | | |
513 | 13.5M | accu = ixheaac_mult16x16in32(inp2[n + 0], p_qmf2[(n + 0)]); |
514 | 13.5M | accu = ixheaac_add32_sat( |
515 | 13.5M | accu, ixheaac_mult16x16in32(inp2[n + 64], p_qmf2[(n + 64)])); |
516 | 13.5M | accu = ixheaac_add32_sat( |
517 | 13.5M | accu, ixheaac_mult16x16in32(inp2[n + 128], p_qmf2[(n + 128)])); |
518 | 13.5M | accu = ixheaac_add32_sat( |
519 | 13.5M | accu, ixheaac_mult16x16in32(inp2[n + 192], p_qmf2[(n + 192)])); |
520 | 13.5M | accu = ixheaac_add32_sat( |
521 | 13.5M | accu, ixheaac_mult16x16in32(inp2[n + 256], p_qmf2[(n + 256)])); |
522 | 13.5M | p_out[n + 32] = accu; |
523 | | |
524 | 13.5M | accu = ixheaac_mult16x16in32(inp2[n + 1 + 0], p_qmf2[(n + 1 + 0)]); |
525 | 13.5M | accu = ixheaac_add32_sat( |
526 | 13.5M | accu, ixheaac_mult16x16in32(inp2[n + 1 + 64], p_qmf2[(n + 1 + 64)])); |
527 | 13.5M | accu = ixheaac_add32_sat( |
528 | 13.5M | accu, ixheaac_mult16x16in32(inp2[n + 1 + 128], p_qmf2[(n + 1 + 128)])); |
529 | 13.5M | accu = ixheaac_add32_sat( |
530 | 13.5M | accu, ixheaac_mult16x16in32(inp2[n + 1 + 192], p_qmf2[(n + 1 + 192)])); |
531 | 13.5M | accu = ixheaac_add32_sat( |
532 | 13.5M | accu, ixheaac_mult16x16in32(inp2[n + 1 + 256], p_qmf2[(n + 1 + 256)])); |
533 | 13.5M | p_out[n + 1 + 32] = accu; |
534 | 13.5M | } |
535 | 846k | } |
536 | | |
537 | | VOID ixheaacd_esbr_qmfanal32_winadd(WORD32 *inp1, WORD32 *inp2, WORD32 *p_qmf1, |
538 | | WORD32 *p_qmf2, WORD32 *p_out, |
539 | 12.6M | WORD32 num_band_anal_qmf) { |
540 | 12.6M | WORD32 n; |
541 | 12.6M | WORD64 accu; |
542 | | |
543 | 12.6M | if (num_band_anal_qmf == 32) { |
544 | 144M | for (n = 0; n < num_band_anal_qmf; n += 2) { |
545 | 136M | accu = ixheaac_mult64(inp1[n + 0], p_qmf1[2 * (n + 0)]); |
546 | 136M | accu = ixheaac_add64( |
547 | 136M | accu, ixheaac_mult64(inp1[n + 2 * num_band_anal_qmf], |
548 | 136M | p_qmf1[2 * (n + 2 * num_band_anal_qmf)])); |
549 | 136M | accu = ixheaac_add64( |
550 | 136M | accu, ixheaac_mult64(inp1[n + 4 * num_band_anal_qmf], |
551 | 136M | p_qmf1[2 * (n + 4 * num_band_anal_qmf)])); |
552 | 136M | accu = ixheaac_add64( |
553 | 136M | accu, ixheaac_mult64(inp1[n + 6 * num_band_anal_qmf], |
554 | 136M | p_qmf1[2 * (n + 6 * num_band_anal_qmf)])); |
555 | 136M | accu = ixheaac_add64( |
556 | 136M | accu, ixheaac_mult64(inp1[n + 8 * num_band_anal_qmf], |
557 | 136M | p_qmf1[2 * (n + 8 * num_band_anal_qmf)])); |
558 | 136M | p_out[n] = (WORD32)(accu >> 31); |
559 | | |
560 | 136M | accu = ixheaac_mult64(inp1[n + 1 + 0], p_qmf1[2 * (n + 1 + 0)]); |
561 | 136M | accu = ixheaac_add64( |
562 | 136M | accu, ixheaac_mult64(inp1[n + 1 + 2 * num_band_anal_qmf], |
563 | 136M | p_qmf1[2 * (n + 1 + 2 * num_band_anal_qmf)])); |
564 | 136M | accu = ixheaac_add64( |
565 | 136M | accu, ixheaac_mult64(inp1[n + 1 + 4 * num_band_anal_qmf], |
566 | 136M | p_qmf1[2 * (n + 1 + 4 * num_band_anal_qmf)])); |
567 | 136M | accu = ixheaac_add64( |
568 | 136M | accu, ixheaac_mult64(inp1[n + 1 + 6 * num_band_anal_qmf], |
569 | 136M | p_qmf1[2 * (n + 1 + 6 * num_band_anal_qmf)])); |
570 | 136M | accu = ixheaac_add64( |
571 | 136M | accu, ixheaac_mult64(inp1[n + 1 + 8 * num_band_anal_qmf], |
572 | 136M | p_qmf1[2 * (n + 1 + 8 * num_band_anal_qmf)])); |
573 | 136M | p_out[n + 1] = (WORD32)(accu >> 31); |
574 | | |
575 | 136M | accu = ixheaac_mult64(inp2[n + 0], p_qmf2[2 * (n + 0)]); |
576 | 136M | accu = ixheaac_add64( |
577 | 136M | accu, ixheaac_mult64(inp2[n + 2 * num_band_anal_qmf], |
578 | 136M | p_qmf2[2 * (n + 2 * num_band_anal_qmf)])); |
579 | 136M | accu = ixheaac_add64( |
580 | 136M | accu, ixheaac_mult64(inp2[n + 4 * num_band_anal_qmf], |
581 | 136M | p_qmf2[2 * (n + 4 * num_band_anal_qmf)])); |
582 | 136M | accu = ixheaac_add64( |
583 | 136M | accu, ixheaac_mult64(inp2[n + 6 * num_band_anal_qmf], |
584 | 136M | p_qmf2[2 * (n + 6 * num_band_anal_qmf)])); |
585 | 136M | accu = ixheaac_add64( |
586 | 136M | accu, ixheaac_mult64(inp2[n + 8 * num_band_anal_qmf], |
587 | 136M | p_qmf2[2 * (n + 8 * num_band_anal_qmf)])); |
588 | 136M | p_out[n + num_band_anal_qmf] = (WORD32)(accu >> 31); |
589 | | |
590 | 136M | accu = ixheaac_mult64(inp2[n + 1 + 0], p_qmf2[2 * (n + 1 + 0)]); |
591 | 136M | accu = ixheaac_add64( |
592 | 136M | accu, ixheaac_mult64(inp2[n + 1 + 2 * num_band_anal_qmf], |
593 | 136M | p_qmf2[2 * (n + 1 + 2 * num_band_anal_qmf)])); |
594 | 136M | accu = ixheaac_add64( |
595 | 136M | accu, ixheaac_mult64(inp2[n + 1 + 4 * num_band_anal_qmf], |
596 | 136M | p_qmf2[2 * (n + 1 + 4 * num_band_anal_qmf)])); |
597 | 136M | accu = ixheaac_add64( |
598 | 136M | accu, ixheaac_mult64(inp2[n + 1 + 6 * num_band_anal_qmf], |
599 | 136M | p_qmf2[2 * (n + 1 + 6 * num_band_anal_qmf)])); |
600 | 136M | accu = ixheaac_add64( |
601 | 136M | accu, ixheaac_mult64(inp2[n + 1 + 8 * num_band_anal_qmf], |
602 | 136M | p_qmf2[2 * (n + 1 + 8 * num_band_anal_qmf)])); |
603 | 136M | p_out[n + 1 + num_band_anal_qmf] = (WORD32)(accu >> 31); |
604 | 136M | } |
605 | 8.50M | } else if (num_band_anal_qmf == 24) { |
606 | 14.6M | for (n = 0; n < num_band_anal_qmf; n += 2) { |
607 | 13.5M | accu = ixheaac_mult64(inp1[n + 0], p_qmf1[(n + 0)]); |
608 | 13.5M | accu = ixheaac_add64( |
609 | 13.5M | accu, ixheaac_mult64(inp1[n + 2 * num_band_anal_qmf], |
610 | 13.5M | p_qmf1[(n + 2 * num_band_anal_qmf)])); |
611 | 13.5M | accu = ixheaac_add64( |
612 | 13.5M | accu, ixheaac_mult64(inp1[n + 4 * num_band_anal_qmf], |
613 | 13.5M | p_qmf1[(n + 4 * num_band_anal_qmf)])); |
614 | 13.5M | accu = ixheaac_add64( |
615 | 13.5M | accu, ixheaac_mult64(inp1[n + 6 * num_band_anal_qmf], |
616 | 13.5M | p_qmf1[(n + 6 * num_band_anal_qmf)])); |
617 | 13.5M | accu = ixheaac_add64( |
618 | 13.5M | accu, ixheaac_mult64(inp1[n + 8 * num_band_anal_qmf], |
619 | 13.5M | p_qmf1[(n + 8 * num_band_anal_qmf)])); |
620 | 13.5M | p_out[n] = (WORD32)(accu >> 31); |
621 | | |
622 | 13.5M | accu = ixheaac_mult64(inp1[n + 1 + 0], p_qmf1[(n + 1 + 0)]); |
623 | 13.5M | accu = ixheaac_add64( |
624 | 13.5M | accu, ixheaac_mult64(inp1[n + 1 + 2 * num_band_anal_qmf], |
625 | 13.5M | p_qmf1[(n + 1 + 2 * num_band_anal_qmf)])); |
626 | 13.5M | accu = ixheaac_add64( |
627 | 13.5M | accu, ixheaac_mult64(inp1[n + 1 + 4 * num_band_anal_qmf], |
628 | 13.5M | p_qmf1[(n + 1 + 4 * num_band_anal_qmf)])); |
629 | 13.5M | accu = ixheaac_add64( |
630 | 13.5M | accu, ixheaac_mult64(inp1[n + 1 + 6 * num_band_anal_qmf], |
631 | 13.5M | p_qmf1[(n + 1 + 6 * num_band_anal_qmf)])); |
632 | 13.5M | accu = ixheaac_add64( |
633 | 13.5M | accu, ixheaac_mult64(inp1[n + 1 + 8 * num_band_anal_qmf], |
634 | 13.5M | p_qmf1[(n + 1 + 8 * num_band_anal_qmf)])); |
635 | 13.5M | p_out[n + 1] = (WORD32)(accu >> 31); |
636 | | |
637 | 13.5M | accu = ixheaac_mult64(inp2[n + 0], p_qmf2[(n + 0)]); |
638 | 13.5M | accu = ixheaac_add64( |
639 | 13.5M | accu, ixheaac_mult64(inp2[n + 2 * num_band_anal_qmf], |
640 | 13.5M | p_qmf2[(n + 2 * num_band_anal_qmf)])); |
641 | 13.5M | accu = ixheaac_add64( |
642 | 13.5M | accu, ixheaac_mult64(inp2[n + 4 * num_band_anal_qmf], |
643 | 13.5M | p_qmf2[(n + 4 * num_band_anal_qmf)])); |
644 | 13.5M | accu = ixheaac_add64( |
645 | 13.5M | accu, ixheaac_mult64(inp2[n + 6 * num_band_anal_qmf], |
646 | 13.5M | p_qmf2[(n + 6 * num_band_anal_qmf)])); |
647 | 13.5M | accu = ixheaac_add64( |
648 | 13.5M | accu, ixheaac_mult64(inp2[n + 8 * num_band_anal_qmf], |
649 | 13.5M | p_qmf2[(n + 8 * num_band_anal_qmf)])); |
650 | 13.5M | p_out[n + num_band_anal_qmf] = (WORD32)(accu >> 31); |
651 | | |
652 | 13.5M | accu = ixheaac_mult64(inp2[n + 1 + 0], p_qmf2[(n + 1 + 0)]); |
653 | 13.5M | accu = ixheaac_add64( |
654 | 13.5M | accu, ixheaac_mult64(inp2[n + 1 + 2 * num_band_anal_qmf], |
655 | 13.5M | p_qmf2[(n + 1 + 2 * num_band_anal_qmf)])); |
656 | 13.5M | accu = ixheaac_add64( |
657 | 13.5M | accu, ixheaac_mult64(inp2[n + 1 + 4 * num_band_anal_qmf], |
658 | 13.5M | p_qmf2[(n + 1 + 4 * num_band_anal_qmf)])); |
659 | 13.5M | accu = ixheaac_add64( |
660 | 13.5M | accu, ixheaac_mult64(inp2[n + 1 + 6 * num_band_anal_qmf], |
661 | 13.5M | p_qmf2[(n + 1 + 6 * num_band_anal_qmf)])); |
662 | 13.5M | accu = ixheaac_add64( |
663 | 13.5M | accu, ixheaac_mult64(inp2[n + 1 + 8 * num_band_anal_qmf], |
664 | 13.5M | p_qmf2[(n + 1 + 8 * num_band_anal_qmf)])); |
665 | 13.5M | p_out[n + 1 + num_band_anal_qmf] = (WORD32)(accu >> 31); |
666 | 13.5M | } |
667 | | |
668 | 2.99M | } else { |
669 | 26.9M | for (n = 0; n < num_band_anal_qmf; n += 2) { |
670 | 23.9M | accu = ixheaac_mult64(inp1[n + 0], p_qmf1[4 * (n + 0)]); |
671 | 23.9M | accu = ixheaac_add64( |
672 | 23.9M | accu, ixheaac_mult64(inp1[n + 2 * num_band_anal_qmf], |
673 | 23.9M | p_qmf1[4 * (n + 2 * num_band_anal_qmf)])); |
674 | 23.9M | accu = ixheaac_add64( |
675 | 23.9M | accu, ixheaac_mult64(inp1[n + 4 * num_band_anal_qmf], |
676 | 23.9M | p_qmf1[4 * (n + 4 * num_band_anal_qmf)])); |
677 | 23.9M | accu = ixheaac_add64( |
678 | 23.9M | accu, ixheaac_mult64(inp1[n + 6 * num_band_anal_qmf], |
679 | 23.9M | p_qmf1[4 * (n + 6 * num_band_anal_qmf)])); |
680 | 23.9M | accu = ixheaac_add64( |
681 | 23.9M | accu, ixheaac_mult64(inp1[n + 8 * num_band_anal_qmf], |
682 | 23.9M | p_qmf1[4 * (n + 8 * num_band_anal_qmf)])); |
683 | 23.9M | p_out[n] = (WORD32)(accu >> 31); |
684 | | |
685 | 23.9M | accu = ixheaac_mult64(inp1[n + 1 + 0], p_qmf1[4 * (n + 1 + 0)]); |
686 | 23.9M | accu = ixheaac_add64( |
687 | 23.9M | accu, ixheaac_mult64(inp1[n + 1 + 2 * num_band_anal_qmf], |
688 | 23.9M | p_qmf1[4 * (n + 1 + 2 * num_band_anal_qmf)])); |
689 | 23.9M | accu = ixheaac_add64( |
690 | 23.9M | accu, ixheaac_mult64(inp1[n + 1 + 4 * num_band_anal_qmf], |
691 | 23.9M | p_qmf1[4 * (n + 1 + 4 * num_band_anal_qmf)])); |
692 | 23.9M | accu = ixheaac_add64( |
693 | 23.9M | accu, ixheaac_mult64(inp1[n + 1 + 6 * num_band_anal_qmf], |
694 | 23.9M | p_qmf1[4 * (n + 1 + 6 * num_band_anal_qmf)])); |
695 | 23.9M | accu = ixheaac_add64( |
696 | 23.9M | accu, ixheaac_mult64(inp1[n + 1 + 8 * num_band_anal_qmf], |
697 | 23.9M | p_qmf1[4 * (n + 1 + 8 * num_band_anal_qmf)])); |
698 | 23.9M | p_out[n + 1] = (WORD32)(accu >> 31); |
699 | | |
700 | 23.9M | accu = ixheaac_mult64(inp2[n + 0], p_qmf2[4 * (n + 0)]); |
701 | 23.9M | accu = ixheaac_add64( |
702 | 23.9M | accu, ixheaac_mult64(inp2[n + 2 * num_band_anal_qmf], |
703 | 23.9M | p_qmf2[4 * (n + 2 * num_band_anal_qmf)])); |
704 | 23.9M | accu = ixheaac_add64( |
705 | 23.9M | accu, ixheaac_mult64(inp2[n + 4 * num_band_anal_qmf], |
706 | 23.9M | p_qmf2[4 * (n + 4 * num_band_anal_qmf)])); |
707 | 23.9M | accu = ixheaac_add64( |
708 | 23.9M | accu, ixheaac_mult64(inp2[n + 6 * num_band_anal_qmf], |
709 | 23.9M | p_qmf2[4 * (n + 6 * num_band_anal_qmf)])); |
710 | 23.9M | accu = ixheaac_add64( |
711 | 23.9M | accu, ixheaac_mult64(inp2[n + 8 * num_band_anal_qmf], |
712 | 23.9M | p_qmf2[4 * (n + 8 * num_band_anal_qmf)])); |
713 | 23.9M | p_out[n + num_band_anal_qmf] = (WORD32)(accu >> 31); |
714 | | |
715 | 23.9M | accu = ixheaac_mult64(inp2[n + 1 + 0], p_qmf2[4 * (n + 1 + 0)]); |
716 | 23.9M | accu = ixheaac_add64( |
717 | 23.9M | accu, ixheaac_mult64(inp2[n + 1 + 2 * num_band_anal_qmf], |
718 | 23.9M | p_qmf2[4 * (n + 1 + 2 * num_band_anal_qmf)])); |
719 | 23.9M | accu = ixheaac_add64( |
720 | 23.9M | accu, ixheaac_mult64(inp2[n + 1 + 4 * num_band_anal_qmf], |
721 | 23.9M | p_qmf2[4 * (n + 1 + 4 * num_band_anal_qmf)])); |
722 | 23.9M | accu = ixheaac_add64( |
723 | 23.9M | accu, ixheaac_mult64(inp2[n + 1 + 6 * num_band_anal_qmf], |
724 | 23.9M | p_qmf2[4 * (n + 1 + 6 * num_band_anal_qmf)])); |
725 | 23.9M | accu = ixheaac_add64( |
726 | 23.9M | accu, ixheaac_mult64(inp2[n + 1 + 8 * num_band_anal_qmf], |
727 | 23.9M | p_qmf2[4 * (n + 1 + 8 * num_band_anal_qmf)])); |
728 | 23.9M | p_out[n + 1 + num_band_anal_qmf] = (WORD32)(accu >> 31); |
729 | 23.9M | } |
730 | 2.99M | } |
731 | 12.6M | } |
732 | | |
733 | | VOID ixheaacd_esbr_inv_modulation( |
734 | | WORD32 *qmf_real, ia_sbr_qmf_filter_bank_struct *syn_qmf, |
735 | 6.61M | ia_qmf_dec_tables_struct *qmf_dec_tables_ptr, WORD32 no_synthesis_channels) { |
736 | | |
737 | 6.61M | if (no_synthesis_channels == NO_SYNTHESIS_CHANNELS_DOWN_SAMPLED) |
738 | 12.6k | { |
739 | 12.6k | ixheaacd_esbr_cos_sin_mod(qmf_real, syn_qmf, qmf_dec_tables_ptr->esbr_w_16, |
740 | 12.6k | qmf_dec_tables_ptr->dig_rev_table4_16); |
741 | 12.6k | } |
742 | 6.60M | else |
743 | 6.60M | { |
744 | 6.60M | ixheaacd_esbr_cos_sin_mod(qmf_real, syn_qmf, qmf_dec_tables_ptr->esbr_w_32, |
745 | 6.60M | qmf_dec_tables_ptr->dig_rev_table2_32); |
746 | 6.60M | } |
747 | 6.61M | } |
748 | | |
749 | | VOID ixheaacd_sbr_qmfsyn32_winadd(WORD16 *tmp1, WORD16 *tmp2, WORD16 *inp1, |
750 | | WORD16 *sample_buffer, FLAG shift, |
751 | 540k | WORD32 ch_fac) { |
752 | 540k | WORD32 k; |
753 | 540k | WORD32 rounding_fac = 0x8000; |
754 | 540k | rounding_fac = rounding_fac >> shift; |
755 | | |
756 | 17.8M | for (k = 0; k < 32; k++) { |
757 | 17.2M | WORD32 syn_out = rounding_fac; |
758 | | |
759 | 17.2M | syn_out = ixheaac_add32( |
760 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp1[0 + k], inp1[2 * (k + 0)])); |
761 | 17.2M | syn_out = ixheaac_add32( |
762 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp1[128 + k], inp1[2 * (k + 64)])); |
763 | 17.2M | syn_out = ixheaac_add32( |
764 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp1[256 + k], inp1[2 * (k + 128)])); |
765 | 17.2M | syn_out = ixheaac_add32( |
766 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp1[384 + k], inp1[2 * (k + 192)])); |
767 | 17.2M | syn_out = ixheaac_add32( |
768 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp1[512 + k], inp1[2 * (k + 256)])); |
769 | | |
770 | 17.2M | syn_out = ixheaac_add32( |
771 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp2[64 + k], inp1[2 * (k + 32)])); |
772 | 17.2M | syn_out = ixheaac_add32( |
773 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp2[192 + k], inp1[2 * (k + 96)])); |
774 | 17.2M | syn_out = ixheaac_add32( |
775 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp2[320 + k], inp1[2 * (k + 160)])); |
776 | 17.2M | syn_out = ixheaac_add32( |
777 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp2[448 + k], inp1[2 * (k + 224)])); |
778 | 17.2M | syn_out = ixheaac_add32( |
779 | 17.2M | syn_out, ixheaac_mult16x16in32(tmp2[576 + k], inp1[2 * (k + 288)])); |
780 | 17.2M | syn_out = ixheaac_add32_sat(syn_out, syn_out); |
781 | 17.2M | if (shift == 2) { |
782 | 17.2M | syn_out = ixheaac_add32_sat(syn_out, syn_out); |
783 | 17.2M | } |
784 | 17.2M | sample_buffer[ch_fac * k] = (syn_out >> 16); |
785 | 17.2M | } |
786 | 540k | } |
787 | | |
788 | | void ixheaacd_sbr_pre_twiddle(WORD32 *p_xre, WORD32 *p_xim, |
789 | 919k | WORD16 *p_twiddles) { |
790 | 919k | int k; |
791 | | |
792 | 58.8M | for (k = 62; k >= 0; k--) { |
793 | 57.9M | WORD32 x_re = *p_xre; |
794 | 57.9M | WORD32 x_im = *p_xim; |
795 | | |
796 | 57.9M | WORD16 ixheaacd_cosine = *p_twiddles++; |
797 | 57.9M | WORD16 ixheaacd_sine = *p_twiddles++; |
798 | | |
799 | 57.9M | WORD32 re, im; |
800 | | |
801 | 57.9M | re = ixheaac_mac32x16in32_shl_sat( |
802 | 57.9M | ixheaac_mult32x16in32_shl(x_re, ixheaacd_cosine), x_im, ixheaacd_sine); |
803 | 57.9M | im = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(x_im, ixheaacd_cosine), |
804 | 57.9M | ixheaac_mult32x16in32_shl(x_re, ixheaacd_sine)); |
805 | | |
806 | 57.9M | *p_xre++ = re; |
807 | 57.9M | *p_xim++ = im; |
808 | 57.9M | } |
809 | 919k | } |
810 | | |
811 | | VOID ixheaacd_cplx_synt_qmffilt( |
812 | | WORD32 **qmf_real, WORD32 **qmf_imag, WORD32 split, |
813 | | WORD32 *qmf_real_out[MAX_ENV_COLS], WORD32 *qmf_imag_out[MAX_ENV_COLS], |
814 | | ia_sbr_scale_fact_struct *sbr_scale_factor, WORD16 *time_out, |
815 | | ia_sbr_qmf_filter_bank_struct *qmf_bank, ia_ps_dec_struct *ptr_ps_dec, |
816 | | FLAG active, FLAG low_pow_flag, ia_sbr_tables_struct *sbr_tables_ptr, |
817 | | ixheaacd_misc_tables *pstr_common_tables, WORD32 ch_fac, FLAG drc_on, |
818 | 59.2k | WORD32 drc_sbr_factors[][64], WORD32 audio_object_type) { |
819 | 59.2k | WORD32 i, j; |
820 | | |
821 | 59.2k | WORD32 code_scale_factor; |
822 | 59.2k | WORD32 scale_factor; |
823 | 59.2k | WORD32 out_scale_factor; |
824 | 59.2k | WORD32 low_band_scale_factor; |
825 | 59.2k | WORD32 high_band_scale_factor; |
826 | 59.2k | WORD16 *filter_states = qmf_bank->filter_states; |
827 | 59.2k | WORD32 **ptr_qmf_imag_temp; |
828 | 59.2k | WORD32 qmf_real2[2 * NO_SYNTHESIS_CHANNELS]; |
829 | | |
830 | 59.2k | WORD32 no_synthesis_channels = qmf_bank->no_channels; |
831 | 59.2k | WORD32 p1; |
832 | | |
833 | 59.2k | WORD16 *fp1; |
834 | 59.2k | WORD16 *fp2; |
835 | | |
836 | 59.2k | WORD32 sixty4 = NO_SYNTHESIS_CHANNELS; |
837 | 59.2k | WORD32 thirty2 = qmf_bank->no_channels; |
838 | | |
839 | 59.2k | WORD16 *filter_coeff; |
840 | 59.2k | WORD32 num_time_slots = qmf_bank->num_time_slots; |
841 | 59.2k | WORD32 ixheaacd_drc_offset; |
842 | 59.2k | WORD32 ov_lb_scale = sbr_scale_factor->ov_lb_scale; |
843 | 59.2k | WORD32 lb_scale = sbr_scale_factor->lb_scale; |
844 | 59.2k | WORD32 st_syn_scale = sbr_scale_factor->st_syn_scale; |
845 | 59.2k | WORD32 ov_lb_shift, lb_shift, hb_shift; |
846 | | |
847 | 59.2k | WORD32 *qmf_real_tmp = qmf_real2; |
848 | 59.2k | WORD32 *qmf_imag_tmp = &qmf_real2[NO_SYNTHESIS_CHANNELS]; |
849 | 59.2k | WORD32 env = 0; |
850 | | |
851 | 59.2k | WORD32 common_shift = 0; |
852 | | |
853 | 59.2k | if (no_synthesis_channels == 32) { |
854 | 34.8k | qmf_bank->cos_twiddle = |
855 | 34.8k | (WORD16 *)sbr_tables_ptr->qmf_dec_tables_ptr->sbr_sin_cos_twiddle_l32; |
856 | 34.8k | qmf_bank->alt_sin_twiddle = |
857 | 34.8k | (WORD16 *)sbr_tables_ptr->qmf_dec_tables_ptr->sbr_alt_sin_twiddle_l32; |
858 | 34.8k | qmf_bank->t_cos = |
859 | 34.8k | (WORD16 *) |
860 | 34.8k | sbr_tables_ptr->qmf_dec_tables_ptr->sbr_cos_sin_twiddle_ds_l32; |
861 | 34.8k | } else { |
862 | 24.3k | qmf_bank->cos_twiddle = |
863 | 24.3k | (WORD16 *)sbr_tables_ptr->qmf_dec_tables_ptr->sbr_sin_cos_twiddle_l64; |
864 | 24.3k | qmf_bank->alt_sin_twiddle = |
865 | 24.3k | (WORD16 *)sbr_tables_ptr->qmf_dec_tables_ptr->sbr_alt_sin_twiddle_l64; |
866 | 24.3k | } |
867 | 59.2k | if (audio_object_type != AOT_ER_AAC_ELD && |
868 | 59.2k | audio_object_type != AOT_ER_AAC_LD) { |
869 | 0 | qmf_bank->filter_pos_syn += |
870 | 0 | (sbr_tables_ptr->qmf_dec_tables_ptr->qmf_c - qmf_bank->p_filter); |
871 | 0 | qmf_bank->p_filter = sbr_tables_ptr->qmf_dec_tables_ptr->qmf_c; |
872 | 59.2k | } else { |
873 | 59.2k | qmf_bank->filter_pos_syn += |
874 | 59.2k | (sbr_tables_ptr->qmf_dec_tables_ptr->qmf_c_eld - qmf_bank->p_filter); |
875 | 59.2k | qmf_bank->p_filter = sbr_tables_ptr->qmf_dec_tables_ptr->qmf_c_eld; |
876 | 59.2k | } |
877 | | |
878 | 59.2k | fp1 = &filter_states[0]; |
879 | 59.2k | fp2 = fp1 + no_synthesis_channels; |
880 | | |
881 | 59.2k | if (audio_object_type == AOT_ER_AAC_ELD || |
882 | 59.2k | audio_object_type == AOT_ER_AAC_LD) { |
883 | 59.2k | fp1 = qmf_bank->fp1_syn; |
884 | 59.2k | fp2 = qmf_bank->fp2_syn; |
885 | 59.2k | sixty4 = qmf_bank->sixty4; |
886 | 59.2k | } |
887 | | |
888 | 59.2k | filter_coeff = qmf_bank->filter_pos_syn; |
889 | | |
890 | 59.2k | if (active) { |
891 | 0 | code_scale_factor = scale_factor = sbr_scale_factor->ps_scale; |
892 | 59.2k | } else { |
893 | 59.2k | code_scale_factor = ixheaac_min32(lb_scale, ov_lb_scale); |
894 | 59.2k | scale_factor = sbr_scale_factor->hb_scale; |
895 | 59.2k | } |
896 | | |
897 | 59.2k | low_band_scale_factor = (st_syn_scale - code_scale_factor); |
898 | 59.2k | high_band_scale_factor = (st_syn_scale - scale_factor); |
899 | | |
900 | 59.2k | p1 = 0; |
901 | | |
902 | 59.2k | if (low_pow_flag) |
903 | | |
904 | 0 | { |
905 | 0 | ov_lb_shift = (st_syn_scale - ov_lb_scale) - 4; |
906 | 0 | lb_shift = (st_syn_scale - lb_scale) - 4; |
907 | 0 | hb_shift = high_band_scale_factor - 4; |
908 | 0 | out_scale_factor = -((sbr_scale_factor->st_syn_scale - 1)); |
909 | 0 | ptr_qmf_imag_temp = 0; |
910 | |
|
911 | 0 | } |
912 | | |
913 | 59.2k | else { |
914 | 59.2k | out_scale_factor = -((sbr_scale_factor->st_syn_scale - 3)); |
915 | 59.2k | if (active) { |
916 | 0 | ov_lb_shift = (sbr_scale_factor->ps_scale - ov_lb_scale); |
917 | 0 | lb_shift = (sbr_scale_factor->ps_scale - lb_scale); |
918 | 0 | hb_shift = (sbr_scale_factor->ps_scale - sbr_scale_factor->hb_scale); |
919 | 0 | common_shift = low_band_scale_factor - 8; |
920 | |
|
921 | 59.2k | } else { |
922 | 59.2k | if (audio_object_type != AOT_ER_AAC_ELD && |
923 | 59.2k | audio_object_type != AOT_ER_AAC_LD) { |
924 | 0 | ov_lb_shift = (st_syn_scale - ov_lb_scale) - 8; |
925 | 0 | lb_shift = (st_syn_scale - lb_scale) - 8; |
926 | 0 | hb_shift = high_band_scale_factor - 8; |
927 | 59.2k | } else { |
928 | 59.2k | ov_lb_shift = (st_syn_scale - ov_lb_scale) - 7; |
929 | 59.2k | lb_shift = (st_syn_scale - lb_scale) - 7; |
930 | 59.2k | hb_shift = high_band_scale_factor - 7; |
931 | 59.2k | } |
932 | 59.2k | common_shift = 0; |
933 | 59.2k | } |
934 | 59.2k | ptr_qmf_imag_temp = qmf_imag; |
935 | 59.2k | } |
936 | | |
937 | 59.2k | { |
938 | 59.2k | if (ov_lb_shift == lb_shift) { |
939 | 59.2k | (*ixheaacd_adjust_scale)(qmf_real, ptr_qmf_imag_temp, 0, qmf_bank->lsb, 0, |
940 | 59.2k | num_time_slots, ov_lb_shift, low_pow_flag); |
941 | | |
942 | 59.2k | } else { |
943 | 0 | (*ixheaacd_adjust_scale)(qmf_real, ptr_qmf_imag_temp, 0, qmf_bank->lsb, 0, |
944 | 0 | split, ov_lb_shift, low_pow_flag); |
945 | |
|
946 | 0 | (*ixheaacd_adjust_scale)(qmf_real, ptr_qmf_imag_temp, 0, qmf_bank->lsb, |
947 | 0 | split, num_time_slots, lb_shift, low_pow_flag); |
948 | 0 | } |
949 | | |
950 | 59.2k | (*ixheaacd_adjust_scale)(qmf_real, ptr_qmf_imag_temp, qmf_bank->lsb, |
951 | 59.2k | qmf_bank->usb, 0, num_time_slots, hb_shift, |
952 | 59.2k | low_pow_flag); |
953 | 59.2k | } |
954 | | |
955 | 59.2k | ixheaacd_drc_offset = qmf_bank->ixheaacd_drc_offset; |
956 | | |
957 | 59.2k | if (1 == drc_on) { |
958 | 917k | for (i = 0; i < num_time_slots; i++) { |
959 | 862k | WORD32 loop_val; |
960 | 56.0M | for (loop_val = 0; loop_val < 64; loop_val++) { |
961 | 55.1M | qmf_real[i][loop_val] = ixheaacd_mult32x32in32_shift25( |
962 | 55.1M | qmf_real[i][loop_val], drc_sbr_factors[6 + i][loop_val]); |
963 | 55.1M | } |
964 | 862k | } |
965 | 55.5k | } |
966 | 979k | for (i = 0; i < num_time_slots; i++) |
967 | 919k | { |
968 | 42.5M | for (j = 0; j < no_synthesis_channels; j++) |
969 | 41.5M | { |
970 | 41.5M | qmf_real_out[i][j] = qmf_real[i][j]; |
971 | 41.5M | if (!low_pow_flag) |
972 | 41.5M | { |
973 | 41.5M | qmf_imag_out[i][j] = qmf_imag[i][j]; |
974 | 41.5M | } |
975 | 41.5M | } |
976 | 919k | } |
977 | 59.2k | if (low_pow_flag) |
978 | 0 | { |
979 | 0 | WORD16 *fptemp; |
980 | |
|
981 | 0 | VOID(*sbr_qmf_syn_winadd) |
982 | 0 | (WORD16 *, WORD16 *, WORD16 *, WORD16 *, FLAG, WORD32); |
983 | 0 | ia_qmf_dec_tables_struct *qmf_tab_ptr = sbr_tables_ptr->qmf_dec_tables_ptr; |
984 | |
|
985 | 0 | if (no_synthesis_channels == NO_SYNTHESIS_CHANNELS_DOWN_SAMPLED) |
986 | 0 | sbr_qmf_syn_winadd = ixheaacd_sbr_qmfsyn32_winadd; |
987 | 0 | else |
988 | 0 | sbr_qmf_syn_winadd = ixheaacd_sbr_qmfsyn64_winadd; |
989 | |
|
990 | 0 | for (i = 0; i < num_time_slots; i++) { |
991 | 0 | ixheaacd_inv_modulation_lp(qmf_real[i], |
992 | 0 | &filter_states[ixheaacd_drc_offset], qmf_bank, |
993 | 0 | qmf_tab_ptr); |
994 | |
|
995 | 0 | sbr_qmf_syn_winadd(fp1, fp2, filter_coeff, &time_out[ch_fac * p1], 2, |
996 | 0 | ch_fac); |
997 | |
|
998 | 0 | ixheaacd_drc_offset -= no_synthesis_channels << 1; |
999 | |
|
1000 | 0 | if (ixheaacd_drc_offset < 0) |
1001 | 0 | ixheaacd_drc_offset += ((no_synthesis_channels << 1) * 10); |
1002 | |
|
1003 | 0 | fptemp = fp1; |
1004 | 0 | fp1 = fp2; |
1005 | 0 | fp2 = fptemp; |
1006 | |
|
1007 | 0 | filter_coeff += 64; |
1008 | |
|
1009 | 0 | if (filter_coeff == qmf_bank->p_filter + 640) |
1010 | 0 | filter_coeff = (WORD16 *)qmf_bank->p_filter; |
1011 | |
|
1012 | 0 | p1 += no_synthesis_channels; |
1013 | 0 | } |
1014 | |
|
1015 | 59.2k | } else { |
1016 | 979k | for (i = 0; i < num_time_slots; i++) { |
1017 | 919k | WORD32 *t_qmf_imag; |
1018 | 919k | t_qmf_imag = qmf_imag[i]; |
1019 | | |
1020 | 919k | if (active) { |
1021 | 0 | if (i == ptr_ps_dec->border_position[env]) { |
1022 | 0 | ixheaacd_init_rot_env(ptr_ps_dec, (WORD16)env, qmf_bank->usb, |
1023 | 0 | sbr_tables_ptr, pstr_common_tables->trig_data); |
1024 | 0 | env++; |
1025 | 0 | } |
1026 | |
|
1027 | 0 | ixheaacd_apply_ps(ptr_ps_dec, &qmf_real[i], &qmf_imag[i], qmf_real_tmp, |
1028 | 0 | qmf_imag_tmp, sbr_scale_factor, (WORD16)i, |
1029 | 0 | sbr_tables_ptr, num_time_slots); |
1030 | 0 | } |
1031 | 919k | if (1 == drc_on) { |
1032 | 862k | WORD32 loop_val; |
1033 | 56.0M | for (loop_val = 0; loop_val < 64; loop_val++) { |
1034 | 55.1M | qmf_real[i][loop_val] = ixheaacd_mult32x32in32_shift25( |
1035 | 55.1M | qmf_real[i][loop_val], drc_sbr_factors[6 + i][loop_val]); |
1036 | 55.1M | } |
1037 | 862k | } |
1038 | | |
1039 | 919k | if (active) { |
1040 | 0 | if (common_shift) |
1041 | 0 | ixheaacd_shiftrountine(qmf_real[i], t_qmf_imag, no_synthesis_channels, |
1042 | 0 | common_shift); |
1043 | 0 | } |
1044 | | |
1045 | 919k | if (audio_object_type == AOT_ER_AAC_ELD || |
1046 | 919k | audio_object_type == AOT_ER_AAC_LD) |
1047 | 919k | ixheaacd_sbr_pre_twiddle( |
1048 | 919k | qmf_real[i], t_qmf_imag, |
1049 | 919k | sbr_tables_ptr->qmf_dec_tables_ptr->ixheaacd_sbr_synth_cos_sin_l32); |
1050 | | |
1051 | 919k | ixheaacd_inv_emodulation(qmf_real[i], qmf_bank, |
1052 | 919k | sbr_tables_ptr->qmf_dec_tables_ptr); |
1053 | | |
1054 | 919k | { |
1055 | 919k | WORD32 temp_out_scale_fac = out_scale_factor + 1; |
1056 | 919k | if (audio_object_type == AOT_ER_AAC_LD || |
1057 | 919k | audio_object_type == AOT_ER_AAC_ELD) { |
1058 | 919k | temp_out_scale_fac = temp_out_scale_fac - 1; |
1059 | | |
1060 | 919k | ixheaacd_shiftrountine_with_rnd_eld( |
1061 | 919k | qmf_real[i], t_qmf_imag, &filter_states[ixheaacd_drc_offset], |
1062 | 919k | no_synthesis_channels, temp_out_scale_fac); |
1063 | | |
1064 | 919k | } |
1065 | | |
1066 | 0 | else { |
1067 | 0 | ixheaacd_shiftrountine_with_rnd( |
1068 | 0 | qmf_real[i], t_qmf_imag, &filter_states[ixheaacd_drc_offset], |
1069 | 0 | no_synthesis_channels, temp_out_scale_fac); |
1070 | 0 | } |
1071 | 919k | } |
1072 | | |
1073 | 919k | if (no_synthesis_channels == NO_SYNTHESIS_CHANNELS_DOWN_SAMPLED) { |
1074 | 540k | WORD32 temp = 1; |
1075 | 540k | if (audio_object_type == AOT_ER_AAC_LD || |
1076 | 540k | audio_object_type == AOT_ER_AAC_ELD) { |
1077 | 540k | temp = 2; |
1078 | 540k | } |
1079 | 540k | ixheaacd_sbr_qmfsyn32_winadd(fp1, fp2, filter_coeff, |
1080 | 540k | &time_out[ch_fac * p1], temp, ch_fac); |
1081 | | |
1082 | 540k | fp1 += thirty2; |
1083 | 540k | fp2 -= thirty2; |
1084 | 540k | thirty2 = -thirty2; |
1085 | | |
1086 | 540k | ixheaacd_drc_offset -= 64; |
1087 | | |
1088 | 540k | if (ixheaacd_drc_offset < 0) ixheaacd_drc_offset += 640; |
1089 | | |
1090 | 540k | } else { |
1091 | 379k | WORD32 temp = 1; |
1092 | 379k | if (audio_object_type == AOT_ER_AAC_LD || |
1093 | 379k | audio_object_type == AOT_ER_AAC_ELD) { |
1094 | 379k | temp = 2; |
1095 | 379k | } |
1096 | 379k | ixheaacd_sbr_qmfsyn64_winadd(fp1, fp2, filter_coeff, |
1097 | 379k | &time_out[ch_fac * p1], temp, ch_fac); |
1098 | | |
1099 | 379k | fp1 += sixty4; |
1100 | 379k | fp2 -= sixty4; |
1101 | 379k | sixty4 = -sixty4; |
1102 | 379k | ixheaacd_drc_offset -= 128; |
1103 | | |
1104 | 379k | if (ixheaacd_drc_offset < 0) ixheaacd_drc_offset += 1280; |
1105 | 379k | } |
1106 | | |
1107 | 919k | filter_coeff += 64; |
1108 | | |
1109 | 919k | if (filter_coeff == qmf_bank->p_filter + 640) |
1110 | 88.5k | filter_coeff = (WORD16 *)qmf_bank->p_filter; |
1111 | | |
1112 | 919k | p1 += no_synthesis_channels; |
1113 | | |
1114 | 919k | if (active) |
1115 | 0 | memcpy(qmf_real[i], qmf_real_tmp, |
1116 | 0 | 2 * no_synthesis_channels * sizeof(WORD32)); |
1117 | 919k | } |
1118 | 59.2k | } |
1119 | | |
1120 | 59.2k | if (audio_object_type == AOT_ER_AAC_LD || |
1121 | 59.2k | audio_object_type == AOT_ER_AAC_ELD) { |
1122 | 59.2k | qmf_bank->fp1_syn = fp1; |
1123 | 59.2k | qmf_bank->fp2_syn = fp2; |
1124 | 59.2k | qmf_bank->sixty4 = sixty4; |
1125 | 59.2k | } |
1126 | | |
1127 | 59.2k | qmf_bank->filter_pos_syn = filter_coeff; |
1128 | 59.2k | qmf_bank->ixheaacd_drc_offset = ixheaacd_drc_offset; |
1129 | 59.2k | } |