1*15dc779aSAndroid Build Coastguard Worker /******************************************************************************
2*15dc779aSAndroid Build Coastguard Worker * *
3*15dc779aSAndroid Build Coastguard Worker * Copyright (C) 2018 The Android Open Source Project
4*15dc779aSAndroid Build Coastguard Worker *
5*15dc779aSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
6*15dc779aSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
7*15dc779aSAndroid Build Coastguard Worker * You may obtain a copy of the License at:
8*15dc779aSAndroid Build Coastguard Worker *
9*15dc779aSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0
10*15dc779aSAndroid Build Coastguard Worker *
11*15dc779aSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
12*15dc779aSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
13*15dc779aSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*15dc779aSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
15*15dc779aSAndroid Build Coastguard Worker * limitations under the License.
16*15dc779aSAndroid Build Coastguard Worker *
17*15dc779aSAndroid Build Coastguard Worker *****************************************************************************
18*15dc779aSAndroid Build Coastguard Worker * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19*15dc779aSAndroid Build Coastguard Worker */
20*15dc779aSAndroid Build Coastguard Worker #include <string.h>
21*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_sbr_common.h"
22*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_type_def.h"
23*15dc779aSAndroid Build Coastguard Worker
24*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_constants.h"
25*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_basic_ops32.h"
26*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_basic_ops16.h"
27*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_basic_ops40.h"
28*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_basic_ops.h"
29*15dc779aSAndroid Build Coastguard Worker
30*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_basic_op.h"
31*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_intrinsics.h"
32*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_common_rom.h"
33*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_basic_funcs.h"
34*15dc779aSAndroid Build Coastguard Worker
35*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_bitbuffer.h"
36*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_sbrdecsettings.h"
37*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_sbr_scale.h"
38*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_lpp_tran.h"
39*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_env_extr_part.h"
40*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_sbr_rom.h"
41*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_hybrid.h"
42*15dc779aSAndroid Build Coastguard Worker
43*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_ps_dec.h"
44*15dc779aSAndroid Build Coastguard Worker
45*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_env_extr.h"
46*15dc779aSAndroid Build Coastguard Worker
47*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_dsp_fft32x32s.h"
48*15dc779aSAndroid Build Coastguard Worker
49*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_function_selector.h"
50*15dc779aSAndroid Build Coastguard Worker
ixheaacd_filt_2_ch(const WORD32 * ptr_qmf,WORD32 * ptr_hybrid,ia_sbr_tables_struct * ptr_sbr_tables)51*15dc779aSAndroid Build Coastguard Worker static VOID ixheaacd_filt_2_ch(const WORD32 *ptr_qmf, WORD32 *ptr_hybrid,
52*15dc779aSAndroid Build Coastguard Worker ia_sbr_tables_struct *ptr_sbr_tables) {
53*15dc779aSAndroid Build Coastguard Worker WORD32 cum0, cum1, cum00, cum11;
54*15dc779aSAndroid Build Coastguard Worker WORD16 *p2_6 = ptr_sbr_tables->ps_tables_ptr->p2_6;
55*15dc779aSAndroid Build Coastguard Worker
56*15dc779aSAndroid Build Coastguard Worker cum0 = ptr_qmf[HYBRID_FILTER_DELAY] >> 1;
57*15dc779aSAndroid Build Coastguard Worker cum00 = ptr_qmf[HYBRID_FILTER_DELAY + 16] >> 1;
58*15dc779aSAndroid Build Coastguard Worker cum1 = 0L;
59*15dc779aSAndroid Build Coastguard Worker cum11 = 0L;
60*15dc779aSAndroid Build Coastguard Worker
61*15dc779aSAndroid Build Coastguard Worker {
62*15dc779aSAndroid Build Coastguard Worker cum1 = ixheaac_add32_sat(cum1, ixheaac_mult32x16in32(ptr_qmf[1], *p2_6));
63*15dc779aSAndroid Build Coastguard Worker cum11 =
64*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(cum11, ixheaac_mult32x16in32(ptr_qmf[17], *p2_6++));
65*15dc779aSAndroid Build Coastguard Worker
66*15dc779aSAndroid Build Coastguard Worker cum1 = ixheaac_add32_sat(cum1, ixheaac_mult32x16in32(ptr_qmf[3], *p2_6));
67*15dc779aSAndroid Build Coastguard Worker cum11 =
68*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(cum11, ixheaac_mult32x16in32(ptr_qmf[19], *p2_6++));
69*15dc779aSAndroid Build Coastguard Worker
70*15dc779aSAndroid Build Coastguard Worker cum1 = ixheaac_add32_sat(cum1, ixheaac_mult32x16in32(ptr_qmf[5], *p2_6));
71*15dc779aSAndroid Build Coastguard Worker cum11 =
72*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(cum11, ixheaac_mult32x16in32(ptr_qmf[21], *p2_6++));
73*15dc779aSAndroid Build Coastguard Worker
74*15dc779aSAndroid Build Coastguard Worker cum1 = ixheaac_add32_sat(cum1, ixheaac_mult32x16in32(ptr_qmf[7], *p2_6));
75*15dc779aSAndroid Build Coastguard Worker cum11 =
76*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(cum11, ixheaac_mult32x16in32(ptr_qmf[23], *p2_6++));
77*15dc779aSAndroid Build Coastguard Worker
78*15dc779aSAndroid Build Coastguard Worker cum1 = ixheaac_add32_sat(cum1, ixheaac_mult32x16in32(ptr_qmf[9], *p2_6));
79*15dc779aSAndroid Build Coastguard Worker cum11 =
80*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(cum11, ixheaac_mult32x16in32(ptr_qmf[25], *p2_6++));
81*15dc779aSAndroid Build Coastguard Worker
82*15dc779aSAndroid Build Coastguard Worker cum1 = ixheaac_add32_sat(cum1, ixheaac_mult32x16in32(ptr_qmf[11], *p2_6));
83*15dc779aSAndroid Build Coastguard Worker cum11 =
84*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(cum11, ixheaac_mult32x16in32(ptr_qmf[27], *p2_6++));
85*15dc779aSAndroid Build Coastguard Worker }
86*15dc779aSAndroid Build Coastguard Worker cum1 = ixheaac_shl32(cum1, 1);
87*15dc779aSAndroid Build Coastguard Worker cum11 = ixheaac_shl32(cum11, 1);
88*15dc779aSAndroid Build Coastguard Worker
89*15dc779aSAndroid Build Coastguard Worker ptr_hybrid[0] = ixheaac_add32_sat(cum0, cum1);
90*15dc779aSAndroid Build Coastguard Worker ptr_hybrid[1] = ixheaac_sub32_sat(cum0, cum1);
91*15dc779aSAndroid Build Coastguard Worker
92*15dc779aSAndroid Build Coastguard Worker ptr_hybrid[16] = ixheaac_add32_sat(cum00, cum11);
93*15dc779aSAndroid Build Coastguard Worker ptr_hybrid[17] = ixheaac_sub32_sat(cum00, cum11);
94*15dc779aSAndroid Build Coastguard Worker }
95*15dc779aSAndroid Build Coastguard Worker
ixheaacd_filt_8_ch(const WORD32 * ptr_qmf_real,const WORD32 * ptr_qmf_imag,WORD32 * ptr_hyb_real,WORD32 * ptr_hyb_imag,ia_sbr_tables_struct * ptr_sbr_tables)96*15dc779aSAndroid Build Coastguard Worker static VOID ixheaacd_filt_8_ch(const WORD32 *ptr_qmf_real,
97*15dc779aSAndroid Build Coastguard Worker const WORD32 *ptr_qmf_imag, WORD32 *ptr_hyb_real,
98*15dc779aSAndroid Build Coastguard Worker WORD32 *ptr_hyb_imag,
99*15dc779aSAndroid Build Coastguard Worker ia_sbr_tables_struct *ptr_sbr_tables) {
100*15dc779aSAndroid Build Coastguard Worker const WORD16 tcos = 0x7642;
101*15dc779aSAndroid Build Coastguard Worker const WORD16 tsin = 0x30fc;
102*15dc779aSAndroid Build Coastguard Worker const WORD16 tcom = 0x5a82;
103*15dc779aSAndroid Build Coastguard Worker WORD32 real, imag;
104*15dc779aSAndroid Build Coastguard Worker WORD32 cum[16];
105*15dc779aSAndroid Build Coastguard Worker const WORD16 *p8_13 = ptr_sbr_tables->ps_tables_ptr->p8_13;
106*15dc779aSAndroid Build Coastguard Worker const WORD16 *p8_13_8 = ptr_sbr_tables->ps_tables_ptr->p8_13 + 8;
107*15dc779aSAndroid Build Coastguard Worker
108*15dc779aSAndroid Build Coastguard Worker real = ixheaac_shl32(
109*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(ixheaac_mult32x16in32(ptr_qmf_real[0], *p8_13),
110*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_real[8], *p8_13_8)),
111*15dc779aSAndroid Build Coastguard Worker 1);
112*15dc779aSAndroid Build Coastguard Worker imag = ixheaac_shl32(
113*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(ixheaac_mult32x16in32(ptr_qmf_imag[0], *p8_13++),
114*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_imag[8], *p8_13_8++)),
115*15dc779aSAndroid Build Coastguard Worker 1);
116*15dc779aSAndroid Build Coastguard Worker
117*15dc779aSAndroid Build Coastguard Worker cum[12] = ixheaac_shl32(
118*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ixheaac_add32_sat(imag, real), tcom), 1);
119*15dc779aSAndroid Build Coastguard Worker cum[13] = ixheaac_shl32(
120*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ixheaac_sub32_sat(imag, real), tcom), 1);
121*15dc779aSAndroid Build Coastguard Worker
122*15dc779aSAndroid Build Coastguard Worker real = ixheaac_shl32(
123*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(ixheaac_mult32x16in32(ptr_qmf_real[1], *p8_13),
124*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_real[9], *p8_13_8)),
125*15dc779aSAndroid Build Coastguard Worker 1);
126*15dc779aSAndroid Build Coastguard Worker imag = ixheaac_shl32(
127*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(ixheaac_mult32x16in32(ptr_qmf_imag[1], *p8_13++),
128*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_imag[9], *p8_13_8++)),
129*15dc779aSAndroid Build Coastguard Worker 1);
130*15dc779aSAndroid Build Coastguard Worker
131*15dc779aSAndroid Build Coastguard Worker cum[10] =
132*15dc779aSAndroid Build Coastguard Worker ixheaac_shl32(ixheaac_add32_sat(ixheaac_mult32x16in32(imag, tcos),
133*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(real, tsin)),
134*15dc779aSAndroid Build Coastguard Worker 1);
135*15dc779aSAndroid Build Coastguard Worker cum[11] =
136*15dc779aSAndroid Build Coastguard Worker ixheaac_shl32(ixheaac_sub32_sat(ixheaac_mult32x16in32(imag, tsin),
137*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(real, tcos)),
138*15dc779aSAndroid Build Coastguard Worker 1);
139*15dc779aSAndroid Build Coastguard Worker cum[9] = ixheaac_shl32(
140*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(
141*15dc779aSAndroid Build Coastguard Worker ixheaac_sub32_sat(ptr_qmf_real[2], ptr_qmf_real[10]), *p8_13_8++),
142*15dc779aSAndroid Build Coastguard Worker 1);
143*15dc779aSAndroid Build Coastguard Worker cum[8] = ixheaac_shl32(
144*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(
145*15dc779aSAndroid Build Coastguard Worker ixheaac_sub32_sat(ptr_qmf_imag[2], ptr_qmf_imag[10]), *p8_13++),
146*15dc779aSAndroid Build Coastguard Worker 1);
147*15dc779aSAndroid Build Coastguard Worker
148*15dc779aSAndroid Build Coastguard Worker real = ixheaac_shl32(
149*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(ixheaac_mult32x16in32(ptr_qmf_real[3], *p8_13),
150*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_real[11], *p8_13_8)),
151*15dc779aSAndroid Build Coastguard Worker 1);
152*15dc779aSAndroid Build Coastguard Worker imag = ixheaac_shl32(
153*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(ixheaac_mult32x16in32(ptr_qmf_imag[3], *p8_13++),
154*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_imag[11], *p8_13_8++)),
155*15dc779aSAndroid Build Coastguard Worker 1);
156*15dc779aSAndroid Build Coastguard Worker
157*15dc779aSAndroid Build Coastguard Worker cum[6] =
158*15dc779aSAndroid Build Coastguard Worker ixheaac_shl32(ixheaac_sub32_sat(ixheaac_mult32x16in32(imag, tcos),
159*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(real, tsin)),
160*15dc779aSAndroid Build Coastguard Worker 1);
161*15dc779aSAndroid Build Coastguard Worker cum[7] = ixheaac_shl32(ixheaac_negate32_sat(ixheaac_add32_sat(
162*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(imag, tsin),
163*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(real, tcos))),
164*15dc779aSAndroid Build Coastguard Worker 1);
165*15dc779aSAndroid Build Coastguard Worker
166*15dc779aSAndroid Build Coastguard Worker real = ixheaac_shl32(
167*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(ixheaac_mult32x16in32(ptr_qmf_real[4], *p8_13),
168*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_real[12], *p8_13_8)),
169*15dc779aSAndroid Build Coastguard Worker 1);
170*15dc779aSAndroid Build Coastguard Worker imag = ixheaac_shl32(
171*15dc779aSAndroid Build Coastguard Worker ixheaac_add32_sat(ixheaac_mult32x16in32(ptr_qmf_imag[4], *p8_13++),
172*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_imag[12], *p8_13_8++)),
173*15dc779aSAndroid Build Coastguard Worker 1);
174*15dc779aSAndroid Build Coastguard Worker
175*15dc779aSAndroid Build Coastguard Worker cum[4] = ixheaac_shl32(
176*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ixheaac_sub32_sat(imag, real), tcom), 1);
177*15dc779aSAndroid Build Coastguard Worker cum[5] = ixheaac_shl32(
178*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(
179*15dc779aSAndroid Build Coastguard Worker ixheaac_negate32_sat(ixheaac_add32_sat(imag, real)), tcom),
180*15dc779aSAndroid Build Coastguard Worker 1);
181*15dc779aSAndroid Build Coastguard Worker
182*15dc779aSAndroid Build Coastguard Worker real = ixheaac_shl32(ixheaac_mult32x16in32(ptr_qmf_real[5], *p8_13), 1);
183*15dc779aSAndroid Build Coastguard Worker imag = ixheaac_shl32(ixheaac_mult32x16in32(ptr_qmf_imag[5], *p8_13++), 1);
184*15dc779aSAndroid Build Coastguard Worker
185*15dc779aSAndroid Build Coastguard Worker cum[2] =
186*15dc779aSAndroid Build Coastguard Worker ixheaac_shl32(ixheaac_sub32_sat(ixheaac_mult32x16in32(real, tcos),
187*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(imag, tsin)),
188*15dc779aSAndroid Build Coastguard Worker 1);
189*15dc779aSAndroid Build Coastguard Worker cum[3] =
190*15dc779aSAndroid Build Coastguard Worker ixheaac_shl32(ixheaac_add32_sat(ixheaac_mult32x16in32(real, tsin),
191*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(imag, tcos)),
192*15dc779aSAndroid Build Coastguard Worker 1);
193*15dc779aSAndroid Build Coastguard Worker
194*15dc779aSAndroid Build Coastguard Worker cum[0] = ixheaac_shl32(
195*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_real[HYBRID_FILTER_DELAY], *p8_13), 1);
196*15dc779aSAndroid Build Coastguard Worker cum[1] = ixheaac_shl32(
197*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(ptr_qmf_imag[HYBRID_FILTER_DELAY], *p8_13++), 1);
198*15dc779aSAndroid Build Coastguard Worker
199*15dc779aSAndroid Build Coastguard Worker real = ixheaac_shl32(ixheaac_mult32x16in32(ptr_qmf_real[7], *p8_13), 1);
200*15dc779aSAndroid Build Coastguard Worker imag = ixheaac_shl32(ixheaac_mult32x16in32(ptr_qmf_imag[7], *p8_13++), 1);
201*15dc779aSAndroid Build Coastguard Worker
202*15dc779aSAndroid Build Coastguard Worker cum[14] =
203*15dc779aSAndroid Build Coastguard Worker ixheaac_shl32(ixheaac_add32_sat(ixheaac_mult32x16in32(imag, tsin),
204*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(real, tcos)),
205*15dc779aSAndroid Build Coastguard Worker 1);
206*15dc779aSAndroid Build Coastguard Worker cum[15] =
207*15dc779aSAndroid Build Coastguard Worker ixheaac_shl32(ixheaac_sub32_sat(ixheaac_mult32x16in32(imag, tcos),
208*15dc779aSAndroid Build Coastguard Worker ixheaac_mult32x16in32(real, tsin)),
209*15dc779aSAndroid Build Coastguard Worker 1);
210*15dc779aSAndroid Build Coastguard Worker
211*15dc779aSAndroid Build Coastguard Worker (*ixheaacd_inv_dit_fft_8pt)(cum, ptr_hyb_real, ptr_hyb_imag);
212*15dc779aSAndroid Build Coastguard Worker }
213*15dc779aSAndroid Build Coastguard Worker
ixheaacd_hybrid_analysis(const WORD32 * ptr_qmf_real,WORD32 * ptr_hyb_real,WORD32 * ptr_hyb_imag,ia_hybrid_struct * ptr_hybrid,WORD16 scale,ia_sbr_tables_struct * ptr_sbr_tables)214*15dc779aSAndroid Build Coastguard Worker VOID ixheaacd_hybrid_analysis(const WORD32 *ptr_qmf_real, WORD32 *ptr_hyb_real,
215*15dc779aSAndroid Build Coastguard Worker WORD32 *ptr_hyb_imag,
216*15dc779aSAndroid Build Coastguard Worker ia_hybrid_struct *ptr_hybrid, WORD16 scale,
217*15dc779aSAndroid Build Coastguard Worker ia_sbr_tables_struct *ptr_sbr_tables)
218*15dc779aSAndroid Build Coastguard Worker
219*15dc779aSAndroid Build Coastguard Worker {
220*15dc779aSAndroid Build Coastguard Worker WORD band, j;
221*15dc779aSAndroid Build Coastguard Worker WORD chn_offset = 0;
222*15dc779aSAndroid Build Coastguard Worker WORD32 *ptr_re, *ptr_im;
223*15dc779aSAndroid Build Coastguard Worker WORD32 *ptr_temp_real, *ptr_temp_imag;
224*15dc779aSAndroid Build Coastguard Worker
225*15dc779aSAndroid Build Coastguard Worker for (band = 0; band < NO_QMF_CHANNELS_IN_HYBRID; band++) {
226*15dc779aSAndroid Build Coastguard Worker ptr_re = ptr_hybrid->ptr_qmf_buf_re[band];
227*15dc779aSAndroid Build Coastguard Worker ptr_im = ptr_hybrid->ptr_qmf_buf_im[band];
228*15dc779aSAndroid Build Coastguard Worker
229*15dc779aSAndroid Build Coastguard Worker ptr_temp_real = &ptr_hybrid->ptr_work_re[0];
230*15dc779aSAndroid Build Coastguard Worker ptr_temp_imag = &ptr_hybrid->ptr_work_im[0];
231*15dc779aSAndroid Build Coastguard Worker
232*15dc779aSAndroid Build Coastguard Worker *ptr_temp_real = *ptr_re;
233*15dc779aSAndroid Build Coastguard Worker *ptr_temp_imag = *ptr_im;
234*15dc779aSAndroid Build Coastguard Worker
235*15dc779aSAndroid Build Coastguard Worker ptr_temp_real++;
236*15dc779aSAndroid Build Coastguard Worker ptr_re++;
237*15dc779aSAndroid Build Coastguard Worker ptr_temp_imag++;
238*15dc779aSAndroid Build Coastguard Worker ptr_im++;
239*15dc779aSAndroid Build Coastguard Worker
240*15dc779aSAndroid Build Coastguard Worker for (j = ptr_hybrid->ptr_qmf_buf - 2; j >= 0; j--) {
241*15dc779aSAndroid Build Coastguard Worker *ptr_temp_real++ = *ptr_re;
242*15dc779aSAndroid Build Coastguard Worker *(ptr_re - 1) = *ptr_re;
243*15dc779aSAndroid Build Coastguard Worker ptr_re++;
244*15dc779aSAndroid Build Coastguard Worker *ptr_temp_imag++ = *ptr_im;
245*15dc779aSAndroid Build Coastguard Worker *(ptr_im - 1) = *ptr_im;
246*15dc779aSAndroid Build Coastguard Worker ptr_im++;
247*15dc779aSAndroid Build Coastguard Worker }
248*15dc779aSAndroid Build Coastguard Worker
249*15dc779aSAndroid Build Coastguard Worker {
250*15dc779aSAndroid Build Coastguard Worker WORD32 temp_re = ptr_qmf_real[band];
251*15dc779aSAndroid Build Coastguard Worker WORD32 temp_im = ptr_qmf_real[band + 0x40];
252*15dc779aSAndroid Build Coastguard Worker
253*15dc779aSAndroid Build Coastguard Worker if (scale < 0) {
254*15dc779aSAndroid Build Coastguard Worker temp_re = ixheaac_shl32(temp_re, -scale);
255*15dc779aSAndroid Build Coastguard Worker temp_im = ixheaac_shl32(temp_im, -scale);
256*15dc779aSAndroid Build Coastguard Worker } else {
257*15dc779aSAndroid Build Coastguard Worker temp_re = ixheaac_shr32(temp_re, scale);
258*15dc779aSAndroid Build Coastguard Worker temp_im = ixheaac_shr32(temp_im, scale);
259*15dc779aSAndroid Build Coastguard Worker }
260*15dc779aSAndroid Build Coastguard Worker *ptr_temp_real = temp_re;
261*15dc779aSAndroid Build Coastguard Worker *--ptr_re = temp_re;
262*15dc779aSAndroid Build Coastguard Worker
263*15dc779aSAndroid Build Coastguard Worker *ptr_temp_imag = temp_im;
264*15dc779aSAndroid Build Coastguard Worker *--ptr_im = temp_im;
265*15dc779aSAndroid Build Coastguard Worker }
266*15dc779aSAndroid Build Coastguard Worker
267*15dc779aSAndroid Build Coastguard Worker switch (ptr_hybrid->ptr_resol[band]) {
268*15dc779aSAndroid Build Coastguard Worker case NO_HYBRID_CHANNELS_LOW:
269*15dc779aSAndroid Build Coastguard Worker
270*15dc779aSAndroid Build Coastguard Worker ixheaacd_filt_2_ch(ptr_hybrid->ptr_work_re, &ptr_hyb_real[chn_offset],
271*15dc779aSAndroid Build Coastguard Worker ptr_sbr_tables);
272*15dc779aSAndroid Build Coastguard Worker
273*15dc779aSAndroid Build Coastguard Worker chn_offset += 2;
274*15dc779aSAndroid Build Coastguard Worker
275*15dc779aSAndroid Build Coastguard Worker break;
276*15dc779aSAndroid Build Coastguard Worker case NO_HYBRID_CHANNELS_HIGH:
277*15dc779aSAndroid Build Coastguard Worker
278*15dc779aSAndroid Build Coastguard Worker ixheaacd_filt_8_ch(ptr_hybrid->ptr_work_re, ptr_hybrid->ptr_work_im,
279*15dc779aSAndroid Build Coastguard Worker &ptr_hyb_real[chn_offset], &ptr_hyb_imag[chn_offset],
280*15dc779aSAndroid Build Coastguard Worker ptr_sbr_tables);
281*15dc779aSAndroid Build Coastguard Worker
282*15dc779aSAndroid Build Coastguard Worker chn_offset += 6;
283*15dc779aSAndroid Build Coastguard Worker }
284*15dc779aSAndroid Build Coastguard Worker }
285*15dc779aSAndroid Build Coastguard Worker }
286