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_bits_offset_bs; 75 WORD32 byte_index_bs; 76 WORD32 num_byts_cur; 77 WORD32 num_byts_cur_ic; 78 WORD32 num_byts_cur_il; 79 WORD32 num_byts_cur_in; 80 WORD32 cpy_over; 81 WORD32 cpy_over_ic; 82 WORD32 cpy_over_il; 83 WORD32 cpy_over_in; 84 WORD32 gain_stream_flag; 85 } ia_drc_bits_handler_struct; 86 87 typedef struct { 88 ia_drc_bits_dec_struct *pstr_bitstream_dec; 89 ia_drc_gain_dec_struct *pstr_gain_dec[2]; 90 ia_drc_sel_pro_struct *pstr_selection_proc; 91 ia_drc_config *pstr_drc_config; 92 ia_drc_loudness_info_set_struct *pstr_loudness_info; 93 ia_drc_gain_struct *pstr_drc_gain; 94 ia_drc_interface_struct *pstr_drc_interface; 95 96 ia_drc_peak_limiter_struct *pstr_peak_limiter; 97 ia_drc_qmf_filt_struct *pstr_qmf_filter; 98 ia_drc_sel_proc_params_struct *pstr_drc_sel_proc_params; 99 ia_drc_sel_proc_output_struct *pstr_drc_sel_proc_output; 100 101 } ia_drc_payload_struct; 102 103 typedef struct ia_drc_state_struct { 104 UWORD32 ui_out_bytes; 105 UWORD32 ui_in_bytes; 106 UWORD32 ui_ir_bytes; 107 UWORD32 total_num_out_samples; 108 UWORD32 frame_no; 109 UWORD32 out_size; 110 UWORD32 ui_init_done; 111 UWORD32 ui_exe_done; 112 UWORD32 ui_ir_used; 113 WORD32 delay_in_output; 114 WORD32 delay_adjust_samples; 115 pVOID persistant_ptr; 116 } ia_drc_state_struct; 117 118 typedef struct IA_PSM_API_Struct { 119 ia_drc_state_struct *p_state; 120 ia_drc_config_struct str_config; 121 ia_drc_payload_struct str_payload; 122 ia_drc_bits_handler_struct str_bit_handler; 123 ia_mem_info_struct *p_mem_info; 124 pVOID *pp_mem; 125 struct ia_bit_buf_struct str_bit_buf, *pstr_bit_buf; 126 127 } ia_drc_api_struct; 128 129 #endif 130