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
23 extern "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
41 typedef 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
56 typedef 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
76 void 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 #ifdef SUPPORT_MC
82 void AGC_MIX_VOL_Mc1Mon_D32_WRA(AGC_MIX_VOL_2St1Mon_FLOAT_t  *pInstance,  /* Instance pointer */
83                                  const LVM_FLOAT            *pStSrc,      /* Source */
84                                  const LVM_FLOAT            *pMonoSrc,    /* Mono source */
85                                  LVM_FLOAT                  *pDst,        /* Destination */
86                                  LVM_UINT16                 NrFrames,     /* Number of frames */
87                                  LVM_UINT16                 NrChannels);  /* Number of channels */
88 #endif
89 
90 #else
91 void AGC_MIX_VOL_2St1Mon_D32_WRA(AGC_MIX_VOL_2St1Mon_D32_t  *pInstance,     /* Instance pointer */
92                                  const LVM_INT32            *pStSrc,        /* Stereo source */
93                                  const LVM_INT32            *pMonoSrc,      /* Mono source */
94                                  LVM_INT32                  *pDst,          /* Stereo destination */
95                                  LVM_UINT16                 n);             /* Number of samples */
96 #endif
97 #ifdef __cplusplus
98 }
99 #endif /* __cplusplus */
100 
101 
102 #endif  /* __AGC_H__ */
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113