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_SBR_ROM_H 21 #define IXHEAACD_SBR_ROM_H 22 23 #define INV_INT_TABLE_SIZE 49 24 #define SBR_NF_NO_RANDOM_VAL 512 25 #define NUM_SER_AP_LINKS 3 26 #define SUBQMF_GROUPS (10) 27 #define QMF_GROUPS (12) 28 #define NO_IID_GROUPS (SUBQMF_GROUPS + QMF_GROUPS) 29 #define NUM_IID_LEVELS (7) 30 #define NUM_IID_LEVELS_FINE (15) 31 #define NUM_ICC_LEVELS (8) 32 #define NO_IID_LEVELS (2 * NUM_IID_LEVELS + 1) 33 #define NO_IID_LEVELS_FINE (2 * NUM_IID_LEVELS_FINE + 1) 34 #define NO_ICC_LEVELS (NUM_ICC_LEVELS) 35 36 typedef struct { 37 WORD16 sbr_lim_gains_m[8]; 38 39 WORD16 sbr_lim_bands_per_octave_q13[4]; 40 WORD16 sbr_smooth_filter[4]; 41 WORD16 sbr_inv_int_table[INV_INT_TABLE_SIZE]; 42 43 WORD32 sbr_rand_ph[SBR_NF_NO_RANDOM_VAL + MAX_FREQ_COEFFS]; 44 45 } ia_env_calc_tables_struct; 46 47 extern const ia_env_calc_tables_struct ixheaacd_aac_dec_env_calc_tables; 48 49 typedef struct { 50 WORD16 w_32[2 * 30]; 51 WORD16 w_16[2 * 12]; 52 WORD32 dig_rev_table2_32[4]; 53 WORD32 dig_rev_table4_16[2]; 54 55 WORD16 sbr_sin_cos_twiddle_l64[64]; 56 WORD16 sbr_alt_sin_twiddle_l64[32]; 57 WORD16 sbr_cos_sin_twiddle_ds_l32[32 + 32]; 58 WORD16 sbr_sin_cos_twiddle_l32[32]; 59 WORD16 sbr_alt_sin_twiddle_l32[16]; 60 WORD16 sbr_t_cos_sin_l32[32 + 32]; 61 62 WORD16 post_fft_tbl[18]; 63 WORD16 dct23_tw[66]; 64 65 WORD16 qmf_c[1280]; 66 67 UWORD8 dig_rev_table2_128[4]; 68 WORD32 w1024[1536]; 69 WORD32 esbr_qmf_c[1280]; 70 WORD32 esbr_qmf_c_24[480]; 71 WORD32 esbr_w_32[2 * 30]; 72 WORD32 esbr_w_16[2 * 12]; 73 74 WORD32 esbr_sin_cos_twiddle_l64[64]; 75 WORD32 esbr_alt_sin_twiddle_l64[32]; 76 77 WORD32 esbr_sin_cos_twiddle_l32[32]; 78 WORD32 esbr_alt_sin_twiddle_l32[16]; 79 WORD32 esbr_t_cos_sin_l32[32 + 32]; 80 81 WORD32 esbr_sin_cos_twiddle_l24[24]; 82 WORD32 esbr_alt_sin_twiddle_l24[12]; 83 WORD32 esbr_t_cos_sin_l24[24 + 24]; 84 85 WORD32 esbr_sin_cos_twiddle_l16[16]; 86 WORD32 esbr_alt_sin_twiddle_l16[8]; 87 WORD32 esbr_t_cos_sin_l16[16 + 16]; 88 89 WORD16 ixheaacd_sbr_t_cos_sin_l32_eld[32 + 32]; 90 91 WORD16 qmf_c_eld[640]; 92 WORD16 qmf_c_eld2[640]; 93 94 WORD16 qmf_c_eld3[640]; 95 96 WORD16 ixheaacd_sbr_synth_cos_sin_l32[64 + 64]; 97 98 } ia_qmf_dec_tables_struct; 99 100 extern const ia_qmf_dec_tables_struct ixheaacd_aac_qmf_dec_tables; 101 102 typedef struct { 103 ia_frame_info_struct sbr_frame_info1_2_4_16[3 + 1]; 104 105 ia_sbr_header_data_struct str_sbr_default_header; 106 WORD16 ixheaacd_t_huffman_env_bal_1_5db_inp_table[50]; 107 WORD16 ixheaacd_f_huffman_env_bal_1_5db_inp_table[50]; 108 WORD16 ixheaacd_t_huffman_env_bal_3_0db_inp_table[26]; 109 WORD16 ixheaacd_f_huffman_env_bal_3_0db_inp_table[26]; 110 WORD16 ixheaacd_t_huffman_noise_3_0db_inp_table[64]; 111 WORD16 ixheaacd_t_huffman_noise_bal_3_0db_inp_table[26]; 112 WORD16 ixheaacd_t_huffman_env_1_5db_inp_table[122]; 113 WORD16 ixheaacd_f_huffman_env_1_5db_inp_table[122]; 114 WORD16 ixheaacd_t_huffman_env_3_0db_inp_table[64]; 115 WORD16 ixheaacd_f_huffman_env_3_0db_inp_table[64]; 116 117 WORD32 ixheaacd_t_huffman_env_bal_1_5db_idx_table[20]; 118 WORD32 ixheaacd_f_huffman_env_bal_1_5db_idx_table[23]; 119 WORD32 ixheaacd_t_huffman_env_bal_3_0db_idx_table[16]; 120 WORD32 ixheaacd_f_huffman_env_bal_3_0db_idx_table[17]; 121 WORD32 ixheaacd_t_huffman_noise_3_0db_idx_table[17]; 122 WORD32 ixheaacd_t_huffman_noise_bal_3_0db_idx_table[11]; 123 WORD32 ixheaacd_t_huffman_env_1_5db_idx_table[27]; 124 WORD32 ixheaacd_f_huffman_env_1_5db_idx_table[28]; 125 WORD32 ixheaacd_t_huffman_env_3_0db_idx_table[26]; 126 WORD32 ixheaacd_f_huffman_env_3_0db_idx_table[25]; 127 128 WORD8 start_min[12]; 129 WORD8 offset_idx[12]; 130 WORD8 ixheaacd_drc_offset[7][16]; 131 WORD8 stop_min[12]; 132 WORD8 stop_off[12][14]; 133 134 } ia_env_extr_tables_struct; 135 136 extern const ia_env_extr_tables_struct ixheaacd_aac_dec_env_extr_tables; 137 138 typedef struct { 139 WORD16 decay_scale_factor[72]; 140 141 WORD16 hyb_resol[3]; 142 WORD16 rev_link_decay_ser[NUM_SER_AP_LINKS]; 143 WORD16 rev_link_delay_ser[3]; 144 WORD16 borders_group[NO_IID_GROUPS + 1]; 145 WORD16 group_shift[6]; 146 WORD16 group_to_bin[NO_IID_GROUPS]; 147 WORD16 hybrid_to_bin[SUBQMF_GROUPS]; 148 WORD16 delay_to_bin[32]; 149 150 WORD16 frac_delay_phase_fac_qmf_re_im[24 * 2]; 151 WORD16 frac_delay_phase_fac_qmf_sub_re_im[16 * 2]; 152 WORD16 frac_delay_phase_fac_qmf_ser_re_im[3][32 * 2]; 153 WORD16 frac_delay_phase_fac_qmf_sub_ser_re_im[3][16 * 2]; 154 155 WORD16 scale_factors[NO_IID_LEVELS]; 156 WORD16 scale_factors_fine[NO_IID_LEVELS_FINE]; 157 WORD16 alpha_values[NO_ICC_LEVELS]; 158 WORD16 p2_6[6]; 159 WORD16 p8_13[13]; 160 WORD16 huff_iid_dt[28]; 161 WORD16 huff_iid_df[28]; 162 WORD16 huff_icc_dt[14]; 163 WORD16 huff_icc_df[14]; 164 WORD16 huff_iid_dt_fine[60]; 165 WORD16 huff_iid_df_fine[60]; 166 WORD32 dummy; 167 168 } ia_ps_tables_struct; 169 170 extern const ia_ps_tables_struct ixheaacd_aac_dec_ps_tables; 171 172 typedef struct { 173 ia_env_calc_tables_struct *env_calc_tables_ptr; 174 ia_qmf_dec_tables_struct *qmf_dec_tables_ptr; 175 ia_env_extr_tables_struct *env_extr_tables_ptr; 176 ia_ps_tables_struct *ps_tables_ptr; 177 WORD32 *sbr_rand_ph; 178 } ia_sbr_tables_struct; 179 180 #endif 181