xref: /aosp_15_r20/external/libxaac/decoder/ixheaacd_mps_get_index.c (revision 15dc779a375ca8b5125643b829a8aa4b70d7f451)
1*15dc779aSAndroid Build Coastguard Worker /******************************************************************************
2*15dc779aSAndroid Build Coastguard Worker  *
3*15dc779aSAndroid Build Coastguard Worker  * Copyright (C) 2023 The Android Open Source Project
4*15dc779aSAndroid Build Coastguard Worker  *
5*15dc779aSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
6*15dc779aSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
7*15dc779aSAndroid Build Coastguard Worker  * You may obtain a copy of the License at:
8*15dc779aSAndroid Build Coastguard Worker  *
9*15dc779aSAndroid Build Coastguard Worker  * http://www.apache.org/licenses/LICENSE-2.0
10*15dc779aSAndroid Build Coastguard Worker  *
11*15dc779aSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
12*15dc779aSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
13*15dc779aSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*15dc779aSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
15*15dc779aSAndroid Build Coastguard Worker  * limitations under the License.
16*15dc779aSAndroid Build Coastguard Worker  *
17*15dc779aSAndroid Build Coastguard Worker  *****************************************************************************
18*15dc779aSAndroid Build Coastguard Worker  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19*15dc779aSAndroid Build Coastguard Worker */
20*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_type_def.h"
21*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_mps_struct_def.h"
22*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_error_codes.h"
23*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_mps_res_rom.h"
24*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_mps_aac_struct.h"
25*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_constants.h"
26*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_bitbuffer.h"
27*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_common_rom.h"
28*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_sbrdecsettings.h"
29*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_sbr_scale.h"
30*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_env_extr_part.h"
31*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_sbr_rom.h"
32*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_hybrid.h"
33*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_ps_dec.h"
34*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_mps_polyphase.h"
35*15dc779aSAndroid Build Coastguard Worker #include "ixheaac_error_standards.h"
36*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_config.h"
37*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_qmf_dec.h"
38*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_mps_dec.h"
39*15dc779aSAndroid Build Coastguard Worker #include "ixheaacd_mps_reshape_bb_env.h"
40*15dc779aSAndroid Build Coastguard Worker 
ixheaacd_get_ch_idx(ia_heaac_mps_state_struct * pstr_mps_state,WORD32 row,WORD32 * index)41*15dc779aSAndroid Build Coastguard Worker VOID ixheaacd_get_ch_idx(ia_heaac_mps_state_struct *pstr_mps_state, WORD32 row, WORD32 *index) {
42*15dc779aSAndroid Build Coastguard Worker   switch (pstr_mps_state->temp_shape_config) {
43*15dc779aSAndroid Build Coastguard Worker     case SHAPE_STP:
44*15dc779aSAndroid Build Coastguard Worker       *index = pstr_mps_state->ia_mps_dec_mps_table.m1_m2_table_ptr->idx_table
45*15dc779aSAndroid Build Coastguard Worker                    .row_2_channel_stp[pstr_mps_state->tree_config][row];
46*15dc779aSAndroid Build Coastguard Worker       break;
47*15dc779aSAndroid Build Coastguard Worker     case SHAPE_GES:
48*15dc779aSAndroid Build Coastguard Worker       *index = pstr_mps_state->ia_mps_dec_mps_table.m1_m2_table_ptr->idx_table
49*15dc779aSAndroid Build Coastguard Worker                    .row_2_channel_ges[pstr_mps_state->tree_config][row];
50*15dc779aSAndroid Build Coastguard Worker       break;
51*15dc779aSAndroid Build Coastguard Worker     default:
52*15dc779aSAndroid Build Coastguard Worker       break;
53*15dc779aSAndroid Build Coastguard Worker   }
54*15dc779aSAndroid Build Coastguard Worker 
55*15dc779aSAndroid Build Coastguard Worker   return;
56*15dc779aSAndroid Build Coastguard Worker }
57*15dc779aSAndroid Build Coastguard Worker 
ixheaacd_get_res_idx(ia_heaac_mps_state_struct * pstr_mps_state,WORD32 row)58*15dc779aSAndroid Build Coastguard Worker WORD32 ixheaacd_get_res_idx(ia_heaac_mps_state_struct *pstr_mps_state, WORD32 row) {
59*15dc779aSAndroid Build Coastguard Worker   return pstr_mps_state->ia_mps_dec_mps_table.m1_m2_table_ptr->idx_table
60*15dc779aSAndroid Build Coastguard Worker       .row_2_residual[pstr_mps_state->tree_config][row];
61*15dc779aSAndroid Build Coastguard Worker }
62