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 __LVCS_HEADPHONE_COEFFS_H__
19 #define __LVCS_HEADPHONE_COEFFS_H__
20 
21 /************************************************************************************/
22 /*                                                                                  */
23 /* The Stereo Enhancer                                                              */
24 /*                                                                                  */
25 /************************************************************************************/
26 /* Stereo Enhancer coefficients for 8000 Hz sample rate, scaled with 0.161258 */
27 #define CS_MIDDLE_8000_A0                           0.227720
28 #define CS_MIDDLE_8000_A1                          (-0.215125)
29 #define CS_MIDDLE_8000_A2                           0.000000
30 #define CS_MIDDLE_8000_B1                          (-0.921899)
31 #define CS_MIDDLE_8000_B2                           0.000000
32 #define CS_MIDDLE_8000_SCALE                        15
33 #define CS_SIDE_8000_A0                             0.611441
34 #define CS_SIDE_8000_A1                            (-0.380344)
35 #define CS_SIDE_8000_A2                            (-0.231097)
36 #define CS_SIDE_8000_B1                            (-0.622470)
37 #define CS_SIDE_8000_B2                            (-0.130759)
38 #define CS_SIDE_8000_SCALE                         15
39 
40 /* Stereo Enhancer coefficients for 11025Hz sample rate, scaled with 0.162943 */
41 #define CS_MIDDLE_11025_A0                       0.230838
42 #define CS_MIDDLE_11025_A1                      (-0.221559)
43 #define CS_MIDDLE_11025_A2                       0.000000
44 #define CS_MIDDLE_11025_B1                      (-0.943056)
45 #define CS_MIDDLE_11025_B2                       0.000000
46 #define CS_MIDDLE_11025_SCALE                    15
47 #define CS_SIDE_11025_A0                         0.557372
48 #define CS_SIDE_11025_A1                        (-0.391490)
49 #define CS_SIDE_11025_A2                        (-0.165881)
50 #define CS_SIDE_11025_B1                        (-0.880608)
51 #define CS_SIDE_11025_B2                         0.032397
52 #define CS_SIDE_11025_SCALE                      15
53 
54 /* Stereo Enhancer coefficients for 12000Hz sample rate, scaled with 0.162191 */
55 #define CS_MIDDLE_12000_A0                        0.229932
56 #define CS_MIDDLE_12000_A1                       (-0.221436)
57 #define CS_MIDDLE_12000_A2                        0.000000
58 #define CS_MIDDLE_12000_B1                       (-0.947616)
59 #define CS_MIDDLE_12000_B2                        0.000000
60 #define CS_MIDDLE_12000_SCALE                        15
61 #define CS_SIDE_12000_A0                         0.558398
62 #define CS_SIDE_12000_A1                        (-0.392211)
63 #define CS_SIDE_12000_A2                        (-0.166187)
64 #define CS_SIDE_12000_B1                        (-0.892550)
65 #define CS_SIDE_12000_B2                         0.032856
66 #define CS_SIDE_12000_SCALE                          15
67 
68 /* Stereo Enhancer coefficients for 16000Hz sample rate, scaled with 0.162371 */
69 #define CS_MIDDLE_16000_A0                       0.230638
70 #define CS_MIDDLE_16000_A1                      (-0.224232)
71 #define CS_MIDDLE_16000_A2                       0.000000
72 #define CS_MIDDLE_16000_B1                      (-0.960550)
73 #define CS_MIDDLE_16000_B2                       0.000000
74 #define CS_MIDDLE_16000_SCALE                        15
75 #define CS_SIDE_16000_A0                         0.499695
76 #define CS_SIDE_16000_A1                        (-0.355543)
77 #define CS_SIDE_16000_A2                        (-0.144152)
78 #define CS_SIDE_16000_B1                        (-1.050788)
79 #define CS_SIDE_16000_B2                         0.144104
80 #define CS_SIDE_16000_SCALE                          14
81 
82 /* Stereo Enhancer coefficients for 22050Hz sample rate, scaled with 0.160781 */
83 #define CS_MIDDLE_22050_A0                       0.228749
84 #define CS_MIDDLE_22050_A1                      (-0.224128)
85 #define CS_MIDDLE_22050_A2                       0.000000
86 #define CS_MIDDLE_22050_B1                      (-0.971262)
87 #define CS_MIDDLE_22050_B2                       0.000000
88 #define CS_MIDDLE_22050_SCALE                        15
89 #define CS_SIDE_22050_A0                          0.440112
90 #define CS_SIDE_22050_A1                         (-0.261096)
91 #define CS_SIDE_22050_A2                         (-0.179016)
92 #define CS_SIDE_22050_B1                         (-1.116786)
93 #define CS_SIDE_22050_B2                          0.182507
94 #define CS_SIDE_22050_SCALE                          14
95 
96 /* Stereo Enhancer coefficients for 24000Hz sample rate, scaled with 0.161882 */
97 #define CS_MIDDLE_24000_A0                         0.230395
98 #define CS_MIDDLE_24000_A1                        (-0.226117)
99 #define CS_MIDDLE_24000_A2                         0.000000
100 #define CS_MIDDLE_24000_B1                        (-0.973573)
101 #define CS_MIDDLE_24000_B2                         0.000000
102 #define CS_MIDDLE_24000_SCALE                        15
103 #define CS_SIDE_24000_A0                           0.414770
104 #define CS_SIDE_24000_A1                          (-0.287182)
105 #define CS_SIDE_24000_A2                          (-0.127588)
106 #define CS_SIDE_24000_B1                          (-1.229648)
107 #define CS_SIDE_24000_B2                           0.282177
108 #define CS_SIDE_24000_SCALE                          14
109 
110 /* Stereo Enhancer coefficients for 32000Hz sample rate, scaled with 0.160322 */
111 #define CS_MIDDLE_32000_A0                          0.228400
112 #define CS_MIDDLE_32000_A1                         (-0.225214)
113 #define CS_MIDDLE_32000_A2                          0.000000
114 #define CS_MIDDLE_32000_B1                         (-0.980126)
115 #define CS_MIDDLE_32000_B2                          0.000000
116 #define CS_MIDDLE_32000_SCALE                        15
117 #define CS_SIDE_32000_A0                            0.364579
118 #define CS_SIDE_32000_A1                           (-0.207355)
119 #define CS_SIDE_32000_A2                           (-0.157224)
120 #define CS_SIDE_32000_B1                           (-1.274231)
121 #define CS_SIDE_32000_B2                            0.312495
122 #define CS_SIDE_32000_SCALE                          14
123 
124 /* Stereo Enhancer coefficients for 44100Hz sample rate, scaled with 0.163834 */
125 #define CS_MIDDLE_44100_A0                     0.233593
126 #define CS_MIDDLE_44100_A1                    (-0.231225)
127 #define CS_MIDDLE_44100_A2                     0.000000
128 #define CS_MIDDLE_44100_B1                    (-0.985545)
129 #define CS_MIDDLE_44100_B2                     0.000000
130 #define CS_MIDDLE_44100_SCALE                        15
131 #define CS_SIDE_44100_A0                       0.284573
132 #define CS_SIDE_44100_A1                      (-0.258910)
133 #define CS_SIDE_44100_A2                      (-0.025662)
134 #define CS_SIDE_44100_B1                      (-1.572248)
135 #define CS_SIDE_44100_B2                       0.588399
136 #define CS_SIDE_44100_SCALE                  14
137 
138 /* Stereo Enhancer coefficients for 48000Hz sample rate, scaled with 0.164402 */
139 #define CS_MIDDLE_48000_A0                     0.234445
140 #define CS_MIDDLE_48000_A1                    (-0.232261)
141 #define CS_MIDDLE_48000_A2                     0.000000
142 #define CS_MIDDLE_48000_B1                    (-0.986713)
143 #define CS_MIDDLE_48000_B2                     0.000000
144 #define CS_MIDDLE_48000_SCALE                        15
145 #define CS_SIDE_48000_A0                     0.272606
146 #define CS_SIDE_48000_A1                    (-0.266952)
147 #define CS_SIDE_48000_A2                    (-0.005654)
148 #define CS_SIDE_48000_B1                    (-1.617141)
149 #define CS_SIDE_48000_B2                     0.630405
150 #define CS_SIDE_48000_SCALE                          14
151 
152 /* Coefficients for 88200Hz sample rate.
153  * The filter coefficients are obtained by carrying out
154  * state-space analysis using the coefficients available
155  * for 44100Hz.
156  */
157 #define CS_MIDDLE_88200_A0                     0.233846f
158 #define CS_MIDDLE_88200_A1                     (-0.232657f)
159 #define CS_MIDDLE_88200_A2                     0.000000f
160 #define CS_MIDDLE_88200_B1                     (-0.992747f)
161 #define CS_MIDDLE_88200_B2                     0.000000f
162 #define CS_MIDDLE_88200_SCALE                  15
163 #define CS_SIDE_88200_A0                       0.231541f
164 #define CS_SIDE_88200_A1                       (-0.289586f)
165 #define CS_SIDE_88200_A2                       0.058045f
166 #define CS_SIDE_88200_B1                       (-1.765300f)
167 #define CS_SIDE_88200_B2                       0.769816f
168 #define CS_SIDE_88200_SCALE                    14
169 
170 /* Stereo Enhancer coefficients for 96000Hz sample rate, scaled with  0.165*/
171 /* high pass filter with cutoff frequency 102.18 Hz*/
172 #define CS_MIDDLE_96000_A0                     0.235532
173 #define CS_MIDDLE_96000_A1                    (-0.234432)
174 #define CS_MIDDLE_96000_A2                     0.000000
175 #define CS_MIDDLE_96000_B1                    (-0.993334)
176 #define CS_MIDDLE_96000_B2                     0.000000
177 #define CS_MIDDLE_96000_SCALE                        15
178 /* Coefficients calculated using tf2ss and ss2tf functions based on
179  * coefficients available for 48000Hz sampling frequency
180  */
181 #define CS_SIDE_96000_A0                     0.224326f
182 #define CS_SIDE_96000_A1                     (-0.294937f)
183 #define CS_SIDE_96000_A2                     0.070611f
184 #define CS_SIDE_96000_B1                     (-1.792166f)
185 #define CS_SIDE_96000_B2                     0.795830f
186 #define CS_SIDE_96000_SCALE                  14
187 
188 /* Stereo Enhancer coefficients for 176400Hz sample rate.
189  * The filter coefficients are obtained by carrying out
190  * state-space analysis using the coefficients available
191  * for 44100Hz.
192  */
193 #define CS_MIDDLE_176400_A0                     0.233973f
194 #define CS_MIDDLE_176400_A1                     (-0.233378f)
195 #define CS_MIDDLE_176400_A2                     0.000000f
196 #define CS_MIDDLE_176400_B1                     (-0.996367f)
197 #define CS_MIDDLE_176400_B2                     0.000000f
198 #define CS_MIDDLE_176400_SCALE                  15
199 #define CS_SIDE_176400_A0                       0.199836f
200 #define CS_SIDE_176400_A1                       (-0.307544f)
201 #define CS_SIDE_176400_A2                       0.107708f
202 #define CS_SIDE_176400_B1                       (-1.876572f)
203 #define CS_SIDE_176400_B2                       0.877771f
204 #define CS_SIDE_176400_SCALE                    14
205 
206 /* Stereo Enhancer coefficients for 192000Hz sample rate, scaled with  0.1689*/
207 #define CS_MIDDLE_192000_A0                     0.241219
208 #define CS_MIDDLE_192000_A1                    (-0.240656)
209 #define CS_MIDDLE_192000_A2                     0.000000
210 #define CS_MIDDLE_192000_B1                    (-0.996661)
211 #define CS_MIDDLE_192000_B2                     0.000000
212 #define CS_MIDDLE_192000_SCALE                        15
213 /* Coefficients calculated using tf2ss and ss2tf functions based on
214  * coefficients available for 48000Hz sampling frequency
215  */
216 #define CS_SIDE_192000_A0                    0.196039f
217 #define CS_SIDE_192000_A1                    (-0.311027f)
218 #define CS_SIDE_192000_A2                    0.114988f
219 #define CS_SIDE_192000_B1                    (-1.891380f)
220 #define CS_SIDE_192000_B2                    0.8923460f
221 #define CS_SIDE_192000_SCALE                 14
222 
223 /************************************************************************************/
224 /*                                                                                  */
225 /* The Reverb Unit                                                                  */
226 /*                                                                                  */
227 /************************************************************************************/
228 
229 /* Reverb delay settings in samples */
230 #define LVCS_STEREODELAY_CS_8KHZ                     93         /* Sample rate 8kS/s */
231 #define LVCS_STEREODELAY_CS_11KHZ                   128         /* Sample rate 11kS/s */
232 #define LVCS_STEREODELAY_CS_12KHZ                   139         /* Sample rate 12kS/s */
233 #define LVCS_STEREODELAY_CS_16KHZ                   186         /* Sample rate 16kS/s */
234 #define LVCS_STEREODELAY_CS_22KHZ                   256         /* Sample rate 22kS/s */
235 #define LVCS_STEREODELAY_CS_24KHZ                   279         /* Sample rate 24kS/s */
236 #define LVCS_STEREODELAY_CS_32KHZ                   372         /* Sample rate 32kS/s */
237 #define LVCS_STEREODELAY_CS_44KHZ                   512         /* Sample rate 44kS/s */
238 #define LVCS_STEREODELAY_CS_48KHZ                   557         /* Sample rate 48kS/s */
239 #define LVCS_STEREODELAY_CS_88KHZ                   1024        /* Sample rate 88.2kS/s */
240 #define LVCS_STEREODELAY_CS_96KHZ                   1115        /* Sample rate 96kS/s */
241 #define LVCS_STEREODELAY_CS_176KHZ                  2048        /* Sample rate 176.4kS/s */
242 #define LVCS_STEREODELAY_CS_192KHZ                  2229        /* Sample rate 196kS/s */
243 #define LVCS_STEREODELAY_CS_MAX_VAL                 LVCS_STEREODELAY_CS_192KHZ
244 
245 /* Reverb coefficients for 8000 Hz sample rate, scaled with 1.038030 */
246 #define CS_REVERB_8000_A0                          0.667271
247 #define CS_REVERB_8000_A1                         (-0.667271)
248 #define CS_REVERB_8000_A2                          0.000000
249 #define CS_REVERB_8000_B1                         (-0.668179)
250 #define CS_REVERB_8000_B2                          0.000000
251 #define CS_REVERB_8000_SCALE                         15
252 
253 /* Reverb coefficients for 11025Hz sample rate, scaled with 1.038030 */
254 #define CS_REVERB_11025_A0                     0.699638
255 #define CS_REVERB_11025_A1                    (-0.699638)
256 #define CS_REVERB_11025_A2                     0.000000
257 #define CS_REVERB_11025_B1                    (-0.749096)
258 #define CS_REVERB_11025_B2                     0.000000
259 #define CS_REVERB_11025_SCALE                  15
260 
261 /* Reverb coefficients for 12000Hz sample rate, scaled with 1.038030 */
262 #define CS_REVERB_12000_A0                   0.706931
263 #define CS_REVERB_12000_A1                  (-0.706931)
264 #define CS_REVERB_12000_A2                   0.000000
265 #define CS_REVERB_12000_B1                  (-0.767327)
266 #define CS_REVERB_12000_B2                   0.000000
267 #define CS_REVERB_12000_SCALE                15
268 
269 /* Reverb coefficients for 16000Hz sample rate, scaled with 1.038030 */
270 #define CS_REVERB_16000_A0                      0.728272
271 #define CS_REVERB_16000_A1                     (-0.728272)
272 #define CS_REVERB_16000_A2                      0.000000
273 #define CS_REVERB_16000_B1                     (-0.820679)
274 #define CS_REVERB_16000_B2                      0.000000
275 #define CS_REVERB_16000_SCALE                        15
276 
277 /* Reverb coefficients for 22050Hz sample rate, scaled with 1.038030 */
278 #define CS_REVERB_22050_A0                     0.516396
279 #define CS_REVERB_22050_A1                     0.000000
280 #define CS_REVERB_22050_A2                    (-0.516396)
281 #define CS_REVERB_22050_B1                    (-0.518512)
282 #define CS_REVERB_22050_B2                    (-0.290990)
283 #define CS_REVERB_22050_SCALE                        15
284 
285 /* Reverb coefficients for 24000Hz sample rate, scaled with 1.038030 */
286 #define CS_REVERB_24000_A0                       0.479565
287 #define CS_REVERB_24000_A1                       0.000000
288 #define CS_REVERB_24000_A2                      (-0.479565)
289 #define CS_REVERB_24000_B1                      (-0.637745)
290 #define CS_REVERB_24000_B2                      (-0.198912)
291 #define CS_REVERB_24000_SCALE                        15
292 
293 /* Reverb coefficients for 32000Hz sample rate, scaled with 1.038030 */
294 #define CS_REVERB_32000_A0                      0.380349
295 #define CS_REVERB_32000_A1                      0.000000
296 #define CS_REVERB_32000_A2                     (-0.380349)
297 #define CS_REVERB_32000_B1                     (-0.950873)
298 #define CS_REVERB_32000_B2                      0.049127
299 #define CS_REVERB_32000_SCALE                        15
300 
301 /* Reverb coefficients for 44100Hz sample rate, scaled with 1.038030 */
302 #define CS_REVERB_44100_A0                         0.297389
303 #define CS_REVERB_44100_A1                         0.000000
304 #define CS_REVERB_44100_A2                        (-0.297389)
305 #define CS_REVERB_44100_B1                        (-1.200423)
306 #define CS_REVERB_44100_B2                         0.256529
307 #define CS_REVERB_44100_SCALE                        14
308 
309 /* Reverb coefficients for 48000Hz sample rate, scaled with 1.038030 */
310 #define CS_REVERB_48000_A0                       0.278661
311 #define CS_REVERB_48000_A1                       0.000000
312 #define CS_REVERB_48000_A2                      (-0.278661)
313 #define CS_REVERB_48000_B1                      (-1.254993)
314 #define CS_REVERB_48000_B2                       0.303347
315 #define CS_REVERB_48000_SCALE                        14
316 
317 /* Reverb coefficients for 88200Hz sample rate, scaled with 0.8 */
318 /* Band pass filter with fc1=500 and fc2=8000 */
319 #define CS_REVERB_88200_A0                       0.171901f
320 #define CS_REVERB_88200_A1                       0.000000f
321 #define CS_REVERB_88200_A2                      (-0.171901f)
322 #define CS_REVERB_88200_B1                      (-1.553948f)
323 #define CS_REVERB_88200_B2                      (0.570248f)
324 #define CS_REVERB_88200_SCALE                      14
325 /* Reverb coefficients for 96000Hz sample rate, scaled with 0.8 */
326 /* Band pass filter with fc1=500 and fc2=8000*/
327 #define CS_REVERB_96000_A0                       0.1602488
328 #define CS_REVERB_96000_A1                       0.000000
329 #define CS_REVERB_96000_A2                      (-0.1602488)
330 #define CS_REVERB_96000_B1                      (-1.585413)
331 #define CS_REVERB_96000_B2                       0.599377
332 #define CS_REVERB_96000_SCALE                        14
333 
334 /* Reverb coefficients for 176400Hz sample rate, scaled with 0.8 */
335 /* Band pass filter with fc1=500 and fc2=8000 */
336 #define CS_REVERB_176400_A0                       0.094763f
337 #define CS_REVERB_176400_A1                       0.000000f
338 #define CS_REVERB_176400_A2                      (-0.094763f)
339 #define CS_REVERB_176400_B1                      (-1.758593f)
340 #define CS_REVERB_176400_B2                      (0.763091f)
341 #define CS_REVERB_176400_SCALE                      14
342 /* Reverb coefficients for 192000Hz sample rate, scaled with 0.8 */
343 /* Band pass filter with fc1=500 and fc2=8000*/
344 #define CS_REVERB_192000_A0                       0.0878369
345 #define CS_REVERB_192000_A1                       0.000000
346 #define CS_REVERB_192000_A2                      (-0.0878369)
347 #define CS_REVERB_192000_B1                      (-1.7765764)
348 #define CS_REVERB_192000_B2                       0.7804076
349 #define CS_REVERB_192000_SCALE                        14
350 
351 /* Reverb Gain Settings */
352 #define LVCS_HEADPHONE_DELAYGAIN               0.800000         /* Algorithm delay path gain */
353 #define LVCS_HEADPHONE_OUTPUTGAIN              1.000000         /* Algorithm output gain */
354 #define LVCS_HEADPHONE_PROCGAIN                   18403         /* Processed path gain */
355 #define LVCS_HEADPHONE_UNPROCGAIN                 18403         /* Unprocessed path gain */
356 #define LVCS_HEADPHONE_GAINCORRECT             1.009343         /* Delay mixer gain correction */
357 
358 /************************************************************************************/
359 /*                                                                                  */
360 /* The Equaliser                                                                    */
361 /*                                                                                  */
362 /************************************************************************************/
363 
364 /* Equaliser coefficients for 8000 Hz sample rate, \
365    CS scaled with 1.038497 and CSEX scaled with 0.775480 */
366 #define CS_EQUALISER_8000_A0                     1.263312
367 #define CS_EQUALISER_8000_A1                    (-0.601748)
368 #define CS_EQUALISER_8000_A2                    (-0.280681)
369 #define CS_EQUALISER_8000_B1                    (-0.475865)
370 #define CS_EQUALISER_8000_B2                    (-0.408154)
371 #define CS_EQUALISER_8000_SCALE                      14
372 #define CSEX_EQUALISER_8000_A0                    0.943357
373 #define CSEX_EQUALISER_8000_A1                   (-0.449345)
374 #define CSEX_EQUALISER_8000_A2                   (-0.209594)
375 #define CSEX_EQUALISER_8000_B1                   (-0.475865)
376 #define CSEX_EQUALISER_8000_B2                   (-0.408154)
377 #define CSEX_EQUALISER_8000_SCALE                    15
378 
379 /* Equaliser coefficients for 11025Hz sample rate, \
380    CS scaled with 1.027761 and CSEX scaled with 0.767463 */
381 #define CS_EQUALISER_11025_A0                    1.101145
382 #define CS_EQUALISER_11025_A1                    0.139020
383 #define CS_EQUALISER_11025_A2                   (-0.864423)
384 #define CS_EQUALISER_11025_B1                    0.024541
385 #define CS_EQUALISER_11025_B2                   (-0.908930)
386 #define CS_EQUALISER_11025_SCALE                     14
387 #define CSEX_EQUALISER_11025_A0                    0.976058
388 #define CSEX_EQUALISER_11025_A1                   (-0.695326)
389 #define CSEX_EQUALISER_11025_A2                   (-0.090809)
390 #define CSEX_EQUALISER_11025_B1                   (-0.610594)
391 #define CSEX_EQUALISER_11025_B2                   (-0.311149)
392 #define CSEX_EQUALISER_11025_SCALE                   15
393 
394 /* Equaliser coefficients for 12000Hz sample rate, \
395    CS scaled with 1.032521 and CSEX scaled with 0.771017 */
396 #define CS_EQUALISER_12000_A0                      1.276661
397 #define CS_EQUALISER_12000_A1                     (-1.017519)
398 #define CS_EQUALISER_12000_A2                     (-0.044128)
399 #define CS_EQUALISER_12000_B1                     (-0.729616)
400 #define CS_EQUALISER_12000_B2                     (-0.204532)
401 #define CS_EQUALISER_12000_SCALE                     14
402 #define CSEX_EQUALISER_12000_A0                 1.007095
403 #define CSEX_EQUALISER_12000_A1                (-0.871912)
404 #define CSEX_EQUALISER_12000_A2                 0.023232
405 #define CSEX_EQUALISER_12000_B1                (-0.745857)
406 #define CSEX_EQUALISER_12000_B2                (-0.189171)
407 #define CSEX_EQUALISER_12000_SCALE                   14
408 
409 /* Equaliser coefficients for 16000Hz sample rate, \
410    CS scaled with 1.031378 and CSEX scaled with 0.770164 */
411 #define CS_EQUALISER_16000_A0                     1.281629
412 #define CS_EQUALISER_16000_A1                    (-1.075872)
413 #define CS_EQUALISER_16000_A2                    (-0.041365)
414 #define CS_EQUALISER_16000_B1                    (-0.725239)
415 #define CS_EQUALISER_16000_B2                    (-0.224358)
416 #define CS_EQUALISER_16000_SCALE                     14
417 #define CSEX_EQUALISER_16000_A0                  1.081091
418 #define CSEX_EQUALISER_16000_A1                 (-0.867183)
419 #define CSEX_EQUALISER_16000_A2                 (-0.070247)
420 #define CSEX_EQUALISER_16000_B1                 (-0.515121)
421 #define CSEX_EQUALISER_16000_B2                 (-0.425893)
422 #define CSEX_EQUALISER_16000_SCALE                   14
423 
424 /* Equaliser coefficients for 22050Hz sample rate, \
425    CS scaled with 1.041576 and CSEX scaled with 0.777779 */
426 #define CS_EQUALISER_22050_A0                   1.388605
427 #define CS_EQUALISER_22050_A1                  (-1.305799)
428 #define CS_EQUALISER_22050_A2                   0.039922
429 #define CS_EQUALISER_22050_B1                  (-0.719494)
430 #define CS_EQUALISER_22050_B2                  (-0.243245)
431 #define CS_EQUALISER_22050_SCALE                     14
432 #define CSEX_EQUALISER_22050_A0                   1.272910
433 #define CSEX_EQUALISER_22050_A1                  (-1.341014)
434 #define CSEX_EQUALISER_22050_A2                   0.167462
435 #define CSEX_EQUALISER_22050_B1                  (-0.614219)
436 #define CSEX_EQUALISER_22050_B2                  (-0.345384)
437 #define CSEX_EQUALISER_22050_SCALE                   14
438 
439 /* Equaliser coefficients for 24000Hz sample rate, \
440    CS scaled with 1.034495 and CSEX scaled with 0.772491 */
441 #define CS_EQUALISER_24000_A0                    1.409832
442 #define CS_EQUALISER_24000_A1                   (-1.456506)
443 #define CS_EQUALISER_24000_A2                    0.151410
444 #define CS_EQUALISER_24000_B1                   (-0.804201)
445 #define CS_EQUALISER_24000_B2                   (-0.163783)
446 #define CS_EQUALISER_24000_SCALE                     14
447 #define CSEX_EQUALISER_24000_A0                  1.299198
448 #define CSEX_EQUALISER_24000_A1                 (-1.452447)
449 #define CSEX_EQUALISER_24000_A2                  0.240489
450 #define CSEX_EQUALISER_24000_B1                 (-0.669303)
451 #define CSEX_EQUALISER_24000_B2                 (-0.294984)
452 #define CSEX_EQUALISER_24000_SCALE                   14
453 
454 /* Equaliser coefficients for 32000Hz sample rate, \
455    CS scaled with 1.044559 and CSEX scaled with 0.780006 */
456 #define CS_EQUALISER_32000_A0                     1.560988
457 #define CS_EQUALISER_32000_A1                    (-1.877724)
458 #define CS_EQUALISER_32000_A2                     0.389741
459 #define CS_EQUALISER_32000_B1                    (-0.907410)
460 #define CS_EQUALISER_32000_B2                    (-0.070489)
461 #define CS_EQUALISER_32000_SCALE                     14
462 #define CSEX_EQUALISER_32000_A0                  1.785049
463 #define CSEX_EQUALISER_32000_A1                 (-2.233497)
464 #define CSEX_EQUALISER_32000_A2                  0.526431
465 #define CSEX_EQUALISER_32000_B1                 (-0.445939)
466 #define CSEX_EQUALISER_32000_B2                 (-0.522446)
467 #define CSEX_EQUALISER_32000_SCALE                   13
468 
469 /* Equaliser coefficients for 44100Hz sample rate, \
470    CS scaled with 1.022170 and CSEX scaled with 0.763288 */
471 #define CS_EQUALISER_44100_A0                  1.623993
472 #define CS_EQUALISER_44100_A1                 (-2.270743)
473 #define CS_EQUALISER_44100_A2                  0.688829
474 #define CS_EQUALISER_44100_B1                 (-1.117190)
475 #define CS_EQUALISER_44100_B2                  0.130208
476 #define CS_EQUALISER_44100_SCALE                     13
477 #define CSEX_EQUALISER_44100_A0                   2.028315
478 #define CSEX_EQUALISER_44100_A1                  (-2.882459)
479 #define CSEX_EQUALISER_44100_A2                   0.904535
480 #define CSEX_EQUALISER_44100_B1                  (-0.593308)
481 #define CSEX_EQUALISER_44100_B2                  (-0.385816)
482 #define CSEX_EQUALISER_44100_SCALE                   13
483 
484 /* Equaliser coefficients for 48000Hz sample rate, \
485    CS scaled with 1.018635 and CSEX scaled with 0.760648 */
486 #define CS_EQUALISER_48000_A0                    1.641177
487 #define CS_EQUALISER_48000_A1                   (-2.364687)
488 #define CS_EQUALISER_48000_A2                    0.759910
489 #define CS_EQUALISER_48000_B1                   (-1.166774)
490 #define CS_EQUALISER_48000_B2                    0.178074
491 #define CS_EQUALISER_48000_SCALE                     13
492 #define CSEX_EQUALISER_48000_A0                  2.099655
493 #define CSEX_EQUALISER_48000_A1                 (-3.065220)
494 #define CSEX_EQUALISER_48000_A2                  1.010417
495 #define CSEX_EQUALISER_48000_B1                 (-0.634021)
496 #define CSEX_EQUALISER_48000_B2                 (-0.347332)
497 #define CSEX_EQUALISER_48000_SCALE                   13
498 
499 /* Equaliser coefficients for 88200Hz sample rate.
500  * The filter coefficients are obtained by carrying out
501  * state-space analysis using the coefficients available
502  * for 44100Hz.
503  */
504 #define CS_EQUALISER_88200_A0                   1.771899f
505 #define CS_EQUALISER_88200_A1                   (-2.930762f)
506 #define CS_EQUALISER_88200_A2                   1.172175f
507 #define CS_EQUALISER_88200_B1                   (-1.438349f)
508 #define CS_EQUALISER_88200_B2                   0.442520f
509 #define CS_EQUALISER_88200_SCALE                13
510 #define CSEX_EQUALISER_88200_A0                 2.675241f
511 #define CSEX_EQUALISER_88200_A1                 (-4.466154f)
512 #define CSEX_EQUALISER_88200_A2                 1.810305f
513 #define CSEX_EQUALISER_88200_B1                 (-0.925350f)
514 #define CSEX_EQUALISER_88200_B2                 (-0.066616f)
515 #define CSEX_EQUALISER_88200_SCALE              13
516 
517 #define CS_EQUALISER_96000_A0                    1.784497
518 #define CS_EQUALISER_96000_A1                   (-3.001435)
519 #define CS_EQUALISER_96000_A2                    1.228422
520 #define CS_EQUALISER_96000_B1                   (-1.477804)
521 #define CS_EQUALISER_96000_B2                    0.481369
522 #define CS_EQUALISER_96000_SCALE                     13
523 #define CSEX_EQUALISER_96000_A0                  2.7573
524 #define CSEX_EQUALISER_96000_A1                 (-4.6721)
525 #define CSEX_EQUALISER_96000_A2                  1.9317
526 #define CSEX_EQUALISER_96000_B1                 (-0.971718)
527 #define CSEX_EQUALISER_96000_B2                 (-0.021216)
528 #define CSEX_EQUALISER_96000_SCALE                   13
529 /* Equaliser coefficients for 176400Hz sample rate.
530  * The filter coefficients are obtained by carrying out
531  * state-space analysis using the coefficients available
532  * for 44100Hz.
533  */
534 #define CS_EQUALISER_176400_A0                  1.883440f
535 #define CS_EQUALISER_176400_A1                  (-3.414272f)
536 #define CS_EQUALISER_176400_A2                  1.534702f
537 #define CS_EQUALISER_176400_B1                  (-1.674614f)
538 #define CS_EQUALISER_176400_B2                  0.675827f
539 #define CS_EQUALISER_176400_SCALE               13
540 #define CSEX_EQUALISER_176400_A0                3.355068f
541 #define CSEX_EQUALISER_176400_A1                (-6.112578f)
542 #define CSEX_EQUALISER_176400_A2                2.764135f
543 #define CSEX_EQUALISER_176400_B1                (-1.268533f)
544 #define CSEX_EQUALISER_176400_B2                0.271277f
545 #define CSEX_EQUALISER_176400_SCALE             13
546 
547 #define CS_EQUALISER_192000_A0                    1.889582
548 #define CS_EQUALISER_192000_A1                   (-3.456140)
549 #define CS_EQUALISER_192000_A2                    1.569864
550 #define CS_EQUALISER_192000_B1                   (-1.700798)
551 #define CS_EQUALISER_192000_B2                    0.701824
552 #define CS_EQUALISER_192000_SCALE                     13
553 #define CSEX_EQUALISER_192000_A0                  3.4273
554 #define CSEX_EQUALISER_192000_A1                 (-6.2936)
555 #define CSEX_EQUALISER_192000_A2                  2.8720
556 #define CSEX_EQUALISER_192000_B1                 (-1.31074)
557 #define CSEX_EQUALISER_192000_B2                 0.31312
558 #define CSEX_EQUALISER_192000_SCALE                   13
559 
560 #define LVCS_HEADPHONE_SHIFT                          2              /* Output Shift */
561 #define LVCS_HEADPHONE_SHIFTLOSS                  0.8477735          /* Output Shift loss */
562 #define LVCS_HEADPHONE_GAIN                       0.2087465          /* Unprocessed path gain */
563 #define LVCS_EX_HEADPHONE_SHIFT                       3              /* EX Output Shift */
564 #define LVCS_EX_HEADPHONE_SHIFTLOSS               0.569225           /* EX Output Shift loss */
565 #define LVCS_EX_HEADPHONE_GAIN                    0.07794425         /* EX Unprocessed path gain */
566 #endif
567 
568