1/*
2 * Copyright (C) 2004-2010 NXP Software
3 * Copyright (C) 2010 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#ifndef __AGC_H__
19#define __AGC_H__
20
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* __cplusplus */
25
26/**********************************************************************************/
27/*                                                                                */
28/*    Includes                                                                    */
29/*                                                                                */
30/**********************************************************************************/
31
32#include "LVM_Types.h"
33
34
35/**********************************************************************************/
36/*                                                                                */
37/*    Types                                                                       */
38/*                                                                                */
39/**********************************************************************************/
40#ifndef BUILD_FLOAT
41typedef struct
42{
43    LVM_INT32  AGC_Gain;                        /* The current AGC gain */
44    LVM_INT32  AGC_MaxGain;                     /* The maximum AGC gain */
45    LVM_INT32  Volume;                          /* The current volume setting */
46    LVM_INT32  Target;                          /* The target volume setting */
47    LVM_INT32  AGC_Target;                      /* AGC target level */
48    LVM_INT16  AGC_Attack;                      /* AGC attack scaler */
49    LVM_INT16  AGC_Decay;                       /* AGC decay scaler */
50    LVM_INT16  AGC_GainShift;                   /* The gain shift */
51    LVM_INT16  VolumeShift;                     /* Volume shift scaling */
52    LVM_INT16  VolumeTC;                        /* Volume update time constant */
53
54} AGC_MIX_VOL_2St1Mon_D32_t;
55#else
56typedef struct
57{
58    LVM_FLOAT  AGC_Gain;                        /* The current AGC gain */
59    LVM_FLOAT  AGC_MaxGain;                     /* The maximum AGC gain */
60    LVM_FLOAT  Volume;                          /* The current volume setting */
61    LVM_FLOAT  Target;                          /* The target volume setting */
62    LVM_FLOAT  AGC_Target;                      /* AGC target level */
63    LVM_FLOAT  AGC_Attack;                      /* AGC attack scaler */
64    LVM_FLOAT  AGC_Decay;                       /* AGC decay scaler */
65    LVM_FLOAT  VolumeTC;                        /* Volume update time constant */
66
67} AGC_MIX_VOL_2St1Mon_FLOAT_t;
68#endif
69
70/**********************************************************************************/
71/*                                                                                */
72/*    Function Prototypes                                                              */
73/*                                                                                */
74/**********************************************************************************/
75#ifdef BUILD_FLOAT
76void AGC_MIX_VOL_2St1Mon_D32_WRA(AGC_MIX_VOL_2St1Mon_FLOAT_t  *pInstance,     /* Instance pointer */
77                                 const LVM_FLOAT            *pStSrc,        /* Stereo source */
78                                 const LVM_FLOAT            *pMonoSrc,      /* Mono source */
79                                 LVM_FLOAT                  *pDst,          /* Stereo destination */
80                                 LVM_UINT16                 n);             /* Number of samples */
81#else
82void AGC_MIX_VOL_2St1Mon_D32_WRA(AGC_MIX_VOL_2St1Mon_D32_t  *pInstance,     /* Instance pointer */
83                                 const LVM_INT32            *pStSrc,        /* Stereo source */
84                                 const LVM_INT32            *pMonoSrc,      /* Mono source */
85                                 LVM_INT32                  *pDst,          /* Stereo destination */
86                                 LVM_UINT16                 n);             /* Number of samples */
87#endif
88#ifdef __cplusplus
89}
90#endif /* __cplusplus */
91
92
93#endif  /* __AGC_H__ */
94
95
96
97
98
99
100
101
102
103
104