1 /****************************************************************************** 2 * * 3 * Copyright (C) 2018 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 #ifndef _IXHEAACD_FUNCTION_SELECTOR_H_ 21 #define _IXHEAACD_FUNCTION_SELECTOR_H_ 22 23 #include <stdio.h> 24 #include <string.h> 25 #include "ixheaacd_sbr_common.h" 26 #include <ixheaacd_type_def.h> 27 28 #include "ixheaacd_constants.h" 29 #include "ixheaacd_intrinsics.h" 30 #include "ixheaacd_common_rom.h" 31 #include "ixheaacd_sbrdecsettings.h" 32 #include "ixheaacd_bitbuffer.h" 33 #include "ixheaacd_defines.h" 34 35 #include "ixheaacd_pns.h" 36 37 #include <ixheaacd_aac_rom.h> 38 #include "ixheaacd_pulsedata.h" 39 40 #include "ixheaacd_drc_data_struct.h" 41 42 #include "ixheaacd_lt_predict.h" 43 44 #include "ixheaacd_channelinfo.h" 45 #include "ixheaacd_drc_dec.h" 46 47 #include "ixheaacd_sbrdecoder.h" 48 #include "ixheaacd_sbr_scale.h" 49 #include "ixheaacd_lpp_tran.h" 50 #include "ixheaacd_env_extr_part.h" 51 #include <ixheaacd_sbr_rom.h> 52 #include "ixheaacd_hybrid.h" 53 #include "ixheaacd_ps_dec.h" 54 #include "ixheaacd_env_extr.h" 55 56 #include "ixheaacd_basic_funcs.h" 57 58 extern WORD32 (*ixheaacd_fix_div)(WORD32, WORD32); 59 extern VOID (*ixheaacd_covariance_matrix_calc)(WORD32 *, 60 ixheaacd_lpp_trans_cov_matrix *, 61 WORD32); 62 extern VOID (*ixheaacd_covariance_matrix_calc_2)( 63 ixheaacd_lpp_trans_cov_matrix *, WORD32 *, WORD32, WORD16); 64 extern VOID (*ixheaacd_over_lap_add1)(WORD32 *, WORD32 *, WORD16 *, 65 const WORD16 *, WORD16, WORD16, WORD16); 66 extern VOID (*ixheaacd_over_lap_add2)(WORD32 *, WORD32 *, WORD32 *, 67 const WORD16 *, WORD16, WORD16, WORD16); 68 69 extern VOID (*ixheaacd_decorr_filter1)(ia_ps_dec_struct *, 70 ia_ps_tables_struct *, WORD16 *); 71 72 extern VOID (*ixheaacd_decorr_filter2)(ia_ps_dec_struct *, WORD32 *, WORD32 *, 73 WORD32 *, WORD32 *, 74 ia_ps_tables_struct *, WORD16 *); 75 76 extern WORD32 (*ixheaacd_divide16_pos)(WORD32, WORD32); 77 78 extern VOID (*ixheaacd_decorrelation)(ia_ps_dec_struct *, WORD32 *, WORD32 *, 79 WORD32 *, WORD32 *, 80 ia_ps_tables_struct *); 81 82 extern VOID (*ixheaacd_apply_rot)(ia_ps_dec_struct *, WORD32 *, WORD32 *, 83 WORD32 *, WORD32 *, ia_sbr_tables_struct *, 84 const WORD16 *); 85 86 extern VOID (*ixheaacd_conv_ergtoamplitudelp)(WORD32, WORD16, WORD16 *, 87 WORD16 *, WORD16 *, WORD16 *); 88 89 extern VOID (*ixheaacd_conv_ergtoamplitude)(WORD32, WORD16, WORD16 *, WORD16 *, 90 WORD16 *, WORD16 *); 91 92 extern VOID (*ixheaacd_adjust_scale)(WORD32 **, WORD32 **, WORD32, WORD32, 93 WORD32, WORD32, WORD32, FLAG); 94 95 extern WORD16 (*ixheaacd_ixheaacd_expsubbandsamples)(WORD32 **, WORD32 **, 96 WORD32, WORD32, WORD32, 97 WORD32, FLAG); 98 99 extern VOID (*ixheaacd_enery_calc_per_subband)(WORD32, WORD32, WORD32, WORD32, 100 WORD32, WORD16 *, FLAG, 101 ia_sbr_tables_struct *, 102 WORD32 *); 103 104 extern VOID (*ixheaacd_harm_idx_zerotwolp)(WORD32 *, WORD16 *, WORD, WORD16 *, 105 const WORD32 *, WORD16 *, WORD, FLAG, 106 WORD32); 107 108 extern VOID (*ixheaacd_tns_ar_filter_fixed)(WORD32 *, WORD32, WORD32, WORD32 *, 109 WORD32, WORD32, WORD); 110 111 extern VOID (*ixheaacd_tns_ar_filter)(WORD32 *, WORD32, WORD32, WORD16 *, 112 WORD32, WORD32, WORD, WORD32 *); 113 114 extern VOID (*ixheaacd_tns_parcor_lpc_convert)(WORD16 *, WORD16 *, WORD16 *, 115 WORD); 116 117 extern WORD32 (*ixheaacd_calc_max_spectral_line)(WORD32 *, WORD32); 118 119 extern VOID (*ixheaacd_post_twiddle)(WORD32[], WORD32[], 120 ia_aac_dec_imdct_tables_struct *, WORD); 121 122 extern VOID (*ixheaacd_post_twid_overlap_add)(WORD16[], WORD32[], 123 ia_aac_dec_imdct_tables_struct *, 124 WORD, WORD32 *, WORD16, 125 const WORD16 *, WORD16); 126 127 extern VOID (*ixheaacd_neg_shift_spec)(WORD32 *, WORD16 *, WORD16, WORD16); 128 129 extern VOID (*ixheaacd_spec_to_overlapbuf)(WORD32 *, WORD32 *, WORD32, WORD32); 130 131 extern VOID (*ixheaacd_overlap_buf_out)(WORD16 *, WORD32 *, WORD32, 132 const WORD16); 133 134 extern VOID (*ixheaacd_overlap_out_copy)(WORD16 *, WORD32 *, WORD32 *, 135 const WORD16); 136 137 extern VOID (*ixheaacd_pretwiddle_compute)(WORD32 *, WORD32 *, WORD32 *, 138 ia_aac_dec_imdct_tables_struct *, 139 WORD, WORD32); 140 141 extern VOID (*ixheaacd_imdct_using_fft)(ia_aac_dec_imdct_tables_struct *, 142 WORD32, WORD32 *, WORD32 *); 143 144 extern VOID (*ixheaacd_complex_fft_p2)(WORD32 *xr, WORD32 *xi, WORD32 nlength, 145 WORD32 fft_mode, WORD32 *preshift); 146 147 extern VOID (*ixheaacd_mps_complex_fft_64)(WORD32 *ptr_x, WORD32 *fin_re, 148 WORD32 *fin_im, WORD32 nlength); 149 150 extern VOID (*ixheaacd_mps_synt_pre_twiddle)(WORD32 *ptr_in, WORD32 *table_re, 151 WORD32 *table_im, 152 WORD32 resolution); 153 154 extern VOID (*ixheaacd_mps_synt_post_twiddle)(WORD32 *ptr_in, WORD32 *table_re, 155 WORD32 *table_im, 156 WORD32 resolution); 157 158 extern VOID (*ixheaacd_calc_pre_twid)(WORD32 *ptr_x, WORD32 *r_ptr, 159 WORD32 *i_ptr, WORD32 nlength, 160 const WORD32 *cos_ptr, 161 const WORD32 *sin_ptr); 162 163 extern VOID (*ixheaacd_calc_post_twid)(WORD32 *ptr_x, WORD32 *r_ptr, 164 WORD32 *i_ptr, WORD32 nlength, 165 const WORD32 *cos_ptr, 166 const WORD32 *sin_ptr); 167 168 extern VOID (*ixheaacd_mps_synt_post_fft_twiddle)( 169 WORD32 resolution, WORD32 *fin_re, WORD32 *fin_im, WORD32 *table_re, 170 WORD32 *table_im, WORD32 *state); 171 extern VOID (*ixheaacd_mps_synt_out_calc)(WORD32 resolution, WORD32 *out, 172 WORD32 *state, 173 const WORD32 *filter_coeff); 174 175 extern VOID (*ixheaacd_fft_15_ld)(WORD32 *inp, WORD32 *op, WORD32 *fft3out, 176 UWORD8 *re_arr_tab_sml_240_ptr); 177 178 extern VOID (*ixheaacd_aac_ld_dec_rearrange)(WORD32 *ip, WORD32 *op, 179 WORD32 mdct_len_2, 180 UWORD8 *re_arr_tab); 181 182 extern VOID (*ixheaacd_fft32x32_ld)( 183 ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints, 184 WORD32 *ptr_x, WORD32 *ptr_y); 185 186 extern VOID (*ixheaacd_fft32x32_ld2)( 187 ia_aac_dec_imdct_tables_struct *imdct_tables_ptr, WORD32 npoints, 188 WORD32 *ptr_x, WORD32 *ptr_y); 189 190 extern WORD16 (*ixheaacd_neg_expo_inc)(WORD16 neg_expo); 191 192 extern VOID (*ixheaacd_inv_dit_fft_8pt)(WORD32 *x, WORD32 *real, WORD32 *imag); 193 194 extern VOID (*ixheaacd_scale_factor_process)( 195 WORD32 *x_invquant, WORD16 *scale_fact, WORD no_band, WORD8 *width, 196 WORD32 *scale_tables_ptr, WORD32 total_channels, WORD32 object_type, 197 WORD32 aac_sf_data_resil_flag); 198 199 #endif /* _IXHEAACD_FUNCTION_SELECTOR_H_ */ 200