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 21*15dc779aSAndroid Build Coastguard Worker #pragma once 22*15dc779aSAndroid Build Coastguard Worker WORD32 iusace_write_ics_info(ia_bit_buf_struct *it_bit_buf, ia_sfb_params_struct *pstr_sfb_prms, 23*15dc779aSAndroid Build Coastguard Worker WORD32 ch); 24*15dc779aSAndroid Build Coastguard Worker 25*15dc779aSAndroid Build Coastguard Worker WORD32 iusace_write_cpe(ia_sfb_params_struct *pstr_sfb_prms, ia_bit_buf_struct *it_bit_buf, 26*15dc779aSAndroid Build Coastguard Worker WORD32 *tns_data_present, WORD32 const usac_independency_flg, 27*15dc779aSAndroid Build Coastguard Worker ia_usac_encoder_config_struct *ptr_usac_config, 28*15dc779aSAndroid Build Coastguard Worker ia_usac_data_struct *ptr_usac_data, WORD32 ch); 29*15dc779aSAndroid Build Coastguard Worker 30*15dc779aSAndroid Build Coastguard Worker WORD32 iusace_write_fd_data(ia_bit_buf_struct *it_bit_buf, ia_sfb_params_struct *pstr_sfb_prms, 31*15dc779aSAndroid Build Coastguard Worker WORD32 num_fac_bits, WORD32 usac_independency_flg, 32*15dc779aSAndroid Build Coastguard Worker ia_usac_data_struct *ptr_usac_data, 33*15dc779aSAndroid Build Coastguard Worker ia_usac_encoder_config_struct *ptr_usac_config, WORD32 ch_idx, 34*15dc779aSAndroid Build Coastguard Worker WORD32 ele_id, WORD32 idx); 35*15dc779aSAndroid Build Coastguard Worker 36*15dc779aSAndroid Build Coastguard Worker WORD32 iusace_count_fd_bits(ia_sfb_params_struct *pstr_sfb_prms, 37*15dc779aSAndroid Build Coastguard Worker ia_usac_data_struct *ptr_usac_data, WORD32 usac_independency_flg, 38*15dc779aSAndroid Build Coastguard Worker ia_usac_encoder_config_struct *ptr_usac_config, WORD32 ch_idx, 39*15dc779aSAndroid Build Coastguard Worker WORD32 idx); 40*15dc779aSAndroid Build Coastguard Worker 41*15dc779aSAndroid Build Coastguard Worker WORD32 iusace_write_fill_ele(ia_bit_buf_struct *it_bit_buf, WORD32 num_bits); 42*15dc779aSAndroid Build Coastguard Worker 43*15dc779aSAndroid Build Coastguard Worker WORD32 iusace_write_tns_data(ia_bit_buf_struct *it_bit_buf, ia_tns_info *pstr_tns_info, 44*15dc779aSAndroid Build Coastguard Worker WORD32 window_sequence, WORD32 core_mode); 45*15dc779aSAndroid Build Coastguard Worker 46*15dc779aSAndroid Build Coastguard Worker WORD32 iusace_write_cplx_pred_data(ia_bit_buf_struct *it_bit_buf, WORD32 num_win_grps, 47*15dc779aSAndroid Build Coastguard Worker WORD32 num_sfb, WORD32 complex_coef, 48*15dc779aSAndroid Build Coastguard Worker WORD32 pred_coeffs_re[MAX_SHORT_WINDOWS][MAX_SFB_LONG], 49*15dc779aSAndroid Build Coastguard Worker WORD32 pred_coeffs_im[MAX_SHORT_WINDOWS][MAX_SFB_LONG], 50*15dc779aSAndroid Build Coastguard Worker const WORD32 huff_tab[CODE_BOOK_ALPHA_LAV][2], 51*15dc779aSAndroid Build Coastguard Worker WORD32 const usac_independency_flg, WORD32 pred_dir, 52*15dc779aSAndroid Build Coastguard Worker WORD32 cplx_pred_used[MAX_SHORT_WINDOWS][MAX_SFB_LONG], 53*15dc779aSAndroid Build Coastguard Worker WORD32 cplx_pred_all, WORD32 *ptr_prev_alpha_coeff_re, 54*15dc779aSAndroid Build Coastguard Worker WORD32 *ptr_prev_alpha_coeff_im, WORD32 *delta_code_time); 55*15dc779aSAndroid Build Coastguard Worker 56*15dc779aSAndroid Build Coastguard Worker WORD32 iusace_write_ms_data(ia_bit_buf_struct *it_bit_buf, WORD32 ms_mask, 57*15dc779aSAndroid Build Coastguard Worker WORD32 ms_used[MAX_SHORT_WINDOWS][MAX_SFB_LONG], WORD32 num_win_grps, 58*15dc779aSAndroid Build Coastguard Worker WORD32 nr_of_sfb); 59*15dc779aSAndroid Build Coastguard Worker 60*15dc779aSAndroid Build Coastguard Worker WORD32 iusace_write_scf_data(ia_bit_buf_struct *it_bit_buf, WORD32 max_sfb, WORD32 num_sfb, 61*15dc779aSAndroid Build Coastguard Worker const WORD32 *scale_factors, WORD32 num_win_grps, WORD32 global_gain, 62*15dc779aSAndroid Build Coastguard Worker const WORD32 huff_tab[CODE_BOOK_ALPHA_LAV][2]); 63