xref: /aosp_15_r20/external/libxaac/decoder/ixheaacd_mps_mdct_2_qmf.c (revision 15dc779a375ca8b5125643b829a8aa4b70d7f451)
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_cnst.h"
31 #include "ixheaacd_common_rom.h"
32 #include "ixheaacd_sbrdecsettings.h"
33 #include "ixheaacd_sbr_scale.h"
34 #include "ixheaacd_env_extr_part.h"
35 #include "ixheaacd_sbr_rom.h"
36 #include "ixheaacd_hybrid.h"
37 #include "ixheaacd_ps_dec.h"
38 #include "ixheaac_error_standards.h"
39 #include "ixheaacd_mps_polyphase.h"
40 #include "ixheaacd_config.h"
41 #include "ixheaacd_qmf_dec.h"
42 #include "ixheaacd_mps_dec.h"
43 #include "ixheaacd_mps_mdct_2_qmf.h"
44 #include "ixheaacd_mps_macro_def.h"
45 #include "ixheaacd_mps_basic_op.h"
46 
ixheaacd_mdct2qmf_tables_init(ia_heaac_mps_state_struct * pstr_mps_state)47 IA_ERRORCODE ixheaacd_mdct2qmf_tables_init(ia_heaac_mps_state_struct *pstr_mps_state) {
48   WORD32 time_slots;
49 
50   time_slots = pstr_mps_state->upd_qmf;
51 
52   if (32 == time_slots) {
53     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[0] =
54         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_00;
55     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[1] =
56         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_01;
57     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[2] =
58         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_02;
59     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[3] =
60         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_03;
61     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[4] =
62         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_04;
63     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[5] =
64         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_05;
65     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[6] =
66         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_06;
67     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[7] =
68         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_07;
69     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[8] =
70         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_08;
71     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[9] =
72         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_09;
73     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[10] =
74         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_10;
75     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[11] =
76         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_11;
77     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[12] =
78         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_12;
79     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[13] =
80         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_13;
81     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[14] =
82         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_14;
83     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[15] =
84         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_15;
85     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[16] =
86         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_15;
87     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[17] =
88         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_14;
89     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[18] =
90         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_13;
91     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[19] =
92         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_12;
93     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[20] =
94         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_11;
95     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[21] =
96         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_10;
97     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[22] =
98         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_09;
99     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[23] =
100         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_08;
101     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[24] =
102         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_07;
103     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[25] =
104         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_06;
105     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[26] =
106         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_05;
107     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[27] =
108         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_04;
109     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[28] =
110         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_03;
111     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[29] =
112         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_02;
113     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[30] =
114         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_01;
115     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[31] =
116         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_00;
117     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[32] =
118         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_16;
119     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[33] =
120         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_17;
121     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[34] =
122         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_18;
123     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[35] =
124         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_19;
125     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[36] =
126         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_20;
127     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[37] =
128         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_21;
129     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[38] =
130         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_22;
131     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[39] =
132         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_23;
133     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[40] =
134         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_24;
135     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[41] =
136         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_25;
137     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[42] =
138         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_26;
139     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[43] =
140         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_27;
141     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[44] =
142         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_28;
143     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[45] =
144         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_29;
145     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[46] =
146         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_30;
147     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[47] =
148         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_31;
149     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[48] =
150         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_31;
151     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[49] =
152         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_30;
153     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[50] =
154         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_29;
155     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[51] =
156         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_28;
157     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[52] =
158         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_27;
159     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[53] =
160         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_26;
161     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[54] =
162         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_25;
163     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[55] =
164         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_24;
165     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[56] =
166         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_23;
167     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[57] =
168         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_22;
169     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[58] =
170         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_21;
171     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[59] =
172         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_20;
173     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[60] =
174         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_19;
175     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[61] =
176         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_18;
177     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[62] =
178         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_17;
179     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[63] =
180         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_32_16;
181 
182     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[0] =
183         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_4_00;
184     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[1] =
185         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_4_01;
186     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[2] =
187         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_4_01;
188     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[3] =
189         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_4_00;
190     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[4] =
191         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_4_02;
192     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[5] =
193         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_4_03;
194     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[6] =
195         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_4_03;
196     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[7] =
197         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_4_02;
198     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[8] = NULL;
199     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[9] = NULL;
200   } else {
201     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[0] =
202         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_2_00;
203     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[1] =
204         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_2_00;
205     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[2] =
206         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_2_01;
207     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[3] =
208         pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_2_01;
209     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[4] = NULL;
210     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[5] = NULL;
211     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[6] = NULL;
212     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[7] = NULL;
213     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[8] = NULL;
214     pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[9] = NULL;
215 
216     if (30 == time_slots) {
217       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[0] =
218           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_00;
219       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[1] =
220           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_01;
221       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[2] =
222           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_02;
223       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[3] =
224           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_03;
225       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[4] =
226           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_04;
227       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[5] =
228           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_05;
229       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[6] =
230           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_06;
231       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[7] =
232           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_07;
233       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[8] =
234           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_08;
235       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[9] =
236           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_09;
237       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[10] =
238           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_10;
239       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[11] =
240           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_11;
241       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[12] =
242           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_12;
243       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[13] =
244           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_13;
245       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[14] =
246           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_14;
247       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[15] =
248           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_14;
249       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[16] =
250           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_13;
251       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[17] =
252           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_12;
253       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[18] =
254           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_11;
255       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[19] =
256           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_10;
257       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[20] =
258           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_09;
259       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[21] =
260           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_08;
261       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[22] =
262           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_07;
263       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[23] =
264           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_06;
265       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[24] =
266           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_05;
267       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[25] =
268           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_04;
269       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[26] =
270           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_03;
271       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[27] =
272           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_02;
273       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[28] =
274           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_01;
275       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[29] =
276           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_00;
277       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[30] =
278           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_15;
279       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[31] =
280           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_16;
281       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[32] =
282           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_17;
283       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[33] =
284           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_18;
285       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[34] =
286           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_19;
287       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[35] =
288           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_20;
289       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[36] =
290           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_21;
291       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[37] =
292           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_22;
293       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[38] =
294           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_23;
295       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[39] =
296           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_24;
297       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[40] =
298           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_25;
299       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[41] =
300           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_26;
301       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[42] =
302           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_27;
303       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[43] =
304           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_28;
305       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[44] =
306           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_29;
307       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[45] =
308           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_29;
309       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[46] =
310           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_28;
311       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[47] =
312           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_27;
313       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[48] =
314           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_26;
315       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[49] =
316           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_25;
317       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[50] =
318           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_24;
319       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[51] =
320           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_23;
321       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[52] =
322           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_22;
323       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[53] =
324           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_21;
325       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[54] =
326           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_20;
327       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[55] =
328           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_19;
329       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[56] =
330           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_18;
331       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[57] =
332           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_17;
333       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[58] =
334           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_16;
335       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[59] =
336           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_30_15;
337       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[60] = NULL;
338       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[61] = NULL;
339       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[62] = NULL;
340       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[63] = NULL;
341     } else if (24 == time_slots) {
342       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[0] =
343           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_00;
344       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[1] =
345           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_01;
346       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[2] =
347           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_02;
348       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[3] =
349           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_03;
350       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[4] =
351           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_04;
352       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[5] =
353           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_05;
354       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[6] =
355           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_06;
356       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[7] =
357           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_07;
358       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[8] =
359           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_08;
360       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[9] =
361           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_09;
362       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[10] =
363           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_10;
364       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[11] =
365           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_11;
366       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[12] =
367           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_11;
368       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[13] =
369           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_10;
370       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[14] =
371           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_09;
372       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[15] =
373           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_08;
374       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[16] =
375           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_07;
376       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[17] =
377           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_06;
378       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[18] =
379           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_05;
380       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[19] =
381           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_04;
382       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[20] =
383           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_03;
384       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[21] =
385           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_02;
386       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[22] =
387           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_01;
388       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[23] =
389           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_00;
390       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[24] =
391           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_12;
392       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[25] =
393           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_13;
394       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[26] =
395           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_14;
396       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[27] =
397           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_15;
398       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[28] =
399           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_16;
400       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[29] =
401           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_17;
402       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[30] =
403           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_18;
404       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[31] =
405           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_19;
406       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[32] =
407           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_20;
408       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[33] =
409           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_21;
410       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[34] =
411           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_22;
412       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[35] =
413           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_23;
414       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[36] =
415           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_23;
416       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[37] =
417           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_22;
418       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[38] =
419           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_21;
420       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[39] =
421           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_20;
422       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[40] =
423           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_19;
424       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[41] =
425           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_18;
426       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[42] =
427           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_17;
428       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[43] =
429           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_16;
430       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[44] =
431           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_15;
432       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[45] =
433           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_14;
434       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[46] =
435           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_13;
436       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[47] =
437           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_24_12;
438       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[48] = NULL;
439       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[49] = NULL;
440       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[50] = NULL;
441       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[51] = NULL;
442       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[52] = NULL;
443       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[53] = NULL;
444       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[54] = NULL;
445       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[55] = NULL;
446       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[56] = NULL;
447       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[57] = NULL;
448       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[58] = NULL;
449       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[59] = NULL;
450       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[60] = NULL;
451       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[61] = NULL;
452       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[62] = NULL;
453       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[63] = NULL;
454     } else if (18 == time_slots) {
455       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[0] =
456           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_00;
457       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[1] =
458           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_01;
459       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[2] =
460           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_02;
461       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[3] =
462           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_03;
463       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[4] =
464           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_04;
465       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[5] =
466           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_05;
467       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[6] =
468           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_06;
469       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[7] =
470           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_07;
471       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[8] =
472           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_08;
473       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[9] =
474           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_08;
475       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[10] =
476           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_07;
477       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[11] =
478           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_06;
479       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[12] =
480           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_05;
481       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[13] =
482           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_04;
483       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[14] =
484           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_03;
485       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[15] =
486           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_02;
487       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[16] =
488           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_01;
489       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[17] =
490           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_00;
491       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[18] =
492           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_09;
493       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[19] =
494           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_10;
495       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[20] =
496           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_11;
497       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[21] =
498           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_12;
499       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[22] =
500           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_13;
501       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[23] =
502           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_14;
503       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[24] =
504           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_15;
505       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[25] =
506           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_16;
507       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[26] =
508           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_17;
509       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[27] =
510           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_17;
511       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[28] =
512           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_16;
513       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[29] =
514           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_15;
515       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[30] =
516           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_14;
517       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[31] =
518           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_13;
519       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[32] =
520           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_12;
521       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[33] =
522           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_11;
523       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[34] =
524           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_10;
525       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[35] =
526           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_18_09;
527       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[36] = NULL;
528       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[37] = NULL;
529       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[38] = NULL;
530       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[39] = NULL;
531       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[40] = NULL;
532       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[41] = NULL;
533       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[42] = NULL;
534       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[43] = NULL;
535       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[44] = NULL;
536       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[45] = NULL;
537       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[46] = NULL;
538       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[47] = NULL;
539       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[48] = NULL;
540       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[49] = NULL;
541       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[50] = NULL;
542       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[51] = NULL;
543       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[52] = NULL;
544       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[53] = NULL;
545       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[54] = NULL;
546       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[55] = NULL;
547       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[56] = NULL;
548       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[57] = NULL;
549       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[58] = NULL;
550       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[59] = NULL;
551       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[60] = NULL;
552       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[61] = NULL;
553       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[62] = NULL;
554       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[63] = NULL;
555     } else if (16 == time_slots) {
556       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[0] =
557           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_00;
558       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[1] =
559           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_01;
560       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[2] =
561           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_02;
562       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[3] =
563           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_03;
564       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[4] =
565           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_04;
566       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[5] =
567           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_05;
568       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[6] =
569           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_06;
570       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[7] =
571           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_07;
572       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[8] =
573           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_07;
574       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[9] =
575           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_06;
576       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[10] =
577           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_05;
578       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[11] =
579           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_04;
580       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[12] =
581           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_03;
582       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[13] =
583           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_02;
584       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[14] =
585           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_01;
586       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[15] =
587           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_00;
588       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[16] =
589           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_08;
590       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[17] =
591           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_09;
592       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[18] =
593           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_10;
594       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[19] =
595           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_11;
596       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[20] =
597           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_12;
598       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[21] =
599           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_13;
600       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[22] =
601           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_14;
602       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[23] =
603           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_15;
604       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[24] =
605           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_15;
606       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[25] =
607           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_14;
608       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[26] =
609           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_13;
610       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[27] =
611           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_12;
612       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[28] =
613           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_11;
614       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[29] =
615           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_10;
616       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[30] =
617           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_09;
618       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[31] =
619           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_16_08;
620       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[32] = NULL;
621       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[33] = NULL;
622       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[34] = NULL;
623       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[35] = NULL;
624       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[36] = NULL;
625       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[37] = NULL;
626       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[38] = NULL;
627       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[39] = NULL;
628       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[40] = NULL;
629       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[41] = NULL;
630       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[42] = NULL;
631       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[43] = NULL;
632       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[44] = NULL;
633       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[45] = NULL;
634       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[46] = NULL;
635       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[47] = NULL;
636       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[48] = NULL;
637       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[49] = NULL;
638       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[50] = NULL;
639       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[51] = NULL;
640       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[52] = NULL;
641       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[53] = NULL;
642       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[54] = NULL;
643       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[55] = NULL;
644       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[56] = NULL;
645       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[57] = NULL;
646       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[58] = NULL;
647       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[59] = NULL;
648       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[60] = NULL;
649       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[61] = NULL;
650       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[62] = NULL;
651       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[63] = NULL;
652     } else if (15 == time_slots) {
653       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[0] =
654           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_00;
655       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[1] =
656           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_01;
657       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[2] =
658           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_02;
659       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[3] =
660           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_03;
661       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[4] =
662           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_04;
663       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[5] =
664           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_05;
665       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[6] =
666           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_06;
667       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[7] =
668           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_06;
669       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[8] =
670           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_05;
671       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[9] =
672           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_04;
673       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[10] =
674           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_03;
675       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[11] =
676           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_02;
677       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[12] =
678           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_01;
679       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[13] =
680           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_00;
681       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[14] =
682           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_07;
683       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[15] =
684           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_08;
685       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[16] =
686           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_09;
687       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[17] =
688           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_10;
689       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[18] =
690           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_11;
691       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[19] =
692           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_12;
693       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[20] =
694           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_13;
695       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[21] =
696           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_14;
697       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[22] =
698           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_14;
699       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[23] =
700           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_13;
701       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[24] =
702           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_12;
703       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[25] =
704           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_11;
705       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[26] =
706           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_10;
707       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[27] =
708           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_09;
709       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[28] =
710           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_08;
711       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[29] =
712           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_long_15_07;
713       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[30] = NULL;
714       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[31] = NULL;
715       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[32] = NULL;
716       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[33] = NULL;
717       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[34] = NULL;
718       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[35] = NULL;
719       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[36] = NULL;
720       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[37] = NULL;
721       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[38] = NULL;
722       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[39] = NULL;
723       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[40] = NULL;
724       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[41] = NULL;
725       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[42] = NULL;
726       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[43] = NULL;
727       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[44] = NULL;
728       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[45] = NULL;
729       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[46] = NULL;
730       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[47] = NULL;
731       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[48] = NULL;
732       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[49] = NULL;
733       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[50] = NULL;
734       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[51] = NULL;
735       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[52] = NULL;
736       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[53] = NULL;
737       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[54] = NULL;
738       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[55] = NULL;
739       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[56] = NULL;
740       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[57] = NULL;
741       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[58] = NULL;
742       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[59] = NULL;
743       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[60] = NULL;
744       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[61] = NULL;
745       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[62] = NULL;
746       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_long[63] = NULL;
747 
748       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[4] =
749           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_3_00;
750       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[5] =
751           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_3_00;
752       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[6] =
753           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_3_01;
754       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[7] =
755           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_3_02;
756       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[8] =
757           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_3_02;
758       pstr_mps_state->ia_mps_dec_mdct2qmfcos_table.cos_table_short[9] =
759           pstr_mps_state->ia_mps_dec_mps_table.mdct2qmfcos_table_ptr->cos_table_short_3_01;
760     } else {
761       if (pstr_mps_state->residual_coding) return IA_XHEAAC_MPS_DEC_EXE_FATAL_INVALID_TIMESLOTS;
762     }
763   }
764 
765   return IA_NO_ERROR;
766 }
767 
ixheaacd_mdct2qmf_create(ia_heaac_mps_state_struct * pstr_mps_state)768 IA_ERRORCODE ixheaacd_mdct2qmf_create(ia_heaac_mps_state_struct *pstr_mps_state) {
769   IA_ERRORCODE error_code = IA_NO_ERROR;
770 
771   WORD32 *qmf_residual_real = pstr_mps_state->array_struct->qmf_residual_real_pre;
772   WORD32 *qmf_residual_imag = pstr_mps_state->array_struct->qmf_residual_imag_pre;
773 
774   memset(qmf_residual_real, 0, RES_CHXQMFXTSX4);
775   memset(qmf_residual_imag, 0, RES_CHXQMFXTSX4);
776 
777   error_code = ixheaacd_mdct2qmf_tables_init(pstr_mps_state);
778 
779   return error_code;
780 }
781 
ixheaacd_local_zero(WORD32 const l,WORD32 * const b)782 static VOID ixheaacd_local_zero(WORD32 const l, WORD32 *const b) {
783   WORD32 i;
784 
785   for (i = 0; i < l; i++) {
786     b[i] = 0;
787   }
788 }
789 
ixheaacd_local_fold_out(WORD32 * const s,WORD32 const lv,WORD32 * const w,WORD32 const l_w,WORD32 * const v_main,WORD32 * const v_slave)790 static VOID ixheaacd_local_fold_out(WORD32 *const s, WORD32 const lv, WORD32 *const w,
791                                     WORD32 const l_w, WORD32 *const v_main,
792                                     WORD32 *const v_slave) {
793   WORD32 n;
794   WORD32 i;
795   WORD32 j;
796   WORD32 k;
797 
798   WORD32 temp_1;
799 
800   WORD32 *w1;
801   WORD32 *w2;
802   WORD32 *w3;
803   WORD32 *w4;
804   WORD32 *ptr1, *ptr2, *ptr3;
805 
806   WORD32 m = l_w >> 1;
807   WORD32 l = lv / m;
808   WORD32 m2w = m >> 1;
809   WORD32 m2a = m - m2w;
810 
811   for (i = m; i < lv; i += l_w) {
812     for (n = i + l_w; i < n; i++) {
813       s[i] = -s[i];
814     }
815   }
816 
817   w1 = &w[-m2a];
818   w2 = &w[m2w];
819   w3 = &w[m2w];
820   w4 = &w[m + m2w];
821 
822   for (n = 0, j = 0, k = m; n < l - 1; n++) {
823     for (i = 0; i < m2a; i++, j++, k++) {
824       v_main[k] = ixheaacd_mps_mult32_shr_30(w2[i], s[k]);
825       v_slave[j] = ixheaacd_mps_mult32_shr_30(w4[i], s[k]);
826     }
827 
828     for (; i < m; i++, j++, k++) {
829       v_main[j] = ixheaacd_mps_mult32_shr_30(w3[i], s[j]);
830       v_slave[k] = ixheaacd_mps_mult32_shr_30(w1[i], s[j]);
831     }
832   }
833 
834   ptr1 = v_main;
835   ptr2 = v_slave + m - 1;
836   ptr3 = s;
837   for (i = 0; i < m2a; i++) {
838     temp_1 = *ptr3++;
839     *ptr1++ = ixheaacd_mps_mult32_shr_30(*w2++, temp_1);
840     *ptr2-- = ixheaacd_mps_mult32_shr_30(*w4++, temp_1);
841   }
842 
843   j = l * m - m2w;
844   k = l * m - m2a - 1;
845   ptr3 = s + l * m - m;
846   ptr1 = v_main + j;
847   ptr2 = v_slave + k;
848 
849   w1 += m2a;
850   for (; i < m; i++, j++) {
851     temp_1 = *ptr3++;
852     *ptr1++ = ixheaacd_mps_mult32_shr_30(*w2++, temp_1);
853     *ptr2-- = ixheaacd_mps_mult32_shr_30(*w1++, temp_1);
854   }
855 }
856 
ixheaacd_local_imdet(WORD32 * x1,WORD32 * x2,WORD32 * const scale1,WORD32 const val,WORD32 * z_real,WORD32 * z_imag,const ia_mps_dec_mdct2qmf_cos_table_struct * ia_mps_dec_mdct2qmfcos_tab,WORD32 is_long,VOID * scratch)857 static VOID ixheaacd_local_imdet(
858     WORD32 *x1, WORD32 *x2, WORD32 *const scale1, WORD32 const val, WORD32 *z_real,
859     WORD32 *z_imag, const ia_mps_dec_mdct2qmf_cos_table_struct *ia_mps_dec_mdct2qmfcos_tab,
860     WORD32 is_long, VOID *scratch) {
861   WORD32 lw = val << 1;
862   WORD32 offset = val - (val >> 1);
863 
864   WORD32 temp_1, temp3, temp_2;
865   WORD32 *z_real_2, *z_imag_2;
866   WORD32 *px1, *px2, *px3, *px4;
867   const WORD16 *cp, *sp;
868   WORD32 *scale;
869   WORD32 cnt = val + (val >> 1);
870 
871   WORD32 k;
872   WORD32 n, j;
873 
874   WORD32 l;
875 
876   WORD32 *p_sum = scratch;
877   WORD32 *p_diff =
878       (WORD32 *)scratch + IXHEAAC_GET_SIZE_ALIGNED_TYPE(SUM_SIZE, sizeof(*p_diff), BYTE_ALIGN_8);
879 
880   z_real_2 = z_real + lw;
881   z_imag_2 = z_imag + lw;
882 
883   for (l = 0; l < LOOP_COUNTER; l++) {
884     WORD32 *sum = p_sum;
885     WORD32 *diff = p_diff;
886 
887     px1 = x1;
888     px2 = x2 + val - 1;
889     px3 = x2 + val;
890     px4 = x1 + 2 * val - 1;
891 
892     for (n = 0; n < val; n++) {
893       *sum++ = *px1 + *px2;
894       *sum++ = *px3 + *px4;
895       *diff++ = *px1++ - *px2--;
896       *diff++ = *px3++ - *px4--;
897     }
898 
899     scale = scale1;
900     for (k = 0; k < cnt; k++) {
901       if (1 == is_long) {
902         cp = ia_mps_dec_mdct2qmfcos_tab->cos_table_long[k];
903         sp = cp + val;
904       } else {
905         cp = ia_mps_dec_mdct2qmfcos_tab->cos_table_short[k + is_long];
906         sp = cp + val;
907       }
908 
909       sum = p_sum;
910       diff = p_diff;
911 
912       temp_1 = *cp++;
913       temp_2 = ixheaacd_mps_mult32_shr_15(temp_1, *sum);
914       sum++;
915       *z_real = temp_2;
916 
917       temp_2 = ixheaacd_mps_mult32_shr_15(temp_1, *sum);
918       sum++;
919       *z_real_2 = temp_2;
920 
921       temp_1 = *--sp;
922       temp_2 = ixheaacd_mps_mult32_shr_15(temp_1, *diff);
923       diff++;
924       *z_imag = temp_2;
925 
926       temp_2 = ixheaacd_mps_mult32_shr_15(temp_1, *diff);
927       diff++;
928       *z_imag_2 = temp_2;
929       for (n = 1; n < val; n++) {
930         temp_1 = *cp++;
931         temp_2 = ixheaacd_mps_mult32_shr_15(temp_1, *sum);
932         sum++;
933         *z_real += temp_2;
934 
935         temp_2 = ixheaacd_mps_mult32_shr_15(temp_1, *sum);
936         sum++;
937         *z_real_2 += temp_2;
938 
939         temp_1 = *--sp;
940         temp_2 = ixheaacd_mps_mult32_shr_15(temp_1, *diff);
941         diff++;
942         *z_imag += temp_2;
943 
944         temp_2 = ixheaacd_mps_mult32_shr_15(temp_1, *diff);
945         diff++;
946         *z_imag_2 += temp_2;
947       }
948       z_real++;
949       z_imag++;
950       z_real_2++;
951       z_imag_2++;
952     }
953     z_real -= cnt;
954     z_real_2 -= cnt;
955     z_imag -= cnt;
956     z_imag_2 -= cnt;
957 
958     for (j = 0; j < (cnt); j++) {
959       *z_real = ixheaacd_mps_mult32_shr_15(*z_real, *scale);
960       z_real++;
961       *z_imag = ixheaacd_mps_mult32_shr_15(*z_imag, *scale);
962       z_imag++;
963       *z_real_2 = ixheaacd_mps_mult32_shr_15(*z_real_2, *scale);
964       z_real_2++;
965       *z_imag_2 = ixheaacd_mps_mult32_shr_15(*z_imag_2, *scale);
966       scale++;
967       z_imag_2++;
968     }
969 
970     for (; k < lw; k++) {
971       if (1 == is_long) {
972         cp = ia_mps_dec_mdct2qmfcos_tab->cos_table_long[k];
973         sp = cp + val;
974       } else {
975         cp = ia_mps_dec_mdct2qmfcos_tab->cos_table_short[k + is_long];
976         sp = cp + val;
977       }
978 
979       sum = p_sum;
980       diff = p_diff;
981 
982       temp_1 = *cp++;
983 
984       temp3 = ixheaacd_mps_mult32_shr_15(temp_1, *sum);
985       sum++;
986       *z_real = temp3;
987 
988       temp3 = ixheaacd_mps_mult32_shr_15(temp_1, *sum);
989       sum++;
990       *z_real_2 = temp3;
991 
992       temp_1 = *--sp;
993       temp3 = ixheaacd_mps_mult32_shr_15(temp_1, *diff);
994       diff++;
995       *z_imag = temp3;
996 
997       temp3 = ixheaacd_mps_mult32_shr_15(temp_1, *diff);
998       diff++;
999       *z_imag_2 = temp3;
1000 
1001       for (n = 1; n < val; n++) {
1002         temp_1 = *cp++;
1003         temp3 = ixheaacd_mps_mult32_shr_15(temp_1, *sum);
1004         sum++;
1005         *z_real += temp3;
1006 
1007         temp3 = ixheaacd_mps_mult32_shr_15(temp_1, *sum);
1008         sum++;
1009         *z_real_2 += temp3;
1010 
1011         temp_1 = *--sp;
1012         temp3 = ixheaacd_mps_mult32_shr_15(temp_1, *diff);
1013         diff++;
1014         *z_imag += temp3;
1015 
1016         temp3 = ixheaacd_mps_mult32_shr_15(temp_1, *diff);
1017         diff++;
1018         *z_imag_2 += temp3;
1019       }
1020 
1021       z_real++;
1022       z_imag++;
1023       z_real_2++;
1024       z_imag_2++;
1025     }
1026     z_real -= offset;
1027     z_real_2 -= offset;
1028     z_imag -= offset;
1029     z_imag_2 -= offset;
1030 
1031     for (j = 0; j < (offset); j++) {
1032       temp_1 = (*scale++) * -1;
1033       *z_real = ixheaacd_mps_mult32_shr_15(*z_real, temp_1);
1034       z_real++;
1035       *z_imag = ixheaacd_mps_mult32_shr_15(*z_imag, temp_1);
1036       z_imag++;
1037       *z_real_2 = ixheaacd_mps_mult32_shr_15(*z_real_2, temp_1);
1038       z_real_2++;
1039       *z_imag_2 = ixheaacd_mps_mult32_shr_15(*z_imag_2, temp_1);
1040       z_imag_2++;
1041     }
1042 
1043     x1 += lw;
1044     x2 += lw;
1045 
1046     z_real += lw;
1047     z_imag += lw;
1048     z_imag_2 += lw;
1049     z_real_2 += lw;
1050   }
1051 }
1052 
ixheaacd_local_hybcmdct2qmf(WORD32 * const v_main,WORD32 * const v_slave,WORD32 * const w,WORD32 const lw,WORD32 * z_real,WORD32 * z_imag,const ia_mps_dec_mdct2qmf_cos_table_struct * ia_mps_dec_mdct2qmfcos_tab,VOID * scratch,WORD32 is_long)1053 static VOID ixheaacd_local_hybcmdct2qmf(
1054     WORD32 *const v_main, WORD32 *const v_slave, WORD32 *const w, WORD32 const lw, WORD32 *z_real,
1055     WORD32 *z_imag, const ia_mps_dec_mdct2qmf_cos_table_struct *ia_mps_dec_mdct2qmfcos_tab,
1056     VOID *scratch, WORD32 is_long) {
1057   WORD32 i, start = 0;
1058   WORD32 m = lw >> 1;
1059 
1060   switch (lw) {
1061     case TSX2_4:
1062     case TSX2_6:
1063     case TSX2_30:
1064     case TSX2_36:
1065     case TSX2_60:
1066       start = 1;
1067       break;
1068 
1069     case TSX2_8:
1070     case TSX2_32:
1071     case TSX2_48:
1072     case TSX2_64:
1073       start = 0;
1074       break;
1075 
1076     default:
1077       break;
1078   }
1079 
1080   ixheaacd_local_imdet(v_slave, v_main, w, m, z_real, z_imag, ia_mps_dec_mdct2qmfcos_tab, is_long,
1081                        scratch);
1082 
1083   for (i = start; i < (m << 7); i += 2) {
1084     z_imag[i] = -(z_imag[i]);
1085   }
1086 
1087   return;
1088 }
1089 
ixheaacd_local_p_zero_ts15(WORD32 * const b,WORD32 * src,WORD32 l)1090 static VOID ixheaacd_local_p_zero_ts15(WORD32 *const b, WORD32 *src, WORD32 l) {
1091   WORD32 i;
1092 
1093   for (i = 0; i < 15; i++) {
1094     b[i] = *src++;
1095   }
1096   if (l != 15) {
1097     src--;
1098     for (; i < l; i++) {
1099       b[i] = *--src;
1100     }
1101   }
1102 }
1103 
ixheaacd_local_p_nonzero(WORD32 * const b,WORD32 * src,WORD32 l)1104 static VOID ixheaacd_local_p_nonzero(WORD32 *const b, WORD32 *src, WORD32 l) {
1105   WORD32 i;
1106 
1107   for (i = 0; i < l; i++) {
1108     b[i] = *src--;
1109   }
1110 }
1111 
ixheaacd_local_p_zero(WORD32 * const b,WORD32 * src,WORD32 l,WORD32 upd_qmf)1112 static VOID ixheaacd_local_p_zero(WORD32 *const b, WORD32 *src, WORD32 l, WORD32 upd_qmf) {
1113   WORD32 i;
1114 
1115   for (i = 0; i < upd_qmf; i++) {
1116     b[i] = *src++;
1117   }
1118   if (l != upd_qmf) {
1119     for (; i < l; i++) {
1120       b[i] = *--src;
1121     }
1122   }
1123 }
1124 
ixheaacd_local_sin(WORD32 const t,WORD32 const p,WORD32 const l,WORD32 * const b,ia_mps_dec_mdct2qmf_table_struct * mdct2qmf_tab)1125 static VOID ixheaacd_local_sin(WORD32 const t, WORD32 const p, WORD32 const l, WORD32 *const b,
1126                                ia_mps_dec_mdct2qmf_table_struct *mdct2qmf_tab) {
1127   WORD32 *sin_ptr;
1128 
1129   switch (t) {
1130     case TS_2:
1131       switch (p) {
1132         case ZERO:
1133           b[0] = 12540;
1134           b[1] = 30274;
1135           if (l == TSX2_4) {
1136             b[2] = b[1];
1137             b[3] = b[0];
1138           }
1139           break;
1140         case TS_2:
1141           b[0] = 30274;
1142           b[1] = 12540;
1143           break;
1144         default:
1145           break;
1146       }
1147       break;
1148     case TS_4:
1149       switch (p) {
1150         case ZERO:
1151           sin_ptr = mdct2qmf_tab->local_sin_4;
1152           b[0] = *sin_ptr++;
1153           b[1] = *sin_ptr++;
1154           b[2] = *sin_ptr++;
1155           b[3] = *sin_ptr;
1156           if (l == TSX2_8) {
1157             b[4] = *sin_ptr--;
1158             b[5] = *sin_ptr--;
1159             b[6] = *sin_ptr--;
1160             b[7] = *sin_ptr;
1161           }
1162           break;
1163         case TS_4:
1164           sin_ptr = &(mdct2qmf_tab->local_sin_4[TS_MINUS_ONE_4]);
1165           b[0] = *sin_ptr--;
1166           b[1] = *sin_ptr--;
1167           b[2] = *sin_ptr--;
1168           b[3] = *sin_ptr;
1169           break;
1170         default:
1171           break;
1172       }
1173       break;
1174     case UPD_QMF_15:
1175       switch (p) {
1176         case ZERO:
1177           sin_ptr = &(mdct2qmf_tab->local_sin_15[1]);
1178           ixheaacd_local_p_zero_ts15(b, sin_ptr, l);
1179           break;
1180         case UPD_QMF_15:
1181           sin_ptr = &(mdct2qmf_tab->local_sin_15[TS_MINUS_ONE_15]);
1182           ixheaacd_local_p_nonzero(b, sin_ptr, l);
1183           break;
1184         default:
1185           break;
1186       }
1187       break;
1188     case UPD_QMF_16:
1189       switch (p) {
1190         case ZERO:
1191           sin_ptr = mdct2qmf_tab->local_sin_16;
1192           ixheaacd_local_p_zero(b, sin_ptr, l, UPD_QMF_16);
1193           break;
1194         case UPD_QMF_16:
1195           sin_ptr = &(mdct2qmf_tab->local_sin_16[TS_MINUS_ONE_16]);
1196           ixheaacd_local_p_nonzero(b, sin_ptr, l);
1197           break;
1198         default:
1199           break;
1200       }
1201       break;
1202     case UPD_QMF_18:
1203       switch (p) {
1204         case ZERO:
1205           sin_ptr = mdct2qmf_tab->local_sin_18;
1206           ixheaacd_local_p_zero(b, sin_ptr, l, UPD_QMF_18);
1207           break;
1208         case UPD_QMF_18:
1209           sin_ptr = &(mdct2qmf_tab->local_sin_18[TS_MINUS_ONE_18]);
1210           ixheaacd_local_p_nonzero(b, sin_ptr, l);
1211           break;
1212         default:
1213           break;
1214       }
1215       break;
1216     case UPD_QMF_24:
1217       switch (p) {
1218         case ZERO:
1219           sin_ptr = mdct2qmf_tab->local_sin_24;
1220           ixheaacd_local_p_zero(b, sin_ptr, l, UPD_QMF_24);
1221           break;
1222         case UPD_QMF_24:
1223           sin_ptr = &(mdct2qmf_tab->local_sin_24[TS_MINUS_ONE_24]);
1224           ixheaacd_local_p_nonzero(b, sin_ptr, l);
1225           break;
1226         default:
1227           break;
1228       }
1229       break;
1230     case UPD_QMF_30:
1231       switch (p) {
1232         case ZERO:
1233           sin_ptr = mdct2qmf_tab->local_sin_30;
1234           ixheaacd_local_p_zero(b, sin_ptr, l, UPD_QMF_30);
1235           break;
1236         case UPD_QMF_30:
1237           sin_ptr = &(mdct2qmf_tab->local_sin_30[TS_MINUS_ONE_30]);
1238           ixheaacd_local_p_nonzero(b, sin_ptr, l);
1239           break;
1240         default:
1241           break;
1242       }
1243       break;
1244     case UPD_QMF_32:
1245       switch (p) {
1246         case ZERO:
1247           sin_ptr = mdct2qmf_tab->local_sin_32;
1248           ixheaacd_local_p_zero(b, sin_ptr, l, UPD_QMF_32);
1249           break;
1250         case UPD_QMF_32:
1251           sin_ptr = &(mdct2qmf_tab->local_sin_32[TS_MINUS_ONE_32]);
1252           ixheaacd_local_p_nonzero(b, sin_ptr, l);
1253 
1254           break;
1255         default:
1256           break;
1257       }
1258       break;
1259     default:
1260       break;
1261   }
1262   return;
1263 }
1264 
ixheaacd_local_one(WORD32 const l,WORD32 * const b)1265 static VOID ixheaacd_local_one(WORD32 const l, WORD32 *const b) {
1266   WORD32 i;
1267 
1268   for (i = 0; i < l; i++) {
1269     b[i] = ONE_IN_Q15;
1270   }
1271 }
1272 
ixheaacd_local_freq_win(WORD32 const l,WORD32 * const b,const WORD32 ** wf)1273 static VOID ixheaacd_local_freq_win(WORD32 const l, WORD32 *const b, const WORD32 **wf) {
1274   WORD32 i;
1275   WORD32 odd_length = (l & ONE_BIT_MASK);
1276   WORD32 temp_1;
1277   WORD32 *b_start, *b_end;
1278   b_start = b;
1279   b_end = b + 2 * l - 1 - odd_length;
1280 
1281   for (i = 0; i < l - odd_length; i++) {
1282     temp_1 = wf[l - 1][i];
1283     *b_start++ = temp_1;
1284     *b_end-- = temp_1;
1285   }
1286 
1287   if (odd_length == 1) {
1288     *b_start = wf[l - 1][l - 1];
1289     *(b_start + l) = 0;
1290   }
1291 }
1292 
ixheaacd_local_mdct_win(WORD32 upd_qmf,WORD32 const window_type,WORD32 * const wf,WORD32 const ** wf_tab,WORD32 * const wt,ia_mps_dec_mdct2qmf_table_struct * mdct2qmf_tab)1293 static VOID ixheaacd_local_mdct_win(WORD32 upd_qmf, WORD32 const window_type, WORD32 *const wf,
1294                                     WORD32 const **wf_tab, WORD32 *const wt,
1295                                     ia_mps_dec_mdct2qmf_table_struct *mdct2qmf_tab) {
1296   WORD32 length = 0;
1297   WORD32 length_right = 0;
1298   WORD32 length_left = 0;
1299   WORD32 length_const1 = 0;
1300   WORD32 length_const2 = 0;
1301 
1302   switch (window_type) {
1303     case ONLY_LONG_SEQUENCE:
1304       length = upd_qmf;
1305       ixheaacd_local_sin(upd_qmf, 0, (length << 1), &wt[0], mdct2qmf_tab);
1306       break;
1307     case LONG_START_SEQUENCE:
1308       switch (upd_qmf) {
1309         case UPD_QMF_15:
1310           length_const1 = 6;
1311           length_const2 = 7;
1312           length_right = 2;
1313           break;
1314         case UPD_QMF_16:
1315         case UPD_QMF_32:
1316           length_const1 = 7 * (upd_qmf >> 4);
1317           length_const2 = length_const1;
1318           length_right = upd_qmf >> 3;
1319           break;
1320         case UPD_QMF_18:
1321           length_const1 = 8;
1322           length_const2 = length_const1;
1323           length_right = 2;
1324           break;
1325         case UPD_QMF_24:
1326           length_const1 = 11;
1327           length_const2 = length_const1;
1328           length_right = 2;
1329           break;
1330         case UPD_QMF_30:
1331           length_const1 = 14;
1332           length_const2 = length_const1;
1333           length_right = 2;
1334           break;
1335         default:
1336           length_const1 = 6;
1337           length_const2 = 7;
1338           length_right = 2;
1339           break;
1340       }
1341 
1342       ixheaacd_local_sin(upd_qmf, 0, upd_qmf, &wt[0], mdct2qmf_tab);
1343       ixheaacd_local_one(length_const1, &wt[upd_qmf]);
1344       ixheaacd_local_sin(length_right, length_right, length_right, &wt[upd_qmf + length_const1],
1345                          mdct2qmf_tab);
1346 
1347       ixheaacd_local_zero(length_const2, &wt[upd_qmf + length_const1 + length_right]);
1348       length = upd_qmf;
1349       break;
1350     case EIGHT_SHORT_SEQUENCE:
1351       switch (upd_qmf) {
1352         case UPD_QMF_16:
1353         case UPD_QMF_32:
1354           length = upd_qmf >> 3;
1355           break;
1356         case UPD_QMF_15:
1357         case UPD_QMF_18:
1358         case UPD_QMF_30:
1359         case UPD_QMF_24:
1360           length = 2;
1361           break;
1362         default:
1363           break;
1364       }
1365       ixheaacd_local_sin(length, 0, 2 * length, &wt[0], mdct2qmf_tab);
1366       break;
1367     case LONG_STOP_SEQUENCE:
1368       switch (upd_qmf) {
1369         case UPD_QMF_15:
1370           length_const1 = 6;
1371           length_const2 = 7;
1372           length_left = 2;
1373           break;
1374         case UPD_QMF_16:
1375         case UPD_QMF_32:
1376           length_const1 = 7 * (upd_qmf >> 4);
1377           length_const2 = length_const1;
1378           length_left = upd_qmf >> 3;
1379           break;
1380         case UPD_QMF_18:
1381           length_const1 = 8;
1382           length_const2 = length_const1;
1383           length_left = 2;
1384           break;
1385         case UPD_QMF_24:
1386           length_const1 = 11;
1387           length_const2 = length_const1;
1388           length_left = 2;
1389           break;
1390         case UPD_QMF_30:
1391           length_const1 = 14;
1392           length_const2 = length_const1;
1393           length_left = 2;
1394           break;
1395         default:
1396           break;
1397       }
1398 
1399       ixheaacd_local_zero(length_const1, &wt[0]);
1400       ixheaacd_local_sin(length_left, 0, length_left, &wt[length_const1], mdct2qmf_tab);
1401       ixheaacd_local_one(length_const2, &wt[length_const1 + length_left]);
1402       ixheaacd_local_sin(upd_qmf, upd_qmf, upd_qmf,
1403                          &wt[length_const1 + length_left + length_const2], mdct2qmf_tab);
1404       length = upd_qmf;
1405       break;
1406     default:
1407       break;
1408   }
1409 
1410   ixheaacd_local_freq_win(length, &wf[0], wf_tab);
1411 
1412   if ((upd_qmf == UPD_QMF_15) && (window_type == EIGHT_SHORT_SEQUENCE)) {
1413     WORD32 length2 = 3;
1414 
1415     ixheaacd_local_sin(length, 0, length, &wt[(length << 1)], mdct2qmf_tab);
1416     ixheaacd_local_one(1, &wt[3 * length]);
1417     ixheaacd_local_sin(length, length, length, &wt[3 * length + 1], mdct2qmf_tab);
1418     ixheaacd_local_zero(1, &wt[(length << 2) + 1]);
1419 
1420     ixheaacd_local_freq_win(length2, &wf[(length << 1)], wf_tab);
1421   }
1422   return;
1423 }
1424 
ixheaacd_get_gain(WORD32 l,WORD32 * gain)1425 static VOID ixheaacd_get_gain(WORD32 l, WORD32 *gain) {
1426   switch (l) {
1427     case TSX2_4:
1428       *gain = 16384;
1429       break;
1430 
1431     case TSX2_6:
1432       *gain = 13377;
1433       break;
1434 
1435     case TSX2_8:
1436       *gain = 11585;
1437       break;
1438 
1439     case TSX2_30:
1440       *gain = 5982;
1441       break;
1442 
1443     case TSX2_32:
1444       *gain = 5792;
1445       break;
1446 
1447     case TSX2_36:
1448       *gain = 5461;
1449       break;
1450 
1451     case TSX2_48:
1452       *gain = 4729;
1453       break;
1454 
1455     case TSX2_60:
1456       *gain = 4230;
1457       break;
1458 
1459     case TSX2_64:
1460       *gain = 4096;
1461       break;
1462 
1463     default:
1464       break;
1465   }
1466 
1467   return;
1468 }
1469 
ixheaacd_mdct2qmf_process(WORD32 upd_qmf,WORD32 * const mdct_in,WORD32 * qmf_real_pre,WORD32 * qmf_real_post,WORD32 * qmf_imag_pre,WORD32 * qmf_imag_post,WORD32 const window_type,WORD32 qmf_global_offset,ia_mps_dec_mps_tables_struct * ia_mps_dec_mps_table_ptr,VOID * scratch,WORD32 time_slots)1470 VOID ixheaacd_mdct2qmf_process(WORD32 upd_qmf, WORD32 *const mdct_in, WORD32 *qmf_real_pre,
1471                                WORD32 *qmf_real_post, WORD32 *qmf_imag_pre, WORD32 *qmf_imag_post,
1472                                WORD32 const window_type, WORD32 qmf_global_offset,
1473                                ia_mps_dec_mps_tables_struct *ia_mps_dec_mps_table_ptr,
1474                                VOID *scratch, WORD32 time_slots) {
1475   WORD32 i;
1476   WORD32 j;
1477   WORD32 k;
1478 
1479   WORD32 l = (upd_qmf << 1);
1480 
1481   WORD32 n = 0;
1482   WORD32 *wf;
1483   WORD32 *wt;
1484 
1485   WORD32 *v1;
1486   WORD32 *v2;
1487 
1488   WORD32 *z1_real;
1489   WORD32 *z1_imag;
1490 
1491   WORD32 *twipost_real;
1492   WORD32 *twipost_imag;
1493 
1494   WORD32 *mdct_sf, *mdct_sf_ptr;
1495   WORD32 *mdct_p, *mdct_p2;
1496 
1497   WORD32 temp_2, temp3, temp4;
1498 
1499   WORD32 *p_qmf_real_pre = qmf_real_pre;
1500   WORD32 *p_qmf_real_post = qmf_real_post;
1501   WORD32 *p_qmf_imag_pre = qmf_imag_pre;
1502   WORD32 *p_qmf_imag_post = qmf_imag_post;
1503 
1504   VOID *free_scratch;
1505 
1506   WORD32 const **wf_tab = ia_mps_dec_mps_table_ptr->wf_tab_ptr->wf;
1507 
1508   WORD32 window_offset = 0;
1509 
1510   WORD32 mdct_offset = 0;
1511   WORD32 mdct_shift = AAC_SHORT_FRAME_LENGTH;
1512 
1513   WORD32 qmf_offset = 0;
1514   WORD32 qmf_shift = 0;
1515 
1516   WORD32 n_windows = 0;
1517 
1518   WORD32 mdct_length = MDCT_LENGTH_LO;
1519 
1520   WORD32 qmf_bands = 64;
1521   const WORD32 *ptr1, *ptr2;
1522   WORD32 is_long;
1523   WORD32 *zr, *zi;
1524 
1525   WORD32 *a, *scale;
1526   WORD32 gain = 0;
1527   WORD32 *wp;
1528 
1529   wf = scratch;
1530   wt = wf + IXHEAAC_GET_SIZE_ALIGNED_TYPE(MAX_TIMESLOTSX2, sizeof(*wt), BYTE_ALIGN_8);
1531   v1 = wt + IXHEAAC_GET_SIZE_ALIGNED_TYPE(MAX_TIMESLOTSX2, sizeof(*v1), BYTE_ALIGN_8);
1532   v2 = v1 + IXHEAAC_GET_SIZE_ALIGNED_TYPE(MDCT_LENGTH_HI, sizeof(*v2), BYTE_ALIGN_8);
1533   twipost_real =
1534       v2 + IXHEAAC_GET_SIZE_ALIGNED_TYPE(MDCT_LENGTH_HI, sizeof(*twipost_real), BYTE_ALIGN_8);
1535   twipost_imag = twipost_real + IXHEAAC_GET_SIZE_ALIGNED_TYPE(
1536                                     MAX_NUM_QMF_BANDS, sizeof(*twipost_imag), BYTE_ALIGN_8);
1537   mdct_sf = twipost_imag +
1538             IXHEAAC_GET_SIZE_ALIGNED_TYPE(MAX_NUM_QMF_BANDS, sizeof(*mdct_sf), BYTE_ALIGN_8);
1539   z1_real =
1540       mdct_sf + IXHEAAC_GET_SIZE_ALIGNED_TYPE(MDCT_LENGTH_SF, sizeof(*z1_real), BYTE_ALIGN_8);
1541   z1_imag = z1_real + IXHEAAC_GET_SIZE_ALIGNED_TYPE(QBXTSX2, sizeof(*z1_imag), BYTE_ALIGN_8);
1542   a = z1_imag + IXHEAAC_GET_SIZE_ALIGNED_TYPE(QBXTSX2, sizeof(*a), BYTE_ALIGN_8);
1543   free_scratch = (VOID *)((WORD32 *)a + IXHEAAC_GET_SIZE_ALIGNED_TYPE(MAX_NUM_QMF_BANDS,
1544                                                                       sizeof(*a), BYTE_ALIGN_8));
1545 
1546   scale = a;
1547 
1548   ixheaacd_local_mdct_win(upd_qmf, window_type, wf, wf_tab, wt,
1549                           ia_mps_dec_mps_table_ptr->mdct2qmf_table_ptr);
1550 
1551   switch (window_type) {
1552     case ONLY_LONG_SEQUENCE:
1553     case LONG_START_SEQUENCE:
1554     case LONG_STOP_SEQUENCE:
1555 
1556       n = upd_qmf * qmf_bands - MDCT_LENGTH_LO;
1557 
1558       if (n > 0) {
1559         ixheaacd_local_zero(n, &mdct_in[MDCT_LENGTH_LO]);
1560       }
1561       mdct_length += n;
1562 
1563       ixheaacd_local_fold_out(mdct_in, mdct_length, wf, l, v1, v2);
1564 
1565       wp = wt;
1566 
1567       ixheaacd_get_gain(l, &gain);
1568 
1569       for (k = 0; k < l; k++) {
1570         *scale++ = ixheaacd_mps_mult32_shr_15(gain, *wp);
1571         wp++;
1572       }
1573       ixheaacd_local_hybcmdct2qmf(v1, v2, a, l, z1_real, z1_imag,
1574                                   ia_mps_dec_mps_table_ptr->mdct2qmfcos_tab_ptr, free_scratch, 1);
1575 
1576       ptr1 = ia_mps_dec_mps_table_ptr->mdct2qmf_table_ptr->twi_post_cos;
1577       ptr2 = ia_mps_dec_mps_table_ptr->mdct2qmf_table_ptr->twi_post_sin;
1578 
1579       if (qmf_global_offset < time_slots) {
1580         if (qmf_global_offset + l < time_slots) {
1581           for (i = 0; i < qmf_bands; i++) {
1582             WORD32 cos_twi = *ptr1++;
1583             WORD32 sin_twi = *ptr2++;
1584             for (j = 0; j < l; j++) {
1585               temp3 = *z1_real++;
1586               temp4 = *z1_imag++;
1587 
1588               temp_2 = j + qmf_global_offset;
1589               p_qmf_real_pre[temp_2] += cos_twi * temp3;
1590               p_qmf_real_pre[temp_2] -= sin_twi * temp4;
1591               p_qmf_imag_pre[temp_2] += cos_twi * temp4;
1592               p_qmf_imag_pre[temp_2] += sin_twi * temp3;
1593             }
1594             p_qmf_real_pre += MAX_TIME_SLOTS;
1595             p_qmf_imag_pre += MAX_TIME_SLOTS;
1596           }
1597         } else {
1598           for (i = 0; i < qmf_bands; i++) {
1599             WORD32 cos_twi = *ptr1++;
1600             WORD32 sin_twi = *ptr2++;
1601             for (j = 0; j < l; j++) {
1602               temp3 = *z1_real++;
1603               temp4 = *z1_imag++;
1604 
1605               temp_2 = j + qmf_global_offset;
1606               if (temp_2 < time_slots) {
1607                 p_qmf_real_pre[temp_2] += cos_twi * temp3;
1608                 p_qmf_real_pre[temp_2] -= sin_twi * temp4;
1609                 p_qmf_imag_pre[temp_2] += cos_twi * temp4;
1610                 p_qmf_imag_pre[temp_2] += sin_twi * temp3;
1611               } else {
1612                 p_qmf_real_post[temp_2 - time_slots] += cos_twi * temp3;
1613                 p_qmf_real_post[temp_2 - time_slots] -= sin_twi * temp4;
1614                 p_qmf_imag_post[temp_2 - time_slots] += cos_twi * temp4;
1615                 p_qmf_imag_post[temp_2 - time_slots] += sin_twi * temp3;
1616               }
1617             }
1618             p_qmf_real_pre += MAX_TIME_SLOTS;
1619             p_qmf_real_post += MAX_TIME_SLOTS;
1620 
1621             p_qmf_imag_pre += MAX_TIME_SLOTS;
1622             p_qmf_imag_post += MAX_TIME_SLOTS;
1623           }
1624         }
1625       } else {
1626         for (i = 0; i < qmf_bands; i++) {
1627           WORD32 cos_twi = *ptr1++;
1628           WORD32 sin_twi = *ptr2++;
1629           for (j = 0; j < l; j++) {
1630             temp3 = *z1_real++;
1631             temp4 = *z1_imag++;
1632 
1633             temp_2 = j + qmf_global_offset;
1634 
1635             p_qmf_real_post[temp_2 - time_slots] += cos_twi * temp3;
1636             p_qmf_real_post[temp_2 - time_slots] -= sin_twi * temp4;
1637             p_qmf_imag_post[temp_2 - time_slots] += cos_twi * temp4;
1638             p_qmf_imag_post[temp_2 - time_slots] += sin_twi * temp3;
1639           }
1640           p_qmf_real_post += MAX_TIME_SLOTS;
1641           p_qmf_imag_post += MAX_TIME_SLOTS;
1642         }
1643       }
1644       break;
1645     case EIGHT_SHORT_SEQUENCE:
1646 
1647       switch (upd_qmf) {
1648         case UPD_QMF_15:
1649           l = 4;
1650           mdct_length = AAC_SHORT_FRAME_LENGTH;
1651           qmf_offset = 6;
1652           qmf_shift = 2;
1653           n_windows = 7;
1654           break;
1655         case UPD_QMF_16:
1656         case UPD_QMF_32:
1657           n = (upd_qmf - UPD_QMF_16) * 8;
1658           mdct_length = AAC_SHORT_FRAME_LENGTH + n;
1659           l = 2 * (upd_qmf >> 3);
1660           qmf_offset = 7 * upd_qmf >> 4;
1661           qmf_shift = upd_qmf >> 3;
1662           n_windows = 8;
1663           break;
1664         case UPD_QMF_18:
1665           l = 4;
1666           mdct_length = AAC_SHORT_FRAME_LENGTH;
1667           qmf_offset = 8;
1668           qmf_shift = 2;
1669           n_windows = 9;
1670           break;
1671         case UPD_QMF_24:
1672           l = 4;
1673           mdct_length = AAC_SHORT_FRAME_LENGTH;
1674           qmf_offset = 11;
1675           qmf_shift = 2;
1676           n_windows = 12;
1677           break;
1678         case UPD_QMF_30:
1679           l = 4;
1680           mdct_length = AAC_SHORT_FRAME_LENGTH;
1681           qmf_offset = 14;
1682           qmf_shift = 2;
1683           n_windows = 15;
1684           break;
1685         default:
1686           l = 4;
1687           mdct_length = AAC_SHORT_FRAME_LENGTH;
1688           qmf_offset = 6;
1689           qmf_shift = 2;
1690           n_windows = 7;
1691           break;
1692       }
1693 
1694       wp = wt;
1695       ixheaacd_get_gain(l, &gain);
1696 
1697       for (k = 0; k < l; k++) {
1698         *scale++ = ixheaacd_mps_mult32_shr_15(gain, *wp);
1699         wp++;
1700       }
1701 
1702       for (k = 0; k < n_windows; k++) {
1703         is_long = 0;
1704         mdct_sf_ptr = mdct_sf;
1705         switch (upd_qmf) {
1706           case UPD_QMF_16:
1707           case UPD_QMF_32:
1708             mdct_p = mdct_in + mdct_offset;
1709             for (i = 0; i < AAC_SHORT_FRAME_LENGTH; i++) {
1710               *mdct_sf_ptr++ = *mdct_p++;
1711             }
1712 
1713             ixheaacd_local_zero(n, &mdct_sf[AAC_SHORT_FRAME_LENGTH]);
1714             break;
1715           case UPD_QMF_15:
1716             if (k < n_windows - 1) {
1717               mdct_p = mdct_in + mdct_offset;
1718               for (i = 0; i < AAC_SHORT_FRAME_LENGTH; i++) {
1719                 *mdct_sf_ptr++ = *mdct_p++;
1720               }
1721             } else {
1722               window_offset = l;
1723               l = 6;
1724               mdct_length = 192;
1725               is_long = 4;
1726               gain = 13377;
1727               scale = a;
1728               wp = wt + window_offset;
1729 
1730               for (k = 0; k < l; k++) {
1731                 *scale++ = ixheaacd_mps_mult32_shr_15(gain, *wp);
1732                 wp++;
1733               }
1734 
1735               mdct_p = mdct_in + mdct_offset;
1736               mdct_p2 = mdct_in + mdct_offset + AAC_SHORT_FRAME_LENGTH;
1737 
1738               for (i = 0, j = 0; i < mdct_length / 2; i++) {
1739                 *mdct_sf_ptr++ = *mdct_p++;
1740                 *mdct_sf_ptr++ = *mdct_p2++;
1741               }
1742             }
1743             break;
1744           case UPD_QMF_18:
1745           case UPD_QMF_24:
1746           case UPD_QMF_30:
1747 
1748             mdct_p = mdct_in + mdct_offset;
1749             for (i = 0; i < AAC_SHORT_FRAME_LENGTH; i++) {
1750               *mdct_sf_ptr++ = *mdct_p++;
1751             }
1752             break;
1753           default:
1754             break;
1755         }
1756         ixheaacd_local_fold_out(mdct_sf, mdct_length, &wf[window_offset], l, v1, v2);
1757 
1758         ixheaacd_local_hybcmdct2qmf(v1, v2, a, l, z1_real, z1_imag,
1759                                     ia_mps_dec_mps_table_ptr->mdct2qmfcos_tab_ptr, free_scratch,
1760                                     is_long);
1761 
1762         zr = z1_real;
1763         zi = z1_imag;
1764 
1765         ptr1 = ia_mps_dec_mps_table_ptr->mdct2qmf_table_ptr->twi_post_cos;
1766         ptr2 = ia_mps_dec_mps_table_ptr->mdct2qmf_table_ptr->twi_post_sin;
1767         temp_2 = qmf_offset + qmf_global_offset;
1768 
1769         if (temp_2 < time_slots) {
1770           if ((temp_2 + l) < time_slots) {
1771             p_qmf_real_pre = qmf_real_pre;
1772             p_qmf_imag_pre = qmf_imag_pre;
1773 
1774             for (i = 0; i < qmf_bands; i++) {
1775               WORD32 cos_twi = *ptr1++;
1776               WORD32 sin_twi = *ptr2++;
1777 
1778               for (j = 0; j < l; j++) {
1779                 temp3 = *zr++;
1780                 temp4 = (*zi++);
1781 
1782                 p_qmf_real_pre[temp_2 + j] += cos_twi * temp3;
1783                 p_qmf_real_pre[temp_2 + j] -= sin_twi * temp4;
1784                 p_qmf_imag_pre[temp_2 + j] += cos_twi * temp4;
1785                 p_qmf_imag_pre[temp_2 + j] += sin_twi * temp3;
1786               }
1787               p_qmf_real_pre += MAX_TIME_SLOTS;
1788               p_qmf_imag_pre += MAX_TIME_SLOTS;
1789             }
1790           } else {
1791             p_qmf_real_pre = qmf_real_pre;
1792             p_qmf_real_post = qmf_real_post;
1793             p_qmf_imag_pre = qmf_imag_pre;
1794             p_qmf_imag_post = qmf_imag_post;
1795 
1796             for (i = 0; i < qmf_bands; i++) {
1797               WORD32 cos_twi = *ptr1++;
1798               WORD32 sin_twi = *ptr2++;
1799 
1800               for (j = 0; j < l; j++) {
1801                 temp3 = *zr++;
1802                 temp4 = (*zi++);
1803 
1804                 if ((temp_2 + j) < time_slots) {
1805                   p_qmf_real_pre[temp_2 + j] += cos_twi * temp3;
1806                   p_qmf_real_pre[temp_2 + j] -= sin_twi * temp4;
1807                   p_qmf_imag_pre[temp_2 + j] += cos_twi * temp4;
1808                   p_qmf_imag_pre[temp_2 + j] += sin_twi * temp3;
1809                 } else {
1810                   p_qmf_real_post[temp_2 + j - time_slots] += cos_twi * temp3;
1811                   p_qmf_real_post[temp_2 + j - time_slots] -= sin_twi * temp4;
1812                   p_qmf_imag_post[temp_2 + j - time_slots] += cos_twi * temp4;
1813                   p_qmf_imag_post[temp_2 + j - time_slots] += sin_twi * temp3;
1814                 }
1815               }
1816               p_qmf_real_pre += MAX_TIME_SLOTS;
1817               p_qmf_imag_pre += MAX_TIME_SLOTS;
1818 
1819               p_qmf_real_post += MAX_TIME_SLOTS;
1820               p_qmf_imag_post += MAX_TIME_SLOTS;
1821             }
1822           }
1823         } else {
1824           p_qmf_real_post = qmf_real_post;
1825           p_qmf_imag_post = qmf_imag_post;
1826 
1827           for (i = 0; i < qmf_bands; i++) {
1828             WORD32 cos_twi = *ptr1++;
1829             WORD32 sin_twi = *ptr2++;
1830 
1831             for (j = 0; j < l; j++) {
1832               temp3 = *zr++;
1833               temp4 = (*zi++);
1834               {
1835                 p_qmf_real_post[temp_2 + j - time_slots] += cos_twi * temp3;
1836                 p_qmf_real_post[temp_2 + j - time_slots] -= sin_twi * temp4;
1837                 p_qmf_imag_post[temp_2 + j - time_slots] += cos_twi * temp4;
1838                 p_qmf_imag_post[temp_2 + j - time_slots] += sin_twi * temp3;
1839               }
1840             }
1841             p_qmf_real_post += MAX_TIME_SLOTS;
1842             p_qmf_imag_post += MAX_TIME_SLOTS;
1843           }
1844         }
1845 
1846         mdct_offset += mdct_shift;
1847         qmf_offset += qmf_shift;
1848       }
1849       break;
1850     default:
1851       break;
1852   }
1853   return;
1854 }
1855