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 /*                                                                                  */
21 /*  Includes                                                                        */
22 /*                                                                                  */
23 /************************************************************************************/
24 
25 #include "LVCS_Private.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 /*                                                                                  */
33 /*  Stereo Enhancer coefficient constant tables                                     */
34 /*                                                                                  */
35 /************************************************************************************/
36 
37 /* Coefficient table for the middle filter */
38 const BiquadA01B1CoefsSP_t LVCS_SEMidCoefTable[] = {
39     {CS_MIDDLE_8000_A0,         /* 8kS/s coefficients */
40      CS_MIDDLE_8000_A1,
41      CS_MIDDLE_8000_B1,
42      (LVM_UINT16 )CS_MIDDLE_8000_SCALE},
43     {CS_MIDDLE_11025_A0,        /* 11kS/s coefficients */
44      CS_MIDDLE_11025_A1,
45      CS_MIDDLE_11025_B1,
46      (LVM_UINT16 )CS_MIDDLE_11025_SCALE},
47     {CS_MIDDLE_12000_A0,        /* 12kS/s coefficients */
48      CS_MIDDLE_12000_A1,
49      CS_MIDDLE_12000_B1,
50      (LVM_UINT16 )CS_MIDDLE_12000_SCALE},
51     {CS_MIDDLE_16000_A0,        /* 16kS/s coefficients */
52      CS_MIDDLE_16000_A1,
53      CS_MIDDLE_16000_B1,
54      (LVM_UINT16 )CS_MIDDLE_16000_SCALE},
55     {CS_MIDDLE_22050_A0,        /* 22kS/s coefficients */
56      CS_MIDDLE_22050_A1,
57      CS_MIDDLE_22050_B1,
58      (LVM_UINT16 )CS_MIDDLE_22050_SCALE},
59     {CS_MIDDLE_24000_A0,        /* 24kS/s coefficients */
60      CS_MIDDLE_24000_A1,
61      CS_MIDDLE_24000_B1,
62      (LVM_UINT16 )CS_MIDDLE_24000_SCALE},
63     {CS_MIDDLE_32000_A0,        /* 32kS/s coefficients */
64      CS_MIDDLE_32000_A1,
65      CS_MIDDLE_32000_B1,
66      (LVM_UINT16 )CS_MIDDLE_32000_SCALE},
67     {CS_MIDDLE_44100_A0,        /* 44kS/s coefficients */
68      CS_MIDDLE_44100_A1,
69      CS_MIDDLE_44100_B1,
70      (LVM_UINT16 )CS_MIDDLE_44100_SCALE},
71     {CS_MIDDLE_48000_A0,        /* 48kS/s coefficients */
72      CS_MIDDLE_48000_A1,
73      CS_MIDDLE_48000_B1,
74      (LVM_UINT16 )CS_MIDDLE_48000_SCALE}
75 #ifdef HIGHER_FS
76     ,
77     {CS_MIDDLE_96000_A0,        /* 96kS/s coefficients */
78      CS_MIDDLE_96000_A1,
79      CS_MIDDLE_96000_B1,
80      (LVM_UINT16 )CS_MIDDLE_96000_SCALE},
81     {CS_MIDDLE_192000_A0,        /* 192kS/s coefficients */
82      CS_MIDDLE_192000_A1,
83      CS_MIDDLE_192000_B1,
84      (LVM_UINT16 )CS_MIDDLE_192000_SCALE}
85 #endif
86     };
87 
88 /* Coefficient table for the side filter */
89 const BiquadA012B12CoefsSP_t LVCS_SESideCoefTable[] = {
90     /* Headphone Side coefficients */
91     {CS_SIDE_8000_A0,           /* 8kS/s coefficients */
92      CS_SIDE_8000_A1,
93      CS_SIDE_8000_A2,
94      CS_SIDE_8000_B1,
95      CS_SIDE_8000_B2,
96      (LVM_UINT16 )CS_SIDE_8000_SCALE},
97     {CS_SIDE_11025_A0,          /* 11kS/s coefficients */
98      CS_SIDE_11025_A1,
99      CS_SIDE_11025_A2,
100      CS_SIDE_11025_B1,
101      CS_SIDE_11025_B2,
102      (LVM_UINT16 )CS_SIDE_11025_SCALE},
103     {CS_SIDE_12000_A0,          /* 12kS/s coefficients */
104      CS_SIDE_12000_A1,
105      CS_SIDE_12000_A2,
106      CS_SIDE_12000_B1,
107      CS_SIDE_12000_B2,
108      (LVM_UINT16 )CS_SIDE_12000_SCALE},
109     {CS_SIDE_16000_A0,          /* 16kS/s coefficients */
110      CS_SIDE_16000_A1,
111      CS_SIDE_16000_A2,
112      CS_SIDE_16000_B1,
113      CS_SIDE_16000_B2,
114      (LVM_UINT16 )CS_SIDE_16000_SCALE},
115     {CS_SIDE_22050_A0,          /* 22kS/s coefficients */
116      CS_SIDE_22050_A1,
117      CS_SIDE_22050_A2,
118      CS_SIDE_22050_B1,
119      CS_SIDE_22050_B2,
120      (LVM_UINT16 )CS_SIDE_22050_SCALE},
121     {CS_SIDE_24000_A0,          /* 24kS/s coefficients */
122      CS_SIDE_24000_A1,
123      CS_SIDE_24000_A2,
124      CS_SIDE_24000_B1,
125      CS_SIDE_24000_B2,
126      (LVM_UINT16 )CS_SIDE_24000_SCALE},
127     {CS_SIDE_32000_A0,          /* 32kS/s coefficients */
128      CS_SIDE_32000_A1,
129      CS_SIDE_32000_A2,
130      CS_SIDE_32000_B1,
131      CS_SIDE_32000_B2,
132      (LVM_UINT16 )CS_SIDE_32000_SCALE},
133     {CS_SIDE_44100_A0,          /* 44kS/s coefficients */
134      CS_SIDE_44100_A1,
135      CS_SIDE_44100_A2,
136      CS_SIDE_44100_B1,
137      CS_SIDE_44100_B2,
138      (LVM_UINT16 )CS_SIDE_44100_SCALE},
139     {CS_SIDE_48000_A0,          /* 48kS/s coefficients */
140      CS_SIDE_48000_A1,
141      CS_SIDE_48000_A2,
142      CS_SIDE_48000_B1,
143      CS_SIDE_48000_B2,
144      (LVM_UINT16 )CS_SIDE_48000_SCALE}
145 #ifdef HIGHER_FS
146      ,
147      {CS_SIDE_96000_A0,          /* 96kS/s coefficients */
148      CS_SIDE_96000_A1,
149      CS_SIDE_96000_A2,
150      CS_SIDE_96000_B1,
151      CS_SIDE_96000_B2,
152      (LVM_UINT16 )CS_SIDE_96000_SCALE},
153      {CS_SIDE_192000_A0,          /* 192kS/s coefficients */
154      CS_SIDE_192000_A1,
155      CS_SIDE_192000_A2,
156      CS_SIDE_192000_B1,
157      CS_SIDE_192000_B2,
158      (LVM_UINT16 )CS_SIDE_192000_SCALE}
159 #endif
160 };
161 
162 
163 /************************************************************************************/
164 /*                                                                                  */
165 /*  Equaliser coefficient constant tables                                           */
166 /*                                                                                  */
167 /************************************************************************************/
168 
169 const BiquadA012B12CoefsSP_t LVCS_EqualiserCoefTable[] = {
170     /* Headphone coefficients */
171     {CS_EQUALISER_8000_A0,      /* 8kS/s coefficients */
172      CS_EQUALISER_8000_A1,
173      CS_EQUALISER_8000_A2,
174      CS_EQUALISER_8000_B1,
175      CS_EQUALISER_8000_B2,
176      (LVM_UINT16 )CS_EQUALISER_8000_SCALE},
177     {CS_EQUALISER_11025_A0,     /* 11kS/s coefficients */
178      CS_EQUALISER_11025_A1,
179      CS_EQUALISER_11025_A2,
180      CS_EQUALISER_11025_B1,
181      CS_EQUALISER_11025_B2,
182      (LVM_UINT16 )CS_EQUALISER_11025_SCALE},
183     {CS_EQUALISER_12000_A0,     /* 12kS/s coefficients */
184      CS_EQUALISER_12000_A1,
185      CS_EQUALISER_12000_A2,
186      CS_EQUALISER_12000_B1,
187      CS_EQUALISER_12000_B2,
188      (LVM_UINT16 )CS_EQUALISER_12000_SCALE},
189     {CS_EQUALISER_16000_A0,     /* 16kS/s coefficients */
190      CS_EQUALISER_16000_A1,
191      CS_EQUALISER_16000_A2,
192      CS_EQUALISER_16000_B1,
193      CS_EQUALISER_16000_B2,
194      (LVM_UINT16 )CS_EQUALISER_16000_SCALE},
195     {CS_EQUALISER_22050_A0,     /* 22kS/s coefficients */
196      CS_EQUALISER_22050_A1,
197      CS_EQUALISER_22050_A2,
198      CS_EQUALISER_22050_B1,
199      CS_EQUALISER_22050_B2,
200      (LVM_UINT16 )CS_EQUALISER_22050_SCALE},
201     {CS_EQUALISER_24000_A0,     /* 24kS/s coefficients */
202      CS_EQUALISER_24000_A1,
203      CS_EQUALISER_24000_A2,
204      CS_EQUALISER_24000_B1,
205      CS_EQUALISER_24000_B2,
206      (LVM_UINT16 )CS_EQUALISER_24000_SCALE},
207     {CS_EQUALISER_32000_A0,     /* 32kS/s coefficients */
208      CS_EQUALISER_32000_A1,
209      CS_EQUALISER_32000_A2,
210      CS_EQUALISER_32000_B1,
211      CS_EQUALISER_32000_B2,
212      (LVM_UINT16 )CS_EQUALISER_32000_SCALE},
213     {CS_EQUALISER_44100_A0,     /* 44kS/s coefficients */
214      CS_EQUALISER_44100_A1,
215      CS_EQUALISER_44100_A2,
216      CS_EQUALISER_44100_B1,
217      CS_EQUALISER_44100_B2,
218      (LVM_UINT16 )CS_EQUALISER_44100_SCALE},
219     {CS_EQUALISER_48000_A0,     /* 48kS/s coefficients */
220      CS_EQUALISER_48000_A1,
221      CS_EQUALISER_48000_A2,
222      CS_EQUALISER_48000_B1,
223      CS_EQUALISER_48000_B2,
224      (LVM_UINT16 )CS_EQUALISER_48000_SCALE},
225 #ifdef HIGHER_FS
226     {CS_EQUALISER_96000_A0,     /* 96kS/s coefficients */
227      CS_EQUALISER_96000_A1,
228      CS_EQUALISER_96000_A2,
229      CS_EQUALISER_96000_B1,
230      CS_EQUALISER_96000_B2,
231      (LVM_UINT16 )CS_EQUALISER_96000_SCALE},
232     {CS_EQUALISER_192000_A0,     /* 192kS/s coefficients */
233      CS_EQUALISER_192000_A1,
234      CS_EQUALISER_192000_A2,
235      CS_EQUALISER_192000_B1,
236      CS_EQUALISER_192000_B2,
237      (LVM_UINT16 )CS_EQUALISER_192000_SCALE},
238 #endif
239 
240     /* Concert Sound EX Headphone coefficients */
241     {CSEX_EQUALISER_8000_A0,    /* 8kS/s coefficients */
242      CSEX_EQUALISER_8000_A1,
243      CSEX_EQUALISER_8000_A2,
244      CSEX_EQUALISER_8000_B1,
245      CSEX_EQUALISER_8000_B2,
246      (LVM_UINT16 )CSEX_EQUALISER_8000_SCALE},
247     {CSEX_EQUALISER_11025_A0,   /* 11kS/s coefficients */
248      CSEX_EQUALISER_11025_A1,
249      CSEX_EQUALISER_11025_A2,
250      CSEX_EQUALISER_11025_B1,
251      CSEX_EQUALISER_11025_B2,
252      (LVM_UINT16 )CSEX_EQUALISER_11025_SCALE},
253     {CSEX_EQUALISER_12000_A0,   /* 12kS/s coefficients */
254      CSEX_EQUALISER_12000_A1,
255      CSEX_EQUALISER_12000_A2,
256      CSEX_EQUALISER_12000_B1,
257      CSEX_EQUALISER_12000_B2,
258      (LVM_UINT16 )CSEX_EQUALISER_12000_SCALE},
259     {CSEX_EQUALISER_16000_A0,   /* 16kS/s coefficients */
260      CSEX_EQUALISER_16000_A1,
261      CSEX_EQUALISER_16000_A2,
262      CSEX_EQUALISER_16000_B1,
263      CSEX_EQUALISER_16000_B2,
264      (LVM_UINT16 )CSEX_EQUALISER_16000_SCALE},
265     {CSEX_EQUALISER_22050_A0,   /* 22kS/s coefficients */
266      CSEX_EQUALISER_22050_A1,
267      CSEX_EQUALISER_22050_A2,
268      CSEX_EQUALISER_22050_B1,
269      CSEX_EQUALISER_22050_B2,
270      (LVM_UINT16 )CSEX_EQUALISER_22050_SCALE},
271     {CSEX_EQUALISER_24000_A0,   /* 24kS/s coefficients */
272      CSEX_EQUALISER_24000_A1,
273      CSEX_EQUALISER_24000_A2,
274      CSEX_EQUALISER_24000_B1,
275      CSEX_EQUALISER_24000_B2,
276      (LVM_UINT16 )CSEX_EQUALISER_24000_SCALE},
277     {CSEX_EQUALISER_32000_A0,   /* 32kS/s coefficients */
278      CSEX_EQUALISER_32000_A1,
279      CSEX_EQUALISER_32000_A2,
280      CSEX_EQUALISER_32000_B1,
281      CSEX_EQUALISER_32000_B2,
282      (LVM_UINT16 )CSEX_EQUALISER_32000_SCALE},
283     {CSEX_EQUALISER_44100_A0,   /* 44kS/s coefficients */
284      CSEX_EQUALISER_44100_A1,
285      CSEX_EQUALISER_44100_A2,
286      CSEX_EQUALISER_44100_B1,
287      CSEX_EQUALISER_44100_B2,
288      (LVM_UINT16 )CSEX_EQUALISER_44100_SCALE},
289     {CSEX_EQUALISER_48000_A0,   /* 48kS/s coefficients */
290      CSEX_EQUALISER_48000_A1,
291      CSEX_EQUALISER_48000_A2,
292      CSEX_EQUALISER_48000_B1,
293      CSEX_EQUALISER_48000_B2,
294      (LVM_UINT16 )CSEX_EQUALISER_48000_SCALE}
295 #ifdef HIGHER_FS
296     ,
297     {CSEX_EQUALISER_96000_A0,   /* 96kS/s coefficients */
298      CSEX_EQUALISER_96000_A1,
299      CSEX_EQUALISER_96000_A2,
300      CSEX_EQUALISER_96000_B1,
301      CSEX_EQUALISER_96000_B2,
302      (LVM_UINT16 )CSEX_EQUALISER_96000_SCALE},
303      {CSEX_EQUALISER_192000_A0,   /* 192kS/s coefficients */
304      CSEX_EQUALISER_192000_A1,
305      CSEX_EQUALISER_192000_A2,
306      CSEX_EQUALISER_192000_B1,
307      CSEX_EQUALISER_192000_B2,
308      (LVM_UINT16 )CSEX_EQUALISER_192000_SCALE}
309 #endif
310 };
311 
312 
313 /************************************************************************************/
314 /*                                                                                  */
315 /*  Reverb delay constant tables                                                    */
316 /*                                                                                  */
317 /************************************************************************************/
318 
319 /* Stereo delay table for Concert Sound */
320 const LVM_UINT16    LVCS_StereoDelayCS[] = {
321     LVCS_STEREODELAY_CS_8KHZ,
322     LVCS_STEREODELAY_CS_11KHZ,
323     LVCS_STEREODELAY_CS_12KHZ,
324     LVCS_STEREODELAY_CS_16KHZ,
325     LVCS_STEREODELAY_CS_22KHZ,
326     LVCS_STEREODELAY_CS_24KHZ,
327     LVCS_STEREODELAY_CS_32KHZ,
328     LVCS_STEREODELAY_CS_44KHZ,
329     LVCS_STEREODELAY_CS_48KHZ};
330 
331 /************************************************************************************/
332 /*                                                                                  */
333 /*  Reverb coefficients constant table                                              */
334 /*                                                                                  */
335 /************************************************************************************/
336 
337 const BiquadA012B12CoefsSP_t LVCS_ReverbCoefTable[] = {
338     /* Headphone coefficients */
339     {CS_REVERB_8000_A0,             /* 8kS/s coefficients */
340      CS_REVERB_8000_A1,
341      CS_REVERB_8000_A2,
342      CS_REVERB_8000_B1,
343      CS_REVERB_8000_B2,
344      (LVM_UINT16 )CS_REVERB_8000_SCALE},
345     {CS_REVERB_11025_A0,            /* 11kS/s coefficients */
346      CS_REVERB_11025_A1,
347      CS_REVERB_11025_A2,
348      CS_REVERB_11025_B1,
349      CS_REVERB_11025_B2,
350      (LVM_UINT16 )CS_REVERB_11025_SCALE},
351     {CS_REVERB_12000_A0,            /* 12kS/s coefficients */
352      CS_REVERB_12000_A1,
353      CS_REVERB_12000_A2,
354      CS_REVERB_12000_B1,
355      CS_REVERB_12000_B2,
356      (LVM_UINT16 )CS_REVERB_12000_SCALE},
357     {CS_REVERB_16000_A0,            /* 16kS/s coefficients */
358      CS_REVERB_16000_A1,
359      CS_REVERB_16000_A2,
360      CS_REVERB_16000_B1,
361      CS_REVERB_16000_B2,
362      (LVM_UINT16 )CS_REVERB_16000_SCALE},
363     {CS_REVERB_22050_A0,            /* 22kS/s coefficients */
364      CS_REVERB_22050_A1,
365      CS_REVERB_22050_A2,
366      CS_REVERB_22050_B1,
367      CS_REVERB_22050_B2,
368      (LVM_UINT16 )CS_REVERB_22050_SCALE},
369     {CS_REVERB_24000_A0,            /* 24kS/s coefficients */
370      CS_REVERB_24000_A1,
371      CS_REVERB_24000_A2,
372      CS_REVERB_24000_B1,
373      CS_REVERB_24000_B2,
374      (LVM_UINT16 )CS_REVERB_24000_SCALE},
375     {CS_REVERB_32000_A0,            /* 32kS/s coefficients */
376      CS_REVERB_32000_A1,
377      CS_REVERB_32000_A2,
378      CS_REVERB_32000_B1,
379      CS_REVERB_32000_B2,
380      (LVM_UINT16 )CS_REVERB_32000_SCALE},
381     {CS_REVERB_44100_A0,            /* 44kS/s coefficients */
382      CS_REVERB_44100_A1,
383      CS_REVERB_44100_A2,
384      CS_REVERB_44100_B1,
385      CS_REVERB_44100_B2,
386      (LVM_UINT16 )CS_REVERB_44100_SCALE},
387     {CS_REVERB_48000_A0,            /* 48kS/s coefficients */
388      CS_REVERB_48000_A1,
389      CS_REVERB_48000_A2,
390      CS_REVERB_48000_B1,
391      CS_REVERB_48000_B2,
392      (LVM_UINT16 )CS_REVERB_48000_SCALE}
393 #ifdef HIGHER_FS
394     ,
395     {CS_REVERB_96000_A0,            /* 96kS/s coefficients */
396      CS_REVERB_96000_A1,
397      CS_REVERB_96000_A2,
398      CS_REVERB_96000_B1,
399      CS_REVERB_96000_B2,
400      (LVM_UINT16 )CS_REVERB_96000_SCALE},
401      {CS_REVERB_192000_A0,            /* 192kS/s coefficients */
402      CS_REVERB_192000_A1,
403      CS_REVERB_192000_A2,
404      CS_REVERB_192000_B1,
405      CS_REVERB_192000_B2,
406      (LVM_UINT16 )CS_REVERB_192000_SCALE}
407 #endif
408 };
409 
410 
411 /************************************************************************************/
412 /*                                                                                  */
413 /*  Bypass mixer constant tables                                                    */
414 /*                                                                                  */
415 /************************************************************************************/
416 
417 const Gain_t LVCS_OutputGainTable[] = {
418     {LVCS_HEADPHONE_SHIFT,         /* Headphone, stereo mode */
419      LVCS_HEADPHONE_SHIFTLOSS,
420      LVCS_HEADPHONE_GAIN},
421     {LVCS_EX_HEADPHONE_SHIFT,      /* EX Headphone, stereo mode */
422      LVCS_EX_HEADPHONE_SHIFTLOSS,
423      LVCS_EX_HEADPHONE_GAIN},
424     {LVCS_HEADPHONE_SHIFT,         /* Headphone, mono mode */
425      LVCS_HEADPHONE_SHIFTLOSS,
426      LVCS_HEADPHONE_GAIN},
427     {LVCS_EX_HEADPHONE_SHIFT,      /* EX Headphone, mono mode */
428      LVCS_EX_HEADPHONE_SHIFTLOSS,
429      LVCS_EX_HEADPHONE_GAIN}
430 };
431 
432 
433 /************************************************************************************/
434 /*                                                                                  */
435 /*  Volume correction table                                                         */
436 /*                                                                                  */
437 /*  Coefficient order:                                                              */
438 /*      Compression 100% effect                                                     */
439 /*      Compression 0% effect                                                       */
440 /*      Gain 100% effect                                                            */
441 /*      Gain 0% effect                                                              */
442 /*                                                                                  */
443 /*  The Compression gain is represented by a Q1.15 number to give a range of 0dB    */
444 /*  to +6dB, E.g.:                                                                  */
445 /*          0       is 0dB compression (no effect)                                  */
446 /*          5461    is 1dB compression gain                                         */
447 /*          10923   is 2dB compression gain                                         */
448 /*          32767   is 6dB compression gain                                         */
449 /*                                                                                  */
450 /*  The Gain is represented as a Q3.13 number to give a range of +8 to -infinity    */
451 /*  E.g.:                                                                           */
452 /*          0       is -infinity                                                    */
453 /*          32767   is +18dB (x8) gain                                              */
454 /*          4096    is 0dB gain                                                     */
455 /*          1024    is -12dB gain                                                   */
456 /*                                                                                  */
457 /************************************************************************************/
458 const LVCS_VolCorrect_t LVCS_VolCorrectTable[] = {
459 #ifdef BUILD_FLOAT
460     {0.433362f,          /* Headphone, stereo mode */
461      0.000000f,
462      1.000024f,
463      1.412640f},
464     {0.433362f,          /* EX Headphone, stereo mode */
465      0.000000f,
466      1.000024f,
467      1.412640f},
468     {1.000000f,         /* Headphone, mono mode */
469      0.000000f,
470      1.000024f,
471      1.412640f},
472     {1.000000f,         /* EX Headphone, mono mode */
473      0.000000f,
474      1.000024f,
475      1.412640f}
476 #else
477     {14200,          /* Headphone, stereo mode */
478      0,
479      4096,
480      5786},
481     {14200,          /* EX Headphone, stereo mode */
482      0,
483      4096,
484      5786},
485     {32767,         /* Headphone, mono mode */
486      0,
487      4096,
488      5786},
489     {32767,         /* EX Headphone, mono mode */
490      0,
491      4096,
492      5786}
493 #endif
494 };
495 
496 /************************************************************************************/
497 /*                                                                                  */
498 /*  Mixer time constants, 100ms                                                     */
499 /*                                                                                  */
500 /************************************************************************************/
501 
502 #define LVCS_VOL_TC_Fs8000      32580       /* Floating point value 0.994262695 */
503 #define LVCS_VOL_TC_Fs11025     32632       /* Floating point value 0.995849609 */
504 #define LVCS_VOL_TC_Fs12000     32643       /* Floating point value 0.996185303 */
505 #define LVCS_VOL_TC_Fs16000     32674       /* Floating point value 0.997131348 */
506 #define LVCS_VOL_TC_Fs22050     32700       /* Floating point value 0.997924805 */
507 #define LVCS_VOL_TC_Fs24000     32705       /* Floating point value 0.998077393 */
508 #define LVCS_VOL_TC_Fs32000     32721       /* Floating point value 0.998565674 */
509 #define LVCS_VOL_TC_Fs44100     32734       /* Floating point value 0.998962402 */
510 #define LVCS_VOL_TC_Fs48000     32737       /* Floating point value 0.999053955 */
511 #if defined(BUILD_FLOAT) && defined(HIGHER_FS)
512 #define LVCS_VOL_TC_Fs96000     32751       /* Floating point value 0.999511703 */   /* Todo @ need to re check this value*/
513 #define LVCS_VOL_TC_Fs192000    32763       /* Floating point value 0.999877925 */  /* Todo @ need to re check this value*/
514 #endif
515 
516 #if defined(BUILD_FLOAT) && defined(HIGHER_FS)
517 const LVM_INT16 LVCS_VolumeTCTable[11] = {LVCS_VOL_TC_Fs8000,
518 		                                  LVCS_VOL_TC_Fs11025,
519 										  LVCS_VOL_TC_Fs12000,
520 										  LVCS_VOL_TC_Fs16000,
521 										  LVCS_VOL_TC_Fs22050,
522 										  LVCS_VOL_TC_Fs24000,
523 										  LVCS_VOL_TC_Fs32000,
524 										  LVCS_VOL_TC_Fs44100,
525 										  LVCS_VOL_TC_Fs48000,
526 										  LVCS_VOL_TC_Fs96000,
527 										  LVCS_VOL_TC_Fs192000
528 };
529 #else
530 const LVM_INT16 LVCS_VolumeTCTable[9] = {LVCS_VOL_TC_Fs8000,
531                                         LVCS_VOL_TC_Fs11025,
532                                         LVCS_VOL_TC_Fs12000,
533                                         LVCS_VOL_TC_Fs16000,
534                                         LVCS_VOL_TC_Fs22050,
535                                         LVCS_VOL_TC_Fs24000,
536                                         LVCS_VOL_TC_Fs32000,
537                                         LVCS_VOL_TC_Fs44100,
538                                         LVCS_VOL_TC_Fs48000
539 };
540 #endif
541 
542 /************************************************************************************/
543 /*                                                                                  */
544 /*  Sample rate table                                                               */
545 /*                                                                                  */
546 /************************************************************************************/
547 #if defined(BUILD_FLOAT) && defined(HIGHER_FS)
548 const LVM_INT32   LVCS_SampleRateTable[11] = {8000,
549 		                                      11025,
550 											  12000,
551 											  16000,
552 											  22050,
553 											  24000,
554 											  32000,
555 											  44100,
556 											  48000,
557 											  96000,
558 											  192000
559 };
560 #else
561 const LVM_INT16   LVCS_SampleRateTable[9] = {8000,
562                                             11025,
563                                             12000,
564                                             16000,
565                                             22050,
566                                             24000,
567                                             32000,
568                                             44100,
569                                             48000
570 };
571 #endif
572