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 "ixheaacd_type_def.h"
21 #include "ixheaacd_mps_struct_def.h"
22 #include "ixheaacd_error_codes.h"
23 #include "ixheaacd_mps_res_rom.h"
24 #include "ixheaacd_mps_aac_struct.h"
25 #include "ixheaacd_constants.h"
26 #include "ixheaacd_bitbuffer.h"
27 #include "ixheaacd_common_rom.h"
28 #include "ixheaacd_sbrdecsettings.h"
29 #include "ixheaacd_sbr_scale.h"
30 #include "ixheaacd_env_extr_part.h"
31 #include "ixheaacd_sbr_rom.h"
32 #include "ixheaacd_hybrid.h"
33 #include "ixheaacd_ps_dec.h"
34 #include "ixheaacd_mps_polyphase.h"
35 #include "ixheaacd_error_standards.h"
36 #include "ixheaacd_config.h"
37 #include "ixheaacd_qmf_dec.h"
38 #include "ixheaacd_mps_dec.h"
39 #include "ixheaacd_mps_reshape_bb_env.h"
40
ixheaacd_get_ch_idx(ia_heaac_mps_state_struct * pstr_mps_state,WORD32 row,WORD32 * index)41 VOID ixheaacd_get_ch_idx(ia_heaac_mps_state_struct *pstr_mps_state, WORD32 row, WORD32 *index) {
42 switch (pstr_mps_state->temp_shape_config) {
43 case SHAPE_STP:
44 *index = pstr_mps_state->ia_mps_dec_mps_table.m1_m2_table_ptr->idx_table
45 .row_2_channel_stp[pstr_mps_state->tree_config][row];
46 break;
47 case SHAPE_GES:
48 *index = pstr_mps_state->ia_mps_dec_mps_table.m1_m2_table_ptr->idx_table
49 .row_2_channel_ges[pstr_mps_state->tree_config][row];
50 break;
51 default:
52 break;
53 }
54
55 return;
56 }
57
ixheaacd_get_res_idx(ia_heaac_mps_state_struct * pstr_mps_state,WORD32 row)58 WORD32 ixheaacd_get_res_idx(ia_heaac_mps_state_struct *pstr_mps_state, WORD32 row) {
59 return pstr_mps_state->ia_mps_dec_mps_table.m1_m2_table_ptr->idx_table
60 .row_2_residual[pstr_mps_state->tree_config][row];
61 }
62