xref: /aosp_15_r20/external/libxaac/encoder/drc_src/impd_drc_tables.h (revision 15dc779a375ca8b5125643b829a8aa4b70d7f451)
1 /******************************************************************************
2  *                                                                            *
3  * Copyright (C) 2023 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 
21 #pragma once
22 extern const FLOAT32 impd_drc_downmix_coeff[16];
23 extern const FLOAT32 impd_drc_downmix_coeff_lfe[16];
24 extern const FLOAT32 impd_drc_channel_weight[16];
25 extern const FLOAT32 impd_drc_downmix_coeff_v1[32];
26 extern const FLOAT32 impd_drc_eq_slope_table[16];
27 extern const FLOAT32 impd_drc_eq_gain_delta_table[32];
28 extern const FLOAT32 impd_drc_zero_pole_radius_table[128];
29 extern const FLOAT32 impd_drc_zero_pole_angle_table[128];
30 
31 typedef struct {
32   WORD32 size;
33   WORD32 code;
34   WORD32 value;
35 } ia_drc_delta_time_code_table_entry_struct;
36 
37 typedef struct {
38   WORD32 size;
39   WORD32 code;
40   FLOAT32 value;
41   WORD32 index;
42 } ia_drc_slope_code_table_entry_struct;
43 
44 typedef struct {
45   WORD32 size;
46   WORD32 code;
47   FLOAT32 value;
48 } ia_drc_delta_gain_code_entry_struct;
49 
50 VOID impd_drc_generate_delta_time_code_table(
51     const WORD32 num_gain_values_max,
52     ia_drc_delta_time_code_table_entry_struct *delta_time_code_table_item);
53 
54 VOID impd_drc_get_delta_gain_code_table(
55     const WORD32 gain_coding_profile,
56     ia_drc_delta_gain_code_entry_struct const **pstr_delta_gain_code_table, WORD32 *num_entries);
57 
58 const ia_drc_slope_code_table_entry_struct *impd_drc_get_slope_code_table_by_value(VOID);
59 
60 FLOAT32 impd_drc_decode_slope_idx_value(const WORD32 slope_code_index);
61 
62 FLOAT32 impd_drc_decode_slope_idx_magnitude(const WORD32 slope_code_index);
63