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 IMPD_DRC_API_STRUCT_DEF_H 21 #define IMPD_DRC_API_STRUCT_DEF_H 22 23 /****************************************************************************/ 24 /* structure definitions */ 25 /****************************************************************************/ 26 /* DRC Configuration */ 27 typedef struct ia_drc_config_struct { 28 WORD32 bitstream_file_format; 29 WORD32 dec_type; 30 WORD32 sub_band_domain_mode; 31 WORD32 num_ch_in; 32 WORD32 num_ch_out; 33 WORD32 sampling_rate; 34 WORD32 control_parameter_index; 35 WORD32 delay_mode; 36 WORD32 absorb_delay_on; 37 WORD32 gain_delay_samples; 38 WORD32 subband_domain_io_flag; 39 WORD32 frame_size; 40 WORD32 sub_band_down_sampling_factor; 41 WORD32 sub_band_count; 42 WORD32 peak_limiter; 43 WORD32 interface_bitstream_present; 44 WORD32 pcm_size; 45 WORD32 parametric_drc_delay_gain_dec_instance; 46 WORD32 parametric_drc_delay; 47 WORD32 parametric_drc_delay_max; 48 WORD32 eq_delay_gain_dec_instance; 49 WORD32 eq_delay; 50 WORD32 eq_delay_max; 51 WORD32 delay_line_samples; 52 WORD32 constant_delay_on; 53 WORD32 audio_delay_samples; 54 55 WORD32 effect_type; 56 WORD32 target_loudness; 57 WORD32 loud_norm_flag; 58 59 } ia_drc_config_struct; 60 61 /* DRC bitsteam handler */ 62 typedef struct bits_handler { 63 UWORD8 *bitstream_drc_config; 64 UWORD8 *bitstream_loudness_info; 65 UWORD8 *bitstream_unidrc_interface; 66 UWORD8 *it_bit_buf; 67 WORD32 num_bytes_bs_drc_config; 68 WORD32 num_bytes_bs_loudness_info; 69 WORD32 num_bits_read_bs_unidrc_interface; 70 WORD32 num_bytes_bs_unidrc_interface; 71 WORD32 num_bits_read_bs; 72 WORD32 num_bytes_read_bs; 73 WORD32 num_bytes_bs; 74 WORD32 num_bytes_offset_bs; 75 WORD32 num_total_bytes; 76 WORD32 num_bits_offset_bs; 77 WORD32 byte_index_bs; 78 WORD32 num_byts_cur; 79 WORD32 num_byts_cur_ic; 80 WORD32 num_byts_cur_il; 81 WORD32 num_byts_cur_in; 82 WORD32 cpy_over; 83 WORD32 cpy_over_ic; 84 WORD32 cpy_over_il; 85 WORD32 cpy_over_in; 86 WORD32 gain_stream_flag; 87 } ia_drc_bits_handler_struct; 88 89 typedef struct { 90 ia_drc_bits_dec_struct *pstr_bitstream_dec; 91 ia_drc_gain_dec_struct *pstr_gain_dec[2]; 92 ia_drc_sel_pro_struct *pstr_selection_proc; 93 ia_drc_config *pstr_drc_config; 94 ia_drc_loudness_info_set_struct *pstr_loudness_info; 95 ia_drc_gain_struct *pstr_drc_gain; 96 ia_drc_interface_struct *pstr_drc_interface; 97 98 ia_drc_peak_limiter_struct *pstr_peak_limiter; 99 ia_drc_qmf_filt_struct *pstr_qmf_filter; 100 ia_drc_sel_proc_params_struct *pstr_drc_sel_proc_params; 101 ia_drc_sel_proc_output_struct *pstr_drc_sel_proc_output; 102 103 } ia_drc_payload_struct; 104 105 typedef struct ia_drc_state_struct { 106 UWORD32 ui_out_bytes; 107 UWORD32 ui_in_bytes; 108 UWORD32 ui_ir_bytes; 109 UWORD32 total_num_out_samples; 110 UWORD32 frame_no; 111 UWORD32 out_size; 112 UWORD32 ui_init_done; 113 UWORD32 ui_exe_done; 114 UWORD32 ui_ir_used; 115 WORD32 delay_in_output; 116 WORD32 delay_adjust_samples; 117 pVOID persistent_ptr; 118 } ia_drc_state_struct; 119 120 typedef struct IA_PSM_API_Struct { 121 ia_drc_state_struct *p_state; 122 ia_drc_config_struct str_config; 123 ia_drc_payload_struct str_payload; 124 ia_drc_bits_handler_struct str_bit_handler; 125 ia_mem_info_struct *p_mem_info; 126 pVOID *pp_mem; 127 struct ia_bit_buf_struct str_bit_buf, *pstr_bit_buf; 128 129 } ia_drc_api_struct; 130 131 #endif 132