Home | History | Annotate | Download | only in drc_src
      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_STURCT_H
     21 #define IMPD_DRC_STURCT_H
     22 
     23 #ifdef __cplusplus
     24 extern "C" {
     25 #endif
     26 
     27 #define METHOD_DEFINITION_UNKNOWN_OTHER 0
     28 #define METHOD_DEFINITION_PROGRAM_LOUDNESS 1
     29 #define METHOD_DEFINITION_ANCHOR_LOUDNESS 2
     30 #define METHOD_DEFINITION_MAX_OF_LOUDNESS_RANGE 3
     31 #define METHOD_DEFINITION_MOMENTARY_LOUDNESS_MAX 4
     32 #define METHOD_DEFINITION_SHORT_TERM_LOUDNESS_MAX 5
     33 #define METHOD_DEFINITION_LOUDNESS_RANGE 6
     34 #define METHOD_DEFINITION_MIXING_LEVEL 7
     35 #define METHOD_DEFINITION_ROOM_TYPE 8
     36 #define METHOD_DEFINITION_SHORT_TERM_LOUDNESS 9
     37 
     38 #define MEASUREMENT_SYSTEM_UNKNOWN_OTHER 0
     39 #define MEASUREMENT_SYSTEM_EBU_R_128 1
     40 #define MEASUREMENT_SYSTEM_BS_1770_4 2
     41 #define MEASUREMENT_SYSTEM_BS_1770_3 MEASUREMENT_SYSTEM_BS_1770_4
     42 #define MEASUREMENT_SYSTEM_BS_1770_4_PRE_PROCESSING 3
     43 #define MEASUREMENT_SYSTEM_BS_1770_3_PRE_PROCESSING \
     44   MEASUREMENT_SYSTEM_BS_1770_4_PRE_PROCESSING
     45 #define MEASUREMENT_SYSTEM_USER 4
     46 #define MEASUREMENT_SYSTEM_EXPERT_PANEL 5
     47 #define MEASUREMENT_SYSTEM_BS_1771_1 6
     48 #define MEASUREMENT_SYSTEM_RESERVED_A 7
     49 #define MEASUREMENT_SYSTEM_RESERVED_B 8
     50 #define MEASUREMENT_SYSTEM_RESERVED_C 9
     51 #define MEASUREMENT_SYSTEM_RESERVED_D 10
     52 #define MEASUREMENT_SYSTEM_RESERVED_E 11
     53 
     54 #define RELIABILITY_UKNOWN 0
     55 #define RELIABILITY_UNVERIFIED 1
     56 #define RELIABILITY_CEILING 2
     57 #define RELIABILITY_ACCURATE 3
     58 
     59 #define EFFECT_BIT_COUNT 12
     60 
     61 #define EFFECT_BIT_NONE (-1)
     62 #define EFFECT_BIT_NIGHT 0x0001
     63 #define EFFECT_BIT_NOISY 0x0002
     64 #define EFFECT_BIT_LIMITED 0x0004
     65 #define EFFECT_BIT_LOWLEVEL 0x0008
     66 #define EFFECT_BIT_DIALOG 0x0010
     67 #define EFFECT_BIT_GENERAL_COMPR 0x0020
     68 #define EFFECT_BIT_EXPAND 0x0040
     69 #define EFFECT_BIT_ARTISTIC 0x0080
     70 #define EFFECT_BIT_CLIPPING 0x0100
     71 #define EFFECT_BIT_FADE 0x0200
     72 #define EFFECT_BIT_DUCK_OTHER 0x0400
     73 #define EFFECT_BIT_DUCK_SELF 0x0800
     74 
     75 #define GAIN_CODING_PROFILE_REGULAR 0
     76 #define GAIN_CODING_PROFILE_FADING 1
     77 #define GAIN_CODING_PROFILE_CLIPPING 2
     78 #define GAIN_CODING_PROFILE_CONSTANT 3
     79 #define GAIN_CODING_PROFILE_DUCKING GAIN_CODING_PROFILE_CLIPPING
     80 
     81 #define GAIN_INTERPOLATION_TYPE_SPLINE 0
     82 #define GAIN_INTERPOLATION_TYPE_LINEAR 1
     83 
     84 #define USER_METHOD_DEFINITION_DEFAULT 0
     85 #define USER_METHOD_DEFINITION_PROGRAM_LOUDNESS 1
     86 #define USER_METHOD_DEFINITION_ANCHOR_LOUDNESS 2
     87 
     88 #define USER_MEASUREMENT_SYSTEM_DEFAULT 0
     89 #define USER_MEASUREMENT_SYSTEM_BS_1770_4 1
     90 #define USER_MEASUREMENT_SYSTEM_BS_1770_3 USER_MEASUREMENT_SYSTEM_BS_1770_4
     91 #define USER_MEASUREMENT_SYSTEM_USER 2
     92 #define USER_MEASUREMENT_SYSTEM_EXPERT_PANEL 3
     93 #define USER_MEASUREMENT_SYSTEM_RESERVED_A 4
     94 #define USER_MEASUREMENT_SYSTEM_RESERVED_B 5
     95 #define USER_MEASUREMENT_SYSTEM_RESERVED_C 6
     96 #define USER_MEASUREMENT_SYSTEM_RESERVED_D 7
     97 #define USER_MEASUREMENT_SYSTEM_RESERVED_E 8
     98 
     99 #define USER_LOUDNESS_PREPROCESSING_DEFAULT 0
    100 #define USER_LOUDNESS_PREPROCESSING_OFF 1
    101 #define USER_LOUDNESS_PREPROCESSING_HIGHPASS 2
    102 
    103 #define LOUDNESS_DEVIATION_MAX_DEFAULT 63
    104 #define LOUDNESS_NORMALIZATION_GAIN_MAX_DEFAULT 1000
    105 
    106 #define SHORT_TERM_LOUDNESS_TO_AVG 0
    107 #define MOMENTARY_LOUDNESS_TO_AVG 1
    108 #define TOP_OF_LOUDNESS_RANGE_TO_AVG 2
    109 
    110 #define DRC_COMPLEXITY_LEVEL_MAX 0xF
    111 #define EQ_COMPLEXITY_LEVEL_MAX 0xF
    112 #define COMPLEXITY_LEVEL_SUPPORTED_TOTAL 20.0f
    113 
    114 #define COMPLEXITY_W_SUBBAND_EQ 2.5f
    115 #define COMPLEXITY_W_FIR 0.4f
    116 #define COMPLEXITY_W_IIR 5.0f
    117 #define COMPLEXITY_W_MOD_TIME 1.0f
    118 #define COMPLEXITY_W_MOD_SUBBAND 2.0f
    119 #define COMPLEXITY_W_LAP 2.0f
    120 #define COMPLEXITY_W_SHAPE 6.0f
    121 #define COMPLEXITY_W_SPLINE 5.0f
    122 #define COMPLEXITY_W_LINEAR 2.5f
    123 #define COMPLEXITY_W_PARAM_DRC_FILT 5.0f
    124 #define COMPLEXITY_W_PARAM_DRC_SUBBAND 5.0f
    125 #define COMPLEXITY_W_PARAM_LIM_FILT 4.5f
    126 #define COMPLEXITY_W_PARAM_DRC_ATTACK 136.0f
    127 
    128 #define LEFT_SIDE 0
    129 #define RIGHT_SIDE 1
    130 
    131 #define CHARACTERISTIC_SIGMOID 0
    132 #define CHARACTERISTIC_NODES 1
    133 #define CHARACTERISTIC_PASS_THRU 2
    134 
    135 #define GAINFORMAT_QMF32 0x1
    136 #define GAINFORMAT_QMFHYBRID39 0x2
    137 #define GAINFORMAT_QMF64 0x3
    138 #define GAINFORMAT_QMFHYBRID71 0x4
    139 #define GAINFORMAT_QMF128 0x5
    140 #define GAINFORMAT_QMFHYBRID135 0x6
    141 #define GAINFORMAT_UNIFORM 0x7
    142 
    143 #define DRC_INPUT_LOUDNESS_TARGET (-31.0f)
    144 
    145 #define SHAPE_FILTER_TYPE_OFF 0
    146 #define SHAPE_FILTER_TYPE_LF_CUT 1
    147 #define SHAPE_FILTER_TYPE_LF_BOOST 2
    148 #define SHAPE_FILTER_TYPE_HF_CUT 3
    149 #define SHAPE_FILTER_TYPE_HF_BOOST 4
    150 
    151 #define SHAPE_FILTER_DRC_GAIN_MAX_MINUS_ONE 1583.8931924611f
    152 
    153 typedef struct {
    154   WORD32 type;
    155   FLOAT32 gain_offset;
    156   FLOAT32 y1_bound;
    157   FLOAT32 warped_gain_max;
    158   FLOAT32 factor;
    159   FLOAT32 coeff_sum;
    160   FLOAT32 partial_coeff_sum;
    161   FLOAT32 g_norm;
    162   FLOAT32 a1;
    163   FLOAT32 a2;
    164   FLOAT32 b1;
    165   FLOAT32 b2;
    166   FLOAT32 audio_in_state_1[MAX_CHANNEL_COUNT];
    167   FLOAT32 audio_in_state_2[MAX_CHANNEL_COUNT];
    168   FLOAT32 audio_out_state_1[MAX_CHANNEL_COUNT];
    169   FLOAT32 audio_out_state_2[MAX_CHANNEL_COUNT];
    170 } ia_shape_filter_struct;
    171 
    172 typedef struct {
    173   WORD32 shape_flter_block_flag;
    174   FLOAT32 drc_gain_last;
    175   ia_shape_filter_struct shape_filter[4];
    176 } shape_filter_block;
    177 
    178 typedef struct {
    179   WORD32 level_estim_k_weighting_type;
    180   WORD32 level_estim_integration_time_present;
    181   WORD32 level_estim_integration_time;
    182   WORD32 drc_curve_definition_type;
    183   WORD32 drc_characteristic;
    184   WORD32 node_count;
    185   WORD32 node_level[PARAM_DRC_TYPE_FF_NODE_COUNT_MAX];
    186   WORD32 node_gain[PARAM_DRC_TYPE_FF_NODE_COUNT_MAX];
    187   WORD32 drc_gain_smooth_parameters_present;
    188   WORD32 gain_smooth_attack_time_slow;
    189   WORD32 gain_smooth_release_time_slow;
    190   WORD32 gain_smooth_time_fast_present;
    191   WORD32 gain_smooth_attack_time_fast;
    192   WORD32 gain_smooth_release_time_fast;
    193   WORD32 gain_smooth_threshold_present;
    194   WORD32 gain_smooth_attack_threshold;
    195   WORD32 gain_smooth_rel_threshold;
    196   WORD32 gain_smooth_hold_off_count_present;
    197   WORD32 gain_smooth_hold_off;
    198 
    199   WORD32 disable_paramteric_drc;
    200 } ia_parametric_drc_type_feed_forward_struct;
    201 
    202 typedef struct {
    203   WORD32 parametric_lim_threshold_present;
    204   FLOAT32 parametric_lim_threshold;
    205   WORD32 parametric_lim_attack;
    206   WORD32 parametric_lim_release_present;
    207   WORD32 parametric_lim_release;
    208   WORD32 drc_characteristic;
    209 
    210   WORD32 disable_paramteric_drc;
    211 } ia_parametric_drc_lim_struct;
    212 
    213 typedef struct {
    214   WORD32 parametric_drc_id;
    215   WORD32 parametric_drc_look_ahead_flag;
    216   WORD32 parametric_drc_look_ahead;
    217   WORD32 parametric_drc_preset_id_present;
    218   WORD32 parametric_drc_preset_id;
    219   WORD32 parametric_drc_type;
    220   WORD32 len_bit_size;
    221   ia_parametric_drc_type_feed_forward_struct
    222       str_parametric_drc_type_feed_forward;
    223   ia_parametric_drc_lim_struct parametric_drc_lim;
    224 
    225   WORD32 drc_characteristic;
    226   WORD32 disable_paramteric_drc;
    227 } ia_parametric_drc_instructions_struct;
    228 
    229 typedef struct {
    230   WORD32 parametric_drc_id;
    231   WORD32 side_chain_config_type;
    232   WORD32 downmix_id;
    233   WORD32 level_estim_channel_weight_format;
    234   FLOAT32 level_estim_ch_weight[MAX_CHANNEL_COUNT];
    235   WORD32 drc_input_loudness_present;
    236   FLOAT32 drc_input_loudness;
    237 
    238   WORD32 ch_count_from_dwnmix_id;
    239 } ia_parametric_drc_gain_set_params_struct;
    240 
    241 typedef struct {
    242   WORD32 drc_location;
    243   WORD32 parametric_drc_frame_size_format;
    244   WORD32 parametric_drc_frame_size;
    245   WORD32 parametric_drc_delay_max_present;
    246   WORD32 parametric_drc_delay_max;
    247   WORD32 reset_parametric_drc;
    248   WORD32 parametric_drc_gain_set_count;
    249   ia_parametric_drc_gain_set_params_struct
    250       str_parametric_drc_gain_set_params[SEQUENCE_COUNT_MAX];
    251 } ia_drc_coeff_parametric_drc_struct;
    252 
    253 typedef struct {
    254   WORD32 base_channel_count;
    255   WORD32 layout_signaling_present;
    256   WORD32 defined_layout;
    257   WORD32 speaker_position[SPEAKER_POS_COUNT_MAX];
    258 } ia_channel_layout_struct;
    259 
    260 typedef struct {
    261   WORD32 downmix_id;
    262   WORD32 target_channel_count;
    263   WORD32 target_layout;
    264   WORD32 downmix_coefficients_present;
    265   FLOAT32 downmix_coefficient[DOWNMIX_COEFF_COUNT_MAX];
    266 } ia_downmix_instructions_struct;
    267 
    268 typedef struct {
    269   WORD32 gain_seq_idx;
    270   WORD32 drc_characteristic;
    271   WORD32 drc_characteristic_present;
    272   WORD32 drc_characteristic_format_is_cicp;
    273   WORD32 drc_characteristic_left_index;
    274   WORD32 drc_characteristic_right_index;
    275   WORD32 crossover_freq_idx;
    276   WORD32 start_subband_index;
    277 } ia_gain_params_struct;
    278 
    279 typedef struct {
    280   WORD32 ducking_scaling_flag;
    281   FLOAT32 ducking_scaling;
    282   FLOAT32 ducking_scaling_quantized;
    283 } ia_ducking_modifiers_struct;
    284 
    285 typedef struct {
    286   WORD32 target_characteristic_left_present[DRC_BAND_COUNT_MAX];
    287   WORD32 target_characteristic_left_index[DRC_BAND_COUNT_MAX];
    288   WORD32 target_characteristic_right_present[DRC_BAND_COUNT_MAX];
    289   WORD32 target_characteristic_right_index[DRC_BAND_COUNT_MAX];
    290   WORD32 shape_filter_flag;
    291   WORD32 shape_filter_idx;
    292   WORD32 gain_scaling_flag[BAND_COUNT_MAX];
    293   FLOAT32 attn_scaling[BAND_COUNT_MAX];
    294   FLOAT32 ampl_scaling[BAND_COUNT_MAX];
    295   WORD32 gain_offset_flag[BAND_COUNT_MAX];
    296   FLOAT32 gain_offset[BAND_COUNT_MAX];
    297 } ia_gain_modifiers_struct;
    298 
    299 typedef struct {
    300   WORD32 gain_coding_profile;
    301   WORD32 gain_interpolation_type;
    302   WORD32 full_frame;
    303   WORD32 time_alignment;
    304   WORD32 time_delt_min_flag;
    305   WORD32 time_delt_min_val;
    306   WORD32 band_count;
    307   WORD32 drc_band_type;
    308   ia_gain_params_struct gain_params[BAND_COUNT_MAX];
    309 
    310   WORD32 num_gain_max_values;
    311   ia_tables_struct str_tables;
    312 } ia_gain_set_params_struct;
    313 
    314 #define SPLIT_CHARACTERISTIC_NODE_COUNT_MAX 4
    315 typedef struct {
    316   WORD32 characteristic_format;
    317   FLOAT32 in_out_ratio;
    318   FLOAT32 gain;
    319   FLOAT32 exp;
    320   WORD32 flip_sign;
    321   WORD32 characteristic_node_count;
    322   FLOAT32 node_level[SPLIT_CHARACTERISTIC_NODE_COUNT_MAX + 1];
    323   FLOAT32 node_gain[SPLIT_CHARACTERISTIC_NODE_COUNT_MAX + 1];
    324 } ia_split_drc_characteristic_struct;
    325 
    326 typedef struct {
    327   WORD32 corner_freq_index;
    328   WORD32 filter_strength_index;
    329 } ia_shape_filter_params_struct;
    330 
    331 typedef struct {
    332   WORD32 lf_cut_filter_present;
    333   ia_shape_filter_params_struct str_lf_cut_params;
    334   WORD32 lf_boost_filter_present;
    335   ia_shape_filter_params_struct str_lf_boost_params;
    336   WORD32 hf_cut_filter_present;
    337   ia_shape_filter_params_struct str_hfCutParams;
    338   WORD32 hf_boost_filter_present;
    339   ia_shape_filter_params_struct str_hf_boost_params;
    340 } ia_shape_filter_block_params_struct;
    341 
    342 typedef struct {
    343   WORD32 drc_location;
    344   WORD32 drc_characteristic;
    345 } ia_drc_coefficients_basic_struct;
    346 
    347 typedef struct {
    348   WORD32 version;
    349   WORD32 drc_location;
    350   WORD32 drc_frame_size_present;
    351   WORD32 drc_frame_size;
    352   WORD32 gain_set_count;
    353   ia_gain_set_params_struct gain_set_params[GAIN_SET_COUNT_MAX];
    354   WORD32 drc_characteristic_left_present;
    355   WORD32 characteristic_left_count;
    356   ia_split_drc_characteristic_struct
    357       str_split_characteristic_left[SPLIT_CHARACTERISTIC_COUNT_MAX];
    358   WORD32 drc_characteristic_right_present;
    359   WORD32 characteristic_right_count;
    360   ia_split_drc_characteristic_struct
    361       str_split_characteristic_right[SPLIT_CHARACTERISTIC_COUNT_MAX];
    362   WORD32 shape_filters_present;
    363   WORD32 shape_num_filter;
    364   ia_shape_filter_block_params_struct
    365       str_shape_filter_block_params[SHAPE_FILTER_COUNT_MAX + 1];
    366   WORD32 gain_sequence_count;
    367   WORD32 gain_set_params_index_for_gain_sequence[SEQUENCE_COUNT_MAX];
    368   WORD32 gain_set_count_plus;
    369 
    370 } ia_uni_drc_coeffs_struct;
    371 
    372 typedef struct {
    373   WORD32 drc_set_id;
    374   WORD32 drc_location;
    375   WORD32 dwnmix_id_count;
    376   WORD32 downmix_id[DOWNMIX_ID_COUNT_MAX];
    377   WORD32 drc_set_effect;
    378   WORD32 limiter_peak_target_present;
    379   FLOAT32 limiter_peak_target;
    380   WORD32 drc_set_target_loudness_present;
    381   WORD32 drc_set_target_loudness_value_upper;
    382   WORD32 drc_set_target_loudness_value_lower_present;
    383   WORD32 drc_set_target_loudness_value_lower;
    384 } ia_drc_instructions_basic_struct;
    385 
    386 typedef struct {
    387   WORD32 drc_set_id;
    388   WORD32 drc_set_complexity_level;
    389   WORD32 requires_eq;
    390   WORD32 drc_apply_to_dwnmix;
    391   WORD32 drc_location;
    392   WORD32 dwnmix_id_count;
    393   WORD32 downmix_id[DOWNMIX_ID_COUNT_MAX];
    394   WORD32 depends_on_drc_set_present;
    395   WORD32 depends_on_drc_set;
    396   WORD32 no_independent_use;
    397   WORD32 drc_set_effect;
    398   WORD32 gain_set_index[MAX_CHANNEL_COUNT];
    399   ia_gain_modifiers_struct
    400       str_gain_modifiers_of_ch_group[CHANNEL_GROUP_COUNT_MAX];
    401   ia_ducking_modifiers_struct
    402       str_ducking_modifiers_for_channel[MAX_CHANNEL_COUNT];
    403   WORD32 limiter_peak_target_present;
    404   FLOAT32 limiter_peak_target;
    405   WORD32 drc_set_target_loudness_present;
    406   WORD32 drc_set_target_loudness_value_upper;
    407   WORD32 drc_set_target_loudness_value_lower_present;
    408   WORD32 drc_set_target_loudness_value_lower;
    409 
    410   WORD32 audio_num_chan;
    411   WORD32 num_drc_ch_groups;
    412   WORD32 gain_set_index_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
    413   WORD32 band_count_of_ch_group[CHANNEL_GROUP_COUNT_MAX];
    414   WORD32 gain_interpolation_type_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
    415   WORD32 time_delta_min_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
    416   WORD32 time_alignment_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
    417   ia_ducking_modifiers_struct
    418       str_ducking_modifiers_for_channel_group[CHANNEL_GROUP_COUNT_MAX];
    419   WORD32 channel_group_of_ch[MAX_CHANNEL_COUNT];
    420   WORD32 num_chan_per_ch_group[CHANNEL_GROUP_COUNT_MAX];
    421   WORD32 gain_element_count;
    422   WORD32 multiband_audio_sig_count;
    423   WORD32 ch_group_parametric_drc_flag[CHANNEL_GROUP_COUNT_MAX];
    424   WORD32 gain_set_idx_of_ch_group_parametric_drc[CHANNEL_GROUP_COUNT_MAX];
    425   WORD32 parametric_drc_look_ahead_samples[CHANNEL_GROUP_COUNT_MAX];
    426   WORD32 parametric_drc_look_ahead_samples_max;
    427 } ia_drc_instructions_struct;
    428 
    429 typedef struct {
    430   WORD32 method_def;
    431   FLOAT32 method_val;
    432   WORD32 measurement_system;
    433   WORD32 reliability;
    434 } ia_loudness_measure_struct;
    435 
    436 typedef struct {
    437   WORD32 drc_set_id;
    438   WORD32 eq_set_id;
    439   WORD32 downmix_id;
    440   WORD32 sample_peak_level_present;
    441   FLOAT32 sample_peak_level;
    442   WORD32 true_peak_level_present;
    443   FLOAT32 true_peak_level;
    444   WORD32 true_peak_level_measurement_system;
    445   WORD32 true_peak_level_reliability;
    446   WORD32 measurement_count;
    447   ia_loudness_measure_struct loudness_measure[MEASUREMENT_COUNT_MAX];
    448 } ia_loudness_info_struct;
    449 
    450 typedef struct {
    451   WORD32 loud_eq_set_id;
    452   WORD32 drc_location;
    453   WORD32 dwnmix_id_count;
    454   WORD32 downmix_id[DOWNMIX_ID_COUNT_MAX];
    455   WORD32 drc_set_id_count;
    456   WORD32 drc_set_id[DRC_SET_ID_COUNT_MAX];
    457   WORD32 eq_set_id_count;
    458   WORD32 eq_set_id[EQ_SET_ID_COUNT_MAX];
    459   WORD32 loudness_after_drc;
    460   WORD32 loudness_after_eq;
    461   WORD32 loud_eq_gain_sequence_count;
    462   WORD32 gain_seq_idx[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
    463   WORD32 drc_characteristic_format_is_cicp[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
    464   WORD32 drc_characteristic[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
    465   WORD32 drc_characteristic_left_index[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
    466   WORD32 drc_characteristic_right_index[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
    467   WORD32 frequency_range_index[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
    468   FLOAT32 loud_eq_scaling[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
    469   FLOAT32 loud_eq_offset[LOUD_EQ_GAIN_SEQUENCE_COUNT_MAX];
    470 } ia_loud_eq_instructions_struct;
    471 
    472 typedef struct {
    473   WORD32 filt_ele_idx;
    474   WORD32 filt_ele_gain_flag;
    475   FLOAT32 filt_ele_gain;
    476 } ia_filt_ele_struct;
    477 
    478 typedef struct {
    479   WORD32 filter_element_count;
    480   ia_filt_ele_struct str_filter_element[FILTER_ELEMENT_COUNT_MAX];
    481 } ia_filt_block_struct;
    482 
    483 typedef struct {
    484   WORD32 eq_filter_format;
    485   WORD32 bs_real_zero_radius_one_count;
    486   WORD32 real_zero_count;
    487   WORD32 generic_zero_count;
    488   WORD32 real_pole_count;
    489   WORD32 cmplx_pole_count;
    490   WORD32 zero_sign[REAL_ZERO_RADIUS_ONE_COUNT_MAX];
    491   FLOAT32 real_zero_radius[REAL_ZERO_COUNT_MAX];
    492   FLOAT32 generic_zero_radius[COMPLEX_ZERO_COUNT_MAX];
    493   FLOAT32 generic_zero_angle[COMPLEX_ZERO_COUNT_MAX];
    494   FLOAT32 real_pole_radius[REAL_POLE_COUNT_MAX];
    495   FLOAT32 complex_pole_radius[COMPLEX_POLE_COUNT_MAX];
    496   FLOAT32 complex_pole_angle[COMPLEX_POLE_COUNT_MAX];
    497   WORD32 fir_filt_order;
    498   WORD32 fir_symmetry;
    499   FLOAT32 fir_coeff[FIR_ORDER_MAX / 2];
    500 } ia_unique_td_filt_element;
    501 
    502 typedef struct {
    503   WORD32 num_eq_nodes;
    504   FLOAT32 eq_slope[EQ_NODE_COUNT_MAX];
    505   WORD32 eq_freq_delta[EQ_NODE_COUNT_MAX];
    506   FLOAT32 eq_gain_initial;
    507   FLOAT32 eq_gain_delta[EQ_NODE_COUNT_MAX];
    508 } ia_eq_subband_gain_spline_struct;
    509 
    510 typedef struct {
    511   FLOAT32 eq_subband_gain[EQ_SUBBAND_GAIN_COUNT_MAX];
    512 } ia_eq_subband_gain_vector;
    513 
    514 typedef struct {
    515   WORD32 eq_delay_max_present;
    516   WORD32 eq_delay_max;
    517   WORD32 unique_filter_block_count;
    518   ia_filt_block_struct str_filter_block[FILTER_BLOCK_COUNT_MAX];
    519   WORD32 unique_td_filter_element_count;
    520   ia_unique_td_filt_element unique_td_filt_ele[FILTER_ELEMENT_COUNT_MAX];
    521   WORD32 unique_eq_subband_gains_count;
    522   WORD32 eq_subband_gain_representation;
    523   WORD32 eq_subband_gain_format;
    524   WORD32 eq_subband_gain_count;
    525   ia_eq_subband_gain_spline_struct
    526       str_eq_subband_gain_spline[UNIQUE_SUBBAND_GAIN_COUNT_MAX];
    527   ia_eq_subband_gain_vector
    528       str_eq_subband_gain_vector[UNIQUE_SUBBAND_GAIN_COUNT_MAX];
    529 } ia_eq_coeff_struct;
    530 
    531 typedef struct {
    532   WORD32 filter_block_count;
    533   WORD32 filter_block_index[EQ_FILTER_BLOCK_COUNT_MAX];
    534 } ia_filter_block_refs_struct;
    535 
    536 typedef struct {
    537   WORD32 eq_cascade_gain_present[EQ_CHANNEL_GROUP_COUNT_MAX];
    538   FLOAT32 eq_cascade_gain[EQ_CHANNEL_GROUP_COUNT_MAX];
    539   ia_filter_block_refs_struct str_filter_block_refs[EQ_CHANNEL_GROUP_COUNT_MAX];
    540   WORD32 eq_phase_alignment_present;
    541   WORD32 eq_phase_alignment[EQ_CHANNEL_GROUP_COUNT_MAX]
    542                            [EQ_CHANNEL_GROUP_COUNT_MAX];
    543 } ia_td_filter_cascade_struct;
    544 
    545 typedef struct {
    546   WORD32 eq_set_id;
    547   WORD32 eq_set_complexity_level;
    548   WORD32 dwnmix_id_count;
    549   WORD32 downmix_id[DOWNMIX_ID_COUNT_MAX];
    550   WORD32 eq_apply_to_downmix;
    551   WORD32 drc_set_id_count;
    552   WORD32 drc_set_id[DRC_SET_ID_COUNT_MAX];
    553   WORD32 eq_set_purpose;
    554   WORD32 depends_on_eq_set_present;
    555   WORD32 depends_on_eq_set;
    556   WORD32 no_independent_eq_use;
    557   WORD32 eq_channel_count;
    558   WORD32 eq_ch_group_count;
    559   WORD32 eq_ch_group_of_channel[MAX_CHANNEL_COUNT];
    560   WORD32 td_filter_cascade_present;
    561   ia_td_filter_cascade_struct str_td_filter_cascade;
    562   WORD32 subband_gains_present;
    563   WORD32 subband_gains_index[EQ_CHANNEL_GROUP_COUNT_MAX];
    564   WORD32 eq_transition_duration_present;
    565   WORD32 eq_transition_duration;
    566 } ia_eq_instructions_struct;
    567 
    568 typedef struct {
    569   WORD32 drc_config_ext_type[EXT_COUNT_MAX];
    570   WORD32 ext_bit_size[EXT_COUNT_MAX - 1];
    571 
    572   WORD32 parametric_drc_present;
    573   ia_drc_coeff_parametric_drc_struct str_drc_coeff_param_drc;
    574   WORD32 parametric_drc_instructions_count;
    575   ia_parametric_drc_instructions_struct
    576       str_parametric_drc_instructions[PARAM_DRC_INSTRUCTIONS_COUNT_MAX];
    577   WORD32 drc_extension_v1_present;
    578   WORD32 loud_eq_instructions_flag;
    579   WORD32 loud_eq_instructions_count;
    580   ia_loud_eq_instructions_struct
    581       loud_eq_instructions[LOUD_EQ_INSTRUCTIONS_COUNT_MAX];
    582   WORD32 eq_flag;
    583   ia_eq_coeff_struct str_eq_coeff;
    584   WORD32 eq_instructions_count;
    585   ia_eq_instructions_struct str_eq_instructions[EQ_INSTRUCTIONS_COUNT_MAX];
    586 } ia_drc_config_ext;
    587 
    588 typedef struct ia_drc_config {
    589   WORD32 sample_rate_present;
    590   WORD32 sampling_rate;
    591   WORD32 dwnmix_instructions_count;
    592   WORD32 drc_coefficients_drc_count;
    593   WORD32 drc_instructions_uni_drc_count;
    594   WORD32 drc_instructions_count_plus;
    595   WORD32 drc_description_basic_present;
    596   WORD32 drc_coefficients_basic_count;
    597   WORD32 drc_instructions_basic_count;
    598   WORD32 drc_config_ext_present;
    599   WORD32 apply_drc;
    600   ia_drc_config_ext str_drc_config_ext;
    601   ia_drc_coefficients_basic_struct
    602       str_drc_coefficients_basic[DRC_COEFF_COUNT_MAX];
    603   ia_drc_instructions_basic_struct
    604       str_drc_instructions_basic[DRC_INSTRUCTIONS_COUNT_MAX];
    605   ia_uni_drc_coeffs_struct
    606       str_p_loc_drc_coefficients_uni_drc[DRC_COEFF_COUNT_MAX];
    607   ia_drc_instructions_struct
    608       str_drc_instruction_str[DRC_INSTRUCTIONS_COUNT_MAX];
    609   ia_channel_layout_struct channel_layout;
    610   ia_downmix_instructions_struct
    611       dwnmix_instructions[DOWNMIX_INSTRUCTION_COUNT_MAX];
    612 } ia_drc_config;
    613 
    614 typedef struct {
    615   WORD32 loudness_info_set_ext_type[EXT_COUNT_MAX];
    616   WORD32 ext_bit_size[EXT_COUNT_MAX - 1];
    617 } ia_loudness_info_set_ext_struct;
    618 
    619 typedef struct ia_drc_loudness_info_set_struct {
    620   WORD32 loudness_info_album_count;
    621   WORD32 loudness_info_count;
    622   WORD32 loudness_info_set_ext_present;
    623   ia_loudness_info_struct str_loudness_info_album[LOUDNESS_INFO_COUNT_MAX];
    624   ia_loudness_info_struct loudness_info[LOUDNESS_INFO_COUNT_MAX];
    625   ia_loudness_info_set_ext_struct str_loudness_info_set_ext;
    626 } ia_drc_loudness_info_set_struct;
    627 
    628 typedef struct {
    629   FLOAT32 loc_db_gain;
    630   FLOAT32 slope;
    631   WORD32 time;
    632 } ia_node_struct;
    633 
    634 typedef struct {
    635   WORD32 drc_gain_coding_mode;
    636   WORD32 num_nodes;
    637   ia_node_struct str_node[NODE_COUNT_MAX];
    638 } ia_spline_nodes_struct;
    639 
    640 typedef struct {
    641   ia_spline_nodes_struct str_spline_nodes[1];
    642 } ia_drc_gain_sequence_struct;
    643 
    644 typedef struct {
    645   WORD32 uni_drc_gain_ext_type[EXT_COUNT_MAX];
    646   WORD32 ext_bit_size[EXT_COUNT_MAX - 1];
    647 } ia_uni_drc_gain_ext_struct;
    648 
    649 typedef struct ia_drc_gain_struct {
    650   WORD32 num_drc_gain_sequences;
    651   ia_drc_gain_sequence_struct drc_gain_sequence[SEQUENCE_COUNT_MAX];
    652   WORD32 uni_drc_gain_ext_flag;
    653   ia_uni_drc_gain_ext_struct uni_drc_gain_ext;
    654 } ia_drc_gain_struct;
    655 
    656 typedef struct {
    657   WORD32 delta_tmin_default;
    658   WORD32 drc_frame_size;
    659   WORD32 num_gain_values_max_default;
    660   WORD32 delay_mode;
    661   WORD32 lfe_channel_map_count;
    662   WORD32 lfe_channel_map[MAX_CHANNEL_COUNT];
    663 } ia_drc_params_bs_dec_struct;
    664 
    665 typedef struct ia_drc_bits_dec_struct {
    666   ia_tables_struct tables_default;
    667   ia_drc_params_bs_dec_struct ia_drc_params_struct;
    668 
    669 } ia_drc_bits_dec_struct;
    670 
    671 #ifdef __cplusplus
    672 }
    673 #endif
    674 #endif
    675