/src/libxaac/decoder/ixheaacd_mps_polyphase.c
Line | Count | Source |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Copyright (C) 2023 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 | | #include "ixheaac_type_def.h" |
22 | | #include "ixheaacd_mps_struct_def.h" |
23 | | #include "ixheaacd_error_codes.h" |
24 | | #include "ixheaacd_mps_res_rom.h" |
25 | | #include "ixheaacd_mps_aac_struct.h" |
26 | | #include "ixheaac_constants.h" |
27 | | #include "ixheaac_basic_ops32.h" |
28 | | #include "ixheaac_basic_ops40.h" |
29 | | #include "ixheaacd_bitbuffer.h" |
30 | | #include "ixheaacd_common_rom.h" |
31 | | #include "ixheaacd_sbrdecsettings.h" |
32 | | #include "ixheaacd_sbr_scale.h" |
33 | | #include "ixheaacd_env_extr_part.h" |
34 | | #include "ixheaacd_sbr_rom.h" |
35 | | #include "ixheaacd_hybrid.h" |
36 | | #include "ixheaacd_ps_dec.h" |
37 | | #include "ixheaacd_mps_polyphase.h" |
38 | | #include "ixheaacd_config.h" |
39 | | #include "ixheaacd_qmf_dec.h" |
40 | | #include "ixheaacd_mps_dec.h" |
41 | | #include "ixheaacd_mps_defines.h" |
42 | | #include "ixheaacd_mps_macro_def.h" |
43 | | #include "ixheaacd_mps_basic_op.h" |
44 | | #include "ixheaac_error_standards.h" |
45 | | |
46 | 15.0M | static VOID ixheaacd_fft32(WORD32 *vec, const WORD16 *fft_c) { |
47 | 15.0M | WORD32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9, tmp10, tmp11, tmp12, tmp13, |
48 | 15.0M | tmp14, tmp15; |
49 | 15.0M | WORD32 temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18, temp19, temp110, |
50 | 15.0M | temp111, temp112, temp113, temp114, temp115; |
51 | 15.0M | WORD32 temp20, temp21, temp22, temp23, temp24, temp25, temp26, temp27, temp28, temp29, temp210, |
52 | 15.0M | temp211, temp212, temp213, temp214, temp215; |
53 | 15.0M | WORD32 temp30, temp31, temp32, temp33, temp34, temp35, temp36, temp37, temp38, temp39, temp310, |
54 | 15.0M | temp311, temp312, temp313, temp314, temp315; |
55 | 15.0M | WORD32 temp316, temp317, temp318, temp319, temp320, temp321, temp322, temp323, temp324, temp325, |
56 | 15.0M | temp326, temp327, temp328, temp329, temp330, temp331; |
57 | 15.0M | WORD32 temp40, temp41, temp42, temp43, temp44, temp45, temp46, temp47, temp48, temp49, temp410, |
58 | 15.0M | temp411, temp412, temp413, temp414, temp415; |
59 | | |
60 | 15.0M | temp20 = ixheaac_sub32_sat(vec[2], vec[34]); |
61 | 15.0M | temp21 = ixheaac_sub32_sat(vec[3], vec[35]); |
62 | 15.0M | temp30 = ixheaac_add32_sat(vec[0], vec[32]); |
63 | 15.0M | temp31 = ixheaac_add32_sat(vec[1], vec[33]); |
64 | 15.0M | temp32 = ixheaac_add32_sat(vec[2], vec[34]); |
65 | 15.0M | temp33 = ixheaac_add32_sat(vec[3], vec[35]); |
66 | | |
67 | 15.0M | temp22 = ixheaac_sub32_sat(vec[6], vec[38]); |
68 | 15.0M | temp23 = ixheaac_sub32_sat(vec[7], vec[39]); |
69 | 15.0M | temp34 = ixheaac_add32_sat(vec[4], vec[36]); |
70 | 15.0M | temp35 = ixheaac_add32_sat(vec[5], vec[37]); |
71 | 15.0M | temp36 = ixheaac_add32_sat(vec[6], vec[38]); |
72 | 15.0M | temp37 = ixheaac_add32_sat(vec[7], vec[39]); |
73 | | |
74 | 15.0M | temp24 = ixheaac_sub32_sat(vec[10], vec[42]); |
75 | 15.0M | temp25 = ixheaac_sub32_sat(vec[11], vec[43]); |
76 | 15.0M | temp38 = ixheaac_add32_sat(vec[8], vec[40]); |
77 | 15.0M | temp39 = ixheaac_add32_sat(vec[9], vec[41]); |
78 | 15.0M | temp310 = ixheaac_add32_sat(vec[10], vec[42]); |
79 | 15.0M | temp311 = ixheaac_add32_sat(vec[11], vec[43]); |
80 | | |
81 | 15.0M | temp26 = ixheaac_sub32_sat(vec[14], vec[46]); |
82 | 15.0M | temp27 = ixheaac_sub32_sat(vec[15], vec[47]); |
83 | 15.0M | temp312 = ixheaac_add32_sat(vec[12], vec[44]); |
84 | 15.0M | temp313 = ixheaac_add32_sat(vec[13], vec[45]); |
85 | 15.0M | temp314 = ixheaac_add32_sat(vec[14], vec[46]); |
86 | 15.0M | temp315 = ixheaac_add32_sat(vec[15], vec[47]); |
87 | | |
88 | 15.0M | temp28 = ixheaac_sub32_sat(vec[18], vec[50]); |
89 | 15.0M | temp29 = ixheaac_sub32_sat(vec[19], vec[51]); |
90 | 15.0M | temp316 = ixheaac_add32_sat(vec[16], vec[48]); |
91 | 15.0M | temp317 = ixheaac_add32_sat(vec[17], vec[49]); |
92 | 15.0M | temp318 = ixheaac_add32_sat(vec[18], vec[50]); |
93 | 15.0M | temp319 = ixheaac_add32_sat(vec[19], vec[51]); |
94 | | |
95 | 15.0M | temp210 = ixheaac_sub32_sat(vec[22], vec[54]); |
96 | 15.0M | temp211 = ixheaac_sub32_sat(vec[23], vec[55]); |
97 | 15.0M | temp320 = ixheaac_add32_sat(vec[20], vec[52]); |
98 | 15.0M | temp321 = ixheaac_add32_sat(vec[21], vec[53]); |
99 | 15.0M | temp322 = ixheaac_add32_sat(vec[22], vec[54]); |
100 | 15.0M | temp323 = ixheaac_add32_sat(vec[23], vec[55]); |
101 | | |
102 | 15.0M | temp212 = ixheaac_sub32_sat(vec[26], vec[58]); |
103 | 15.0M | temp213 = ixheaac_sub32_sat(vec[27], vec[59]); |
104 | 15.0M | temp324 = ixheaac_add32_sat(vec[24], vec[56]); |
105 | 15.0M | temp325 = ixheaac_add32_sat(vec[25], vec[57]); |
106 | 15.0M | temp326 = ixheaac_add32_sat(vec[26], vec[58]); |
107 | 15.0M | temp327 = ixheaac_add32_sat(vec[27], vec[59]); |
108 | | |
109 | 15.0M | temp214 = ixheaac_sub32_sat(vec[30], vec[62]); |
110 | 15.0M | temp215 = ixheaac_sub32_sat(vec[31], vec[63]); |
111 | 15.0M | temp328 = ixheaac_add32_sat(vec[28], vec[60]); |
112 | 15.0M | temp329 = ixheaac_add32_sat(vec[29], vec[61]); |
113 | 15.0M | temp330 = ixheaac_add32_sat(vec[30], vec[62]); |
114 | 15.0M | temp331 = ixheaac_add32_sat(vec[31], vec[63]); |
115 | | |
116 | 15.0M | temp41 = ixheaac_negate32_sat(ixheaac_add32_sat(temp20, temp214)); |
117 | 15.0M | temp42 = ixheaac_sub32_sat(temp20, temp214); |
118 | 15.0M | temp40 = ixheaac_add32_sat(temp21, temp215); |
119 | 15.0M | temp43 = ixheaac_sub32_sat(temp21, temp215); |
120 | 15.0M | temp45 = ixheaac_negate32_sat(ixheaac_add32_sat(temp22, temp212)); |
121 | 15.0M | temp46 = ixheaac_sub32_sat(temp22, temp212); |
122 | 15.0M | temp44 = ixheaac_add32_sat(temp23, temp213); |
123 | 15.0M | temp47 = ixheaac_sub32_sat(temp23, temp213); |
124 | 15.0M | temp49 = ixheaac_negate32_sat(ixheaac_add32_sat(temp24, temp210)); |
125 | 15.0M | temp410 = ixheaac_sub32_sat(temp24, temp210); |
126 | 15.0M | temp48 = ixheaac_add32_sat(temp25, temp211); |
127 | 15.0M | temp411 = ixheaac_sub32_sat(temp25, temp211); |
128 | 15.0M | temp413 = ixheaac_negate32_sat(ixheaac_add32_sat(temp26, temp28)); |
129 | 15.0M | temp414 = ixheaac_sub32_sat(temp26, temp28); |
130 | 15.0M | temp412 = ixheaac_add32_sat(temp27, temp29); |
131 | 15.0M | temp415 = ixheaac_sub32_sat(temp27, temp29); |
132 | | |
133 | 15.0M | temp20 = ixheaac_add32_sat(ixheaac_add32_sat(ixheaac_add32_sat( |
134 | 15.0M | ixheaac_mult32x16in32_shl(temp40, fft_c[3]), |
135 | 15.0M | ixheaac_mult32x16in32_shl(temp44, fft_c[2])), |
136 | 15.0M | ixheaac_mult32x16in32_shl(temp48, fft_c[1])), |
137 | 15.0M | ixheaac_mult32x16in32_shl(temp412, fft_c[0])); |
138 | | |
139 | 15.0M | temp24 = ixheaac_sub32_sat(ixheaac_add32_sat(ixheaac_add32_sat( |
140 | 15.0M | ixheaac_mult32x16in32_shl(temp40, fft_c[2]), |
141 | 15.0M | ixheaac_mult32x16in32_shl(temp44, fft_c[0])), |
142 | 15.0M | ixheaac_mult32x16in32_shl(temp48, fft_c[3])), |
143 | 15.0M | ixheaac_mult32x16in32_shl(temp412, fft_c[1])); |
144 | | |
145 | 15.0M | temp28 = ixheaac_add32_sat(ixheaac_sub32_sat(ixheaac_add32_sat( |
146 | 15.0M | ixheaac_mult32x16in32_shl(temp40, fft_c[1]), |
147 | 15.0M | ixheaac_mult32x16in32_shl(temp44, fft_c[3])), |
148 | 15.0M | ixheaac_mult32x16in32_shl(temp48, fft_c[0])), |
149 | 15.0M | ixheaac_mult32x16in32_shl(temp412, fft_c[2])); |
150 | | |
151 | 15.0M | temp212 = ixheaac_sub32_sat(ixheaac_add32_sat(ixheaac_sub32_sat( |
152 | 15.0M | ixheaac_mult32x16in32_shl(temp40, fft_c[0]), |
153 | 15.0M | ixheaac_mult32x16in32_shl(temp44, fft_c[1])), |
154 | 15.0M | ixheaac_mult32x16in32_shl(temp48, fft_c[2])), |
155 | 15.0M | ixheaac_mult32x16in32_shl(temp412, fft_c[3])); |
156 | | |
157 | 15.0M | temp21 = ixheaac_add32_sat(ixheaac_add32_sat(ixheaac_add32_sat( |
158 | 15.0M | ixheaac_mult32x16in32_shl(temp41, fft_c[3]), |
159 | 15.0M | ixheaac_mult32x16in32_shl(temp45, fft_c[2])), |
160 | 15.0M | ixheaac_mult32x16in32_shl(temp49, fft_c[1])), |
161 | 15.0M | ixheaac_mult32x16in32_shl(temp413, fft_c[0])); |
162 | | |
163 | 15.0M | temp25 = ixheaac_sub32_sat(ixheaac_add32_sat(ixheaac_add32_sat( |
164 | 15.0M | ixheaac_mult32x16in32_shl(temp41, fft_c[2]), |
165 | 15.0M | ixheaac_mult32x16in32_shl(temp45, fft_c[0])), |
166 | 15.0M | ixheaac_mult32x16in32_shl(temp49, fft_c[3])), |
167 | 15.0M | ixheaac_mult32x16in32_shl(temp413, fft_c[1])); |
168 | | |
169 | 15.0M | temp29 = ixheaac_add32_sat(ixheaac_sub32_sat(ixheaac_add32_sat( |
170 | 15.0M | ixheaac_mult32x16in32_shl(temp41, fft_c[1]), |
171 | 15.0M | ixheaac_mult32x16in32_shl(temp45, fft_c[3])), |
172 | 15.0M | ixheaac_mult32x16in32_shl(temp49, fft_c[0])), |
173 | 15.0M | ixheaac_mult32x16in32_shl(temp413, fft_c[2])); |
174 | | |
175 | 15.0M | temp213 = ixheaac_sub32_sat(ixheaac_add32_sat(ixheaac_sub32_sat( |
176 | 15.0M | ixheaac_mult32x16in32_shl(temp41, fft_c[0]), |
177 | 15.0M | ixheaac_mult32x16in32_shl(temp45, fft_c[1])), |
178 | 15.0M | ixheaac_mult32x16in32_shl(temp49, fft_c[2])), |
179 | 15.0M | ixheaac_mult32x16in32_shl(temp413, fft_c[3])); |
180 | | |
181 | 15.0M | temp22 = ixheaac_add32_sat(ixheaac_add32_sat(ixheaac_add32_sat( |
182 | 15.0M | ixheaac_mult32x16in32_shl(temp42, fft_c[0]), |
183 | 15.0M | ixheaac_mult32x16in32_shl(temp46, fft_c[1])), |
184 | 15.0M | ixheaac_mult32x16in32_shl(temp410, fft_c[2])), |
185 | 15.0M | ixheaac_mult32x16in32_shl(temp414, fft_c[3])); |
186 | | |
187 | 15.0M | temp26 = ixheaac_sub32_sat(ixheaac_sub32_sat(ixheaac_sub32_sat( |
188 | 15.0M | ixheaac_mult32x16in32_shl(temp42, fft_c[1]), |
189 | 15.0M | ixheaac_mult32x16in32_shl(temp46, fft_c[3])), |
190 | 15.0M | ixheaac_mult32x16in32_shl(temp410, fft_c[0])), |
191 | 15.0M | ixheaac_mult32x16in32_shl(temp414, fft_c[2])); |
192 | | |
193 | 15.0M | temp210 = ixheaac_add32_sat(ixheaac_add32_sat(ixheaac_sub32_sat( |
194 | 15.0M | ixheaac_mult32x16in32_shl(temp42, fft_c[2]), |
195 | 15.0M | ixheaac_mult32x16in32_shl(temp46, fft_c[0])), |
196 | 15.0M | ixheaac_mult32x16in32_shl(temp410, fft_c[3])), |
197 | 15.0M | ixheaac_mult32x16in32_shl(temp414, fft_c[1])); |
198 | | |
199 | 15.0M | temp214 = ixheaac_sub32_sat(ixheaac_add32_sat(ixheaac_sub32_sat( |
200 | 15.0M | ixheaac_mult32x16in32_shl(temp42, fft_c[3]), |
201 | 15.0M | ixheaac_mult32x16in32_shl(temp46, fft_c[2])), |
202 | 15.0M | ixheaac_mult32x16in32_shl(temp410, fft_c[1])), |
203 | 15.0M | ixheaac_mult32x16in32_shl(temp414, fft_c[0])); |
204 | | |
205 | 15.0M | temp23 = ixheaac_add32_sat(ixheaac_add32_sat(ixheaac_add32_sat( |
206 | 15.0M | ixheaac_mult32x16in32_shl(temp43, fft_c[0]), |
207 | 15.0M | ixheaac_mult32x16in32_shl(temp47, fft_c[1])), |
208 | 15.0M | ixheaac_mult32x16in32_shl(temp411, fft_c[2])), |
209 | 15.0M | ixheaac_mult32x16in32_shl(temp415, fft_c[3])); |
210 | | |
211 | 15.0M | temp27 = ixheaac_sub32_sat(ixheaac_sub32_sat(ixheaac_sub32_sat( |
212 | 15.0M | ixheaac_mult32x16in32_shl(temp43, fft_c[1]), |
213 | 15.0M | ixheaac_mult32x16in32_shl(temp47, fft_c[3])), |
214 | 15.0M | ixheaac_mult32x16in32_shl(temp411, fft_c[0])), |
215 | 15.0M | ixheaac_mult32x16in32_shl(temp415, fft_c[2])); |
216 | | |
217 | 15.0M | temp211 = ixheaac_add32_sat(ixheaac_add32_sat(ixheaac_sub32_sat( |
218 | 15.0M | ixheaac_mult32x16in32_shl(temp43, fft_c[2]), |
219 | 15.0M | ixheaac_mult32x16in32_shl(temp47, fft_c[0])), |
220 | 15.0M | ixheaac_mult32x16in32_shl(temp411, fft_c[3])), |
221 | 15.0M | ixheaac_mult32x16in32_shl(temp415, fft_c[1])); |
222 | | |
223 | 15.0M | temp215 = ixheaac_sub32_sat(ixheaac_add32_sat(ixheaac_sub32_sat( |
224 | 15.0M | ixheaac_mult32x16in32_shl(temp43, fft_c[3]), |
225 | 15.0M | ixheaac_mult32x16in32_shl(temp47, fft_c[2])), |
226 | 15.0M | ixheaac_mult32x16in32_shl(temp411, fft_c[1])), |
227 | 15.0M | ixheaac_mult32x16in32_shl(temp415, fft_c[0])); |
228 | | |
229 | 15.0M | temp40 = ixheaac_add32_sat(temp20, temp22); |
230 | 15.0M | temp414 = ixheaac_sub32_sat(temp20, temp22); |
231 | 15.0M | temp41 = ixheaac_add32_sat(temp21, temp23); |
232 | 15.0M | temp415 = ixheaac_sub32_sat(temp21, temp23); |
233 | 15.0M | temp42 = ixheaac_add32_sat(temp24, temp26); |
234 | 15.0M | temp412 = ixheaac_sub32_sat(temp24, temp26); |
235 | 15.0M | temp43 = ixheaac_add32_sat(temp25, temp27); |
236 | 15.0M | temp413 = ixheaac_sub32_sat(temp25, temp27); |
237 | 15.0M | temp44 = ixheaac_add32_sat(temp28, temp210); |
238 | 15.0M | temp410 = ixheaac_sub32_sat(temp28, temp210); |
239 | 15.0M | temp45 = ixheaac_add32_sat(temp29, temp211); |
240 | 15.0M | temp411 = ixheaac_sub32_sat(temp29, temp211); |
241 | 15.0M | temp46 = ixheaac_add32_sat(temp212, temp214); |
242 | 15.0M | temp48 = ixheaac_sub32_sat(temp212, temp214); |
243 | 15.0M | temp47 = ixheaac_add32_sat(temp213, temp215); |
244 | 15.0M | temp49 = ixheaac_sub32_sat(temp213, temp215); |
245 | | |
246 | 15.0M | temp10 = ixheaac_add32_sat(temp30, temp316); |
247 | 15.0M | temp11 = ixheaac_add32_sat(temp31, temp317); |
248 | 15.0M | temp12 = ixheaac_add32_sat(temp32, temp318); |
249 | 15.0M | temp13 = ixheaac_add32_sat(temp33, temp319); |
250 | 15.0M | temp14 = ixheaac_add32_sat(temp34, temp320); |
251 | 15.0M | temp15 = ixheaac_add32_sat(temp35, temp321); |
252 | 15.0M | temp16 = ixheaac_add32_sat(temp36, temp322); |
253 | 15.0M | temp17 = ixheaac_add32_sat(temp37, temp323); |
254 | 15.0M | temp18 = ixheaac_add32_sat(temp38, temp324); |
255 | 15.0M | temp19 = ixheaac_add32_sat(temp39, temp325); |
256 | 15.0M | temp110 = ixheaac_add32_sat(temp310, temp326); |
257 | 15.0M | temp111 = ixheaac_add32_sat(temp311, temp327); |
258 | 15.0M | temp112 = ixheaac_add32_sat(temp312, temp328); |
259 | 15.0M | temp113 = ixheaac_add32_sat(temp313, temp329); |
260 | 15.0M | temp114 = ixheaac_add32_sat(temp314, temp330); |
261 | 15.0M | temp115 = ixheaac_add32_sat(temp315, temp331); |
262 | | |
263 | 15.0M | tmp0 = ixheaac_add32_sat(temp10, temp18); |
264 | 15.0M | tmp2 = ixheaac_sub32_sat(temp10, temp18); |
265 | 15.0M | tmp1 = ixheaac_add32_sat(temp11, temp19); |
266 | 15.0M | tmp3 = ixheaac_sub32_sat(temp11, temp19); |
267 | 15.0M | tmp4 = ixheaac_add32_sat(temp12, temp110); |
268 | 15.0M | tmp6 = ixheaac_sub32_sat(temp12, temp110); |
269 | 15.0M | tmp5 = ixheaac_add32_sat(temp13, temp111); |
270 | 15.0M | tmp7 = ixheaac_sub32_sat(temp13, temp111); |
271 | 15.0M | tmp8 = ixheaac_add32_sat(temp14, temp112); |
272 | 15.0M | tmp10 = ixheaac_sub32_sat(temp14, temp112); |
273 | 15.0M | tmp9 = ixheaac_add32_sat(temp15, temp113); |
274 | 15.0M | tmp11 = ixheaac_sub32_sat(temp15, temp113); |
275 | 15.0M | tmp12 = ixheaac_add32_sat(temp16, temp114); |
276 | 15.0M | tmp14 = ixheaac_sub32_sat(temp16, temp114); |
277 | 15.0M | tmp13 = ixheaac_add32_sat(temp17, temp115); |
278 | 15.0M | tmp15 = ixheaac_sub32_sat(temp17, temp115); |
279 | | |
280 | 15.0M | temp20 = ixheaac_add32_sat(tmp0, tmp8); |
281 | 15.0M | temp24 = ixheaac_sub32_sat(tmp0, tmp8); |
282 | 15.0M | temp21 = ixheaac_add32_sat(tmp1, tmp9); |
283 | 15.0M | temp25 = ixheaac_sub32_sat(tmp1, tmp9); |
284 | 15.0M | temp28 = ixheaac_sub32_sat(tmp2, tmp11); |
285 | 15.0M | temp210 = ixheaac_add32_sat(tmp2, tmp11); |
286 | 15.0M | temp29 = ixheaac_add32_sat(tmp3, tmp10); |
287 | 15.0M | temp211 = ixheaac_sub32_sat(tmp3, tmp10); |
288 | 15.0M | temp22 = ixheaac_add32_sat(tmp4, tmp12); |
289 | 15.0M | temp27 = ixheaac_sub32_sat(tmp4, tmp12); |
290 | 15.0M | temp23 = ixheaac_add32_sat(tmp5, tmp13); |
291 | 15.0M | temp26 = ixheaac_sub32_sat(tmp13, tmp5); |
292 | | |
293 | 15.0M | tmp1 = ixheaac_add32_sat(tmp6, tmp14); |
294 | 15.0M | tmp2 = ixheaac_sub32_sat(tmp6, tmp14); |
295 | 15.0M | tmp0 = ixheaac_add32_sat(tmp7, tmp15); |
296 | 15.0M | tmp3 = ixheaac_sub32_sat(tmp7, tmp15); |
297 | | |
298 | 15.0M | temp212 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(tmp0, tmp2), INV_SQRT2_Q15); |
299 | 15.0M | temp214 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(tmp0, tmp2), INV_SQRT2_Q15); |
300 | 15.0M | temp213 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(tmp3, tmp1), INV_SQRT2_Q15); |
301 | 15.0M | temp215 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(tmp1, tmp3), -INV_SQRT2_Q15); |
302 | | |
303 | 15.0M | temp10 = ixheaac_sub32_sat(temp30, temp316); |
304 | 15.0M | temp11 = ixheaac_sub32_sat(temp31, temp317); |
305 | 15.0M | temp12 = ixheaac_sub32_sat(temp32, temp318); |
306 | 15.0M | temp13 = ixheaac_sub32_sat(temp33, temp319); |
307 | 15.0M | temp14 = ixheaac_sub32_sat(temp34, temp320); |
308 | 15.0M | temp15 = ixheaac_sub32_sat(temp35, temp321); |
309 | 15.0M | temp16 = ixheaac_sub32_sat(temp36, temp322); |
310 | 15.0M | temp17 = ixheaac_sub32_sat(temp37, temp323); |
311 | 15.0M | temp18 = ixheaac_sub32_sat(temp38, temp324); |
312 | 15.0M | temp19 = ixheaac_sub32_sat(temp39, temp325); |
313 | 15.0M | temp110 = ixheaac_sub32_sat(temp310, temp326); |
314 | 15.0M | temp111 = ixheaac_sub32_sat(temp311, temp327); |
315 | 15.0M | temp112 = ixheaac_sub32_sat(temp312, temp328); |
316 | 15.0M | temp113 = ixheaac_sub32_sat(temp313, temp329); |
317 | 15.0M | temp114 = ixheaac_sub32_sat(temp314, temp330); |
318 | 15.0M | temp115 = ixheaac_sub32_sat(temp315, temp331); |
319 | | |
320 | 15.0M | temp30 = ixheaac_add32_sat(temp20, temp22); |
321 | 15.0M | temp316 = ixheaac_sub32_sat(temp20, temp22); |
322 | 15.0M | temp31 = ixheaac_add32_sat(temp21, temp23); |
323 | 15.0M | temp317 = ixheaac_sub32_sat(temp21, temp23); |
324 | 15.0M | temp38 = ixheaac_sub32_sat(temp24, temp26); |
325 | 15.0M | temp324 = ixheaac_add32_sat(temp24, temp26); |
326 | 15.0M | temp39 = ixheaac_sub32_sat(temp25, temp27); |
327 | 15.0M | temp325 = ixheaac_add32_sat(temp25, temp27); |
328 | 15.0M | temp312 = ixheaac_add32_sat(temp28, temp214); |
329 | 15.0M | temp328 = ixheaac_sub32_sat(temp28, temp214); |
330 | 15.0M | temp313 = ixheaac_add32_sat(temp29, temp215); |
331 | 15.0M | temp329 = ixheaac_sub32_sat(temp29, temp215); |
332 | 15.0M | temp34 = ixheaac_add32_sat(temp210, temp212); |
333 | 15.0M | temp320 = ixheaac_sub32_sat(temp210, temp212); |
334 | 15.0M | temp35 = ixheaac_add32_sat(temp211, temp213); |
335 | 15.0M | temp321 = ixheaac_sub32_sat(temp211, temp213); |
336 | | |
337 | 15.0M | tmp9 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp12, temp114), -COS_3PI_BY_8_Q15); |
338 | 15.0M | tmp10 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp12, temp114), COS_PI_BY_8_Q15); |
339 | 15.0M | tmp8 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp13, temp115), COS_3PI_BY_8_Q15); |
340 | 15.0M | tmp11 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp13, temp115), COS_PI_BY_8_Q15); |
341 | 15.0M | tmp5 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp14, temp112), -INV_SQRT2_Q15); |
342 | 15.0M | tmp6 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp14, temp112), INV_SQRT2_Q15); |
343 | 15.0M | tmp4 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp15, temp113), INV_SQRT2_Q15); |
344 | 15.0M | tmp7 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp15, temp113), INV_SQRT2_Q15); |
345 | 15.0M | tmp13 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp16, temp110), -COS_PI_BY_8_Q15); |
346 | 15.0M | tmp14 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp16, temp110), COS_3PI_BY_8_Q15); |
347 | 15.0M | tmp12 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp17, temp111), COS_PI_BY_8_Q15); |
348 | 15.0M | tmp15 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp17, temp111), COS_3PI_BY_8_Q15); |
349 | | |
350 | 15.0M | temp12 = ixheaac_sub32_sat(ixheaac_shl32(ixheaac_mult32x16in32(tmp8, SQRT2PLUS1_Q13), 3), |
351 | 15.0M | ixheaac_mult32x16in32_shl(tmp12, SQRT2MINUS1_Q15)); |
352 | 15.0M | temp13 = ixheaac_sub32_sat(ixheaac_shl32(ixheaac_mult32x16in32(tmp9, SQRT2PLUS1_Q13), 3), |
353 | 15.0M | ixheaac_mult32x16in32_shl(tmp13, SQRT2MINUS1_Q15)); |
354 | 15.0M | temp14 = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(tmp10, SQRT2MINUS1_Q15), |
355 | 15.0M | ixheaac_shl32(ixheaac_mult32x16in32(tmp14, SQRT2PLUS1_Q13), 3)); |
356 | 15.0M | temp15 = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(tmp11, SQRT2MINUS1_Q15), |
357 | 15.0M | ixheaac_shl32(ixheaac_mult32x16in32(tmp15, SQRT2PLUS1_Q13), 3)); |
358 | | |
359 | 15.0M | tmp8 = ixheaac_add32_sat(tmp8, tmp12); |
360 | 15.0M | tmp9 = ixheaac_add32_sat(tmp9, tmp13); |
361 | 15.0M | tmp10 = ixheaac_add32_sat(tmp10, tmp14); |
362 | 15.0M | tmp11 = ixheaac_add32_sat(tmp11, tmp15); |
363 | 15.0M | temp16 = ixheaac_add32_sat(temp10, tmp4); |
364 | 15.0M | temp110 = ixheaac_sub32_sat(temp10, tmp4); |
365 | 15.0M | temp17 = ixheaac_add32_sat(temp11, tmp5); |
366 | 15.0M | temp111 = ixheaac_sub32_sat(temp11, tmp5); |
367 | | |
368 | 15.0M | temp112 = ixheaac_sub32_sat(tmp6, temp19); |
369 | 15.0M | temp114 = ixheaac_add32_sat(tmp6, temp19); |
370 | 15.0M | temp113 = ixheaac_add32_sat(temp18, tmp7); |
371 | 15.0M | temp115 = ixheaac_sub32_sat(temp18, tmp7); |
372 | | |
373 | 15.0M | tmp0 = ixheaac_sub32_sat(temp16, temp114); |
374 | 15.0M | tmp2 = ixheaac_add32_sat(temp16, temp114); |
375 | 15.0M | tmp1 = ixheaac_add32_sat(temp17, temp115); |
376 | 15.0M | tmp3 = ixheaac_sub32_sat(temp17, temp115); |
377 | 15.0M | tmp4 = ixheaac_add32_sat(temp110, temp112); |
378 | 15.0M | tmp6 = ixheaac_sub32_sat(temp110, temp112); |
379 | 15.0M | tmp5 = ixheaac_add32_sat(temp111, temp113); |
380 | 15.0M | tmp7 = ixheaac_sub32_sat(temp111, temp113); |
381 | | |
382 | 15.0M | temp110 = ixheaac_add32_sat(tmp8, tmp10); |
383 | 15.0M | tmp10 = ixheaac_sub32_sat(tmp8, tmp10); |
384 | 15.0M | temp111 = ixheaac_add32_sat(tmp9, tmp11); |
385 | 15.0M | tmp11 = ixheaac_sub32_sat(tmp9, tmp11); |
386 | | |
387 | 15.0M | tmp12 = ixheaac_add32_sat(temp12, temp14); |
388 | 15.0M | tmp14 = ixheaac_sub32_sat(temp12, temp14); |
389 | 15.0M | tmp13 = ixheaac_add32_sat(temp13, temp15); |
390 | 15.0M | tmp15 = ixheaac_sub32_sat(temp13, temp15); |
391 | | |
392 | 15.0M | temp32 = ixheaac_add32_sat(tmp2, temp110); |
393 | 15.0M | temp318 = ixheaac_sub32_sat(tmp2, temp110); |
394 | 15.0M | temp33 = ixheaac_add32_sat(tmp3, temp111); |
395 | 15.0M | temp319 = ixheaac_sub32_sat(tmp3, temp111); |
396 | 15.0M | temp36 = ixheaac_add32_sat(tmp0, tmp12); |
397 | 15.0M | temp322 = ixheaac_sub32_sat(tmp0, tmp12); |
398 | 15.0M | temp37 = ixheaac_add32_sat(tmp1, tmp13); |
399 | 15.0M | temp323 = ixheaac_sub32_sat(tmp1, tmp13); |
400 | 15.0M | temp314 = ixheaac_add32_sat(tmp4, tmp10); |
401 | 15.0M | temp330 = ixheaac_sub32_sat(tmp4, tmp10); |
402 | 15.0M | temp315 = ixheaac_add32_sat(tmp5, tmp11); |
403 | 15.0M | temp331 = ixheaac_sub32_sat(tmp5, tmp11); |
404 | 15.0M | temp310 = ixheaac_add32_sat(tmp6, tmp14); |
405 | 15.0M | temp326 = ixheaac_sub32_sat(tmp6, tmp14); |
406 | 15.0M | temp311 = ixheaac_add32_sat(tmp7, tmp15); |
407 | 15.0M | temp327 = ixheaac_sub32_sat(tmp7, tmp15); |
408 | | |
409 | 15.0M | temp10 = ixheaac_sub32_sat(vec[0], vec[32]); |
410 | 15.0M | temp11 = ixheaac_sub32_sat(vec[1], vec[33]); |
411 | 15.0M | temp12 = ixheaac_sub32_sat(vec[4], vec[36]); |
412 | 15.0M | temp13 = ixheaac_sub32_sat(vec[5], vec[37]); |
413 | 15.0M | temp14 = ixheaac_sub32_sat(vec[8], vec[40]); |
414 | 15.0M | temp15 = ixheaac_sub32_sat(vec[9], vec[41]); |
415 | 15.0M | temp16 = ixheaac_sub32_sat(vec[12], vec[44]); |
416 | 15.0M | temp17 = ixheaac_sub32_sat(vec[13], vec[45]); |
417 | 15.0M | temp18 = ixheaac_sub32_sat(vec[16], vec[48]); |
418 | 15.0M | temp19 = ixheaac_sub32_sat(vec[17], vec[49]); |
419 | 15.0M | temp110 = ixheaac_sub32_sat(vec[20], vec[52]); |
420 | 15.0M | temp111 = ixheaac_sub32_sat(vec[21], vec[53]); |
421 | 15.0M | temp112 = ixheaac_sub32_sat(vec[24], vec[56]); |
422 | 15.0M | temp113 = ixheaac_sub32_sat(vec[25], vec[57]); |
423 | 15.0M | temp114 = ixheaac_sub32_sat(vec[28], vec[60]); |
424 | 15.0M | temp115 = ixheaac_sub32_sat(vec[29], vec[61]); |
425 | | |
426 | 15.0M | tmp9 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp12, temp114), -COS_3PI_BY_8_Q15); |
427 | 15.0M | tmp10 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp12, temp114), COS_PI_BY_8_Q15); |
428 | 15.0M | tmp8 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp13, temp115), COS_3PI_BY_8_Q15); |
429 | 15.0M | tmp11 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp13, temp115), COS_PI_BY_8_Q15); |
430 | 15.0M | tmp5 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp14, temp112), -INV_SQRT2_Q15); |
431 | 15.0M | tmp6 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp14, temp112), INV_SQRT2_Q15); |
432 | 15.0M | tmp4 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp15, temp113), INV_SQRT2_Q15); |
433 | 15.0M | tmp7 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp15, temp113), INV_SQRT2_Q15); |
434 | 15.0M | tmp13 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp16, temp110), -COS_PI_BY_8_Q15); |
435 | 15.0M | tmp14 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp16, temp110), COS_3PI_BY_8_Q15); |
436 | 15.0M | tmp12 = ixheaac_mult32x16in32_shl(ixheaac_add32_sat(temp17, temp111), COS_PI_BY_8_Q15); |
437 | 15.0M | tmp15 = ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(temp17, temp111), COS_3PI_BY_8_Q15); |
438 | | |
439 | 15.0M | temp12 = ixheaac_sub32_sat(ixheaac_shl32(ixheaac_mult32x16in32(tmp8, SQRT2PLUS1_Q13), 3), |
440 | 15.0M | ixheaac_mult32x16in32_shl(tmp12, SQRT2MINUS1_Q15)); |
441 | 15.0M | temp13 = ixheaac_sub32_sat(ixheaac_shl32(ixheaac_mult32x16in32(tmp9, SQRT2PLUS1_Q13), 3), |
442 | 15.0M | ixheaac_mult32x16in32_shl(tmp13, SQRT2MINUS1_Q15)); |
443 | 15.0M | temp14 = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(tmp10, SQRT2MINUS1_Q15), |
444 | 15.0M | ixheaac_shl32(ixheaac_mult32x16in32(tmp14, SQRT2PLUS1_Q13), 3)); |
445 | 15.0M | temp15 = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(tmp11, SQRT2MINUS1_Q15), |
446 | 15.0M | ixheaac_shl32(ixheaac_mult32x16in32(tmp15, SQRT2PLUS1_Q13), 3)); |
447 | | |
448 | 15.0M | tmp8 = ixheaac_add32_sat(tmp8, tmp12); |
449 | 15.0M | tmp9 = ixheaac_add32_sat(tmp9, tmp13); |
450 | 15.0M | tmp10 = ixheaac_add32_sat(tmp10, tmp14); |
451 | 15.0M | tmp11 = ixheaac_add32_sat(tmp11, tmp15); |
452 | 15.0M | temp16 = ixheaac_add32_sat(temp10, tmp4); |
453 | 15.0M | temp110 = ixheaac_sub32_sat(temp10, tmp4); |
454 | 15.0M | temp17 = ixheaac_add32_sat(temp11, tmp5); |
455 | 15.0M | temp111 = ixheaac_sub32_sat(temp11, tmp5); |
456 | | |
457 | 15.0M | temp112 = ixheaac_sub32_sat(tmp6, temp19); |
458 | 15.0M | temp114 = ixheaac_add32_sat(tmp6, temp19); |
459 | 15.0M | temp113 = ixheaac_add32_sat(temp18, tmp7); |
460 | 15.0M | temp115 = ixheaac_sub32_sat(temp18, tmp7); |
461 | | |
462 | 15.0M | tmp0 = ixheaac_sub32_sat(temp16, temp114); |
463 | 15.0M | tmp2 = ixheaac_add32_sat(temp16, temp114); |
464 | 15.0M | tmp1 = ixheaac_add32_sat(temp17, temp115); |
465 | 15.0M | tmp3 = ixheaac_sub32_sat(temp17, temp115); |
466 | 15.0M | tmp4 = ixheaac_add32_sat(temp110, temp112); |
467 | 15.0M | tmp6 = ixheaac_sub32_sat(temp110, temp112); |
468 | 15.0M | tmp5 = ixheaac_add32_sat(temp111, temp113); |
469 | 15.0M | tmp7 = ixheaac_sub32_sat(temp111, temp113); |
470 | | |
471 | 15.0M | temp110 = ixheaac_add32_sat(tmp8, tmp10); |
472 | 15.0M | tmp10 = ixheaac_sub32_sat(tmp8, tmp10); |
473 | 15.0M | temp111 = ixheaac_add32_sat(tmp9, tmp11); |
474 | 15.0M | tmp11 = ixheaac_sub32_sat(tmp9, tmp11); |
475 | | |
476 | 15.0M | tmp12 = ixheaac_add32_sat(temp12, temp14); |
477 | 15.0M | tmp14 = ixheaac_sub32_sat(temp12, temp14); |
478 | 15.0M | tmp13 = ixheaac_add32_sat(temp13, temp15); |
479 | 15.0M | tmp15 = ixheaac_sub32_sat(temp13, temp15); |
480 | | |
481 | 15.0M | temp10 = ixheaac_add32_sat(tmp2, temp110); |
482 | 15.0M | temp18 = ixheaac_sub32_sat(tmp2, temp110); |
483 | 15.0M | temp11 = ixheaac_add32_sat(tmp3, temp111); |
484 | 15.0M | temp19 = ixheaac_sub32_sat(tmp3, temp111); |
485 | 15.0M | temp12 = ixheaac_add32_sat(tmp0, tmp12); |
486 | 15.0M | temp110 = ixheaac_sub32_sat(tmp0, tmp12); |
487 | 15.0M | temp13 = ixheaac_add32_sat(tmp1, tmp13); |
488 | 15.0M | temp111 = ixheaac_sub32_sat(tmp1, tmp13); |
489 | 15.0M | temp16 = ixheaac_add32_sat(tmp4, tmp10); |
490 | 15.0M | temp114 = ixheaac_sub32_sat(tmp4, tmp10); |
491 | 15.0M | temp17 = ixheaac_add32_sat(tmp5, tmp11); |
492 | 15.0M | temp115 = ixheaac_sub32_sat(tmp5, tmp11); |
493 | 15.0M | temp14 = ixheaac_add32_sat(tmp6, tmp14); |
494 | 15.0M | temp112 = ixheaac_sub32_sat(tmp6, tmp14); |
495 | 15.0M | temp15 = ixheaac_add32_sat(tmp7, tmp15); |
496 | 15.0M | temp113 = ixheaac_sub32_sat(tmp7, tmp15); |
497 | | |
498 | 15.0M | *vec++ = temp30; |
499 | 15.0M | *vec++ = temp31; |
500 | 15.0M | *vec++ = ixheaac_add32_sat(temp10, temp40); |
501 | 15.0M | *vec++ = ixheaac_add32_sat(temp11, temp41); |
502 | 15.0M | *vec++ = temp32; |
503 | 15.0M | *vec++ = temp33; |
504 | 15.0M | *vec++ = ixheaac_add32_sat(temp12, temp42); |
505 | 15.0M | *vec++ = ixheaac_add32_sat(temp13, temp43); |
506 | 15.0M | *vec++ = temp34; |
507 | 15.0M | *vec++ = temp35; |
508 | 15.0M | *vec++ = ixheaac_add32_sat(temp14, temp44); |
509 | 15.0M | *vec++ = ixheaac_add32_sat(temp15, temp45); |
510 | 15.0M | *vec++ = temp36; |
511 | 15.0M | *vec++ = temp37; |
512 | 15.0M | *vec++ = ixheaac_add32_sat(temp16, temp46); |
513 | 15.0M | *vec++ = ixheaac_add32_sat(temp17, temp47); |
514 | 15.0M | *vec++ = temp38; |
515 | 15.0M | *vec++ = temp39; |
516 | 15.0M | *vec++ = ixheaac_add32_sat(temp18, temp48); |
517 | 15.0M | *vec++ = ixheaac_add32_sat(temp19, temp49); |
518 | 15.0M | *vec++ = temp310; |
519 | 15.0M | *vec++ = temp311; |
520 | 15.0M | *vec++ = ixheaac_add32_sat(temp110, temp410); |
521 | 15.0M | *vec++ = ixheaac_add32_sat(temp111, temp411); |
522 | 15.0M | *vec++ = temp312; |
523 | 15.0M | *vec++ = temp313; |
524 | 15.0M | *vec++ = ixheaac_add32_sat(temp112, temp412); |
525 | 15.0M | *vec++ = ixheaac_add32_sat(temp113, temp413); |
526 | 15.0M | *vec++ = temp314; |
527 | 15.0M | *vec++ = temp315; |
528 | 15.0M | *vec++ = ixheaac_add32_sat(temp114, temp414); |
529 | 15.0M | *vec++ = ixheaac_add32_sat(temp115, temp415); |
530 | 15.0M | *vec++ = temp316; |
531 | 15.0M | *vec++ = temp317; |
532 | 15.0M | *vec++ = ixheaac_sub32_sat(temp10, temp40); |
533 | 15.0M | *vec++ = ixheaac_sub32_sat(temp11, temp41); |
534 | 15.0M | *vec++ = temp318; |
535 | 15.0M | *vec++ = temp319; |
536 | 15.0M | *vec++ = ixheaac_sub32_sat(temp12, temp42); |
537 | 15.0M | *vec++ = ixheaac_sub32_sat(temp13, temp43); |
538 | 15.0M | *vec++ = temp320; |
539 | 15.0M | *vec++ = temp321; |
540 | 15.0M | *vec++ = ixheaac_sub32_sat(temp14, temp44); |
541 | 15.0M | *vec++ = ixheaac_sub32_sat(temp15, temp45); |
542 | 15.0M | *vec++ = temp322; |
543 | 15.0M | *vec++ = temp323; |
544 | 15.0M | *vec++ = ixheaac_sub32_sat(temp16, temp46); |
545 | 15.0M | *vec++ = ixheaac_sub32_sat(temp17, temp47); |
546 | 15.0M | *vec++ = temp324; |
547 | 15.0M | *vec++ = temp325; |
548 | 15.0M | *vec++ = ixheaac_sub32_sat(temp18, temp48); |
549 | 15.0M | *vec++ = ixheaac_sub32_sat(temp19, temp49); |
550 | 15.0M | *vec++ = temp326; |
551 | 15.0M | *vec++ = temp327; |
552 | 15.0M | *vec++ = ixheaac_sub32_sat(temp110, temp410); |
553 | 15.0M | *vec++ = ixheaac_sub32_sat(temp111, temp411); |
554 | 15.0M | *vec++ = temp328; |
555 | 15.0M | *vec++ = temp329; |
556 | 15.0M | *vec++ = ixheaac_sub32_sat(temp112, temp412); |
557 | 15.0M | *vec++ = ixheaac_sub32_sat(temp113, temp413); |
558 | 15.0M | *vec++ = temp330; |
559 | 15.0M | *vec++ = temp331; |
560 | 15.0M | *vec++ = ixheaac_sub32_sat(temp114, temp414); |
561 | 15.0M | *vec++ = ixheaac_sub32_sat(temp115, temp415); |
562 | 15.0M | } |
563 | | |
564 | 3.08M | static VOID ixheaacd_cos_mod(WORD32 *subband, ia_mps_dec_qmf_tables_struct *qmf_table_ptr) { |
565 | 3.08M | WORD32 i, m; |
566 | 3.08M | WORD16 wim, wre; |
567 | 3.08M | WORD32 temp_1; |
568 | 3.08M | const WORD16 *ptr1, *ptr2, *ptr3, *ptr4; |
569 | 3.08M | WORD32 re1, im1, re2, im2; |
570 | | |
571 | 3.08M | m = WORD_LENGTH; |
572 | 3.08M | ptr1 = qmf_table_ptr->sbr_sin_twiddle; |
573 | 3.08M | ptr2 = qmf_table_ptr->sbr_cos_twiddle; |
574 | 3.08M | ptr3 = qmf_table_ptr->sbr_sin_twiddle + 31; |
575 | 3.08M | ptr4 = qmf_table_ptr->sbr_cos_twiddle + 31; |
576 | 52.3M | for (i = 0; i < 16; i++) { |
577 | 49.3M | temp_1 = (i << 1); |
578 | 49.3M | re1 = subband[temp_1]; |
579 | 49.3M | im2 = subband[temp_1 + 1]; |
580 | 49.3M | re2 = subband[62 - temp_1]; |
581 | 49.3M | im1 = subband[63 - temp_1]; |
582 | | |
583 | 49.3M | wim = *ptr1++; |
584 | 49.3M | wre = *ptr2++; |
585 | | |
586 | 49.3M | subband[temp_1] = ixheaac_add32_sat( |
587 | 49.3M | ixheaac_mult32x16in32_shl(im1, wim), ixheaac_mult32x16in32_shl(re1, wre)); |
588 | 49.3M | subband[temp_1 + 1] = ixheaac_sub32_sat( |
589 | 49.3M | ixheaac_mult32x16in32_shl(im1, wre), ixheaac_mult32x16in32_shl(re1, wim)); |
590 | | |
591 | 49.3M | wim = *ptr3--; |
592 | 49.3M | wre = *ptr4--; |
593 | | |
594 | 49.3M | subband[62 - temp_1] = ixheaac_add32_sat( |
595 | 49.3M | ixheaac_mult32x16in32_shl(im2, wim), ixheaac_mult32x16in32_shl(re2, wre)); |
596 | 49.3M | subband[63 - temp_1] = ixheaac_sub32_sat( |
597 | 49.3M | ixheaac_mult32x16in32_shl(im2, wre), ixheaac_mult32x16in32_shl(re2, wim)); |
598 | 49.3M | } |
599 | | |
600 | 3.08M | ixheaacd_fft32(subband, qmf_table_ptr->fft_c); |
601 | | |
602 | 3.08M | ptr1 = qmf_table_ptr->sbr_alt_sin_twiddle; |
603 | 3.08M | ptr2 = qmf_table_ptr->sbr_alt_sin_twiddle + m; |
604 | 3.08M | wim = *ptr1++; |
605 | 3.08M | wre = *ptr2--; |
606 | | |
607 | 52.3M | for (i = 0; i < 16; i++) { |
608 | 49.3M | temp_1 = (i << 1); |
609 | 49.3M | re1 = subband[temp_1]; |
610 | 49.3M | im1 = subband[temp_1 + 1]; |
611 | 49.3M | re2 = subband[62 - temp_1]; |
612 | 49.3M | im2 = subband[63 - temp_1]; |
613 | | |
614 | 49.3M | subband[temp_1] = ixheaac_add32_sat( |
615 | 49.3M | ixheaac_mult32x16in32_shl(re1, wre), ixheaac_mult32x16in32_shl(im1, wim)); |
616 | 49.3M | subband[63 - temp_1] = ixheaac_sub32_sat( |
617 | 49.3M | ixheaac_mult32x16in32_shl(re1, wim), ixheaac_mult32x16in32_shl(im1, wre)); |
618 | | |
619 | 49.3M | wim = *ptr1++; |
620 | 49.3M | wre = *ptr2--; |
621 | | |
622 | 49.3M | subband[62 - temp_1] = ixheaac_add32_sat( |
623 | 49.3M | ixheaac_mult32x16in32_shl(re2, wim), ixheaac_mult32x16in32_shl(im2, wre)); |
624 | 49.3M | subband[temp_1 + 1] = ixheaac_sub32_sat( |
625 | 49.3M | ixheaac_mult32x16in32_shl(re2, wre), ixheaac_mult32x16in32_shl(im2, wim)); |
626 | 49.3M | } |
627 | 3.08M | } |
628 | | |
629 | 3.08M | static VOID ixheaacd_sin_mod(WORD32 *subband, ia_mps_dec_qmf_tables_struct *qmf_table_ptr) { |
630 | 3.08M | WORD32 i, m; |
631 | 3.08M | WORD16 wre, wim; |
632 | 3.08M | WORD32 temp_1; |
633 | 3.08M | WORD32 re1, im1, re2, im2; |
634 | 3.08M | const WORD16 *ptr1, *ptr2, *ptr3, *ptr4; |
635 | | |
636 | 3.08M | ptr1 = qmf_table_ptr->sbr_sin_twiddle; |
637 | 3.08M | ptr2 = qmf_table_ptr->sbr_cos_twiddle; |
638 | 3.08M | ptr3 = qmf_table_ptr->sbr_sin_twiddle + 31; |
639 | 3.08M | ptr4 = qmf_table_ptr->sbr_cos_twiddle + 31; |
640 | | |
641 | 3.08M | m = WORD_LENGTH; |
642 | | |
643 | 52.3M | for (i = 0; i < 16; i++) { |
644 | 49.3M | temp_1 = (i << 1); |
645 | | |
646 | 49.3M | re1 = subband[temp_1]; |
647 | 49.3M | im2 = subband[temp_1 + 1]; |
648 | 49.3M | re2 = subband[62 - temp_1]; |
649 | 49.3M | im1 = subband[63 - temp_1]; |
650 | | |
651 | 49.3M | wre = *ptr1++; |
652 | 49.3M | wim = *ptr2++; |
653 | | |
654 | 49.3M | subband[temp_1 + 1] = ixheaac_add32_sat( |
655 | 49.3M | ixheaac_mult32x16in32_shl(im1, wim), ixheaac_mult32x16in32_shl(re1, wre)); |
656 | 49.3M | subband[temp_1] = ixheaac_sub32_sat( |
657 | 49.3M | ixheaac_mult32x16in32_shl(im1, wre), ixheaac_mult32x16in32_shl(re1, wim)); |
658 | | |
659 | 49.3M | wre = *ptr3--; |
660 | 49.3M | wim = *ptr4--; |
661 | | |
662 | 49.3M | subband[63 - temp_1] = ixheaac_add32_sat( |
663 | 49.3M | ixheaac_mult32x16in32_shl(im2, wim), ixheaac_mult32x16in32_shl(re2, wre)); |
664 | 49.3M | subband[62 - temp_1] = ixheaac_sub32_sat( |
665 | 49.3M | ixheaac_mult32x16in32_shl(im2, wre), ixheaac_mult32x16in32_shl(re2, wim)); |
666 | 49.3M | } |
667 | | |
668 | 3.08M | ixheaacd_fft32(subband, qmf_table_ptr->fft_c); |
669 | | |
670 | 3.08M | ptr1 = qmf_table_ptr->sbr_alt_sin_twiddle; |
671 | 3.08M | ptr2 = qmf_table_ptr->sbr_alt_sin_twiddle + m; |
672 | | |
673 | 3.08M | wim = *ptr1++; |
674 | 3.08M | wre = *ptr2--; |
675 | | |
676 | 52.3M | for (i = 0; i < 16; i++) { |
677 | 49.3M | temp_1 = (i << 1); |
678 | 49.3M | re1 = subband[temp_1]; |
679 | 49.3M | im1 = subband[temp_1 + 1]; |
680 | 49.3M | re2 = subband[62 - temp_1]; |
681 | 49.3M | im2 = subband[63 - temp_1]; |
682 | | |
683 | 49.3M | subband[63 - temp_1] = ixheaac_negate32_sat(ixheaac_add32_sat( |
684 | 49.3M | ixheaac_mult32x16in32_shl(re1, wre), ixheaac_mult32x16in32_shl(im1, wim))); |
685 | 49.3M | subband[temp_1] = ixheaac_negate32_sat(ixheaac_sub32_sat( |
686 | 49.3M | ixheaac_mult32x16in32_shl(re1, wim), ixheaac_mult32x16in32_shl(im1, wre))); |
687 | | |
688 | 49.3M | wim = *ptr1++; |
689 | 49.3M | wre = *ptr2--; |
690 | | |
691 | 49.3M | subband[temp_1 + 1] = ixheaac_negate32_sat(ixheaac_add32_sat( |
692 | 49.3M | ixheaac_mult32x16in32_shl(re2, wim), ixheaac_mult32x16in32_shl(im2, wre))); |
693 | 49.3M | subband[62 - temp_1] = ixheaac_negate32_sat(ixheaac_sub32_sat( |
694 | 49.3M | ixheaac_mult32x16in32_shl(re2, wre), ixheaac_mult32x16in32_shl(im2, wim))); |
695 | 49.3M | } |
696 | 3.08M | } |
697 | | |
698 | | static VOID ixheaacd_inverse_modulation(WORD32 *qmf_real, WORD32 *qmf_imag, |
699 | 4.43M | ia_mps_dec_qmf_tables_struct *qmf_table_ptr) { |
700 | 4.43M | WORD32 i; |
701 | | |
702 | 4.43M | const WORD16 *ptr1, *ptr2, *ptr3, *ptr4; |
703 | 4.43M | const WORD16 *fft = qmf_table_ptr->fft_c; |
704 | 4.43M | WORD16 wre, wim; |
705 | 4.43M | WORD32 re1, im1, re2, im2; |
706 | 4.43M | WORD32 re12, im12, re22, im22; |
707 | 4.43M | WORD32 temp_1; |
708 | | |
709 | 4.43M | ptr1 = qmf_table_ptr->sbr_sin_twiddle; |
710 | 4.43M | ptr2 = qmf_table_ptr->sbr_cos_twiddle; |
711 | 4.43M | ptr3 = ptr1 + 31; |
712 | 4.43M | ptr4 = ptr2 + 31; |
713 | | |
714 | 75.3M | for (i = 0; i < 16; i++) { |
715 | 70.9M | temp_1 = (i << 1); |
716 | | |
717 | 70.9M | re1 = qmf_real[temp_1]; |
718 | 70.9M | im1 = qmf_real[63 - temp_1]; |
719 | | |
720 | 70.9M | wim = *ptr1++; |
721 | 70.9M | wre = *ptr2++; |
722 | | |
723 | 70.9M | qmf_real[temp_1] = ixheaac_add32_sat( |
724 | 70.9M | ixheaac_mult32x16in32_shl(im1, wim), ixheaac_mult32x16in32_shl(re1, wre)); |
725 | | |
726 | 70.9M | re12 = qmf_imag[temp_1]; |
727 | 70.9M | im12 = qmf_imag[63 - temp_1]; |
728 | | |
729 | 70.9M | qmf_imag[temp_1] = ixheaac_sub32_sat( |
730 | 70.9M | ixheaac_mult32x16in32_shl(im12, wim), ixheaac_mult32x16in32_shl(re12, wre)); |
731 | | |
732 | 70.9M | im2 = qmf_real[temp_1 + 1]; |
733 | | |
734 | 70.9M | qmf_real[temp_1 + 1] = ixheaac_sub32_sat( |
735 | 70.9M | ixheaac_mult32x16in32_shl(im1, wre), ixheaac_mult32x16in32_shl(re1, wim)); |
736 | | |
737 | 70.9M | im22 = qmf_imag[temp_1 + 1]; |
738 | | |
739 | 70.9M | qmf_imag[temp_1 + 1] = ixheaac_add32_sat( |
740 | 70.9M | ixheaac_mult32x16in32_shl(im12, wre), ixheaac_mult32x16in32_shl(re12, wim)); |
741 | | |
742 | 70.9M | wim = *ptr3--; |
743 | 70.9M | wre = *ptr4--; |
744 | | |
745 | 70.9M | re2 = qmf_real[62 - temp_1]; |
746 | | |
747 | 70.9M | qmf_real[62 - temp_1] = ixheaac_add32_sat( |
748 | 70.9M | ixheaac_mult32x16in32_shl(im2, wim), ixheaac_mult32x16in32_shl(re2, wre)); |
749 | | |
750 | 70.9M | re22 = qmf_imag[62 - temp_1]; |
751 | | |
752 | 70.9M | qmf_imag[62 - temp_1] = ixheaac_sub32_sat( |
753 | 70.9M | ixheaac_mult32x16in32_shl(im22, wim), ixheaac_mult32x16in32_shl(re22, wre)); |
754 | | |
755 | 70.9M | qmf_real[63 - temp_1] = ixheaac_sub32_sat( |
756 | 70.9M | ixheaac_mult32x16in32_shl(im2, wre), ixheaac_mult32x16in32_shl(re2, wim)); |
757 | 70.9M | qmf_imag[63 - temp_1] = ixheaac_add32_sat( |
758 | 70.9M | ixheaac_mult32x16in32_shl(im22, wre), ixheaac_mult32x16in32_shl(re22, wim)); |
759 | 70.9M | } |
760 | | |
761 | 4.43M | ixheaacd_fft32(qmf_real, fft); |
762 | 4.43M | ixheaacd_fft32(qmf_imag, fft); |
763 | | |
764 | 4.43M | ptr1 = qmf_table_ptr->sbr_alt_sin_twiddle; |
765 | 4.43M | ptr2 = ptr1 + 32; |
766 | | |
767 | 4.43M | wim = *ptr1++; |
768 | 4.43M | wre = *ptr2--; |
769 | 75.3M | for (i = 0; i < 16; i++) { |
770 | 70.9M | temp_1 = (i << 1); |
771 | 70.9M | re1 = qmf_real[temp_1]; |
772 | 70.9M | im1 = qmf_real[temp_1 + 1]; |
773 | 70.9M | re12 = qmf_imag[temp_1]; |
774 | 70.9M | im12 = qmf_imag[temp_1 + 1]; |
775 | | |
776 | 70.9M | qmf_real[temp_1] = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(ixheaac_sub32_sat( |
777 | 70.9M | im12, re1), wre), ixheaac_mult32x16in32_shl(ixheaac_add32_sat(im1, re12), wim)); |
778 | 70.9M | qmf_imag[temp_1] = ixheaac_add32_sat(ixheaac_mult32x16in32_shl((ixheaac_add32_sat( |
779 | 70.9M | im12, re1)), wre), ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(im1, re12), wim)); |
780 | | |
781 | 70.9M | im2 = qmf_real[63 - temp_1]; |
782 | 70.9M | im22 = qmf_imag[63 - temp_1]; |
783 | | |
784 | 70.9M | qmf_real[63 - temp_1] = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(ixheaac_sub32_sat( |
785 | 70.9M | im1, re12), wre), ixheaac_mult32x16in32_shl(ixheaac_add32_sat(im12, re1), wim)); |
786 | 70.9M | qmf_imag[63 - temp_1] = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(ixheaac_sub32_sat( |
787 | 70.9M | re1, im12), wim), ixheaac_mult32x16in32_shl(ixheaac_add32_sat(im1, re12), wre)); |
788 | | |
789 | 70.9M | wim = *ptr1++; |
790 | 70.9M | wre = *ptr2--; |
791 | 70.9M | re2 = qmf_real[62 - temp_1]; |
792 | 70.9M | re22 = qmf_imag[62 - temp_1]; |
793 | | |
794 | 70.9M | qmf_real[temp_1 + 1] = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(ixheaac_sub32_sat( |
795 | 70.9M | im2, re22), wim), ixheaac_mult32x16in32_shl(ixheaac_add32_sat(im22, re2), wre)); |
796 | 70.9M | qmf_imag[temp_1 + 1] = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(ixheaac_sub32_sat( |
797 | 70.9M | re2, im22), wre), ixheaac_mult32x16in32_shl(ixheaac_add32_sat(im2, re22), wim)); |
798 | | |
799 | 70.9M | qmf_real[62 - temp_1] = ixheaac_sub32_sat(ixheaac_mult32x16in32_shl(ixheaac_sub32_sat( |
800 | 70.9M | im22, re2), wim), ixheaac_mult32x16in32_shl(ixheaac_add32_sat(im2, re22), wre)); |
801 | 70.9M | qmf_imag[62 - temp_1] = ixheaac_add32_sat(ixheaac_mult32x16in32_shl(ixheaac_add32_sat( |
802 | 70.9M | re2, im22), wim), ixheaac_mult32x16in32_shl(ixheaac_sub32_sat(im2, re22), wre)); |
803 | 70.9M | } |
804 | 4.43M | } |
805 | | |
806 | | VOID ixheaacd_calculate_syn_filt_bank_res64(ia_mps_dec_qmf_syn_filter_bank *syn, WORD32 *sr, |
807 | | WORD32 *si, WORD32 *time_sig, WORD32 channel, |
808 | | WORD32 resolution, WORD32 nr_samples, |
809 | 98.4k | ia_mps_dec_qmf_tables_struct *qmf_table_ptr) { |
810 | 98.4k | WORD32 j, k; |
811 | 98.4k | WORD32 *synth_buf; |
812 | 98.4k | WORD32 *syn_buf_p1, *syn_buf_p2, *syn_buf_p3; |
813 | 98.4k | WORD32 val; |
814 | 98.4k | const WORD32 *p_filter_1, *p_filter_6; |
815 | 98.4k | const WORD32 *p_filter_2, *p_filter_7; |
816 | 98.4k | const WORD32 *p_filter_3, *p_filter_8; |
817 | 98.4k | const WORD32 *p_filter_4, *p_filter_9; |
818 | 98.4k | const WORD32 *p_filter_5, *p_filter_10; |
819 | | |
820 | 98.4k | WORD32 *p_sr, *p_si; |
821 | | |
822 | 98.4k | WORD32 *sbr_qmf_states_synthesis = syn->sbr_qmf_states_synthesis; |
823 | 98.4k | synth_buf = &(sbr_qmf_states_synthesis[channel * QMF_FILTER_STATE_SYN_SIZE_MPS]); |
824 | | |
825 | 98.4k | p_sr = sr; |
826 | 98.4k | p_si = si; |
827 | 2.89M | for (k = 0; k < nr_samples; k++) { |
828 | 2.79M | WORD32 *new_samp = p_si; |
829 | 2.79M | WORD32 *new_samp2; |
830 | | |
831 | 2.79M | ixheaacd_inverse_modulation(p_sr, p_si, qmf_table_ptr); |
832 | | |
833 | 2.79M | p_filter_1 = syn->p_filter_syn; |
834 | 2.79M | p_filter_2 = p_filter_1 + 64; |
835 | 2.79M | p_filter_3 = p_filter_2 + 65; |
836 | 2.79M | p_filter_4 = p_filter_3 + 65; |
837 | 2.79M | p_filter_5 = p_filter_4 + 65; |
838 | | |
839 | 2.79M | syn_buf_p1 = &synth_buf[63]; |
840 | 2.79M | val = *(p_sr); |
841 | | |
842 | 2.79M | { |
843 | 2.79M | WORD32 val1 = *(p_si + 63); |
844 | 2.79M | syn_buf_p2 = &synth_buf[63]; |
845 | | |
846 | 2.79M | *time_sig++ = ixheaac_add32_sat(syn_buf_p1[512], |
847 | 2.79M | ixheaacd_mps_mult32_shr_30(*(p_filter_5 + 65), val)); |
848 | 2.79M | syn_buf_p1[512] = ixheaac_add32_sat(syn_buf_p2[448], |
849 | 2.79M | ixheaacd_mps_mult32_shr_30(*(p_filter_5 + 64), val1)); |
850 | 2.79M | syn_buf_p2[448] = ixheaac_add32_sat(syn_buf_p1[384], |
851 | 2.79M | ixheaacd_mps_mult32_shr_30(*p_filter_5++, val)); |
852 | 2.79M | syn_buf_p1[384] = ixheaac_add32_sat(syn_buf_p2[320], |
853 | 2.79M | ixheaacd_mps_mult32_shr_30(*(p_filter_4 + 64), val1)); |
854 | 2.79M | syn_buf_p2[320] = ixheaac_add32_sat(syn_buf_p1[256], |
855 | 2.79M | ixheaacd_mps_mult32_shr_30(*p_filter_4++, val)); |
856 | 2.79M | syn_buf_p1[256] = ixheaac_add32_sat(syn_buf_p2[192], |
857 | 2.79M | ixheaacd_mps_mult32_shr_30(*(p_filter_3 + 64), val1)); |
858 | 2.79M | syn_buf_p2[192] = ixheaac_add32_sat(syn_buf_p1[128], |
859 | 2.79M | ixheaacd_mps_mult32_shr_30(*p_filter_3++, val)); |
860 | 2.79M | syn_buf_p1[128] = ixheaac_add32_sat(syn_buf_p2[64], |
861 | 2.79M | ixheaacd_mps_mult32_shr_30(*(p_filter_2 + 64), val1)); |
862 | 2.79M | syn_buf_p2[64] = ixheaac_add32_sat(syn_buf_p1[0], |
863 | 2.79M | ixheaacd_mps_mult32_shr_30(*p_filter_2++, val)); |
864 | 2.79M | syn_buf_p1[0] = ixheaacd_mps_mult32_shr_30(*(p_filter_1 + 63), val1); |
865 | 2.79M | } |
866 | 2.79M | p_filter_6 = p_filter_1 + 62; |
867 | 2.79M | p_filter_7 = p_filter_2 + 62; |
868 | 2.79M | p_filter_8 = p_filter_3 + 62; |
869 | 2.79M | p_filter_9 = p_filter_4 + 62; |
870 | 2.79M | p_filter_10 = p_filter_5 + 62; |
871 | 2.79M | time_sig += 62; |
872 | | |
873 | 2.79M | syn_buf_p2 = synth_buf; |
874 | 2.79M | syn_buf_p3 = syn_buf_p2; |
875 | 2.79M | new_samp2 = p_sr + 63; |
876 | 179M | for (j = 0; j < resolution - 1; j++) { |
877 | 176M | *time_sig-- = ixheaac_add32_sat(syn_buf_p3[512], |
878 | 176M | ixheaacd_mps_mult32_shr_30(*p_filter_6--, (*new_samp2))); |
879 | 176M | syn_buf_p3[512] = ixheaac_add32_sat(syn_buf_p2[448], |
880 | 176M | ixheaacd_mps_mult32_shr_30(*p_filter_5++, (*new_samp))); |
881 | 176M | syn_buf_p2[448] = ixheaac_add32_sat(syn_buf_p3[384], |
882 | 176M | ixheaacd_mps_mult32_shr_30(*p_filter_7--, (*new_samp2))); |
883 | 176M | syn_buf_p3[384] = ixheaac_add32_sat(syn_buf_p2[320], |
884 | 176M | ixheaacd_mps_mult32_shr_30(*p_filter_4++, (*new_samp))); |
885 | 176M | syn_buf_p2[320] = ixheaac_add32_sat(syn_buf_p3[256], |
886 | 176M | ixheaacd_mps_mult32_shr_30(*p_filter_8--, (*new_samp2))); |
887 | 176M | syn_buf_p3[256] = ixheaac_add32_sat(syn_buf_p2[192], |
888 | 176M | ixheaacd_mps_mult32_shr_30(*p_filter_3++, (*new_samp))); |
889 | 176M | syn_buf_p2[192] = ixheaac_add32_sat(syn_buf_p3[128], |
890 | 176M | ixheaacd_mps_mult32_shr_30(*p_filter_9--, (*new_samp2))); |
891 | 176M | syn_buf_p3[128] = ixheaac_add32_sat(syn_buf_p2[64], |
892 | 176M | ixheaacd_mps_mult32_shr_30(*p_filter_2++, (*new_samp))); |
893 | 176M | syn_buf_p2[64] = ixheaac_add32_sat(syn_buf_p3[0], |
894 | 176M | ixheaacd_mps_mult32_shr_30(*p_filter_10--, (*new_samp2))); |
895 | 176M | syn_buf_p3[0] = ixheaacd_mps_mult32_shr_30(*p_filter_1++, (*new_samp)); |
896 | | |
897 | 176M | new_samp++; |
898 | 176M | syn_buf_p2++; |
899 | | |
900 | 176M | new_samp2--; |
901 | 176M | syn_buf_p3++; |
902 | 176M | } |
903 | | |
904 | 2.79M | time_sig += 64; |
905 | | |
906 | 2.79M | p_sr += MAX_HYBRID_BANDS; |
907 | 2.79M | p_si += MAX_HYBRID_BANDS; |
908 | 2.79M | } |
909 | 98.4k | } |
910 | | |
911 | | VOID ixheaacd_calculate_syn_filt_bank(ia_mps_dec_qmf_syn_filter_bank *syn, WORD32 *sr, WORD32 *si, |
912 | | WORD32 *time_sig, WORD32 channel, WORD32 resolution, |
913 | | WORD32 nr_samples, |
914 | 62.3k | ia_mps_dec_qmf_tables_struct *qmf_table_ptr) { |
915 | 62.3k | WORD32 j, k; |
916 | 62.3k | WORD32 *synth_buf; |
917 | 62.3k | WORD32 *p_sr, *p_si; |
918 | 62.3k | WORD32 *buf_ptr; |
919 | 62.3k | WORD32 resx2 = resolution << 1; |
920 | 62.3k | WORD32 *sbr_qmf_states_synthesis = syn->sbr_qmf_states_synthesis; |
921 | | |
922 | 62.3k | synth_buf = &(sbr_qmf_states_synthesis[channel * QMF_FILTER_STATE_SYN_SIZE_MPS]); |
923 | | |
924 | 62.3k | p_sr = sr; |
925 | 62.3k | p_si = si; |
926 | 1.69M | for (k = 0; k < nr_samples; k++) { |
927 | 1.63M | WORD32 *new_samp = p_si + 63; |
928 | | |
929 | 1.63M | const WORD32 *p_filter_1 = syn->p_filter_syn; |
930 | 1.63M | const WORD32 *p_filter_2 = p_filter_1 + 65; |
931 | 1.63M | const WORD32 *p_filter_3 = p_filter_2 + 65; |
932 | 1.63M | const WORD32 *p_filter_4 = p_filter_3 + 65; |
933 | 1.63M | const WORD32 *p_filter_5 = p_filter_4 + 65; |
934 | | |
935 | 1.63M | ixheaacd_inverse_modulation(p_sr, p_si, qmf_table_ptr); |
936 | | |
937 | 53.8M | for (j = 0; j < resolution; j++) { |
938 | 52.2M | synth_buf[j] = ixheaacd_mps_mult32_shr_30(*p_filter_1++, (*new_samp)); |
939 | 52.2M | synth_buf[resx2 + j] = ixheaac_add32_sat(synth_buf[resx2 + j], |
940 | 52.2M | ixheaacd_mps_mult32_shr_30(*p_filter_2++, (*new_samp))); |
941 | 52.2M | synth_buf[resx2 * 2 + j] = ixheaac_add32_sat(synth_buf[resx2 * 2 + j], |
942 | 52.2M | ixheaacd_mps_mult32_shr_30(*p_filter_3++, (*new_samp))); |
943 | 52.2M | synth_buf[resx2 * 3 + j] = ixheaac_add32_sat(synth_buf[resx2 * 3 + j], |
944 | 52.2M | ixheaacd_mps_mult32_shr_30(*p_filter_4++, (*new_samp))); |
945 | 52.2M | synth_buf[resx2 * 4 + j] = ixheaac_add32_sat(synth_buf[resx2 * 4 + j], |
946 | 52.2M | ixheaacd_mps_mult32_shr_30(*p_filter_5++, (*new_samp))); |
947 | | |
948 | 52.2M | new_samp--; |
949 | 52.2M | } |
950 | | |
951 | 1.63M | synth_buf[resx2 - 1] = ixheaac_add32_sat(synth_buf[resx2 - 1], |
952 | 1.63M | ixheaacd_mps_mult32_shr_30(*p_filter_1++, *p_sr)); |
953 | 1.63M | synth_buf[resx2 * 2 - 1] = ixheaac_add32_sat(synth_buf[resx2 * 2 - 1], |
954 | 1.63M | ixheaacd_mps_mult32_shr_30(*p_filter_2++, *p_sr)); |
955 | 1.63M | synth_buf[3 * resx2 - 1] = ixheaac_add32_sat(synth_buf[3 * resx2 - 1], |
956 | 1.63M | ixheaacd_mps_mult32_shr_30(*p_filter_3++, *p_sr)); |
957 | 1.63M | synth_buf[4 * resx2 - 1] = ixheaac_add32_sat(synth_buf[4 * resx2 - 1], |
958 | 1.63M | ixheaacd_mps_mult32_shr_30(*p_filter_4++, *p_sr)); |
959 | 1.63M | *time_sig++ = ixheaac_add32_sat(synth_buf[5 * resx2 - 1], |
960 | 1.63M | ixheaacd_mps_mult32_shr_30(*p_filter_5++, *p_sr)); |
961 | | |
962 | 1.63M | p_filter_1 -= 2; |
963 | 1.63M | p_filter_2 -= 2; |
964 | 1.63M | p_filter_3 -= 2; |
965 | 1.63M | p_filter_4 -= 2; |
966 | 1.63M | p_filter_5 -= 2; |
967 | | |
968 | 1.63M | new_samp = p_sr + resolution - 1; |
969 | | |
970 | 52.2M | for (j = 0; j < resolution - 1; j++) { |
971 | 50.6M | synth_buf[resolution + j] = ixheaac_add32_sat(synth_buf[resolution + j], |
972 | 50.6M | ixheaacd_mps_mult32_shr_30(*--p_filter_5, (*new_samp))); |
973 | 50.6M | synth_buf[resolution * (3) + j] = |
974 | 50.6M | ixheaac_add32_sat(synth_buf[resolution * (3) + j], |
975 | 50.6M | ixheaacd_mps_mult32_shr_30(*--p_filter_4, (*new_samp))); |
976 | 50.6M | synth_buf[resolution * (5) + j] = |
977 | 50.6M | ixheaac_add32_sat(synth_buf[resolution * (5) + j], |
978 | 50.6M | ixheaacd_mps_mult32_shr_30(*--p_filter_3, (*new_samp))); |
979 | 50.6M | synth_buf[resolution * (7) + j] = |
980 | 50.6M | ixheaac_add32_sat(synth_buf[resolution * (7) + j], |
981 | 50.6M | ixheaacd_mps_mult32_shr_30(*--p_filter_2, (*new_samp))); |
982 | 50.6M | synth_buf[resolution * (9) + j] = |
983 | 50.6M | ixheaac_add32_sat(synth_buf[resolution * (9) + j], |
984 | 50.6M | ixheaacd_mps_mult32_shr_30(*--p_filter_1, (*new_samp))); |
985 | 50.6M | new_samp--; |
986 | 50.6M | } |
987 | | |
988 | 1.63M | buf_ptr = synth_buf + 9 * resolution + resolution - 2; |
989 | 52.2M | for (j = 0; j < resolution - 1; j++) { |
990 | 50.6M | *time_sig++ = *buf_ptr--; |
991 | 50.6M | } |
992 | | |
993 | 1.63M | memmove((synth_buf + resolution), synth_buf, (9 * resolution) * sizeof(WORD32)); |
994 | | |
995 | 1.63M | p_sr += MAX_HYBRID_BANDS; |
996 | 1.63M | p_si += MAX_HYBRID_BANDS; |
997 | 1.63M | } |
998 | 62.3k | } |
999 | | |
1000 | | IA_ERRORCODE |
1001 | 4.66k | ixheaacd_syn_filt_bank_init(ia_mps_dec_synthesis_interface_handle self, WORD32 resolution) { |
1002 | 4.66k | switch (resolution) { |
1003 | 3.54k | case QMF_BANDS_32: |
1004 | 3.54k | self->syn_filter_bank = ixheaacd_calculate_syn_filt_bank; |
1005 | 3.54k | break; |
1006 | 1.11k | case QMF_BANDS_64: |
1007 | 1.11k | self->syn_filter_bank = ixheaacd_calculate_syn_filt_bank_res64; |
1008 | 1.11k | break; |
1009 | 0 | case QMF_BANDS_128: |
1010 | 0 | self->syn_filter_bank = ixheaacd_calculate_syn_filt_bank; |
1011 | 0 | break; |
1012 | 0 | default: |
1013 | 0 | return IA_XHEAAC_MPS_DEC_INIT_NONFATAL_INVALID_QMF_BAND; |
1014 | 0 | break; |
1015 | 4.66k | } |
1016 | 4.66k | return IA_NO_ERROR; |
1017 | 4.66k | } |
1018 | | |
1019 | | static VOID ia_mps_enc_fwd_mod(WORD32 *time_in, WORD32 *r_subband, WORD32 *i_subband, |
1020 | 3.08M | ia_mps_dec_qmf_tables_struct *qmf_table_ptr) { |
1021 | 3.08M | WORD32 i; |
1022 | | |
1023 | 200M | for (i = 0; i < 64; i++) { |
1024 | 197M | r_subband[i] = time_in[i] - time_in[127 - i]; |
1025 | 197M | i_subband[i] = time_in[i] + time_in[127 - i]; |
1026 | 197M | } |
1027 | 3.08M | ixheaacd_cos_mod(r_subband, qmf_table_ptr); |
1028 | 3.08M | ixheaacd_sin_mod(i_subband, qmf_table_ptr); |
1029 | 3.08M | } |
1030 | | |
1031 | | VOID ixheaacd_calc_ana_filt_bank(ia_heaac_mps_state_struct *pstr_mps_state, WORD16 *time_in, |
1032 | 109k | WORD32 *r_analysis, WORD32 *i_analysis, WORD32 channel) { |
1033 | 109k | ia_mps_dec_qmf_ana_filter_bank *qmf_bank = &pstr_mps_state->qmf_bank[channel]; |
1034 | 109k | ia_mps_dec_qmf_tables_struct *qmf_table_ptr = |
1035 | 109k | pstr_mps_state->ia_mps_dec_mps_table.qmf_table_ptr; |
1036 | 109k | WORD32 i, k, m; |
1037 | | |
1038 | 109k | WORD32 *syn_buffer = pstr_mps_state->mps_scratch_mem_v; |
1039 | 109k | WORD64 accu1 = 0, accu2 = 0; |
1040 | 109k | WORD16 flag; |
1041 | 109k | WORD32 *fp1; |
1042 | 109k | WORD32 *fp2; |
1043 | 109k | WORD32 *temp; |
1044 | 109k | const WORD32 *start_co_eff_ptr_l; |
1045 | 109k | const WORD32 *start_co_eff_ptr_r; |
1046 | 109k | const WORD32 *ptr_pf_l, *ptr_pf_r; |
1047 | 109k | WORD32 *qmf_states_curr_pos; |
1048 | 109k | WORD32 offset = 0; |
1049 | 109k | WORD32 n_channels = pstr_mps_state->num_input_channels; |
1050 | 109k | WORD32 nr_samples = pstr_mps_state->time_slots; |
1051 | 109k | WORD32 qmf_bands = pstr_mps_state->qmf_bands; |
1052 | 109k | WORD32 shift = pstr_mps_state->bits_per_sample - 16; |
1053 | 109k | WORD32 gain = pstr_mps_state->clip_protect_gain; |
1054 | | |
1055 | 109k | WORD32 *p_ana_real = r_analysis; |
1056 | 109k | WORD32 *p_ana_imag = i_analysis; |
1057 | | |
1058 | 109k | WORD32 *p_ana_re, *p_ana_im; |
1059 | | |
1060 | 109k | flag = qmf_bank->flag; |
1061 | 109k | if (!flag) { |
1062 | 109k | fp1 = qmf_bank->qmf_states_buffer; |
1063 | 109k | fp2 = qmf_bank->qmf_states_buffer + qmf_bands; |
1064 | 109k | } else { |
1065 | 0 | fp2 = qmf_bank->qmf_states_buffer; |
1066 | 0 | fp1 = qmf_bank->qmf_states_buffer + qmf_bands; |
1067 | 0 | } |
1068 | | |
1069 | 109k | qmf_bank->qmf_states_curr_pos = |
1070 | 109k | ((WORD32 *)(qmf_bank->qmf_states_buffer) + (qmf_bank->offset * qmf_bands)); |
1071 | | |
1072 | 109k | offset = qmf_bank->offset; |
1073 | 109k | start_co_eff_ptr_l = qmf_bank->ref_co_eff_ptr_l + qmf_bank->offset_l; |
1074 | 109k | start_co_eff_ptr_r = qmf_bank->ref_co_eff_ptr_r - qmf_bank->offset_r; |
1075 | | |
1076 | 3.19M | for (i = 0; i < nr_samples; i++) { |
1077 | 3.08M | const WORD16 *pcoz = qmf_table_ptr->ia_qmf_anl_addt_cos, |
1078 | 3.08M | *psin = qmf_table_ptr->ia_qmf_anl_addt_sin; |
1079 | 3.08M | qmf_states_curr_pos = qmf_bank->qmf_states_curr_pos; |
1080 | | |
1081 | 3.08M | p_ana_re = p_ana_real; |
1082 | 3.08M | p_ana_im = p_ana_imag; |
1083 | | |
1084 | 3.08M | temp = fp1; |
1085 | 3.08M | fp1 = fp2; |
1086 | 3.08M | fp2 = temp; |
1087 | | |
1088 | 3.08M | if (flag) { |
1089 | 1.54M | start_co_eff_ptr_l--; |
1090 | | |
1091 | 1.54M | if (start_co_eff_ptr_l == qmf_bank->ref_co_eff_ptr_l) start_co_eff_ptr_l += 5; |
1092 | 1.54M | } else { |
1093 | 1.54M | start_co_eff_ptr_r++; |
1094 | 1.54M | if (start_co_eff_ptr_r == qmf_bank->ref_co_eff_ptr_r) start_co_eff_ptr_r -= 5; |
1095 | 1.54M | } |
1096 | | |
1097 | 3.08M | flag++; |
1098 | 3.08M | if ((flag & ONE_BIT_MASK) == 0) flag = 0; |
1099 | | |
1100 | 3.08M | if (shift == 0) { |
1101 | 168M | for (k = 0; k < qmf_bands; k++) { |
1102 | 165M | qmf_states_curr_pos[k] = ixheaacd_mps_mult32_shr_15( |
1103 | 165M | (WORD32)time_in[n_channels * (i * qmf_bands + k) + channel], gain); |
1104 | 165M | } |
1105 | 3.08M | } else { |
1106 | 0 | for (k = 0; k < qmf_bands; k++) { |
1107 | 0 | WORD32 temp; |
1108 | 0 | temp = ixheaacd_mps_mult32_shr_15( |
1109 | 0 | (WORD32)time_in[n_channels * (i * qmf_bands + k) + channel], gain); |
1110 | |
|
1111 | 0 | qmf_states_curr_pos[k] = temp >> shift; |
1112 | 0 | } |
1113 | 0 | } |
1114 | | |
1115 | 3.08M | ptr_pf_l = start_co_eff_ptr_l; |
1116 | 3.08M | ptr_pf_r = start_co_eff_ptr_r; |
1117 | | |
1118 | 168M | for (k = 0; k < qmf_bands; k++) { |
1119 | 165M | { |
1120 | 165M | accu1 = (WORD64)((WORD64)ptr_pf_l[0] * (WORD64)fp1[k]); |
1121 | 165M | accu1 += (WORD64)((WORD64)ptr_pf_l[1] * (WORD64)fp1[128 + k]); |
1122 | 165M | accu1 += (WORD64)((WORD64)ptr_pf_l[2] * (WORD64)fp1[256 + k]); |
1123 | 165M | accu1 += (WORD64)((WORD64)ptr_pf_l[3] * (WORD64)fp1[384 + k]); |
1124 | 165M | accu1 += (WORD64)((WORD64)ptr_pf_l[4] * (WORD64)fp1[512 + k]); |
1125 | | |
1126 | 165M | accu2 = (WORD64)((WORD64)ptr_pf_r[-1] * (WORD64)fp2[k]); |
1127 | 165M | accu2 += (WORD64)((WORD64)ptr_pf_r[-2] * (WORD64)fp2[128 + k]); |
1128 | 165M | accu2 += (WORD64)((WORD64)ptr_pf_r[-3] * (WORD64)fp2[256 + k]); |
1129 | 165M | accu2 += (WORD64)((WORD64)ptr_pf_r[-4] * (WORD64)fp2[384 + k]); |
1130 | 165M | accu2 += (WORD64)((WORD64)ptr_pf_r[-5] * (WORD64)fp2[512 + k]); |
1131 | 165M | } |
1132 | 165M | syn_buffer[(qmf_bands << 1) - 1 - k] = (WORD32)((WORD64)accu1 >> 21); |
1133 | 165M | syn_buffer[qmf_bands - 1 - k] = (WORD32)((WORD64)accu2 >> 21); |
1134 | 165M | ptr_pf_l += 10; |
1135 | 165M | ptr_pf_r -= 10; |
1136 | 165M | } |
1137 | | |
1138 | 3.08M | ia_mps_enc_fwd_mod(syn_buffer, p_ana_re, p_ana_im, qmf_table_ptr); |
1139 | | |
1140 | 85.8M | for (m = 0; m < (qmf_bands >> 1); m++) { |
1141 | 82.7M | WORD32 a_cos, b_cos, a_sin, b_sin; |
1142 | 82.7M | WORD32 a_cos1, b_cos1, a_sin1, b_sin1; |
1143 | | |
1144 | 82.7M | WORD16 coz = *pcoz++, sin = *psin++; |
1145 | | |
1146 | 82.7M | a_cos = ixheaac_mult32x16in32(p_ana_re[m], coz); |
1147 | 82.7M | b_sin = ixheaac_mult32x16in32(p_ana_im[m], sin); |
1148 | 82.7M | b_cos = ixheaac_mult32x16in32(p_ana_im[m], coz); |
1149 | 82.7M | a_sin = ixheaac_mult32x16in32(p_ana_re[m], sin); |
1150 | | |
1151 | 82.7M | p_ana_re[m] = ((a_cos + b_sin) << 1); |
1152 | 82.7M | p_ana_im[m] = ((b_cos - a_sin) << 1); |
1153 | | |
1154 | 82.7M | a_cos1 = ixheaac_mult32x16in32(p_ana_re[qmf_bands - 1 - m], coz); |
1155 | 82.7M | b_sin1 = ixheaac_mult32x16in32(p_ana_im[qmf_bands - 1 - m], sin); |
1156 | | |
1157 | 82.7M | a_sin1 = ixheaac_mult32x16in32(p_ana_re[qmf_bands - 1 - m], sin); |
1158 | 82.7M | p_ana_re[qmf_bands - 1 - m] = ((-a_cos1 + b_sin1) << 1); |
1159 | 82.7M | b_cos1 = ixheaac_mult32x16in32(p_ana_im[qmf_bands - 1 - m], coz); |
1160 | | |
1161 | 82.7M | p_ana_im[qmf_bands - 1 - m] = ((-b_cos1 - a_sin1) << 1); |
1162 | 82.7M | } |
1163 | | |
1164 | 3.08M | qmf_bank->qmf_states_curr_pos = qmf_bank->qmf_states_curr_pos + qmf_bands; |
1165 | 3.08M | offset++; |
1166 | 3.08M | if (offset == 10) { |
1167 | 301k | offset = 0; |
1168 | 301k | qmf_bank->qmf_states_curr_pos = qmf_bank->qmf_states_buffer; |
1169 | 301k | } |
1170 | | |
1171 | 3.08M | p_ana_real += MAX_NUM_QMF_BANDS; |
1172 | 3.08M | p_ana_imag += MAX_NUM_QMF_BANDS; |
1173 | 3.08M | } |
1174 | | |
1175 | 109k | qmf_bank->offset_l = (WORD32)(start_co_eff_ptr_l - qmf_bank->ref_co_eff_ptr_l); |
1176 | 109k | qmf_bank->offset_r = (WORD32)(qmf_bank->ref_co_eff_ptr_r - start_co_eff_ptr_r); |
1177 | | |
1178 | 109k | qmf_bank->flag = flag; |
1179 | 109k | qmf_bank->offset = offset; |
1180 | 109k | } |