• 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 IXHEAACD_PEAK_LIMITER_STRUCT_DEF_H
21 #define IXHEAACD_PEAK_LIMITER_STRUCT_DEF_H
22 
23 #define PEAK_LIM_SIZE (1024 * 16)
24 #define DEFAULT_ATTACK_TIME_MS (5.0f)
25 #define DEFAULT_RELEASE_TIME_MS (50.0f)
26 #define PEAK_LIM_THR_FLOAT (29203.6f)
27 #define PEAK_LIM_THR_FIX (2147483647)
28 
29 typedef struct ia_peak_limiter_struct {
30   FLOAT32 attack_time;
31   FLOAT32 release_time;
32   FLOAT32 attack_constant;
33   FLOAT32 release_constant;
34   FLOAT32 limit_threshold;
35   UWORD32 num_channels;
36   UWORD32 sample_rate;
37   UWORD32 attack_time_samples;
38   UWORD32 limiter_on;
39   FLOAT32 gain_modified;
40   FLOAT64 pre_smoothed_gain;
41   FLOAT32 *delayed_input;
42   UWORD32 delayed_input_index;
43   FLOAT32 *max_buf;
44   FLOAT32 min_gain;
45   FLOAT32 buffer[PEAK_LIM_SIZE];
46   WORD32 max_idx;
47   WORD32 cir_buf_pnt;
48 } ia_peak_limiter_struct;
49 
50 #endif /* IXHEAACD_PEAK_LIMITER_STRUCT_DEF_H */
51