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 WORD32 album_mode; 59 FLOAT32 boost; 60 FLOAT32 compress; 61 UWORD8 boost_set; 62 UWORD8 compress_set; 63 WORD32 apply_crossfade; 64 WORD32 is_config_changed; 65 WORD32 ln_dbgain_prev; 66 } ia_drc_config_struct; 67 68 /* DRC bitsteam handler */ 69 typedef struct bits_handler { 70 UWORD8 *bitstream_drc_config; 71 UWORD8 *bitstream_loudness_info; 72 UWORD8 *bitstream_unidrc_interface; 73 UWORD8 *it_bit_buf; 74 WORD32 num_bytes_bs_drc_config; 75 WORD32 num_bytes_bs_loudness_info; 76 WORD32 num_bits_read_bs_unidrc_interface; 77 WORD32 num_bytes_bs_unidrc_interface; 78 WORD32 num_bits_read_bs; 79 WORD32 num_bytes_read_bs; 80 WORD32 num_bytes_bs; 81 WORD32 num_bytes_offset_bs; 82 WORD32 num_total_bytes; 83 WORD32 num_bits_offset_bs; 84 WORD32 byte_index_bs; 85 WORD32 num_byts_cur; 86 WORD32 num_byts_cur_ic; 87 WORD32 num_byts_cur_il; 88 WORD32 num_byts_cur_in; 89 WORD32 cpy_over; 90 WORD32 cpy_over_ic; 91 WORD32 cpy_over_il; 92 WORD32 cpy_over_in; 93 WORD32 gain_stream_flag; 94 } ia_drc_bits_handler_struct; 95 96 typedef struct { 97 ia_drc_bits_dec_struct *pstr_bitstream_dec; 98 ia_drc_gain_dec_struct *pstr_gain_dec[2]; 99 ia_drc_sel_pro_struct *pstr_selection_proc; 100 ia_drc_config *pstr_drc_config; 101 ia_drc_loudness_info_set_struct *pstr_loudness_info; 102 ia_drc_gain_struct *pstr_drc_gain; 103 ia_drc_interface_struct *pstr_drc_interface; 104 105 ia_drc_peak_limiter_struct *pstr_peak_limiter; 106 ia_drc_qmf_filt_struct *pstr_qmf_filter; 107 ia_drc_sel_proc_params_struct *pstr_drc_sel_proc_params; 108 ia_drc_sel_proc_output_struct *pstr_drc_sel_proc_output; 109 110 } ia_drc_payload_struct; 111 112 typedef struct ia_drc_state_struct { 113 UWORD32 ui_out_bytes; 114 UWORD32 ui_in_bytes; 115 UWORD32 ui_ir_bytes; 116 UWORD32 total_num_out_samples; 117 UWORD32 frame_no; 118 UWORD32 out_size; 119 UWORD32 ui_init_done; 120 UWORD32 ui_exe_done; 121 UWORD32 ui_ir_used; 122 WORD32 delay_in_output; 123 WORD32 delay_adjust_samples; 124 pVOID persistent_ptr; 125 } ia_drc_state_struct; 126 127 typedef struct IA_PSM_API_Struct { 128 ia_drc_state_struct *p_state; 129 ia_drc_config_struct str_config; 130 ia_drc_payload_struct str_payload; 131 ia_drc_bits_handler_struct str_bit_handler; 132 ia_mem_info_struct *p_mem_info; 133 pVOID *pp_mem; 134 struct ia_bit_buf_struct str_bit_buf, *pstr_bit_buf; 135 WORD32 frame_count; 136 } ia_drc_api_struct; 137 138 #endif 139