• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_SEL_PROC_DRC_SET_SEL_H
21 #define IMPD_DRC_SEL_PROC_DRC_SET_SEL_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
26 
27 #define SELECTION_FLAG_DRC_TARGET_LOUDNESS_MATCH (1 << 0)
28 #define SELECTION_FLAG_EXPLICIT_PEAK_INFO_PRESENT (1 << 1)
29 
30 typedef struct {
31   WORD32 drc_instructions_index;
32   WORD32 downmix_id_request_index;
33   WORD32 eq_set_id;
34   FLOAT32 output_peak_level;
35   FLOAT32 loudness_norm_db_gain_adjusted;
36   FLOAT32 output_loudness;
37   FLOAT32 mixing_level;
38   WORD32 selection_flags;
39 } ia_selection_candidate_info_struct;
40 
41 WORD32
42 impd_validate_requested_drc_feature(
43     ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
44 
45 WORD32
46 impd_map_requested_effect_bit_idx(WORD32 requested_effect_type,
47                                   WORD32* effect_bit_idx);
48 
49 WORD32
50 impd_get_fading_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
51 
52 WORD32
53 impd_get_ducking_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
54 
55 WORD32
56 impd_get_selected_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
57                           WORD32 drc_set_id_selected);
58 
59 WORD32
60 impd_get_dependent_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
61 
62 WORD32
63 impd_get_dependent_drc_instructions(
64     const ia_drc_config* drc_config,
65     const ia_drc_instructions_struct* str_drc_instruction_str,
66     ia_drc_instructions_struct** ppstr_drc_instructions_dependent);
67 
68 WORD32
69 impd_manage_drc_complexity(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
70                            ia_drc_config* pstr_drc_config);
71 
72 WORD32
73 impd_manage_eq_complexity(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
74                           ia_drc_config* pstr_drc_config);
75 
76 WORD32
77 impd_manage_complexity(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
78                        ia_drc_config* pstr_drc_config,
79                        WORD32* repeat_selection);
80 
81 WORD32
82 impd_get_selected_eq_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
83                          WORD32 eq_set_id_selected);
84 WORD32
85 impd_get_dependent_eq_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
86 
87 WORD32
88 impd_get_selected_loud_eq_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
89                               WORD32 loudEqSetIdSelected);
90 
91 WORD32
92 impd_select_drcs_without_compr_effects(
93     ia_drc_config* pstr_drc_config, WORD32* match_found_flag,
94     WORD32* selection_candidate_count,
95     ia_selection_candidate_info_struct* selection_candidate_info);
96 
97 WORD32
98 impd_match_effect_type_attempt(
99     ia_drc_config* pstr_drc_config, WORD32 requested_effect_type,
100     WORD32 stateRequested, WORD32* match_found_flag,
101     WORD32* selection_candidate_count,
102     ia_selection_candidate_info_struct* selection_candidate_info);
103 
104 WORD32
105 impd_match_effect_types(
106     ia_drc_config* pstr_drc_config, WORD32 total_effect_type_requested,
107     WORD32 desired_effect_type_requested, WORD32* requested_effect_type,
108     WORD32* selection_candidate_count,
109     ia_selection_candidate_info_struct* selection_candidate_info);
110 
111 WORD32 impd_match_dynamic_range(
112     ia_drc_config* pstr_drc_config,
113     ia_drc_loudness_info_set_struct* pstr_loudness_info,
114     ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
115     WORD32 num_drc_requests, WORD32* selection_candidate_count,
116     ia_selection_candidate_info_struct* selection_candidate_info);
117 
118 WORD32
119 impd_match_drc_characteristic_attempt(
120     ia_drc_config* pstr_drc_config, WORD32 requested_drc_characteristic,
121     WORD32* match_found_flag, WORD32* selection_candidate_count,
122     ia_selection_candidate_info_struct* selection_candidate_info);
123 
124 WORD32
125 impd_match_drc_characteristic(
126     ia_drc_config* pstr_drc_config, WORD32 requested_drc_characteristic,
127     WORD32* selection_candidate_count,
128     ia_selection_candidate_info_struct* selection_candidate_info);
129 
130 VOID impd_select_drc_coeff3(
131     ia_drc_config* drc_config,
132     ia_uni_drc_coeffs_struct** str_p_loc_drc_coefficients_uni_drc);
133 
134 WORD32
135 impd_drc_set_preselection(
136     ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
137     ia_drc_config* pstr_drc_config,
138     ia_drc_loudness_info_set_struct* pstr_loudness_info,
139     WORD32 restrict_to_drc_with_album_loudness,
140     ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
141     WORD32* selection_candidate_count,
142     ia_selection_candidate_info_struct* selection_candidate_info);
143 
144 WORD32 impd_drc_set_final_selection(
145     ia_drc_config* pstr_drc_config,
146     ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct,
147     WORD32* selection_candidate_count,
148     ia_selection_candidate_info_struct* selection_candidate_info,
149     WORD32* eq_set_id_valid_flag);
150 
151 WORD32 impd_match_eq_set_purpose(
152     ia_drc_config* drc_config, WORD32 eq_set_purpose_requested,
153     WORD32* eq_set_id_valid_flag, WORD32* selection_candidate_count,
154     ia_selection_candidate_info_struct* selection_candidate_info,
155     ia_selection_candidate_info_struct* selection_candidate_info_step_2);
156 
157 WORD32
158 impd_select_drc_set(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
159                     WORD32* drc_set_id_selected, WORD32* eq_set_id_selected,
160                     WORD32* loud_eq_id_sel);
161 
162 WORD32
163 impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc);
164 
165 WORD32
166 impd_drc_sel_proc_init_sel_proc_params(
167     ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
168     ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct);
169 
170 VOID impd_drc_sel_proc_init_interface_params(
171     ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
172     ia_drc_interface_struct* pstr_drc_interface);
173 
174 #ifdef __cplusplus
175 }
176 #endif /* __cplusplus */
177 
178 #endif
179