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_INT32                       Target;                 /* 32 bit number specifying fractional value of Target Gain */
33     LVM_INT32                       Current;                /* 32 bit number specifying fractional valude of Current Gain */
34     LVM_INT32                       Shift;                  /* Left Shift for Integer part of Gain */
35     LVM_INT32                       Delta;                  /* 32 bit number specifying the fractional value of Delta Gain */
36 } Mix_Private_st;
37 
38 
39 
40 /**********************************************************************************
41    DEFINITIONS
42 ***********************************************************************************/
43 #define LVCore_MixInSoft_D32C31_SAT    LVCore_InSoft_D32C31_SAT
44 #define LVCore_MixSoft_1St_D32C31_WRA  LVCore_Soft_1St_D32C31_WRA
45 #define LVCore_MixHard_2St_D32C31_SAT  LVCore_Hard_2St_D32C31_SAT
46 
47 /**********************************************************************************
48    FUNCTION PROTOTYPES (LOW LEVEL SUBFUNCTIONS)
49 ***********************************************************************************/
50 
51 /*** 16 bit functions *************************************************************/
52 
53 void LVC_Core_MixInSoft_D16C31_SAT( LVMixer3_st *pInstance,
54                                     const LVM_INT16     *src,
55                                           LVM_INT16     *dst,
56                                           LVM_INT16     n);
57 
58 void LVC_Core_MixSoft_1St_D16C31_WRA( LVMixer3_st *pInstance,
59                                     const LVM_INT16     *src,
60                                           LVM_INT16     *dst,
61                                           LVM_INT16     n);
62 
63 void LVC_Core_MixHard_2St_D16C31_SAT( LVMixer3_st *pInstance1,
64                                     LVMixer3_st         *pInstance2,
65                                     const LVM_INT16     *src1,
66                                     const LVM_INT16     *src2,
67                                           LVM_INT16     *dst,
68                                           LVM_INT16     n);
69 
70 /**********************************************************************************/
71 /* For applying different gains to Left and right chennals                        */
72 /* ptrInstance1 applies to Left channel                                           */
73 /* ptrInstance2 applies to Right channel                                          */
74 /* Gain values should not be more that 1.0                                        */
75 /**********************************************************************************/
76 
77 void LVC_Core_MixSoft_1St_2i_D16C31_WRA( LVMixer3_st        *ptrInstance1,
78                                          LVMixer3_st        *ptrInstance2,
79                                          const LVM_INT16    *src,
80                                          LVM_INT16          *dst,   /* dst can be equal to src */
81                                          LVM_INT16          n);     /* Number of stereo samples */
82 
83 /**********************************************************************************/
84 /* For applying different gains to Left and right chennals                        */
85 /* ptrInstance1 applies to Left channel                                           */
86 /* ptrInstance2 applies to Right channel                                          */
87 /* Gain values should not be more that 1.0                                        */
88 /**********************************************************************************/
89 void LVC_Core_MixHard_1St_2i_D16C31_SAT( LVMixer3_st        *ptrInstance1,
90                                          LVMixer3_st        *ptrInstance2,
91                                          const LVM_INT16    *src,
92                                          LVM_INT16          *dst,    /* dst can be equal to src */
93                                          LVM_INT16          n);      /* Number of stereo samples */
94 
95 
96 
97 /*** 32 bit functions *************************************************************/
98 
99 void LVC_Core_MixInSoft_D32C31_SAT( LVMixer3_st *pInstance,
100                                     const LVM_INT32     *src,
101                                           LVM_INT32     *dst,
102                                           LVM_INT16     n);
103 
104 void LVC_Core_MixSoft_1St_D32C31_WRA( LVMixer3_st *pInstance,
105                                     const LVM_INT32     *src,
106                                           LVM_INT32     *dst,
107                                           LVM_INT16     n);
108 
109 void LVC_Core_MixHard_2St_D32C31_SAT( LVMixer3_st *pInstance1,
110                                     LVMixer3_st         *pInstance2,
111                                     const LVM_INT32     *src1,
112                                     const LVM_INT32     *src2,
113                                           LVM_INT32     *dst,
114                                           LVM_INT16     n);
115 
116 /**********************************************************************************/
117 
118 #endif //#ifndef __LVC_MIXER_PRIVATE_H__
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129