aboutsummaryrefslogtreecommitdiff
path: root/decoder/ixheaacd_drc_data_struct.h
blob: 9e1980b77adba21da738eed83244608ab4fae9d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/******************************************************************************
 *                                                                            *
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *****************************************************************************
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/
#ifndef IXHEAACD_DRC_DATA_STRUCT_H

#define IXHEAACD_DRC_DATA_STRUCT_H

#define MAX_DRC_BANDS 16

#define MAX_AUDIO_CHANNELS 8

#define SBR_QMF_SUB_SAMPLES 64
#define SBR_QMF_SUB_BANDS 64

typedef enum {
  UNKNOWN_PAYLOAD = 0,
  MPEG_DRC_EXT_DATA = 1,
  DVB_DRC_ANC_DATA = 2

} AACDEC_DRC_PAYLOAD_TYPE;

#define DVB_ANC_DATA_SYNC_BYTE (0xBC)
typedef struct {
  WORD32 prog_ref_level;
  WORD16 n_mdct_bands[MAX_DRC_BANDS];
  WORD16 drc_fac[MAX_DRC_BANDS];
  WORD16 drc_fac_dvb[MAX_DRC_BANDS];
  WORD8 drc_exp;
  UWORD8 short_block;
  UWORD8 drc_interp_scheme;
  UWORD8 n_drc_bands;
  UWORD8 new_prog_ref_level;
  UWORD8 new_drc_fac;
  UWORD8 prev_interp_scheme;
  WORD32 drc_factors_sbr[SBR_QMF_SUB_SAMPLES][SBR_QMF_SUB_BANDS];
} ixheaac_drc_data_struct;

typedef struct {
  UWORD8 b_channel_on[MAX_AUDIO_CHANNELS];
  UWORD8 prog_ref_level_present;
  UWORD8 prog_ref_level;
  UWORD8 drc_num_bands;
  UWORD8 drc_band_top[MAX_DRC_BANDS];
  WORD8 dyn_rng_dlbl[MAX_DRC_BANDS];
  WORD8 dyn_rng_dlbl_dvb[MAX_DRC_BANDS];
  WORD8 max_dyn_rng_dlbl;
  UWORD8 drc_interpolation_scheme;
  WORD8 drc_data_type;
} ixheaac_drc_bs_data_struct;

typedef struct {
  ixheaac_drc_bs_data_struct str_drc_bs_data[MAX_BS_ELEMENT];
  ixheaac_drc_data_struct str_drc_channel_data[MAX_BS_ELEMENT];
  WORD16 drc_ref_level;
  WORD16 drc_def_level;
  UWORD8 drc_channel_next_index[MAX_BS_ELEMENT];
  UWORD8 sbr_allowed;
  UWORD8 sbr_found;
  UWORD8 drc_element_found;
  UWORD8 max_audio_channels;
  UWORD8 length_history;
  UWORD8 num_drc_elements;
  WORD32 is_longblock[MAX_BS_ELEMENT];
  WORD32 state;
  WORD32 target_ref_level;
  WORD32 prog_ref_level;
  WORD32 cut_factor;
  WORD32 boost_factor;
  FLAG drc_dig_norm;
  FLAG drc_on;
  FLAG dvb_anc_data_present;
  WORD32 dvb_anc_data_pos;
  WORD32 pres_mode;
  WORD32 heavy_mode;
} ia_drc_dec_struct;

#endif