• 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 "LVM_Tables.h"
25 #include "LVM_Coeffs.h"
26 
27 /************************************************************************************/
28 /*                                                                                  */
29 /*    Treble Boost Filter Coefficients                                              */
30 /*                                                                                  */
31 /************************************************************************************/
32 #ifdef BUILD_FLOAT
33 
34 FO_FLOAT_LShx_Coefs_t    LVM_TrebleBoostCoefs[] = {
35 
36                     /* 22kHz sampling rate */
37                     {HPF_Fs22050_Gain1_A1,             /* Gain setting 1 */
38                      HPF_Fs22050_Gain1_A0,
39                      -HPF_Fs22050_Gain1_B1},
40                     {HPF_Fs22050_Gain2_A1,             /* Gain setting 2 */
41                      HPF_Fs22050_Gain2_A0,
42                      -HPF_Fs22050_Gain2_B1},
43                     {HPF_Fs22050_Gain3_A1,             /* Gain setting 3 */
44                      HPF_Fs22050_Gain3_A0,
45                      -HPF_Fs22050_Gain3_B1},
46                     {HPF_Fs22050_Gain4_A1,             /* Gain setting 4 */
47                      HPF_Fs22050_Gain4_A0,
48                      -HPF_Fs22050_Gain4_B1},
49                     {HPF_Fs22050_Gain5_A1,             /* Gain setting 5 */
50                      HPF_Fs22050_Gain5_A0,
51                      -HPF_Fs22050_Gain5_B1},
52                     {HPF_Fs22050_Gain6_A1,             /* Gain setting 6 */
53                      HPF_Fs22050_Gain6_A0,
54                      -HPF_Fs22050_Gain6_B1},
55                     {HPF_Fs22050_Gain7_A1,             /* Gain setting 7 */
56                      HPF_Fs22050_Gain7_A0,
57                      -HPF_Fs22050_Gain7_B1},
58                     {HPF_Fs22050_Gain8_A1,             /* Gain setting 8 */
59                      HPF_Fs22050_Gain8_A0,
60                      -HPF_Fs22050_Gain8_B1},
61                     {HPF_Fs22050_Gain9_A1,             /* Gain setting 9 */
62                      HPF_Fs22050_Gain9_A0,
63                      -HPF_Fs22050_Gain9_B1},
64                     {HPF_Fs22050_Gain10_A1,             /* Gain setting 10 */
65                      HPF_Fs22050_Gain10_A0,
66                      -HPF_Fs22050_Gain10_B1},
67                     {HPF_Fs22050_Gain11_A1,             /* Gain setting 11 */
68                      HPF_Fs22050_Gain11_A0,
69                      -HPF_Fs22050_Gain11_B1},
70                     {HPF_Fs22050_Gain12_A1,             /* Gain setting 12 */
71                      HPF_Fs22050_Gain12_A0,
72                      -HPF_Fs22050_Gain12_B1},
73                     {HPF_Fs22050_Gain13_A1,             /* Gain setting 13 */
74                      HPF_Fs22050_Gain13_A0,
75                      -HPF_Fs22050_Gain13_B1},
76                     {HPF_Fs22050_Gain14_A1,             /* Gain setting 14 */
77                      HPF_Fs22050_Gain14_A0,
78                      -HPF_Fs22050_Gain14_B1},
79                     {HPF_Fs22050_Gain15_A1,             /* Gain setting 15 */
80                      HPF_Fs22050_Gain15_A0,
81                      -HPF_Fs22050_Gain15_B1},
82 
83                     /* 24kHz sampling rate */
84                     {HPF_Fs24000_Gain1_A1,             /* Gain setting 1 */
85                      HPF_Fs24000_Gain1_A0,
86                      -HPF_Fs24000_Gain1_B1},
87                     {HPF_Fs24000_Gain2_A1,             /* Gain setting 2 */
88                      HPF_Fs24000_Gain2_A0,
89                      -HPF_Fs24000_Gain2_B1},
90                     {HPF_Fs24000_Gain3_A1,             /* Gain setting 3 */
91                      HPF_Fs24000_Gain3_A0,
92                      -HPF_Fs24000_Gain3_B1},
93                     {HPF_Fs24000_Gain4_A1,             /* Gain setting 4 */
94                      HPF_Fs24000_Gain4_A0,
95                      -HPF_Fs24000_Gain4_B1},
96                     {HPF_Fs24000_Gain5_A1,             /* Gain setting 5 */
97                      HPF_Fs24000_Gain5_A0,
98                      -HPF_Fs24000_Gain5_B1},
99                     {HPF_Fs24000_Gain6_A1,             /* Gain setting 6 */
100                      HPF_Fs24000_Gain6_A0,
101                      -HPF_Fs24000_Gain6_B1},
102                     {HPF_Fs24000_Gain7_A1,             /* Gain setting 7 */
103                      HPF_Fs24000_Gain7_A0,
104                      -HPF_Fs24000_Gain7_B1},
105                     {HPF_Fs24000_Gain8_A1,             /* Gain setting 8 */
106                      HPF_Fs24000_Gain8_A0,
107                      -HPF_Fs24000_Gain8_B1},
108                     {HPF_Fs24000_Gain9_A1,             /* Gain setting 9 */
109                      HPF_Fs24000_Gain9_A0,
110                      -HPF_Fs24000_Gain9_B1},
111                     {HPF_Fs24000_Gain10_A1,             /* Gain setting 10 */
112                      HPF_Fs24000_Gain10_A0,
113                      -HPF_Fs24000_Gain10_B1},
114                     {HPF_Fs24000_Gain11_A1,             /* Gain setting 11 */
115                      HPF_Fs24000_Gain11_A0,
116                      -HPF_Fs24000_Gain11_B1},
117                     {HPF_Fs24000_Gain12_A1,             /* Gain setting 12 */
118                      HPF_Fs24000_Gain12_A0,
119                      -HPF_Fs24000_Gain12_B1},
120                     {HPF_Fs24000_Gain13_A1,             /* Gain setting 13 */
121                      HPF_Fs24000_Gain13_A0,
122                      -HPF_Fs24000_Gain13_B1},
123                     {HPF_Fs24000_Gain14_A1,             /* Gain setting 14 */
124                      HPF_Fs24000_Gain14_A0,
125                      -HPF_Fs24000_Gain14_B1},
126                     {HPF_Fs24000_Gain15_A1,             /* Gain setting 15 */
127                      HPF_Fs24000_Gain15_A0,
128                      -HPF_Fs24000_Gain15_B1},
129 
130                     /* 32kHz sampling rate */
131                     {HPF_Fs32000_Gain1_A1,             /* Gain setting 1 */
132                      HPF_Fs32000_Gain1_A0,
133                      -HPF_Fs32000_Gain1_B1},
134                     {HPF_Fs32000_Gain2_A1,             /* Gain setting 2 */
135                      HPF_Fs32000_Gain2_A0,
136                      -HPF_Fs32000_Gain2_B1},
137                     {HPF_Fs32000_Gain3_A1,             /* Gain setting 3 */
138                      HPF_Fs32000_Gain3_A0,
139                      -HPF_Fs32000_Gain3_B1},
140                     {HPF_Fs32000_Gain4_A1,             /* Gain setting 4 */
141                      HPF_Fs32000_Gain4_A0,
142                      -HPF_Fs32000_Gain4_B1},
143                     {HPF_Fs32000_Gain5_A1,             /* Gain setting 5 */
144                      HPF_Fs32000_Gain5_A0,
145                      -HPF_Fs32000_Gain5_B1},
146                     {HPF_Fs32000_Gain6_A1,             /* Gain setting 6 */
147                      HPF_Fs32000_Gain6_A0,
148                      -HPF_Fs32000_Gain6_B1},
149                     {HPF_Fs32000_Gain7_A1,             /* Gain setting 7 */
150                      HPF_Fs32000_Gain7_A0,
151                      -HPF_Fs32000_Gain7_B1},
152                     {HPF_Fs32000_Gain8_A1,             /* Gain setting 8 */
153                      HPF_Fs32000_Gain8_A0,
154                      -HPF_Fs32000_Gain8_B1},
155                     {HPF_Fs32000_Gain9_A1,             /* Gain setting 9 */
156                      HPF_Fs32000_Gain9_A0,
157                      -HPF_Fs32000_Gain9_B1},
158                     {HPF_Fs32000_Gain10_A1,             /* Gain setting 10 */
159                      HPF_Fs32000_Gain10_A0,
160                      -HPF_Fs32000_Gain10_B1},
161                     {HPF_Fs32000_Gain11_A1,             /* Gain setting 11 */
162                      HPF_Fs32000_Gain11_A0,
163                      -HPF_Fs32000_Gain11_B1},
164                     {HPF_Fs32000_Gain12_A1,             /* Gain setting 12 */
165                      HPF_Fs32000_Gain12_A0,
166                      -HPF_Fs32000_Gain12_B1},
167                     {HPF_Fs32000_Gain13_A1,             /* Gain setting 13 */
168                      HPF_Fs32000_Gain13_A0,
169                      -HPF_Fs32000_Gain13_B1},
170                     {HPF_Fs32000_Gain14_A1,             /* Gain setting 14 */
171                      HPF_Fs32000_Gain14_A0,
172                      -HPF_Fs32000_Gain14_B1},
173                     {HPF_Fs32000_Gain15_A1,             /* Gain setting 15 */
174                      HPF_Fs32000_Gain15_A0,
175                      -HPF_Fs32000_Gain15_B1},
176 
177                     /* 44kHz sampling rate */
178                     {HPF_Fs44100_Gain1_A1,             /* Gain setting 1 */
179                      HPF_Fs44100_Gain1_A0,
180                      -HPF_Fs44100_Gain1_B1,},
181                     {HPF_Fs44100_Gain2_A1,             /* Gain setting 2 */
182                      HPF_Fs44100_Gain2_A0,
183                      -HPF_Fs44100_Gain2_B1},
184                     {HPF_Fs44100_Gain3_A1,             /* Gain setting 3 */
185                      HPF_Fs44100_Gain3_A0,
186                      -HPF_Fs44100_Gain3_B1},
187                     {HPF_Fs44100_Gain4_A1,             /* Gain setting 4 */
188                      HPF_Fs44100_Gain4_A0,
189                      -HPF_Fs44100_Gain4_B1},
190                     {HPF_Fs44100_Gain5_A1,             /* Gain setting 5 */
191                      HPF_Fs44100_Gain5_A0,
192                      -HPF_Fs44100_Gain5_B1},
193                     {HPF_Fs44100_Gain6_A1,             /* Gain setting 6 */
194                      HPF_Fs44100_Gain6_A0,
195                      -HPF_Fs44100_Gain6_B1},
196                     {HPF_Fs44100_Gain7_A1,             /* Gain setting 7 */
197                      HPF_Fs44100_Gain7_A0,
198                      -HPF_Fs44100_Gain7_B1},
199                     {HPF_Fs44100_Gain8_A1,             /* Gain setting 8 */
200                      HPF_Fs44100_Gain8_A0,
201                      -HPF_Fs44100_Gain8_B1},
202                     {HPF_Fs44100_Gain9_A1,             /* Gain setting 9 */
203                      HPF_Fs44100_Gain9_A0,
204                      -HPF_Fs44100_Gain9_B1},
205                     {HPF_Fs44100_Gain10_A1,             /* Gain setting 10 */
206                      HPF_Fs44100_Gain10_A0,
207                      -HPF_Fs44100_Gain10_B1},
208                     {HPF_Fs44100_Gain11_A1,             /* Gain setting 11 */
209                      HPF_Fs44100_Gain11_A0,
210                      -HPF_Fs44100_Gain11_B1},
211                     {HPF_Fs44100_Gain12_A1,             /* Gain setting 12 */
212                      HPF_Fs44100_Gain12_A0,
213                      -HPF_Fs44100_Gain12_B1},
214                     {HPF_Fs44100_Gain13_A1,             /* Gain setting 13 */
215                      HPF_Fs44100_Gain13_A0,
216                      -HPF_Fs44100_Gain13_B1},
217                     {HPF_Fs44100_Gain14_A1,             /* Gain setting 14 */
218                      HPF_Fs44100_Gain14_A0,
219                      -HPF_Fs44100_Gain14_B1},
220                     {HPF_Fs44100_Gain15_A1,             /* Gain setting 15 */
221                      HPF_Fs44100_Gain15_A0,
222                      -HPF_Fs44100_Gain15_B1},
223 
224                     /* 48kHz sampling rate */
225                     {HPF_Fs48000_Gain1_A1,             /* Gain setting 1 */
226                      HPF_Fs48000_Gain1_A0,
227                      -HPF_Fs48000_Gain1_B1},
228                     {HPF_Fs48000_Gain2_A1,             /* Gain setting 2 */
229                      HPF_Fs48000_Gain2_A0,
230                      -HPF_Fs48000_Gain2_B1},
231                     {HPF_Fs48000_Gain3_A1,             /* Gain setting 3 */
232                      HPF_Fs48000_Gain3_A0,
233                      -HPF_Fs48000_Gain3_B1},
234                     {HPF_Fs48000_Gain4_A1,             /* Gain setting 4 */
235                      HPF_Fs48000_Gain4_A0,
236                      -HPF_Fs48000_Gain4_B1},
237                     {HPF_Fs48000_Gain5_A1,             /* Gain setting 5 */
238                      HPF_Fs48000_Gain5_A0,
239                      -HPF_Fs48000_Gain5_B1},
240                     {HPF_Fs48000_Gain6_A1,             /* Gain setting 6 */
241                      HPF_Fs48000_Gain6_A0,
242                      -HPF_Fs48000_Gain6_B1},
243                     {HPF_Fs48000_Gain7_A1,             /* Gain setting 7 */
244                      HPF_Fs48000_Gain7_A0,
245                      -HPF_Fs48000_Gain7_B1},
246                     {HPF_Fs48000_Gain8_A1,             /* Gain setting 8 */
247                      HPF_Fs48000_Gain8_A0,
248                      -HPF_Fs48000_Gain8_B1},
249                     {HPF_Fs48000_Gain9_A1,             /* Gain setting 9 */
250                      HPF_Fs48000_Gain9_A0,
251                      -HPF_Fs48000_Gain9_B1},
252                     {HPF_Fs48000_Gain10_A1,             /* Gain setting 10 */
253                      HPF_Fs48000_Gain10_A0,
254                      -HPF_Fs48000_Gain10_B1},
255                     {HPF_Fs48000_Gain11_A1,             /* Gain setting 11 */
256                      HPF_Fs48000_Gain11_A0,
257                      -HPF_Fs48000_Gain11_B1},
258                     {HPF_Fs48000_Gain12_A1,             /* Gain setting 12 */
259                      HPF_Fs48000_Gain12_A0,
260                      -HPF_Fs48000_Gain12_B1},
261                     {HPF_Fs48000_Gain13_A1,             /* Gain setting 13 */
262                      HPF_Fs48000_Gain13_A0,
263                      -HPF_Fs48000_Gain13_B1},
264                     {HPF_Fs48000_Gain14_A1,             /* Gain setting 14 */
265                      HPF_Fs48000_Gain14_A0,
266                      -HPF_Fs48000_Gain14_B1},
267                     {HPF_Fs48000_Gain15_A1,             /* Gain setting 15 */
268                      HPF_Fs48000_Gain15_A0,
269                      -HPF_Fs48000_Gain15_B1}
270 #ifdef HIGHER_FS
271                     ,
272                     /* 96kHz sampling rate */
273                     {HPF_Fs96000_Gain1_A1,             /* Gain setting 1 */
274                     HPF_Fs96000_Gain1_A0,
275                     -HPF_Fs96000_Gain1_B1},
276                     {HPF_Fs96000_Gain2_A1,             /* Gain setting 2 */
277                     HPF_Fs96000_Gain2_A0,
278                     -HPF_Fs96000_Gain2_B1},
279                     {HPF_Fs96000_Gain3_A1,             /* Gain setting 3 */
280                     HPF_Fs96000_Gain3_A0,
281                     -HPF_Fs96000_Gain3_B1},
282                     {HPF_Fs96000_Gain4_A1,             /* Gain setting 4 */
283                     HPF_Fs96000_Gain4_A0,
284                     -HPF_Fs96000_Gain4_B1},
285                     {HPF_Fs96000_Gain5_A1,             /* Gain setting 5 */
286                     HPF_Fs96000_Gain5_A0,
287                     -HPF_Fs96000_Gain5_B1},
288                     {HPF_Fs96000_Gain6_A1,             /* Gain setting 6 */
289                     HPF_Fs96000_Gain6_A0,
290                     -HPF_Fs96000_Gain6_B1},
291                     {HPF_Fs96000_Gain7_A1,             /* Gain setting 7 */
292                     HPF_Fs96000_Gain7_A0,
293                     -HPF_Fs96000_Gain7_B1},
294                     {HPF_Fs96000_Gain8_A1,             /* Gain setting 8 */
295                     HPF_Fs96000_Gain8_A0,
296                     -HPF_Fs96000_Gain8_B1},
297                     {HPF_Fs96000_Gain9_A1,             /* Gain setting 9 */
298                     HPF_Fs96000_Gain9_A0,
299                     -HPF_Fs96000_Gain9_B1},
300                     {HPF_Fs96000_Gain10_A1,             /* Gain setting 10 */
301                     HPF_Fs96000_Gain10_A0,
302                     -HPF_Fs96000_Gain10_B1},
303                     {HPF_Fs96000_Gain11_A1,             /* Gain setting 11 */
304                     HPF_Fs96000_Gain11_A0,
305                     -HPF_Fs96000_Gain11_B1},
306                     {HPF_Fs96000_Gain12_A1,             /* Gain setting 12 */
307                     HPF_Fs96000_Gain12_A0,
308                     -HPF_Fs96000_Gain12_B1},
309                     {HPF_Fs96000_Gain13_A1,             /* Gain setting 13 */
310                     HPF_Fs96000_Gain13_A0,
311                     -HPF_Fs96000_Gain13_B1},
312                     {HPF_Fs96000_Gain14_A1,             /* Gain setting 14 */
313                     HPF_Fs96000_Gain14_A0,
314                     -HPF_Fs96000_Gain14_B1},
315                     {HPF_Fs96000_Gain15_A1,             /* Gain setting 15 */
316                     HPF_Fs96000_Gain15_A0,
317                     -HPF_Fs96000_Gain15_B1},
318 
319                     /* 192kHz sampling rate */
320                     {HPF_Fs192000_Gain1_A1,             /* Gain setting 1 */
321                     HPF_Fs192000_Gain1_A0,
322                     -HPF_Fs192000_Gain1_B1},
323                     {HPF_Fs192000_Gain2_A1,             /* Gain setting 2 */
324                     HPF_Fs192000_Gain2_A0,
325                     -HPF_Fs192000_Gain2_B1},
326                     {HPF_Fs192000_Gain3_A1,             /* Gain setting 3 */
327                     HPF_Fs192000_Gain3_A0,
328                     -HPF_Fs192000_Gain3_B1},
329                     {HPF_Fs192000_Gain4_A1,             /* Gain setting 4 */
330                     HPF_Fs192000_Gain4_A0,
331                     -HPF_Fs192000_Gain4_B1},
332                     {HPF_Fs192000_Gain5_A1,             /* Gain setting 5 */
333                     HPF_Fs192000_Gain5_A0,
334                     -HPF_Fs192000_Gain5_B1},
335                     {HPF_Fs192000_Gain6_A1,             /* Gain setting 6 */
336                     HPF_Fs192000_Gain6_A0,
337                     -HPF_Fs192000_Gain6_B1},
338                     {HPF_Fs192000_Gain7_A1,             /* Gain setting 7 */
339                     HPF_Fs192000_Gain7_A0,
340                     -HPF_Fs192000_Gain7_B1},
341                     {HPF_Fs192000_Gain8_A1,             /* Gain setting 8 */
342                     HPF_Fs192000_Gain8_A0,
343                     -HPF_Fs192000_Gain8_B1},
344                     {HPF_Fs192000_Gain9_A1,             /* Gain setting 9 */
345                     HPF_Fs192000_Gain9_A0,
346                     -HPF_Fs192000_Gain9_B1},
347                     {HPF_Fs192000_Gain10_A1,             /* Gain setting 10 */
348                     HPF_Fs192000_Gain10_A0,
349                     -HPF_Fs192000_Gain10_B1},
350                     {HPF_Fs192000_Gain11_A1,             /* Gain setting 11 */
351                     HPF_Fs192000_Gain11_A0,
352                     -HPF_Fs192000_Gain11_B1},
353                     {HPF_Fs192000_Gain12_A1,             /* Gain setting 12 */
354                     HPF_Fs192000_Gain12_A0,
355                     -HPF_Fs192000_Gain12_B1},
356                     {HPF_Fs192000_Gain13_A1,             /* Gain setting 13 */
357                     HPF_Fs192000_Gain13_A0,
358                     -HPF_Fs192000_Gain13_B1},
359                     {HPF_Fs192000_Gain14_A1,             /* Gain setting 14 */
360                     HPF_Fs192000_Gain14_A0,
361                     -HPF_Fs192000_Gain14_B1},
362                     {HPF_Fs192000_Gain15_A1,             /* Gain setting 15 */
363                     HPF_Fs192000_Gain15_A0,
364                     -HPF_Fs192000_Gain15_B1}
365 #endif
366                     };
367 #else
368 FO_C16_LShx_Coefs_t    LVM_TrebleBoostCoefs[] = {
369 
370                     /* 22kHz sampling rate */
371                     {HPF_Fs22050_Gain1_A1,             /* Gain setting 1 */
372                      HPF_Fs22050_Gain1_A0,
373                      -HPF_Fs22050_Gain1_B1,
374                     HPF_Fs22050_Gain1_Shift},
375                     {HPF_Fs22050_Gain2_A1,             /* Gain setting 2 */
376                      HPF_Fs22050_Gain2_A0,
377                      -HPF_Fs22050_Gain2_B1,
378                     HPF_Fs22050_Gain2_Shift},
379                     {HPF_Fs22050_Gain3_A1,             /* Gain setting 3 */
380                      HPF_Fs22050_Gain3_A0,
381                      -HPF_Fs22050_Gain3_B1,
382                     HPF_Fs22050_Gain3_Shift},
383                     {HPF_Fs22050_Gain4_A1,             /* Gain setting 4 */
384                      HPF_Fs22050_Gain4_A0,
385                      -HPF_Fs22050_Gain4_B1,
386                     HPF_Fs22050_Gain4_Shift},
387                     {HPF_Fs22050_Gain5_A1,             /* Gain setting 5 */
388                      HPF_Fs22050_Gain5_A0,
389                      -HPF_Fs22050_Gain5_B1,
390                     HPF_Fs22050_Gain5_Shift},
391                     {HPF_Fs22050_Gain6_A1,             /* Gain setting 6 */
392                      HPF_Fs22050_Gain6_A0,
393                      -HPF_Fs22050_Gain6_B1,
394                     HPF_Fs22050_Gain6_Shift},
395                     {HPF_Fs22050_Gain7_A1,             /* Gain setting 7 */
396                      HPF_Fs22050_Gain7_A0,
397                      -HPF_Fs22050_Gain7_B1,
398                     HPF_Fs22050_Gain7_Shift},
399                     {HPF_Fs22050_Gain8_A1,             /* Gain setting 8 */
400                      HPF_Fs22050_Gain8_A0,
401                      -HPF_Fs22050_Gain8_B1,
402                     HPF_Fs22050_Gain8_Shift},
403                     {HPF_Fs22050_Gain9_A1,             /* Gain setting 9 */
404                      HPF_Fs22050_Gain9_A0,
405                      -HPF_Fs22050_Gain9_B1,
406                     HPF_Fs22050_Gain9_Shift},
407                     {HPF_Fs22050_Gain10_A1,             /* Gain setting 10 */
408                      HPF_Fs22050_Gain10_A0,
409                      -HPF_Fs22050_Gain10_B1,
410                     HPF_Fs22050_Gain10_Shift},
411                     {HPF_Fs22050_Gain11_A1,             /* Gain setting 11 */
412                      HPF_Fs22050_Gain11_A0,
413                      -HPF_Fs22050_Gain11_B1,
414                     HPF_Fs22050_Gain11_Shift},
415                     {HPF_Fs22050_Gain12_A1,             /* Gain setting 12 */
416                      HPF_Fs22050_Gain12_A0,
417                      -HPF_Fs22050_Gain12_B1,
418                     HPF_Fs22050_Gain12_Shift},
419                     {HPF_Fs22050_Gain13_A1,             /* Gain setting 13 */
420                      HPF_Fs22050_Gain13_A0,
421                      -HPF_Fs22050_Gain13_B1,
422                     HPF_Fs22050_Gain13_Shift},
423                     {HPF_Fs22050_Gain14_A1,             /* Gain setting 14 */
424                      HPF_Fs22050_Gain14_A0,
425                      -HPF_Fs22050_Gain14_B1,
426                     HPF_Fs22050_Gain14_Shift},
427                     {HPF_Fs22050_Gain15_A1,             /* Gain setting 15 */
428                      HPF_Fs22050_Gain15_A0,
429                      -HPF_Fs22050_Gain15_B1,
430                     HPF_Fs22050_Gain15_Shift},
431 
432                     /* 24kHz sampling rate */
433                     {HPF_Fs24000_Gain1_A1,             /* Gain setting 1 */
434                      HPF_Fs24000_Gain1_A0,
435                      -HPF_Fs24000_Gain1_B1,
436                      HPF_Fs24000_Gain1_Shift},
437                     {HPF_Fs24000_Gain2_A1,             /* Gain setting 2 */
438                      HPF_Fs24000_Gain2_A0,
439                      -HPF_Fs24000_Gain2_B1,
440                      HPF_Fs24000_Gain2_Shift},
441                     {HPF_Fs24000_Gain3_A1,             /* Gain setting 3 */
442                      HPF_Fs24000_Gain3_A0,
443                      -HPF_Fs24000_Gain3_B1,
444                      HPF_Fs24000_Gain3_Shift},
445                     {HPF_Fs24000_Gain4_A1,             /* Gain setting 4 */
446                      HPF_Fs24000_Gain4_A0,
447                      -HPF_Fs24000_Gain4_B1,
448                      HPF_Fs24000_Gain4_Shift},
449                     {HPF_Fs24000_Gain5_A1,             /* Gain setting 5 */
450                      HPF_Fs24000_Gain5_A0,
451                      -HPF_Fs24000_Gain5_B1,
452                      HPF_Fs24000_Gain5_Shift},
453                     {HPF_Fs24000_Gain6_A1,             /* Gain setting 6 */
454                      HPF_Fs24000_Gain6_A0,
455                      -HPF_Fs24000_Gain6_B1,
456                      HPF_Fs24000_Gain6_Shift},
457                     {HPF_Fs24000_Gain7_A1,             /* Gain setting 7 */
458                      HPF_Fs24000_Gain7_A0,
459                      -HPF_Fs24000_Gain7_B1,
460                      HPF_Fs24000_Gain7_Shift},
461                     {HPF_Fs24000_Gain8_A1,             /* Gain setting 8 */
462                      HPF_Fs24000_Gain8_A0,
463                      -HPF_Fs24000_Gain8_B1,
464                      HPF_Fs24000_Gain8_Shift},
465                     {HPF_Fs24000_Gain9_A1,             /* Gain setting 9 */
466                      HPF_Fs24000_Gain9_A0,
467                      -HPF_Fs24000_Gain9_B1,
468                      HPF_Fs24000_Gain9_Shift},
469                     {HPF_Fs24000_Gain10_A1,             /* Gain setting 10 */
470                      HPF_Fs24000_Gain10_A0,
471                      -HPF_Fs24000_Gain10_B1,
472                      HPF_Fs24000_Gain10_Shift},
473                     {HPF_Fs24000_Gain11_A1,             /* Gain setting 11 */
474                      HPF_Fs24000_Gain11_A0,
475                      -HPF_Fs24000_Gain11_B1,
476                      HPF_Fs24000_Gain11_Shift},
477                     {HPF_Fs24000_Gain12_A1,             /* Gain setting 12 */
478                      HPF_Fs24000_Gain12_A0,
479                      -HPF_Fs24000_Gain12_B1,
480                      HPF_Fs24000_Gain12_Shift},
481                     {HPF_Fs24000_Gain13_A1,             /* Gain setting 13 */
482                      HPF_Fs24000_Gain13_A0,
483                      -HPF_Fs24000_Gain13_B1,
484                      HPF_Fs24000_Gain13_Shift},
485                     {HPF_Fs24000_Gain14_A1,             /* Gain setting 14 */
486                      HPF_Fs24000_Gain14_A0,
487                      -HPF_Fs24000_Gain14_B1,
488                      HPF_Fs24000_Gain14_Shift},
489                     {HPF_Fs24000_Gain15_A1,             /* Gain setting 15 */
490                      HPF_Fs24000_Gain15_A0,
491                      -HPF_Fs24000_Gain15_B1,
492                      HPF_Fs24000_Gain15_Shift},
493 
494                     /* 32kHz sampling rate */
495                     {HPF_Fs32000_Gain1_A1,             /* Gain setting 1 */
496                      HPF_Fs32000_Gain1_A0,
497                      -HPF_Fs32000_Gain1_B1,
498                     HPF_Fs32000_Gain1_Shift},
499                     {HPF_Fs32000_Gain2_A1,             /* Gain setting 2 */
500                      HPF_Fs32000_Gain2_A0,
501                      -HPF_Fs32000_Gain2_B1,
502                     HPF_Fs32000_Gain2_Shift},
503                     {HPF_Fs32000_Gain3_A1,             /* Gain setting 3 */
504                      HPF_Fs32000_Gain3_A0,
505                      -HPF_Fs32000_Gain3_B1,
506                     HPF_Fs32000_Gain3_Shift},
507                     {HPF_Fs32000_Gain4_A1,             /* Gain setting 4 */
508                      HPF_Fs32000_Gain4_A0,
509                      -HPF_Fs32000_Gain4_B1,
510                     HPF_Fs32000_Gain4_Shift},
511                     {HPF_Fs32000_Gain5_A1,             /* Gain setting 5 */
512                      HPF_Fs32000_Gain5_A0,
513                      -HPF_Fs32000_Gain5_B1,
514                     HPF_Fs32000_Gain5_Shift},
515                     {HPF_Fs32000_Gain6_A1,             /* Gain setting 6 */
516                      HPF_Fs32000_Gain6_A0,
517                      -HPF_Fs32000_Gain6_B1,
518                     HPF_Fs32000_Gain6_Shift},
519                     {HPF_Fs32000_Gain7_A1,             /* Gain setting 7 */
520                      HPF_Fs32000_Gain7_A0,
521                      -HPF_Fs32000_Gain7_B1,
522                     HPF_Fs32000_Gain7_Shift},
523                     {HPF_Fs32000_Gain8_A1,             /* Gain setting 8 */
524                      HPF_Fs32000_Gain8_A0,
525                      -HPF_Fs32000_Gain8_B1,
526                     HPF_Fs32000_Gain8_Shift},
527                     {HPF_Fs32000_Gain9_A1,             /* Gain setting 9 */
528                      HPF_Fs32000_Gain9_A0,
529                      -HPF_Fs32000_Gain9_B1,
530                     HPF_Fs32000_Gain9_Shift},
531                     {HPF_Fs32000_Gain10_A1,             /* Gain setting 10 */
532                      HPF_Fs32000_Gain10_A0,
533                      -HPF_Fs32000_Gain10_B1,
534                     HPF_Fs32000_Gain10_Shift},
535                     {HPF_Fs32000_Gain11_A1,             /* Gain setting 11 */
536                      HPF_Fs32000_Gain11_A0,
537                      -HPF_Fs32000_Gain11_B1,
538                     HPF_Fs32000_Gain11_Shift},
539                     {HPF_Fs32000_Gain12_A1,             /* Gain setting 12 */
540                      HPF_Fs32000_Gain12_A0,
541                      -HPF_Fs32000_Gain12_B1,
542                     HPF_Fs32000_Gain12_Shift},
543                     {HPF_Fs32000_Gain13_A1,             /* Gain setting 13 */
544                      HPF_Fs32000_Gain13_A0,
545                      -HPF_Fs32000_Gain13_B1,
546                     HPF_Fs32000_Gain13_Shift},
547                     {HPF_Fs32000_Gain14_A1,             /* Gain setting 14 */
548                      HPF_Fs32000_Gain14_A0,
549                      -HPF_Fs32000_Gain14_B1,
550                     HPF_Fs32000_Gain14_Shift},
551                     {HPF_Fs32000_Gain15_A1,             /* Gain setting 15 */
552                      HPF_Fs32000_Gain15_A0,
553                      -HPF_Fs32000_Gain15_B1,
554                     HPF_Fs32000_Gain15_Shift},
555 
556                     /* 44kHz sampling rate */
557                     {HPF_Fs44100_Gain1_A1,             /* Gain setting 1 */
558                      HPF_Fs44100_Gain1_A0,
559                      -HPF_Fs44100_Gain1_B1,
560                      HPF_Fs44100_Gain1_Shift},
561                     {HPF_Fs44100_Gain2_A1,             /* Gain setting 2 */
562                      HPF_Fs44100_Gain2_A0,
563                      -HPF_Fs44100_Gain2_B1,
564                      HPF_Fs44100_Gain2_Shift},
565                     {HPF_Fs44100_Gain3_A1,             /* Gain setting 3 */
566                      HPF_Fs44100_Gain3_A0,
567                      -HPF_Fs44100_Gain3_B1,
568                      HPF_Fs44100_Gain3_Shift},
569                     {HPF_Fs44100_Gain4_A1,             /* Gain setting 4 */
570                      HPF_Fs44100_Gain4_A0,
571                      -HPF_Fs44100_Gain4_B1,
572                      HPF_Fs44100_Gain4_Shift},
573                     {HPF_Fs44100_Gain5_A1,             /* Gain setting 5 */
574                      HPF_Fs44100_Gain5_A0,
575                      -HPF_Fs44100_Gain5_B1,
576                      HPF_Fs44100_Gain5_Shift},
577                     {HPF_Fs44100_Gain6_A1,             /* Gain setting 6 */
578                      HPF_Fs44100_Gain6_A0,
579                      -HPF_Fs44100_Gain6_B1,
580                      HPF_Fs44100_Gain6_Shift},
581                     {HPF_Fs44100_Gain7_A1,             /* Gain setting 7 */
582                      HPF_Fs44100_Gain7_A0,
583                      -HPF_Fs44100_Gain7_B1,
584                      HPF_Fs44100_Gain7_Shift},
585                     {HPF_Fs44100_Gain8_A1,             /* Gain setting 8 */
586                      HPF_Fs44100_Gain8_A0,
587                      -HPF_Fs44100_Gain8_B1,
588                      HPF_Fs44100_Gain8_Shift},
589                     {HPF_Fs44100_Gain9_A1,             /* Gain setting 9 */
590                      HPF_Fs44100_Gain9_A0,
591                      -HPF_Fs44100_Gain9_B1,
592                      HPF_Fs44100_Gain9_Shift},
593                     {HPF_Fs44100_Gain10_A1,             /* Gain setting 10 */
594                      HPF_Fs44100_Gain10_A0,
595                      -HPF_Fs44100_Gain10_B1,
596                      HPF_Fs44100_Gain10_Shift},
597                     {HPF_Fs44100_Gain11_A1,             /* Gain setting 11 */
598                      HPF_Fs44100_Gain11_A0,
599                      -HPF_Fs44100_Gain11_B1,
600                      HPF_Fs44100_Gain11_Shift},
601                     {HPF_Fs44100_Gain12_A1,             /* Gain setting 12 */
602                      HPF_Fs44100_Gain12_A0,
603                      -HPF_Fs44100_Gain12_B1,
604                      HPF_Fs44100_Gain12_Shift},
605                     {HPF_Fs44100_Gain13_A1,             /* Gain setting 13 */
606                      HPF_Fs44100_Gain13_A0,
607                      -HPF_Fs44100_Gain13_B1,
608                      HPF_Fs44100_Gain13_Shift},
609                     {HPF_Fs44100_Gain14_A1,             /* Gain setting 14 */
610                      HPF_Fs44100_Gain14_A0,
611                      -HPF_Fs44100_Gain14_B1,
612                      HPF_Fs44100_Gain14_Shift},
613                     {HPF_Fs44100_Gain15_A1,             /* Gain setting 15 */
614                      HPF_Fs44100_Gain15_A0,
615                      -HPF_Fs44100_Gain15_B1,
616                      HPF_Fs44100_Gain15_Shift},
617 
618                     /* 48kHz sampling rate */
619                     {HPF_Fs48000_Gain1_A1,             /* Gain setting 1 */
620                      HPF_Fs48000_Gain1_A0,
621                      -HPF_Fs48000_Gain1_B1,
622                      HPF_Fs48000_Gain1_Shift},
623                     {HPF_Fs48000_Gain2_A1,             /* Gain setting 2 */
624                      HPF_Fs48000_Gain2_A0,
625                      -HPF_Fs48000_Gain2_B1,
626                      HPF_Fs48000_Gain2_Shift},
627                     {HPF_Fs48000_Gain3_A1,             /* Gain setting 3 */
628                      HPF_Fs48000_Gain3_A0,
629                      -HPF_Fs48000_Gain3_B1,
630                      HPF_Fs48000_Gain3_Shift},
631                     {HPF_Fs48000_Gain4_A1,             /* Gain setting 4 */
632                      HPF_Fs48000_Gain4_A0,
633                      -HPF_Fs48000_Gain4_B1,
634                      HPF_Fs48000_Gain4_Shift},
635                     {HPF_Fs48000_Gain5_A1,             /* Gain setting 5 */
636                      HPF_Fs48000_Gain5_A0,
637                      -HPF_Fs48000_Gain5_B1,
638                      HPF_Fs48000_Gain5_Shift},
639                     {HPF_Fs48000_Gain6_A1,             /* Gain setting 6 */
640                      HPF_Fs48000_Gain6_A0,
641                      -HPF_Fs48000_Gain6_B1,
642                      HPF_Fs48000_Gain6_Shift},
643                     {HPF_Fs48000_Gain7_A1,             /* Gain setting 7 */
644                      HPF_Fs48000_Gain7_A0,
645                      -HPF_Fs48000_Gain7_B1,
646                      HPF_Fs48000_Gain7_Shift},
647                     {HPF_Fs48000_Gain8_A1,             /* Gain setting 8 */
648                      HPF_Fs48000_Gain8_A0,
649                      -HPF_Fs48000_Gain8_B1,
650                      HPF_Fs48000_Gain8_Shift},
651                     {HPF_Fs48000_Gain9_A1,             /* Gain setting 9 */
652                      HPF_Fs48000_Gain9_A0,
653                      -HPF_Fs48000_Gain9_B1,
654                      HPF_Fs48000_Gain9_Shift},
655                     {HPF_Fs48000_Gain10_A1,             /* Gain setting 10 */
656                      HPF_Fs48000_Gain10_A0,
657                      -HPF_Fs48000_Gain10_B1,
658                      HPF_Fs48000_Gain10_Shift},
659                     {HPF_Fs48000_Gain11_A1,             /* Gain setting 11 */
660                      HPF_Fs48000_Gain11_A0,
661                      -HPF_Fs48000_Gain11_B1,
662                      HPF_Fs48000_Gain11_Shift},
663                     {HPF_Fs48000_Gain12_A1,             /* Gain setting 12 */
664                      HPF_Fs48000_Gain12_A0,
665                      -HPF_Fs48000_Gain12_B1,
666                      HPF_Fs48000_Gain12_Shift},
667                     {HPF_Fs48000_Gain13_A1,             /* Gain setting 13 */
668                      HPF_Fs48000_Gain13_A0,
669                      -HPF_Fs48000_Gain13_B1,
670                      HPF_Fs48000_Gain13_Shift},
671                     {HPF_Fs48000_Gain14_A1,             /* Gain setting 14 */
672                      HPF_Fs48000_Gain14_A0,
673                      -HPF_Fs48000_Gain14_B1,
674                      HPF_Fs48000_Gain14_Shift},
675                     {HPF_Fs48000_Gain15_A1,             /* Gain setting 15 */
676                      HPF_Fs48000_Gain15_A0,
677                      -HPF_Fs48000_Gain15_B1,
678                      HPF_Fs48000_Gain15_Shift}
679                     };
680 #endif
681 
682 /************************************************************************************/
683 /*                                                                                    */
684 /*    Volume control gain and time constant tables                                    */
685 /*                                                                                    */
686 /************************************************************************************/
687 
688 /* dB to linear conversion table */
689 #ifdef BUILD_FLOAT
690 const LVM_FLOAT LVM_VolumeTable[] = {
691     1.000f,             /*  0dB */
692     0.891f,             /* -1dB */
693     0.794f,             /* -2dB */
694     0.708f,             /* -3dB */
695     0.631f,             /* -4dB */
696     0.562f,             /* -5dB */
697     0.501f};            /* -6dB */
698 #else
699 const LVM_INT16 LVM_VolumeTable[] = {
700     0x7FFF,             /*  0dB */
701     0x7215,             /* -1dB */
702     0x65AD,             /* -2dB */
703     0x5A9E,             /* -3dB */
704     0x50C3,             /* -4dB */
705     0x47FB,             /* -5dB */
706     0x4000};            /* -6dB */
707 #endif
708 
709 /************************************************************************************/
710 /*                                                                                  */
711 /*  Volume mixer time constants (100ms)                                             */
712 /*                                                                                  */
713 /************************************************************************************/
714 
715 #define LVM_MIX_TC_Fs8000      32580         /* Floating point value 0.994262695 */
716 #define LVM_MIX_TC_Fs11025     32632         /* Floating point value 0.995849609 */
717 #define LVM_MIX_TC_Fs12000     32643         /* Floating point value 0.996185303 */
718 #define LVM_MIX_TC_Fs16000     32674         /* Floating point value 0.997131348 */
719 #define LVM_MIX_TC_Fs22050     32700         /* Floating point value 0.997924805 */
720 #define LVM_MIX_TC_Fs24000     32705         /* Floating point value 0.998077393 */
721 #define LVM_MIX_TC_Fs32000     32721         /* Floating point value 0.998565674 */
722 #define LVM_MIX_TC_Fs44100     32734         /* Floating point value 0.998962402 */
723 #define LVM_MIX_TC_Fs48000     32737         /* Floating point value 0.999053955 */
724 
725 
726 const LVM_INT16 LVM_MixerTCTable[] = {
727     LVM_MIX_TC_Fs8000,
728     LVM_MIX_TC_Fs11025,
729     LVM_MIX_TC_Fs12000,
730     LVM_MIX_TC_Fs16000,
731     LVM_MIX_TC_Fs22050,
732     LVM_MIX_TC_Fs24000,
733     LVM_MIX_TC_Fs32000,
734     LVM_MIX_TC_Fs44100,
735     LVM_MIX_TC_Fs48000};
736 
737