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_BLOCK_H 21 #define IXHEAACD_BLOCK_H 22 23 #define IQ_TABLE_SIZE_HALF 128 24 25 VOID ixheaacd_inverse_quantize(WORD32 *x_invquant, WORD no_band, 26 WORD32 *ixheaacd_pow_table_Q13, 27 WORD8 *scratch_in); 28 29 VOID ixheaacd_scale_factor_process_dec(WORD32 *x_invquant, WORD16 *scale_fact, 30 WORD no_band, WORD8 *width, 31 WORD32 *scale_tables_ptr, 32 WORD32 total_channels, 33 WORD32 object_type, 34 WORD32 aac_sf_data_resil_flag); 35 36 VOID ixheaacd_scale_factor_process_armv7(WORD32 *x_invquant, WORD16 *scale_fact, 37 WORD no_band, WORD8 *width, 38 WORD32 *scale_tables_ptr, 39 WORD32 total_channels, 40 WORD32 object_type, 41 WORD32 aac_sf_data_resil_flag); 42 43 VOID ixheaacd_scale_factor_process_armv8(WORD32 *x_invquant, WORD16 *scale_fact, 44 WORD no_band, WORD8 *width, 45 WORD32 *scale_tables_ptr, 46 WORD32 total_channels, 47 WORD32 object_type, 48 WORD32 aac_sf_data_resil_flag); 49 50 void ixheaacd_right_shift_block(WORD32 *p_spectrum, WORD length, 51 WORD shift_val); 52 53 WORD ixheaacd_decode_huffman(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no, 54 WORD32 *spec_coef, WORD16 *sfb_offset, WORD start, 55 WORD sfb, WORD group_len, 56 ia_aac_dec_tables_struct *ptr_aac_tables); 57 58 WORD ixheaacd_huffman_dec_word2(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no, 59 WORD32 width, 60 ia_aac_dec_tables_struct *ptr_aac_tables, 61 WORD32 *x_invquant, WORD8 *scratch_ptr); 62 63 VOID ixheaacd_read_scale_factor_data( 64 ia_bit_buf_struct *it_bit_buff, 65 ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info, 66 ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 object_type); 67 68 WORD16 ixheaacd_read_spectral_data( 69 ia_bit_buf_struct *it_bit_buff, 70 ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info, 71 ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 total_channels, 72 WORD32 frame_size, WORD32 object_type, WORD32 aac_spect_data_resil_flag, 73 WORD32 aac_sf_data_resil_flag); 74 75 WORD16 ixheaacd_read_section_data( 76 ia_bit_buf_struct *it_bit_buff, 77 ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info, 78 WORD32 aac_spect_data_resil_flag, WORD32 aac_sect_data_resil_flag, 79 ia_aac_dec_tables_struct *ptr_aac_tables); 80 81 VOID ixheaacd_over_lap_add1_dec(WORD32 *coef, WORD32 *prev, WORD16 *out, 82 const WORD16 *window, WORD16 q_shift, 83 WORD16 size, WORD16 ch_fac); 84 85 VOID ixheaacd_over_lap_add1_armv7(WORD32 *coef, WORD32 *prev, WORD16 *out, 86 const WORD16 *window, WORD16 q_shift, 87 WORD16 size, WORD16 ch_fac); 88 89 VOID ixheaacd_over_lap_add1_armv8(WORD32 *coef, WORD32 *prev, WORD16 *out, 90 const WORD16 *window, WORD16 q_shift, 91 WORD16 size, WORD16 ch_fac); 92 93 VOID ixheaacd_over_lap_add2_dec(WORD32 *coef, WORD32 *prev, WORD32 *out, 94 const WORD16 *window, WORD16 q_shift, 95 WORD16 size, WORD16 ch_fac); 96 97 VOID ixheaacd_over_lap_add2_armv7(WORD32 *coef, WORD32 *prev, WORD32 *out, 98 const WORD16 *window, WORD16 q_shift, 99 WORD16 size, WORD16 ch_fac); 100 101 VOID ixheaacd_over_lap_add2_armv8(WORD32 *coef, WORD32 *prev, WORD32 *out, 102 const WORD16 *window, WORD16 q_shift, 103 WORD16 size, WORD16 ch_fac); 104 105 VOID ixheaacd_set_corr_info( 106 ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info, WORD16 pns_band); 107 108 VOID ixheaacd_gen_rand_vec(WORD32 scale, WORD shift, WORD32 *spec, 109 WORD32 sfb_width, WORD32 *random_vec); 110 111 VOID ixheaacd_pns_process( 112 ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info[], WORD32 channel, 113 ia_aac_dec_tables_struct *ptr_aac_tables); 114 115 VOID ixheaacd_spec_to_overlapbuf_dec(WORD32 *ptr_overlap_buf, 116 WORD32 *ptr_spec_coeff, WORD32 q_shift, 117 WORD32 size); 118 119 VOID ixheaacd_spec_to_overlapbuf_armv7(WORD32 *ptr_overlap_buf, 120 WORD32 *ptr_spec_coeff, WORD32 q_shift, 121 WORD32 size); 122 123 VOID ixheaacd_overlap_buf_out_dec(WORD16 *out_samples, WORD32 *ptr_overlap_buf, 124 WORD32 size, const WORD16 ch_fac); 125 126 VOID ixheaacd_overlap_buf_out_armv7(WORD16 *out_samples, 127 WORD32 *ptr_overlap_buf, WORD32 size, 128 const WORD16 ch_fac); 129 130 WORD32 ixheaacd_inv_quant(WORD32 *x_quant, WORD32 *ixheaacd_pow_table_Q13); 131 132 VOID ixheaacd_imdct_process(ia_aac_dec_overlap_info *ptr_aac_dec_overlap_info, 133 WORD32 *ptr_spec_coeff, 134 ia_ics_info_struct *ptr_ics_info, 135 WORD16 out_samples[], const WORD16 ch_fac, 136 WORD32 *scratch, 137 ia_aac_dec_tables_struct *ptr_aac_tables, 138 WORD32 object_type); 139 140 VOID ixheaacd_neg_shift_spec_dec(WORD32 *coef, WORD16 *out, WORD16 q_shift, 141 WORD16 ch_fac); 142 143 VOID ixheaacd_neg_shift_spec_armv7(WORD32 *coef, WORD16 *out, WORD16 q_shift, 144 WORD16 ch_fac); 145 146 VOID ixheaacd_neg_shift_spec_armv8(WORD32 *coef, WORD16 *out, WORD16 q_shift, 147 WORD16 ch_fac); 148 149 VOID ixheaacd_nolap1_32(WORD32 *coef, WORD32 *out, WORD16 cu_scale, 150 WORD16 stride); 151 152 VOID ixheaacd_overlap_out_copy_dec(WORD16 *out_samples, WORD32 *ptr_overlap_buf, 153 WORD32 *ptr_overlap_buf1, 154 const WORD16 ch_fac); 155 156 VOID ixheaacd_overlap_out_copy_armv7(WORD16 *out_samples, 157 WORD32 *ptr_overlap_buf, 158 WORD32 *ptr_overlap_buf1, 159 const WORD16 ch_fac); 160 161 VOID ixheaacd_long_short_win_seq(WORD32 *current, WORD32 *prev, WORD16 *out, 162 const WORD16 *short_window, 163 const WORD16 *short_window_prev, 164 const WORD16 *long_window_prev, WORD16 q_shift, 165 WORD16 ch_fac); 166 167 WORD32 ixheaacd_cnt_leading_ones(WORD32 a); 168 169 VOID ixheaacd_huffman_decode(WORD32 it_bit_buff, WORD16 *huff_index, 170 WORD16 *len, const UWORD16 *input_table, 171 const UWORD32 *idx_table); 172 173 void ixheaacd_eld_dec_windowing(WORD32 *ptr_spect_coeff, const WORD16 *ptr_win, 174 WORD32 framesize, WORD16 q_shift, 175 WORD32 *ptr_overlap_buf, const WORD16 stride, 176 WORD16 *out_samples); 177 178 WORD32 ixheaacd_extension_payload(ia_bit_buf_struct *it_bit_buff, WORD32 cnt); 179 180 VOID ixheaacd_process_single_scf(WORD32 scale_factor, WORD32 *x_invquant, 181 WORD32 width, WORD32 *ptr_scale_table, 182 WORD32 total_channels, WORD32 object_type, 183 WORD32 aac_sf_data_resil_flag); 184 185 void ixheaacd_lap1_512_480(WORD32 *coef, WORD32 *prev, WORD16 *out, 186 const WORD16 *window, WORD16 q_shift, WORD16 size, 187 WORD16 stride); 188 189 #endif /* #ifndef IXHEAACD_BLOCK_H */ 190