• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /************************************************************************************/
19 /*                                                                                  */
20 /*  Includes                                                                        */
21 /*                                                                                  */
22 /************************************************************************************/
23 
24 #include "LVCS_Private.h"
25 #include "LVCS_Tables.h"
26 #include "Filters.h"               /* Filter definitions */
27 #include "BIQUAD.h"                /* Biquad definitions */
28 #include "LVCS_Headphone_Coeffs.h" /* Headphone coefficients */
29 
30 /************************************************************************************/
31 /*                                                                                  */
32 /*  Stereo Enhancer coefficient constant tables                                     */
33 /*                                                                                  */
34 /************************************************************************************/
35 
36 /* Coefficient table for the middle filter */
37 const BiquadA01B1CoefsSP_t LVCS_SEMidCoefTable[] = {
38         {CS_MIDDLE_8000_A0, /* 8kS/s coefficients */
39          CS_MIDDLE_8000_A1, CS_MIDDLE_8000_B1, (LVM_UINT16)CS_MIDDLE_8000_SCALE},
40         {CS_MIDDLE_11025_A0, /* 11kS/s coefficients */
41          CS_MIDDLE_11025_A1, CS_MIDDLE_11025_B1, (LVM_UINT16)CS_MIDDLE_11025_SCALE},
42         {CS_MIDDLE_12000_A0, /* 12kS/s coefficients */
43          CS_MIDDLE_12000_A1, CS_MIDDLE_12000_B1, (LVM_UINT16)CS_MIDDLE_12000_SCALE},
44         {CS_MIDDLE_16000_A0, /* 16kS/s coefficients */
45          CS_MIDDLE_16000_A1, CS_MIDDLE_16000_B1, (LVM_UINT16)CS_MIDDLE_16000_SCALE},
46         {CS_MIDDLE_22050_A0, /* 22kS/s coefficients */
47          CS_MIDDLE_22050_A1, CS_MIDDLE_22050_B1, (LVM_UINT16)CS_MIDDLE_22050_SCALE},
48         {CS_MIDDLE_24000_A0, /* 24kS/s coefficients */
49          CS_MIDDLE_24000_A1, CS_MIDDLE_24000_B1, (LVM_UINT16)CS_MIDDLE_24000_SCALE},
50         {CS_MIDDLE_32000_A0, /* 32kS/s coefficients */
51          CS_MIDDLE_32000_A1, CS_MIDDLE_32000_B1, (LVM_UINT16)CS_MIDDLE_32000_SCALE},
52         {CS_MIDDLE_44100_A0, /* 44kS/s coefficients */
53          CS_MIDDLE_44100_A1, CS_MIDDLE_44100_B1, (LVM_UINT16)CS_MIDDLE_44100_SCALE},
54         {CS_MIDDLE_48000_A0, /* 48kS/s coefficients */
55          CS_MIDDLE_48000_A1, CS_MIDDLE_48000_B1, (LVM_UINT16)CS_MIDDLE_48000_SCALE},
56         {CS_MIDDLE_88200_A0, /* 88kS/s coefficients */
57          CS_MIDDLE_88200_A1, CS_MIDDLE_88200_B1, (LVM_UINT16)CS_MIDDLE_88200_SCALE},
58         {CS_MIDDLE_96000_A0, /* 96kS/s coefficients */
59          CS_MIDDLE_96000_A1, CS_MIDDLE_96000_B1, (LVM_UINT16)CS_MIDDLE_96000_SCALE},
60         {CS_MIDDLE_176400_A0, /* 176kS/s coefficients */
61          CS_MIDDLE_176400_A1, CS_MIDDLE_176400_B1, (LVM_UINT16)CS_MIDDLE_176400_SCALE},
62         {CS_MIDDLE_192000_A0, /* 192kS/s coefficients */
63          CS_MIDDLE_192000_A1, CS_MIDDLE_192000_B1, (LVM_UINT16)CS_MIDDLE_192000_SCALE}};
64 
65 /* Coefficient table for the side filter */
66 const BiquadA012B12CoefsSP_t LVCS_SESideCoefTable[] = {
67         /* Headphone Side coefficients */
68         {CS_SIDE_8000_A0, /* 8kS/s coefficients */
69          CS_SIDE_8000_A1, CS_SIDE_8000_A2, CS_SIDE_8000_B1, CS_SIDE_8000_B2,
70          (LVM_UINT16)CS_SIDE_8000_SCALE},
71         {CS_SIDE_11025_A0, /* 11kS/s coefficients */
72          CS_SIDE_11025_A1, CS_SIDE_11025_A2, CS_SIDE_11025_B1, CS_SIDE_11025_B2,
73          (LVM_UINT16)CS_SIDE_11025_SCALE},
74         {CS_SIDE_12000_A0, /* 12kS/s coefficients */
75          CS_SIDE_12000_A1, CS_SIDE_12000_A2, CS_SIDE_12000_B1, CS_SIDE_12000_B2,
76          (LVM_UINT16)CS_SIDE_12000_SCALE},
77         {CS_SIDE_16000_A0, /* 16kS/s coefficients */
78          CS_SIDE_16000_A1, CS_SIDE_16000_A2, CS_SIDE_16000_B1, CS_SIDE_16000_B2,
79          (LVM_UINT16)CS_SIDE_16000_SCALE},
80         {CS_SIDE_22050_A0, /* 22kS/s coefficients */
81          CS_SIDE_22050_A1, CS_SIDE_22050_A2, CS_SIDE_22050_B1, CS_SIDE_22050_B2,
82          (LVM_UINT16)CS_SIDE_22050_SCALE},
83         {CS_SIDE_24000_A0, /* 24kS/s coefficients */
84          CS_SIDE_24000_A1, CS_SIDE_24000_A2, CS_SIDE_24000_B1, CS_SIDE_24000_B2,
85          (LVM_UINT16)CS_SIDE_24000_SCALE},
86         {CS_SIDE_32000_A0, /* 32kS/s coefficients */
87          CS_SIDE_32000_A1, CS_SIDE_32000_A2, CS_SIDE_32000_B1, CS_SIDE_32000_B2,
88          (LVM_UINT16)CS_SIDE_32000_SCALE},
89         {CS_SIDE_44100_A0, /* 44kS/s coefficients */
90          CS_SIDE_44100_A1, CS_SIDE_44100_A2, CS_SIDE_44100_B1, CS_SIDE_44100_B2,
91          (LVM_UINT16)CS_SIDE_44100_SCALE},
92         {CS_SIDE_48000_A0, /* 48kS/s coefficients */
93          CS_SIDE_48000_A1, CS_SIDE_48000_A2, CS_SIDE_48000_B1, CS_SIDE_48000_B2,
94          (LVM_UINT16)CS_SIDE_48000_SCALE},
95         {CS_SIDE_88200_A0, /* 88kS/s coefficients */
96          CS_SIDE_88200_A1, CS_SIDE_88200_A2, CS_SIDE_88200_B1, CS_SIDE_88200_B2,
97          (LVM_UINT16)CS_SIDE_88200_SCALE},
98         {CS_SIDE_96000_A0, /* 96kS/s coefficients */
99          CS_SIDE_96000_A1, CS_SIDE_96000_A2, CS_SIDE_96000_B1, CS_SIDE_96000_B2,
100          (LVM_UINT16)CS_SIDE_96000_SCALE},
101         {CS_SIDE_176400_A0, /*176kS/s coefficients */
102          CS_SIDE_176400_A1, CS_SIDE_176400_A2, CS_SIDE_176400_B1, CS_SIDE_176400_B2,
103          (LVM_UINT16)CS_SIDE_176400_SCALE},
104         {CS_SIDE_192000_A0, /* 192kS/s coefficients */
105          CS_SIDE_192000_A1, CS_SIDE_192000_A2, CS_SIDE_192000_B1, CS_SIDE_192000_B2,
106          (LVM_UINT16)CS_SIDE_192000_SCALE}};
107 
108 /************************************************************************************/
109 /*                                                                                  */
110 /*  Equaliser coefficient constant tables                                           */
111 /*                                                                                  */
112 /************************************************************************************/
113 
114 const BiquadA012B12CoefsSP_t LVCS_EqualiserCoefTable[] = {
115         /* Headphone coefficients */
116         {CS_EQUALISER_8000_A0, /* 8kS/s coefficients */
117          CS_EQUALISER_8000_A1, CS_EQUALISER_8000_A2, CS_EQUALISER_8000_B1, CS_EQUALISER_8000_B2,
118          (LVM_UINT16)CS_EQUALISER_8000_SCALE},
119         {CS_EQUALISER_11025_A0, /* 11kS/s coefficients */
120          CS_EQUALISER_11025_A1, CS_EQUALISER_11025_A2, CS_EQUALISER_11025_B1, CS_EQUALISER_11025_B2,
121          (LVM_UINT16)CS_EQUALISER_11025_SCALE},
122         {CS_EQUALISER_12000_A0, /* 12kS/s coefficients */
123          CS_EQUALISER_12000_A1, CS_EQUALISER_12000_A2, CS_EQUALISER_12000_B1, CS_EQUALISER_12000_B2,
124          (LVM_UINT16)CS_EQUALISER_12000_SCALE},
125         {CS_EQUALISER_16000_A0, /* 16kS/s coefficients */
126          CS_EQUALISER_16000_A1, CS_EQUALISER_16000_A2, CS_EQUALISER_16000_B1, CS_EQUALISER_16000_B2,
127          (LVM_UINT16)CS_EQUALISER_16000_SCALE},
128         {CS_EQUALISER_22050_A0, /* 22kS/s coefficients */
129          CS_EQUALISER_22050_A1, CS_EQUALISER_22050_A2, CS_EQUALISER_22050_B1, CS_EQUALISER_22050_B2,
130          (LVM_UINT16)CS_EQUALISER_22050_SCALE},
131         {CS_EQUALISER_24000_A0, /* 24kS/s coefficients */
132          CS_EQUALISER_24000_A1, CS_EQUALISER_24000_A2, CS_EQUALISER_24000_B1, CS_EQUALISER_24000_B2,
133          (LVM_UINT16)CS_EQUALISER_24000_SCALE},
134         {CS_EQUALISER_32000_A0, /* 32kS/s coefficients */
135          CS_EQUALISER_32000_A1, CS_EQUALISER_32000_A2, CS_EQUALISER_32000_B1, CS_EQUALISER_32000_B2,
136          (LVM_UINT16)CS_EQUALISER_32000_SCALE},
137         {CS_EQUALISER_44100_A0, /* 44kS/s coefficients */
138          CS_EQUALISER_44100_A1, CS_EQUALISER_44100_A2, CS_EQUALISER_44100_B1, CS_EQUALISER_44100_B2,
139          (LVM_UINT16)CS_EQUALISER_44100_SCALE},
140         {CS_EQUALISER_48000_A0, /* 48kS/s coefficients */
141          CS_EQUALISER_48000_A1, CS_EQUALISER_48000_A2, CS_EQUALISER_48000_B1, CS_EQUALISER_48000_B2,
142          (LVM_UINT16)CS_EQUALISER_48000_SCALE},
143         {CS_EQUALISER_88200_A0, /* 88kS/s coeffieients */
144          CS_EQUALISER_88200_A1, CS_EQUALISER_88200_A2, CS_EQUALISER_88200_B1, CS_EQUALISER_88200_B2,
145          (LVM_UINT16)CS_EQUALISER_88200_SCALE},
146         {CS_EQUALISER_96000_A0, /* 96kS/s coefficients */
147          CS_EQUALISER_96000_A1, CS_EQUALISER_96000_A2, CS_EQUALISER_96000_B1, CS_EQUALISER_96000_B2,
148          (LVM_UINT16)CS_EQUALISER_96000_SCALE},
149         {CS_EQUALISER_176400_A0, /* 176kS/s coefficients */
150          CS_EQUALISER_176400_A1, CS_EQUALISER_176400_A2, CS_EQUALISER_176400_B1,
151          CS_EQUALISER_176400_B2, (LVM_UINT16)CS_EQUALISER_176400_SCALE},
152         {CS_EQUALISER_192000_A0, /* 192kS/s coefficients */
153          CS_EQUALISER_192000_A1, CS_EQUALISER_192000_A2, CS_EQUALISER_192000_B1,
154          CS_EQUALISER_192000_B2, (LVM_UINT16)CS_EQUALISER_192000_SCALE},
155 
156         /* Concert Sound EX Headphone coefficients */
157         {CSEX_EQUALISER_8000_A0, /* 8kS/s coefficients */
158          CSEX_EQUALISER_8000_A1, CSEX_EQUALISER_8000_A2, CSEX_EQUALISER_8000_B1,
159          CSEX_EQUALISER_8000_B2, (LVM_UINT16)CSEX_EQUALISER_8000_SCALE},
160         {CSEX_EQUALISER_11025_A0, /* 11kS/s coefficients */
161          CSEX_EQUALISER_11025_A1, CSEX_EQUALISER_11025_A2, CSEX_EQUALISER_11025_B1,
162          CSEX_EQUALISER_11025_B2, (LVM_UINT16)CSEX_EQUALISER_11025_SCALE},
163         {CSEX_EQUALISER_12000_A0, /* 12kS/s coefficients */
164          CSEX_EQUALISER_12000_A1, CSEX_EQUALISER_12000_A2, CSEX_EQUALISER_12000_B1,
165          CSEX_EQUALISER_12000_B2, (LVM_UINT16)CSEX_EQUALISER_12000_SCALE},
166         {CSEX_EQUALISER_16000_A0, /* 16kS/s coefficients */
167          CSEX_EQUALISER_16000_A1, CSEX_EQUALISER_16000_A2, CSEX_EQUALISER_16000_B1,
168          CSEX_EQUALISER_16000_B2, (LVM_UINT16)CSEX_EQUALISER_16000_SCALE},
169         {CSEX_EQUALISER_22050_A0, /* 22kS/s coefficients */
170          CSEX_EQUALISER_22050_A1, CSEX_EQUALISER_22050_A2, CSEX_EQUALISER_22050_B1,
171          CSEX_EQUALISER_22050_B2, (LVM_UINT16)CSEX_EQUALISER_22050_SCALE},
172         {CSEX_EQUALISER_24000_A0, /* 24kS/s coefficients */
173          CSEX_EQUALISER_24000_A1, CSEX_EQUALISER_24000_A2, CSEX_EQUALISER_24000_B1,
174          CSEX_EQUALISER_24000_B2, (LVM_UINT16)CSEX_EQUALISER_24000_SCALE},
175         {CSEX_EQUALISER_32000_A0, /* 32kS/s coefficients */
176          CSEX_EQUALISER_32000_A1, CSEX_EQUALISER_32000_A2, CSEX_EQUALISER_32000_B1,
177          CSEX_EQUALISER_32000_B2, (LVM_UINT16)CSEX_EQUALISER_32000_SCALE},
178         {CSEX_EQUALISER_44100_A0, /* 44kS/s coefficients */
179          CSEX_EQUALISER_44100_A1, CSEX_EQUALISER_44100_A2, CSEX_EQUALISER_44100_B1,
180          CSEX_EQUALISER_44100_B2, (LVM_UINT16)CSEX_EQUALISER_44100_SCALE},
181         {CSEX_EQUALISER_48000_A0, /* 48kS/s coefficients */
182          CSEX_EQUALISER_48000_A1, CSEX_EQUALISER_48000_A2, CSEX_EQUALISER_48000_B1,
183          CSEX_EQUALISER_48000_B2, (LVM_UINT16)CSEX_EQUALISER_48000_SCALE},
184         {CSEX_EQUALISER_88200_A0, /* 88kS/s coefficients */
185          CSEX_EQUALISER_88200_A1, CSEX_EQUALISER_88200_A2, CSEX_EQUALISER_88200_B1,
186          CSEX_EQUALISER_88200_B2, (LVM_UINT16)CSEX_EQUALISER_88200_SCALE},
187         {CSEX_EQUALISER_96000_A0, /* 96kS/s coefficients */
188          CSEX_EQUALISER_96000_A1, CSEX_EQUALISER_96000_A2, CSEX_EQUALISER_96000_B1,
189          CSEX_EQUALISER_96000_B2, (LVM_UINT16)CSEX_EQUALISER_96000_SCALE},
190         {CSEX_EQUALISER_176400_A0, /* 176kS/s coefficients */
191          CSEX_EQUALISER_176400_A1, CSEX_EQUALISER_176400_A2, CSEX_EQUALISER_176400_B1,
192          CSEX_EQUALISER_176400_B2, (LVM_UINT16)CSEX_EQUALISER_176400_SCALE},
193         {CSEX_EQUALISER_192000_A0, /* 192kS/s coefficients */
194          CSEX_EQUALISER_192000_A1, CSEX_EQUALISER_192000_A2, CSEX_EQUALISER_192000_B1,
195          CSEX_EQUALISER_192000_B2, (LVM_UINT16)CSEX_EQUALISER_192000_SCALE}};
196 
197 /************************************************************************************/
198 /*                                                                                  */
199 /*  Reverb delay constant tables                                                    */
200 /*                                                                                  */
201 /************************************************************************************/
202 
203 /* Stereo delay table for Concert Sound */
204 const LVM_UINT16 LVCS_StereoDelayCS[] = {
205         LVCS_STEREODELAY_CS_8KHZ,   LVCS_STEREODELAY_CS_11KHZ, LVCS_STEREODELAY_CS_12KHZ,
206         LVCS_STEREODELAY_CS_16KHZ,  LVCS_STEREODELAY_CS_22KHZ, LVCS_STEREODELAY_CS_24KHZ,
207         LVCS_STEREODELAY_CS_32KHZ,  LVCS_STEREODELAY_CS_44KHZ, LVCS_STEREODELAY_CS_48KHZ,
208         LVCS_STEREODELAY_CS_88KHZ,  LVCS_STEREODELAY_CS_96KHZ, LVCS_STEREODELAY_CS_176KHZ,
209         LVCS_STEREODELAY_CS_192KHZ,
210 };
211 
212 /************************************************************************************/
213 /*                                                                                  */
214 /*  Reverb coefficients constant table                                              */
215 /*                                                                                  */
216 /************************************************************************************/
217 
218 const BiquadA012B12CoefsSP_t LVCS_ReverbCoefTable[] = {
219         /* Headphone coefficients */
220         {CS_REVERB_8000_A0, /* 8kS/s coefficients */
221          CS_REVERB_8000_A1, CS_REVERB_8000_A2, CS_REVERB_8000_B1, CS_REVERB_8000_B2,
222          (LVM_UINT16)CS_REVERB_8000_SCALE},
223         {CS_REVERB_11025_A0, /* 11kS/s coefficients */
224          CS_REVERB_11025_A1, CS_REVERB_11025_A2, CS_REVERB_11025_B1, CS_REVERB_11025_B2,
225          (LVM_UINT16)CS_REVERB_11025_SCALE},
226         {CS_REVERB_12000_A0, /* 12kS/s coefficients */
227          CS_REVERB_12000_A1, CS_REVERB_12000_A2, CS_REVERB_12000_B1, CS_REVERB_12000_B2,
228          (LVM_UINT16)CS_REVERB_12000_SCALE},
229         {CS_REVERB_16000_A0, /* 16kS/s coefficients */
230          CS_REVERB_16000_A1, CS_REVERB_16000_A2, CS_REVERB_16000_B1, CS_REVERB_16000_B2,
231          (LVM_UINT16)CS_REVERB_16000_SCALE},
232         {CS_REVERB_22050_A0, /* 22kS/s coefficients */
233          CS_REVERB_22050_A1, CS_REVERB_22050_A2, CS_REVERB_22050_B1, CS_REVERB_22050_B2,
234          (LVM_UINT16)CS_REVERB_22050_SCALE},
235         {CS_REVERB_24000_A0, /* 24kS/s coefficients */
236          CS_REVERB_24000_A1, CS_REVERB_24000_A2, CS_REVERB_24000_B1, CS_REVERB_24000_B2,
237          (LVM_UINT16)CS_REVERB_24000_SCALE},
238         {CS_REVERB_32000_A0, /* 32kS/s coefficients */
239          CS_REVERB_32000_A1, CS_REVERB_32000_A2, CS_REVERB_32000_B1, CS_REVERB_32000_B2,
240          (LVM_UINT16)CS_REVERB_32000_SCALE},
241         {CS_REVERB_44100_A0, /* 44kS/s coefficients */
242          CS_REVERB_44100_A1, CS_REVERB_44100_A2, CS_REVERB_44100_B1, CS_REVERB_44100_B2,
243          (LVM_UINT16)CS_REVERB_44100_SCALE},
244         {CS_REVERB_48000_A0, /* 48kS/s coefficients */
245          CS_REVERB_48000_A1, CS_REVERB_48000_A2, CS_REVERB_48000_B1, CS_REVERB_48000_B2,
246          (LVM_UINT16)CS_REVERB_48000_SCALE},
247         {CS_REVERB_88200_A0, /* 88kS/s coefficients */
248          CS_REVERB_88200_A1, CS_REVERB_88200_A2, CS_REVERB_88200_B1, CS_REVERB_88200_B2,
249          (LVM_UINT16)CS_REVERB_88200_SCALE},
250         {CS_REVERB_96000_A0, /* 96kS/s coefficients */
251          CS_REVERB_96000_A1, CS_REVERB_96000_A2, CS_REVERB_96000_B1, CS_REVERB_96000_B2,
252          (LVM_UINT16)CS_REVERB_96000_SCALE},
253         {CS_REVERB_176400_A0, /* 176kS/s coefficients */
254          CS_REVERB_176400_A1, CS_REVERB_176400_A2, CS_REVERB_176400_B1, CS_REVERB_176400_B2,
255          (LVM_UINT16)CS_REVERB_176400_SCALE},
256         {CS_REVERB_192000_A0, /* 192kS/s coefficients */
257          CS_REVERB_192000_A1, CS_REVERB_192000_A2, CS_REVERB_192000_B1, CS_REVERB_192000_B2,
258          (LVM_UINT16)CS_REVERB_192000_SCALE}};
259 
260 /************************************************************************************/
261 /*                                                                                  */
262 /*  Bypass mixer constant tables                                                    */
263 /*                                                                                  */
264 /************************************************************************************/
265 
266 const Gain_t LVCS_OutputGainTable[] = {{LVCS_HEADPHONE_SHIFT, /* Headphone, stereo mode */
267                                         LVCS_HEADPHONE_SHIFTLOSS, LVCS_HEADPHONE_GAIN},
268                                        {LVCS_EX_HEADPHONE_SHIFT, /* EX Headphone, stereo mode */
269                                         LVCS_EX_HEADPHONE_SHIFTLOSS, LVCS_EX_HEADPHONE_GAIN},
270                                        {LVCS_HEADPHONE_SHIFT, /* Headphone, mono mode */
271                                         LVCS_HEADPHONE_SHIFTLOSS, LVCS_HEADPHONE_GAIN},
272                                        {LVCS_EX_HEADPHONE_SHIFT, /* EX Headphone, mono mode */
273                                         LVCS_EX_HEADPHONE_SHIFTLOSS, LVCS_EX_HEADPHONE_GAIN}};
274 
275 /************************************************************************************/
276 /*                                                                                  */
277 /*  Volume correction table                                                         */
278 /*                                                                                  */
279 /*  Coefficient order:                                                              */
280 /*      Compression 100% effect                                                     */
281 /*      Compression 0% effect                                                       */
282 /*      Gain 100% effect                                                            */
283 /*      Gain 0% effect                                                              */
284 /*                                                                                  */
285 /*  The Compression gain is represented by a Q1.15 number to give a range of 0dB    */
286 /*  to +6dB, E.g.:                                                                  */
287 /*          0       is 0dB compression (no effect)                                  */
288 /*          5461    is 1dB compression gain                                         */
289 /*          10923   is 2dB compression gain                                         */
290 /*          32767   is 6dB compression gain                                         */
291 /*                                                                                  */
292 /*  The Gain is represented as a Q3.13 number to give a range of +8 to -infinity    */
293 /*  E.g.:                                                                           */
294 /*          0       is -infinity                                                    */
295 /*          32767   is +18dB (x8) gain                                              */
296 /*          4096    is 0dB gain                                                     */
297 /*          1024    is -12dB gain                                                   */
298 /*                                                                                  */
299 /************************************************************************************/
300 const LVCS_VolCorrect_t LVCS_VolCorrectTable[] = {{0.433362f, /* Headphone, stereo mode */
301                                                    0.000000f, 1.000024f, 1.412640f},
302                                                   {0.433362f, /* EX Headphone, stereo mode */
303                                                    0.000000f, 1.000024f, 1.412640f},
304                                                   {1.000000f, /* Headphone, mono mode */
305                                                    0.000000f, 1.000024f, 1.412640f},
306                                                   {1.000000f, /* EX Headphone, mono mode */
307                                                    0.000000f, 1.000024f, 1.412640f}};
308 
309 /************************************************************************************/
310 /*                                                                                  */
311 /*  Mixer time constants, 100ms                                                     */
312 /*                                                                                  */
313 /************************************************************************************/
314 
315 #define LVCS_VOL_TC_Fs8000 32580  /* Floating point value 0.994262695 */
316 #define LVCS_VOL_TC_Fs11025 32632 /* Floating point value 0.995849609 */
317 #define LVCS_VOL_TC_Fs12000 32643 /* Floating point value 0.996185303 */
318 #define LVCS_VOL_TC_Fs16000 32674 /* Floating point value 0.997131348 */
319 #define LVCS_VOL_TC_Fs22050 32700 /* Floating point value 0.997924805 */
320 #define LVCS_VOL_TC_Fs24000 32705 /* Floating point value 0.998077393 */
321 #define LVCS_VOL_TC_Fs32000 32721 /* Floating point value 0.998565674 */
322 #define LVCS_VOL_TC_Fs44100 32734 /* Floating point value 0.998962402 */
323 #define LVCS_VOL_TC_Fs48000 32737 /* Floating point value 0.999053955 */
324 #define LVCS_VOL_TC_Fs88200 32751 /* Floating point value 0.999481066 */
325 #define LVCS_VOL_TC_Fs96000 \
326     32751 /* Floating point value 0.999511703 */ /* Todo @ need to re check this value*/
327 #define LVCS_VOL_TC_Fs176400 32759               /* Floating point value 0.999740499 */
328 #define LVCS_VOL_TC_Fs192000 \
329     32763 /* Floating point value 0.999877925 */ /* Todo @ need to re check this value*/
330 
331 const LVM_INT16 LVCS_VolumeTCTable[13] = {
332         LVCS_VOL_TC_Fs8000,  LVCS_VOL_TC_Fs11025, LVCS_VOL_TC_Fs12000, LVCS_VOL_TC_Fs16000,
333         LVCS_VOL_TC_Fs22050, LVCS_VOL_TC_Fs24000, LVCS_VOL_TC_Fs32000, LVCS_VOL_TC_Fs44100,
334         LVCS_VOL_TC_Fs48000, LVCS_VOL_TC_Fs88200, LVCS_VOL_TC_Fs96000, LVCS_VOL_TC_Fs176400,
335         LVCS_VOL_TC_Fs192000};
336 
337 /************************************************************************************/
338 /*                                                                                  */
339 /*  Sample rate table                                                               */
340 /*                                                                                  */
341 /************************************************************************************/
342 const LVM_INT32 LVCS_SampleRateTable[13] = {8000,  11025, 12000, 16000, 22050,  24000, 32000,
343                                             44100, 48000, 88200, 96000, 176400, 192000};
344