aboutsummaryrefslogtreecommitdiff
path: root/decoder/drc_src/impd_drc_interface_decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/drc_src/impd_drc_interface_decoder.c')
-rw-r--r--decoder/drc_src/impd_drc_interface_decoder.c255
1 files changed, 132 insertions, 123 deletions
diff --git a/decoder/drc_src/impd_drc_interface_decoder.c b/decoder/drc_src/impd_drc_interface_decoder.c
index dd0d5e6..35b1f3c 100644
--- a/decoder/drc_src/impd_drc_interface_decoder.c
+++ b/decoder/drc_src/impd_drc_interface_decoder.c
@@ -30,139 +30,148 @@
#include "impd_drc_parser_interface.h"
WORD32
-impd_drc_dec_interface_process(
- ia_bit_buf_struct* it_bit_buff,
- ia_drc_interface_struct* pstr_drc_interface,
- UWORD8* it_bit_buf,
- WORD32 num_bit_stream_bits,
- WORD32* num_bits_read)
-{
- WORD32 err = 0;
-
- if (it_bit_buff != NULL && num_bit_stream_bits) {
- it_bit_buff = impd_create_init_bit_buf(it_bit_buff, it_bit_buf, num_bit_stream_bits/8);
+impd_drc_dec_interface_process(ia_bit_buf_struct* it_bit_buff,
+ ia_drc_interface_struct* pstr_drc_interface,
+ UWORD8* it_bit_buf, WORD32 num_bit_stream_bits,
+ WORD32* num_bits_read) {
+ WORD32 err = 0;
- } else {
- return -1;
- }
+ if (it_bit_buff != NULL && num_bit_stream_bits) {
+ it_bit_buff = impd_create_init_bit_buf(it_bit_buff, it_bit_buf,
+ num_bit_stream_bits / 8);
- err = impd_unidrc_interface_read(it_bit_buff, pstr_drc_interface);
- if (err) return(err);
+ } else {
+ return -1;
+ }
- *num_bits_read = (it_bit_buff->size ) - it_bit_buff->cnt_bits;
+ err = impd_unidrc_interface_read(it_bit_buff, pstr_drc_interface);
+ if (err) return (err);
- return err;
+ *num_bits_read = (it_bit_buff->size) - it_bit_buff->cnt_bits;
+ return err;
}
-
WORD32
-impd_drc_dec_interface_add_effect_type(ia_drc_interface_struct* pstr_drc_interface,
- WORD32 drc_effect_type,
- WORD32 target_loudness,
- WORD32 loud_norm)
-{
- WORD32 err = 0;
- WORD32 i = 0;
-
- if (pstr_drc_interface != NULL)
- {
- pstr_drc_interface->interface_signat_flag = 0;
- for(i=0;i<MAX_SIGNATURE_DATA_LENGTH_PLUS_ONE * 8;i++)
- pstr_drc_interface->drc_uni_interface_signature.interface_signat_data[i] = 0;
-
- pstr_drc_interface->drc_uni_interface_signature.interface_signat_data_len = 0;
-
- pstr_drc_interface->system_interface_flag = 1;
-
- pstr_drc_interface->system_interface.target_config_request_type = 0;
- pstr_drc_interface->system_interface.num_downmix_id_requests = 0;
- for (i = 0; i < MAX_NUM_DOWNMIX_ID_REQUESTS; i++)
- {
- pstr_drc_interface->system_interface.requested_dwnmix_id[i] = 0;
- }
- pstr_drc_interface->system_interface.requested_target_layout = 0;
- pstr_drc_interface->system_interface.requested_target_ch_count = 0;
-
- pstr_drc_interface->loudness_norm_ctrl_interface_flag= 1;
- if(loud_norm==1)
- {
- pstr_drc_interface->loudness_norm_ctrl_interface.loudness_normalization_on = 1;
- }
- else
- {
- pstr_drc_interface->loudness_norm_ctrl_interface.loudness_normalization_on = 0;
- }
- pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness = (FLOAT32)target_loudness;
-
- pstr_drc_interface->loudness_norm_parameter_interface_flag = 1;
- pstr_drc_interface->loudness_norm_param_interface.album_mode = 0;
- pstr_drc_interface->loudness_norm_param_interface.peak_limiter = 0;
- pstr_drc_interface->loudness_norm_param_interface.change_loudness_deviation_max = 1;
- pstr_drc_interface->loudness_norm_param_interface.loudness_deviation_max = 63;
- pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_method = 1;
- pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_method = 1;
- pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_system = 1;
- pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_system = 1;
- pstr_drc_interface->loudness_norm_param_interface.change_loudness_measur_pre_proc = 0;
- pstr_drc_interface->loudness_norm_param_interface.loudness_measurement_pre_proc = 0;
- pstr_drc_interface->loudness_norm_param_interface.change_device_cut_off_freq = 1;
- pstr_drc_interface->loudness_norm_param_interface.device_cut_off_frequency = 20;
- pstr_drc_interface->loudness_norm_param_interface.change_loudness_norm_gain_db_max = 1;
- pstr_drc_interface->loudness_norm_param_interface.loudness_norm_gain_db_max = 1000.0;
- pstr_drc_interface->loudness_norm_param_interface.change_loudness_norm_gain_modification_db = 1;
- pstr_drc_interface->loudness_norm_param_interface.loudness_norm_gain_modification_db = 0.0;
- pstr_drc_interface->loudness_norm_param_interface.change_output_peak_level_max = 1;
- pstr_drc_interface->loudness_norm_param_interface.output_peak_level_max = 0.0;
-
- pstr_drc_interface->drc_interface_flag = 1;
- if(drc_effect_type==-1)
- {
- pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on=0;
- pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[0][0] = 0;
- }
- else if(drc_effect_type==0)
- {
- pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on=1;
- pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests = 0;
- }
- else
- {
- pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on = 1;
- pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[0][0] = drc_effect_type;
- pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests = 3;
- pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[0] = 0;
- pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[1] = 1;
- pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[2] = 2;
- pstr_drc_interface->drc_ctrl_interface.requested_num_drc_effects[0] = 1;
- pstr_drc_interface->drc_ctrl_interface.desired_num_drc_effects_of_requested[0] = 1;
- }
-
- pstr_drc_interface->drc_ctrl_interface.requested_dyn_rng_measurement_type[0] = 0;
- pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_is_single_val_flag[0] = 0;
- pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_is_single_val_flag[1] = 0;
- pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_min_val[1] = 3.0f;
- pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_max_val[1] = 10.0f;
- pstr_drc_interface->drc_ctrl_interface.requested_drc_characteristic[2] = 3;
-
- pstr_drc_interface->drc_parameter_interface_flag = 1;
- pstr_drc_interface->drc_parameter_interface.change_compress = 1;
- pstr_drc_interface->drc_parameter_interface.change_boost = 1;
- pstr_drc_interface->drc_parameter_interface.compress = 1.0f;
- pstr_drc_interface->drc_parameter_interface.boost = 1.0f;
- pstr_drc_interface->drc_parameter_interface.change_drc_characteristic_target = 1;
- pstr_drc_interface->drc_parameter_interface.drc_characteristic_target = 0;
-
-
- pstr_drc_interface->drc_uni_interface_ext_flag = 0;
-
+impd_drc_dec_interface_add_effect_type(
+ ia_drc_interface_struct* pstr_drc_interface, WORD32 drc_effect_type,
+ WORD32 target_loudness, WORD32 loud_norm) {
+ WORD32 err = 0;
+ WORD32 i = 0;
+
+ if (pstr_drc_interface != NULL) {
+ pstr_drc_interface->interface_signat_flag = 0;
+ for (i = 0; i < MAX_SIGNATURE_DATA_LENGTH_PLUS_ONE * 8; i++)
+ pstr_drc_interface->drc_uni_interface_signature.interface_signat_data[i] =
+ 0;
+
+ pstr_drc_interface->drc_uni_interface_signature.interface_signat_data_len =
+ 0;
+
+ pstr_drc_interface->system_interface_flag = 1;
+
+ pstr_drc_interface->system_interface.target_config_request_type = 0;
+ pstr_drc_interface->system_interface.num_downmix_id_requests = 0;
+ for (i = 0; i < MAX_NUM_DOWNMIX_ID_REQUESTS; i++) {
+ pstr_drc_interface->system_interface.requested_dwnmix_id[i] = 0;
+ }
+ pstr_drc_interface->system_interface.requested_target_layout = 0;
+ pstr_drc_interface->system_interface.requested_target_ch_count = 0;
+ pstr_drc_interface->loudness_norm_ctrl_interface_flag = 1;
+ if (loud_norm == 1) {
+ pstr_drc_interface->loudness_norm_ctrl_interface
+ .loudness_normalization_on = 1;
+ } else {
+ pstr_drc_interface->loudness_norm_ctrl_interface
+ .loudness_normalization_on = 0;
}
- else
- {
- return UNEXPECTED_ERROR;
+ pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness =
+ (FLOAT32)target_loudness;
+
+ pstr_drc_interface->loudness_norm_parameter_interface_flag = 1;
+ pstr_drc_interface->loudness_norm_param_interface.album_mode = 0;
+ pstr_drc_interface->loudness_norm_param_interface.peak_limiter = 0;
+ pstr_drc_interface->loudness_norm_param_interface
+ .change_loudness_deviation_max = 1;
+ pstr_drc_interface->loudness_norm_param_interface.loudness_deviation_max =
+ 63;
+ pstr_drc_interface->loudness_norm_param_interface
+ .change_loudness_measur_method = 1;
+ pstr_drc_interface->loudness_norm_param_interface
+ .loudness_measurement_method = 1;
+ pstr_drc_interface->loudness_norm_param_interface
+ .change_loudness_measur_system = 1;
+ pstr_drc_interface->loudness_norm_param_interface
+ .loudness_measurement_system = 1;
+ pstr_drc_interface->loudness_norm_param_interface
+ .change_loudness_measur_pre_proc = 0;
+ pstr_drc_interface->loudness_norm_param_interface
+ .loudness_measurement_pre_proc = 0;
+ pstr_drc_interface->loudness_norm_param_interface
+ .change_device_cut_off_freq = 1;
+ pstr_drc_interface->loudness_norm_param_interface.device_cut_off_frequency =
+ 20;
+ pstr_drc_interface->loudness_norm_param_interface
+ .change_loudness_norm_gain_db_max = 1;
+ pstr_drc_interface->loudness_norm_param_interface
+ .loudness_norm_gain_db_max = 1000.0;
+ pstr_drc_interface->loudness_norm_param_interface
+ .change_loudness_norm_gain_modification_db = 1;
+ pstr_drc_interface->loudness_norm_param_interface
+ .loudness_norm_gain_modification_db = 0.0;
+ pstr_drc_interface->loudness_norm_param_interface
+ .change_output_peak_level_max = 1;
+ pstr_drc_interface->loudness_norm_param_interface.output_peak_level_max =
+ 0.0;
+
+ pstr_drc_interface->drc_interface_flag = 1;
+ if (drc_effect_type == -1) {
+ pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on = 0;
+ pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[0][0] =
+ 0;
+ } else if (drc_effect_type == 0) {
+ pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on = 1;
+ pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests = 0;
+ } else {
+ pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on = 1;
+ pstr_drc_interface->drc_ctrl_interface.requested_drc_effect_type[0][0] =
+ drc_effect_type;
+ pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests = 3;
+ pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[0] = 0;
+ pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[1] = 1;
+ pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[2] = 2;
+ pstr_drc_interface->drc_ctrl_interface.requested_num_drc_effects[0] = 1;
+ pstr_drc_interface->drc_ctrl_interface
+ .desired_num_drc_effects_of_requested[0] = 1;
}
-
- return err;
+ pstr_drc_interface->drc_ctrl_interface
+ .requested_dyn_rng_measurement_type[0] = 0;
+ pstr_drc_interface->drc_ctrl_interface
+ .requested_dyn_range_is_single_val_flag[0] = 0;
+ pstr_drc_interface->drc_ctrl_interface
+ .requested_dyn_range_is_single_val_flag[1] = 0;
+ pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_min_val[1] =
+ 3.0f;
+ pstr_drc_interface->drc_ctrl_interface.requested_dyn_range_max_val[1] =
+ 10.0f;
+ pstr_drc_interface->drc_ctrl_interface.requested_drc_characteristic[2] = 3;
+
+ pstr_drc_interface->drc_parameter_interface_flag = 1;
+ pstr_drc_interface->drc_parameter_interface.change_compress = 1;
+ pstr_drc_interface->drc_parameter_interface.change_boost = 1;
+ pstr_drc_interface->drc_parameter_interface.compress = 1.0f;
+ pstr_drc_interface->drc_parameter_interface.boost = 1.0f;
+ pstr_drc_interface->drc_parameter_interface
+ .change_drc_characteristic_target = 1;
+ pstr_drc_interface->drc_parameter_interface.drc_characteristic_target = 0;
+
+ pstr_drc_interface->drc_uni_interface_ext_flag = 0;
+
+ } else {
+ return UNEXPECTED_ERROR;
+ }
+
+ return err;
}