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 __LVC_MIXER_PRIVATE_H__
19 #define __LVC_MIXER_PRIVATE_H__
20 
21 /**********************************************************************************
22    INCLUDE FILES
23 ***********************************************************************************/
24 
25 #include "LVC_Mixer.h"
26 #include "VectorArithmetic.h"
27 
28 /* Instance parameter structure */
29 typedef struct
30 {
31     /* General */
32     LVM_FLOAT                       Target;           /*number specifying value of Target Gain */
33     LVM_FLOAT                       Current;          /*number specifying value of Current Gain */
34     LVM_FLOAT                       Delta;            /*number specifying value of Delta Gain */
35 } Mix_Private_FLOAT_st;
36 
37 /**********************************************************************************
38    DEFINITIONS
39 ***********************************************************************************/
40 #define LVCore_MixInSoft_D32C31_SAT    LVCore_InSoft_D32C31_SAT
41 #define LVCore_MixSoft_1St_D32C31_WRA  LVCore_Soft_1St_D32C31_WRA
42 #define LVCore_MixHard_2St_D32C31_SAT  LVCore_Hard_2St_D32C31_SAT
43 
44 /**********************************************************************************
45    FUNCTION PROTOTYPES (LOW LEVEL SUBFUNCTIONS)
46 ***********************************************************************************/
47 
48 /*** 16 bit functions *************************************************************/
49 void LVC_Core_MixInSoft_D16C31_SAT( LVMixer3_FLOAT_st *ptrInstance,
50                                     const LVM_FLOAT     *src,
51                                     LVM_FLOAT     *dst,
52                                     LVM_INT16     n);
53 #ifdef SUPPORT_MC
54 void LVC_Core_MixInSoft_Mc_D16C31_SAT(LVMixer3_FLOAT_st *ptrInstance,
55                                     const LVM_FLOAT     *src,
56                                           LVM_FLOAT     *dst,
57                                           LVM_INT16     NrFrames,
58                                           LVM_INT16     NrChannels);
59 #endif
60 void LVC_Core_MixSoft_1St_D16C31_WRA( LVMixer3_FLOAT_st *ptrInstance,
61                                       const LVM_FLOAT     *src,
62                                       LVM_FLOAT     *dst,
63                                       LVM_INT16     n);
64 #ifdef SUPPORT_MC
65 void LVC_Core_MixSoft_Mc_D16C31_WRA(LVMixer3_FLOAT_st *ptrInstance,
66                                     const LVM_FLOAT     *src,
67                                           LVM_FLOAT     *dst,
68                                           LVM_INT16     NrFrames,
69                                           LVM_INT16     NrChannels);
70 #endif
71 void LVC_Core_MixHard_2St_D16C31_SAT( LVMixer3_FLOAT_st *pInstance1,
72                                       LVMixer3_FLOAT_st         *pInstance2,
73                                       const LVM_FLOAT     *src1,
74                                       const LVM_FLOAT     *src2,
75                                       LVM_FLOAT     *dst,
76                                       LVM_INT16     n);
77 
78 /**********************************************************************************/
79 /* For applying different gains to Left and right chennals                        */
80 /* ptrInstance1 applies to Left channel                                           */
81 /* ptrInstance2 applies to Right channel                                          */
82 /* Gain values should not be more that 1.0                                        */
83 /**********************************************************************************/
84 #ifdef SUPPORT_MC
85 void LVC_Core_MixSoft_1St_MC_float_WRA(Mix_Private_FLOAT_st **ptrInstance,
86                                          const LVM_FLOAT      *src,
87                                          LVM_FLOAT            *dst,
88                                          LVM_INT16            NrFrames,
89                                          LVM_INT16            NrChannels);
90 #endif
91 void LVC_Core_MixSoft_1St_2i_D16C31_WRA( LVMixer3_FLOAT_st        *ptrInstance1,
92                                          LVMixer3_FLOAT_st        *ptrInstance2,
93                                          const LVM_FLOAT    *src,
94                                          LVM_FLOAT          *dst,
95                                          LVM_INT16          n);
96 
97 /**********************************************************************************/
98 /* For applying different gains to Left and right chennals                        */
99 /* ptrInstance1 applies to Left channel                                           */
100 /* ptrInstance2 applies to Right channel                                          */
101 /* Gain values should not be more that 1.0                                        */
102 /**********************************************************************************/
103 #ifdef SUPPORT_MC
104 void LVC_Core_MixHard_1St_MC_float_SAT(Mix_Private_FLOAT_st **ptrInstance,
105                                          const LVM_FLOAT      *src,
106                                          LVM_FLOAT            *dst,
107                                          LVM_INT16            NrFrames,
108                                          LVM_INT16            NrChannels);
109 #endif
110 void LVC_Core_MixHard_1St_2i_D16C31_SAT( LVMixer3_FLOAT_st        *ptrInstance1,
111                                          LVMixer3_FLOAT_st        *ptrInstance2,
112                                          const LVM_FLOAT    *src,
113                                          LVM_FLOAT          *dst,
114                                          LVM_INT16          n);
115 
116 /*** 32 bit functions *************************************************************/
117 /**********************************************************************************/
118 
119 #endif //#ifndef __LVC_MIXER_PRIVATE_H__
120 
121