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 #include <stdio.h>
21 #include <stdlib.h>
22 #include <string.h>
23 #include "impd_type_def.h"
24 #include "impd_drc_extr_delta_coded_info.h"
25 #include "impd_drc_common.h"
26 #include "impd_drc_struct.h"
27 #include "impd_drc_interface.h"
28 #include "impd_drc_selection_process.h"
29
impd_drc_sel_proc_init_dflt(ia_drc_sel_pro_struct * pstr_drc_uni_sel_proc)30 WORD32 impd_drc_sel_proc_init_dflt(
31 ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc) {
32 if (pstr_drc_uni_sel_proc != NULL) {
33 pstr_drc_uni_sel_proc->first_frame = 0;
34
35 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.base_channel_count = -1;
36 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.base_layout = -1;
37 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_config_request_type =
38 0;
39 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_downmix_id_requests = 0;
40
41 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.album_mode = 0;
42
43 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter = 0;
44
45 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_normalization_on =
46 0;
47 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_loudness = -24.0f;
48
49 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_deviation_max =
50 LOUDNESS_DEVIATION_MAX_DEFAULT;
51
52 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_method =
53 USER_METHOD_DEFINITION_DEFAULT;
54 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_measurement_system =
55 USER_MEASUREMENT_SYSTEM_DEFAULT;
56 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
57 .loudness_measurement_pre_proc = USER_LOUDNESS_PREPROCESSING_DEFAULT;
58 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.device_cut_off_frequency =
59 500;
60 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_norm_gain_db_max =
61 LOUDNESS_NORMALIZATION_GAIN_MAX_DEFAULT;
62 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
63 .loudness_norm_gain_modification_db = 0.0f;
64 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max = 0.0f;
65 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter == 1) {
66 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max =
67 6.0f;
68 }
69
70 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.dynamic_range_control_on = 1;
71 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_bands_supported = 4;
72 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.num_drc_feature_requests = 0;
73
74 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.boost = 1.f;
75 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.compress = 1.f;
76 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.drc_characteristic_target =
77 0;
78
79 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_eq_request =
80 LOUD_EQ_REQUEST_OFF;
81 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.eq_set_purpose_request =
82 EQ_PURPOSE_EQ_OFF;
83 pstr_drc_uni_sel_proc->compl_level_supported_total =
84 COMPLEXITY_LEVEL_SUPPORTED_TOTAL;
85
86 pstr_drc_uni_sel_proc->drc_inst_index_sel = -1;
87 pstr_drc_uni_sel_proc->drc_coef_index_sel = -1;
88 pstr_drc_uni_sel_proc->downmix_inst_index_sel = -1;
89 pstr_drc_uni_sel_proc->drc_instructions_index[0] = -1;
90 pstr_drc_uni_sel_proc->drc_instructions_index[1] = -1;
91 pstr_drc_uni_sel_proc->drc_instructions_index[2] = -1;
92 pstr_drc_uni_sel_proc->drc_instructions_index[3] = -1;
93 pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.output_peak_level_db = 0;
94 pstr_drc_uni_sel_proc->uni_drc_sel_proc_output
95 .loudness_normalization_gain_db = 0;
96 pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.output_loudness =
97 UNDEFINED_LOUDNESS_VALUE;
98 pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.num_sel_drc_sets = 0;
99 pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.active_downmix_id = 0;
100 pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.base_channel_count = 0;
101 pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.target_channel_count = 0;
102 pstr_drc_uni_sel_proc->uni_drc_sel_proc_output.downmix_matrix_present = 0;
103
104 pstr_drc_uni_sel_proc->eq_inst_index[0] = -1;
105 pstr_drc_uni_sel_proc->eq_inst_index[1] = -1;
106 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
107 } else {
108 return 1;
109 }
110
111 return 0;
112 }
113 WORD32
impd_drc_sel_proc_init_sel_proc_params(ia_drc_sel_pro_struct * pstr_drc_uni_sel_proc,ia_drc_sel_proc_params_struct * pstr_drc_sel_proc_params_struct)114 impd_drc_sel_proc_init_sel_proc_params(
115 ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
116 ia_drc_sel_proc_params_struct* pstr_drc_sel_proc_params_struct) {
117 if (pstr_drc_uni_sel_proc != NULL &&
118 pstr_drc_sel_proc_params_struct != NULL) {
119 if (memcmp(&pstr_drc_uni_sel_proc->uni_drc_sel_proc_params,
120 pstr_drc_sel_proc_params_struct,
121 sizeof(ia_drc_sel_proc_params_struct))) {
122 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params =
123 *pstr_drc_sel_proc_params_struct;
124 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
125 }
126 }
127
128 return 0;
129 }
130 WORD32
impd_drc_sel_proc_init_interface_params(ia_drc_sel_pro_struct * pstr_drc_uni_sel_proc,ia_drc_interface_struct * pstr_drc_interface)131 impd_drc_sel_proc_init_interface_params(
132 ia_drc_sel_pro_struct* pstr_drc_uni_sel_proc,
133 ia_drc_interface_struct* pstr_drc_interface) {
134 WORD32 i, j;
135
136 if (pstr_drc_uni_sel_proc != NULL && pstr_drc_interface != NULL) {
137 if (pstr_drc_interface->system_interface_flag) {
138 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
139 .target_config_request_type !=
140 pstr_drc_interface->system_interface.target_config_request_type) {
141 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
142 .target_config_request_type =
143 pstr_drc_interface->system_interface.target_config_request_type;
144 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
145 }
146 switch (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
147 .target_config_request_type) {
148 case 0:
149 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
150 .num_downmix_id_requests !=
151 pstr_drc_interface->system_interface.num_downmix_id_requests) {
152 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
153 .num_downmix_id_requests =
154 pstr_drc_interface->system_interface.num_downmix_id_requests;
155 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
156 }
157 for (i = 0; i < pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
158 .num_downmix_id_requests;
159 i++) {
160 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
161 .requested_dwnmix_id[i] !=
162 pstr_drc_interface->system_interface.requested_dwnmix_id[i]) {
163 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
164 .requested_dwnmix_id[i] =
165 pstr_drc_interface->system_interface.requested_dwnmix_id[i];
166 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
167 }
168 }
169 break;
170 case 1:
171 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
172 .requested_target_layout !=
173 pstr_drc_interface->system_interface.requested_target_layout) {
174 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
175 .requested_target_layout =
176 pstr_drc_interface->system_interface.requested_target_layout;
177 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
178 }
179 break;
180 case 2:
181 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
182 .requested_target_ch_count !=
183 pstr_drc_interface->system_interface.requested_target_ch_count) {
184 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
185 .requested_target_ch_count =
186 pstr_drc_interface->system_interface.requested_target_ch_count;
187 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
188 }
189 break;
190 }
191 }
192 if (pstr_drc_interface->loudness_norm_ctrl_interface_flag) {
193 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
194 .loudness_normalization_on !=
195 pstr_drc_interface->loudness_norm_ctrl_interface
196 .loudness_normalization_on) {
197 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
198 .loudness_normalization_on =
199 pstr_drc_interface->loudness_norm_ctrl_interface
200 .loudness_normalization_on;
201 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
202 }
203 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
204 .loudness_normalization_on) {
205 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_loudness !=
206 pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness) {
207 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.target_loudness =
208 pstr_drc_interface->loudness_norm_ctrl_interface.target_loudness;
209 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
210 }
211 }
212 }
213 if (pstr_drc_interface->loudness_norm_parameter_interface_flag) {
214 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.album_mode !=
215 pstr_drc_interface->loudness_norm_param_interface.album_mode) {
216 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.album_mode =
217 pstr_drc_interface->loudness_norm_param_interface.album_mode;
218 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
219 }
220 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter !=
221 pstr_drc_interface->loudness_norm_param_interface.peak_limiter) {
222 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.peak_limiter =
223 pstr_drc_interface->loudness_norm_param_interface.peak_limiter;
224 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
225 }
226 if (pstr_drc_interface->loudness_norm_param_interface
227 .change_loudness_deviation_max) {
228 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
229 .loudness_deviation_max !=
230 pstr_drc_interface->loudness_norm_param_interface
231 .loudness_deviation_max) {
232 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
233 .loudness_deviation_max =
234 pstr_drc_interface->loudness_norm_param_interface
235 .loudness_deviation_max;
236 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
237 }
238 }
239 if (pstr_drc_interface->loudness_norm_param_interface
240 .change_loudness_measur_method) {
241 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
242 .loudness_measurement_method !=
243 pstr_drc_interface->loudness_norm_param_interface
244 .loudness_measurement_method) {
245 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
246 .loudness_measurement_method =
247 pstr_drc_interface->loudness_norm_param_interface
248 .loudness_measurement_method;
249 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
250 }
251 }
252 if (pstr_drc_interface->loudness_norm_param_interface
253 .change_loudness_measur_pre_proc) {
254 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
255 .loudness_measurement_pre_proc !=
256 pstr_drc_interface->loudness_norm_param_interface
257 .loudness_measurement_pre_proc) {
258 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
259 .loudness_measurement_pre_proc =
260 pstr_drc_interface->loudness_norm_param_interface
261 .loudness_measurement_pre_proc;
262 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
263 }
264 }
265 if (pstr_drc_interface->loudness_norm_param_interface
266 .change_loudness_measur_system) {
267 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
268 .loudness_measurement_system !=
269 pstr_drc_interface->loudness_norm_param_interface
270 .loudness_measurement_system) {
271 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
272 .loudness_measurement_system =
273 pstr_drc_interface->loudness_norm_param_interface
274 .loudness_measurement_system;
275 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
276 }
277 }
278 if (pstr_drc_interface->loudness_norm_param_interface
279 .change_device_cut_off_freq) {
280 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
281 .device_cut_off_frequency !=
282 pstr_drc_interface->loudness_norm_param_interface
283 .device_cut_off_frequency) {
284 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
285 .device_cut_off_frequency =
286 pstr_drc_interface->loudness_norm_param_interface
287 .device_cut_off_frequency;
288 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
289 }
290 }
291 if (pstr_drc_interface->loudness_norm_param_interface
292 .change_loudness_norm_gain_db_max) {
293 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
294 .loudness_norm_gain_db_max !=
295 pstr_drc_interface->loudness_norm_param_interface
296 .loudness_norm_gain_db_max) {
297 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
298 .loudness_norm_gain_db_max =
299 pstr_drc_interface->loudness_norm_param_interface
300 .loudness_norm_gain_db_max;
301 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
302 }
303 }
304 if (pstr_drc_interface->loudness_norm_param_interface
305 .change_loudness_norm_gain_modification_db) {
306 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
307 .loudness_norm_gain_modification_db !=
308 pstr_drc_interface->loudness_norm_param_interface
309 .loudness_norm_gain_modification_db) {
310 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
311 .loudness_norm_gain_modification_db =
312 pstr_drc_interface->loudness_norm_param_interface
313 .loudness_norm_gain_modification_db;
314 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
315 }
316 }
317 if (pstr_drc_interface->loudness_norm_param_interface
318 .change_output_peak_level_max) {
319 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
320 .output_peak_level_max !=
321 pstr_drc_interface->loudness_norm_param_interface
322 .output_peak_level_max) {
323 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.output_peak_level_max =
324 pstr_drc_interface->loudness_norm_param_interface
325 .output_peak_level_max;
326 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
327 }
328 }
329 }
330 if (pstr_drc_interface->drc_interface_flag) {
331 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
332 .dynamic_range_control_on !=
333 pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on) {
334 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
335 .dynamic_range_control_on =
336 pstr_drc_interface->drc_ctrl_interface.dynamic_range_control_on;
337 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
338 if (!pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
339 .dynamic_range_control_on) {
340 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
341 .num_drc_feature_requests = 0;
342 }
343 }
344 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
345 .dynamic_range_control_on) {
346 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
347 .num_drc_feature_requests !=
348 pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests) {
349 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
350 .num_drc_feature_requests =
351 pstr_drc_interface->drc_ctrl_interface.num_drc_feature_requests;
352 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
353 }
354 for (i = 0; i < pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
355 .num_drc_feature_requests;
356 i++) {
357 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
358 .drc_feature_req_type[i] !=
359 pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[i]) {
360 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
361 .drc_feature_req_type[i] =
362 pstr_drc_interface->drc_ctrl_interface.drc_feature_req_type[i];
363 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
364 }
365 switch (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
366 .drc_feature_req_type[i]) {
367 case 0:
368 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
369 .requested_num_drc_effects[i] !=
370 pstr_drc_interface->drc_ctrl_interface
371 .requested_num_drc_effects[i]) {
372 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
373 .requested_num_drc_effects[i] =
374 pstr_drc_interface->drc_ctrl_interface
375 .requested_num_drc_effects[i];
376 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
377 }
378 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
379 .desired_num_drc_effects_of_requested[i] !=
380 pstr_drc_interface->drc_ctrl_interface
381 .desired_num_drc_effects_of_requested[i]) {
382 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
383 .desired_num_drc_effects_of_requested[i] =
384 pstr_drc_interface->drc_ctrl_interface
385 .desired_num_drc_effects_of_requested[i];
386 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
387 }
388 for (j = 0; j < pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
389 .requested_num_drc_effects[i];
390 j++) {
391 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
392 .requested_drc_effect_type[i][j] !=
393 pstr_drc_interface->drc_ctrl_interface
394 .requested_drc_effect_type[i][j]) {
395 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
396 .requested_drc_effect_type[i][j] =
397 pstr_drc_interface->drc_ctrl_interface
398 .requested_drc_effect_type[i][j];
399 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
400 }
401 }
402 break;
403 case 1:
404 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
405 .requested_dyn_range_measur_type[i] !=
406 pstr_drc_interface->drc_ctrl_interface
407 .requested_dyn_rng_measurement_type[i]) {
408 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
409 .requested_dyn_range_measur_type[i] =
410 pstr_drc_interface->drc_ctrl_interface
411 .requested_dyn_rng_measurement_type[i];
412 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
413 }
414 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
415 .requested_dyn_range_range_flag[i] !=
416 pstr_drc_interface->drc_ctrl_interface
417 .requested_dyn_range_is_single_val_flag[i]) {
418 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
419 .requested_dyn_range_range_flag[i] =
420 pstr_drc_interface->drc_ctrl_interface
421 .requested_dyn_range_is_single_val_flag[i];
422 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
423 }
424 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
425 .requested_dyn_range_range_flag[i] == 0) {
426 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
427 .requested_dyn_range_value[i] !=
428 pstr_drc_interface->drc_ctrl_interface
429 .requested_dyn_range_value[i]) {
430 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
431 .requested_dyn_range_value[i] =
432 pstr_drc_interface->drc_ctrl_interface
433 .requested_dyn_range_value[i];
434 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
435 }
436 } else {
437 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
438 .requested_dyn_range_min_val[i] !=
439 pstr_drc_interface->drc_ctrl_interface
440 .requested_dyn_range_min_val[i]) {
441 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
442 .requested_dyn_range_min_val[i] =
443 pstr_drc_interface->drc_ctrl_interface
444 .requested_dyn_range_min_val[i];
445 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
446 }
447 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
448 .requested_dyn_range_max_val[i] !=
449 pstr_drc_interface->drc_ctrl_interface
450 .requested_dyn_range_max_val[i]) {
451 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
452 .requested_dyn_range_max_val[i] =
453 pstr_drc_interface->drc_ctrl_interface
454 .requested_dyn_range_max_val[i];
455 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
456 }
457 }
458 break;
459 case 2:
460 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
461 .requested_drc_characteristic[i] !=
462 pstr_drc_interface->drc_ctrl_interface
463 .requested_drc_characteristic[i]) {
464 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
465 .requested_drc_characteristic[i] =
466 pstr_drc_interface->drc_ctrl_interface
467 .requested_drc_characteristic[i];
468 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
469 }
470 break;
471 }
472 }
473 }
474 }
475 if (pstr_drc_interface->drc_parameter_interface_flag) {
476 if (pstr_drc_interface->drc_parameter_interface.change_compress) {
477 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.compress !=
478 pstr_drc_interface->drc_parameter_interface.compress) {
479 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.compress =
480 pstr_drc_interface->drc_parameter_interface.compress;
481 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
482 }
483 }
484 if (pstr_drc_interface->drc_parameter_interface.change_boost) {
485 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.boost !=
486 pstr_drc_interface->drc_parameter_interface.boost) {
487 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.boost =
488 pstr_drc_interface->drc_parameter_interface.boost;
489 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
490 }
491 }
492 if (pstr_drc_interface->drc_parameter_interface
493 .change_drc_characteristic_target) {
494 if (pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
495 .drc_characteristic_target !=
496 pstr_drc_interface->drc_parameter_interface
497 .drc_characteristic_target) {
498 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params
499 .drc_characteristic_target =
500 pstr_drc_interface->drc_parameter_interface
501 .drc_characteristic_target;
502 pstr_drc_uni_sel_proc->sel_proc_request_flag = 1;
503 }
504 }
505 }
506 if (pstr_drc_interface->drc_uni_interface_ext_flag) {
507 ia_drc_uni_interface_ext_struct* drc_uni_interface_ext =
508 &pstr_drc_interface->drc_uni_interface_ext;
509 if (drc_uni_interface_ext->loudness_eq_parameter_interface_flag) {
510 ia_loudness_eq_parameter_interface_struct*
511 loudness_eq_parameter_interface =
512 &drc_uni_interface_ext->loudness_eq_parameter_interface;
513 if (loudness_eq_parameter_interface->loudness_eq_request_flag) {
514 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.loudness_eq_request =
515 loudness_eq_parameter_interface->loudness_eq_request;
516 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.sensitivity =
517 loudness_eq_parameter_interface->sensitivity;
518 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.playback_gain =
519 loudness_eq_parameter_interface->playback_gain;
520 }
521 }
522 if (drc_uni_interface_ext->eq_ctrl_interface_flag) {
523 pstr_drc_uni_sel_proc->uni_drc_sel_proc_params.eq_set_purpose_request =
524 drc_uni_interface_ext->eq_ctrl_interface.eq_set_purpose_request;
525 }
526 }
527 }
528
529 return 0;
530 }
531