• 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_GAIN_DECODER2_H
21 #define IMPD_DRC_GAIN_DECODER2_H
22 
23 #ifndef M_PI
24 #define M_PI (3.14159265358979323846)
25 #endif
26 
27 typedef struct ia_drc_gain_dec_struct {
28   WORD32 audio_num_chan;
29   ia_drc_params_struct ia_drc_params_struct;
30   ia_drc_gain_buffers_struct drc_gain_buffers;
31   ia_audio_band_buffer_struct audio_band_buffer;
32   ia_overlap_params_struct str_overlap_params;
33   ia_filter_banks_struct ia_filter_banks_struct;
34   ia_audio_in_out_buf audio_in_out_buf;
35   ia_parametric_drc_params_struct parametricdrc_params;
36   shape_filter_block shape_filter_block[CHANNEL_GROUP_COUNT_MAX];
37   ia_eq_set_struct* eq_set;
38 } ia_drc_gain_dec_struct;
39 
40 WORD32 impd_init_drc_decode(WORD32 frame_size, WORD32 sample_rate,
41                             WORD32 gain_delay_samples, WORD32 delay_mode,
42                             WORD32 sub_band_domain_mode,
43                             ia_drc_gain_dec_struct* p_drc_gain_dec_structs);
44 
45 WORD32 impd_init_drc_decode_post_config(
46     WORD32 audio_num_chan, WORD32* drc_set_id_processed,
47     WORD32* downmix_id_processed, WORD32 num_sets_processed,
48     WORD32 eq_set_id_processed,
49 
50     ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
51     ia_drc_config* pstr_drc_config,
52     ia_drc_loudness_info_set_struct* pstr_loudness_info, pVOID* mem_ptr
53 
54     );
55 
56 WORD32 impd_drc_process_time_domain(
57     ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
58     ia_drc_config* pstr_drc_config, ia_drc_gain_struct* pstr_drc_gain,
59     FLOAT32* audio_in_out_buf[], FLOAT32 loudness_normalization_gain_db,
60     FLOAT32 boost, FLOAT32 compress, WORD32 drc_characteristic);
61 
62 WORD32 impd_drc_process_freq_domain(
63     ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
64     ia_drc_config* pstr_drc_config, ia_drc_gain_struct* pstr_drc_gain,
65     FLOAT32* audio_real_buff[], FLOAT32* audio_imag_buff[],
66     FLOAT32 loudness_normalization_gain_db, FLOAT32 boost, FLOAT32 compress,
67     WORD32 drc_characteristic);
68 
69 VOID impd_get_parametric_drc_delay(
70     ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
71     ia_drc_config* pstr_drc_config, WORD32* parametric_drc_delay,
72     WORD32* parametric_drc_delay_max);
73 
74 VOID impd_get_eq_delay(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
75                        ia_drc_config* pstr_drc_config, WORD32* eq_delay,
76                        WORD32* eq_delay_max);
77 
78 WORD32
79 impd_get_drc_gain(ia_drc_gain_dec_struct* p_drc_gain_dec_structs,
80                   ia_drc_config* pstr_drc_config,
81                   ia_drc_gain_struct* pstr_drc_gain, FLOAT32 compress,
82                   FLOAT32 boost, WORD32 characteristic_index,
83                   FLOAT32 loudness_normalization_gain_db, WORD32 sub_drc_index,
84                   ia_drc_gain_buffers_struct* drc_gain_buffers);
85 
86 #endif
87