Home | History | Annotate | Download | only in src
      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 /*                                                                                  */
     24 /* The Stereo Enhancer                                                              */
     25 /*                                                                                  */
     26 /************************************************************************************/
     27 #ifdef BUILD_FLOAT
     28 /* Stereo Enhancer coefficients for 8000 Hz sample rate, scaled with 0.161258 */
     29 #define CS_MIDDLE_8000_A0                           0.227720
     30 #define CS_MIDDLE_8000_A1                          (-0.215125)
     31 #define CS_MIDDLE_8000_A2                           0.000000
     32 #define CS_MIDDLE_8000_B1                          (-0.921899)
     33 #define CS_MIDDLE_8000_B2                           0.000000
     34 #define CS_MIDDLE_8000_SCALE                        15
     35 #define CS_SIDE_8000_A0                             0.611441
     36 #define CS_SIDE_8000_A1                            (-0.380344)
     37 #define CS_SIDE_8000_A2                            (-0.231097)
     38 #define CS_SIDE_8000_B1                            (-0.622470)
     39 #define CS_SIDE_8000_B2                            (-0.130759)
     40 #define CS_SIDE_8000_SCALE                         15
     41 
     42 /* Stereo Enhancer coefficients for 11025Hz sample rate, scaled with 0.162943 */
     43 #define CS_MIDDLE_11025_A0                       0.230838
     44 #define CS_MIDDLE_11025_A1                      (-0.221559)
     45 #define CS_MIDDLE_11025_A2                       0.000000
     46 #define CS_MIDDLE_11025_B1                      (-0.943056)
     47 #define CS_MIDDLE_11025_B2                       0.000000
     48 #define CS_MIDDLE_11025_SCALE                    15
     49 #define CS_SIDE_11025_A0                         0.557372
     50 #define CS_SIDE_11025_A1                        (-0.391490)
     51 #define CS_SIDE_11025_A2                        (-0.165881)
     52 #define CS_SIDE_11025_B1                        (-0.880608)
     53 #define CS_SIDE_11025_B2                         0.032397
     54 #define CS_SIDE_11025_SCALE                      15
     55 
     56 /* Stereo Enhancer coefficients for 12000Hz sample rate, scaled with 0.162191 */
     57 #define CS_MIDDLE_12000_A0                        0.229932
     58 #define CS_MIDDLE_12000_A1                       (-0.221436)
     59 #define CS_MIDDLE_12000_A2                        0.000000
     60 #define CS_MIDDLE_12000_B1                       (-0.947616)
     61 #define CS_MIDDLE_12000_B2                        0.000000
     62 #define CS_MIDDLE_12000_SCALE                        15
     63 #define CS_SIDE_12000_A0                         0.558398
     64 #define CS_SIDE_12000_A1                        (-0.392211)
     65 #define CS_SIDE_12000_A2                        (-0.166187)
     66 #define CS_SIDE_12000_B1                        (-0.892550)
     67 #define CS_SIDE_12000_B2                         0.032856
     68 #define CS_SIDE_12000_SCALE                          15
     69 
     70 /* Stereo Enhancer coefficients for 16000Hz sample rate, scaled with 0.162371 */
     71 #define CS_MIDDLE_16000_A0                       0.230638
     72 #define CS_MIDDLE_16000_A1                      (-0.224232)
     73 #define CS_MIDDLE_16000_A2                       0.000000
     74 #define CS_MIDDLE_16000_B1                      (-0.960550)
     75 #define CS_MIDDLE_16000_B2                       0.000000
     76 #define CS_MIDDLE_16000_SCALE                        15
     77 #define CS_SIDE_16000_A0                         0.499695
     78 #define CS_SIDE_16000_A1                        (-0.355543)
     79 #define CS_SIDE_16000_A2                        (-0.144152)
     80 #define CS_SIDE_16000_B1                        (-1.050788)
     81 #define CS_SIDE_16000_B2                         0.144104
     82 #define CS_SIDE_16000_SCALE                          14
     83 
     84 /* Stereo Enhancer coefficients for 22050Hz sample rate, scaled with 0.160781 */
     85 #define CS_MIDDLE_22050_A0                       0.228749
     86 #define CS_MIDDLE_22050_A1                      (-0.224128)
     87 #define CS_MIDDLE_22050_A2                       0.000000
     88 #define CS_MIDDLE_22050_B1                      (-0.971262)
     89 #define CS_MIDDLE_22050_B2                       0.000000
     90 #define CS_MIDDLE_22050_SCALE                        15
     91 #define CS_SIDE_22050_A0                          0.440112
     92 #define CS_SIDE_22050_A1                         (-0.261096)
     93 #define CS_SIDE_22050_A2                         (-0.179016)
     94 #define CS_SIDE_22050_B1                         (-1.116786)
     95 #define CS_SIDE_22050_B2                          0.182507
     96 #define CS_SIDE_22050_SCALE                          14
     97 
     98 /* Stereo Enhancer coefficients for 24000Hz sample rate, scaled with 0.161882 */
     99 #define CS_MIDDLE_24000_A0                         0.230395
    100 #define CS_MIDDLE_24000_A1                        (-0.226117)
    101 #define CS_MIDDLE_24000_A2                         0.000000
    102 #define CS_MIDDLE_24000_B1                        (-0.973573)
    103 #define CS_MIDDLE_24000_B2                         0.000000
    104 #define CS_MIDDLE_24000_SCALE                        15
    105 #define CS_SIDE_24000_A0                           0.414770
    106 #define CS_SIDE_24000_A1                          (-0.287182)
    107 #define CS_SIDE_24000_A2                          (-0.127588)
    108 #define CS_SIDE_24000_B1                          (-1.229648)
    109 #define CS_SIDE_24000_B2                           0.282177
    110 #define CS_SIDE_24000_SCALE                          14
    111 
    112 /* Stereo Enhancer coefficients for 32000Hz sample rate, scaled with 0.160322 */
    113 #define CS_MIDDLE_32000_A0                          0.228400
    114 #define CS_MIDDLE_32000_A1                         (-0.225214)
    115 #define CS_MIDDLE_32000_A2                          0.000000
    116 #define CS_MIDDLE_32000_B1                         (-0.980126)
    117 #define CS_MIDDLE_32000_B2                          0.000000
    118 #define CS_MIDDLE_32000_SCALE                        15
    119 #define CS_SIDE_32000_A0                            0.364579
    120 #define CS_SIDE_32000_A1                           (-0.207355)
    121 #define CS_SIDE_32000_A2                           (-0.157224)
    122 #define CS_SIDE_32000_B1                           (-1.274231)
    123 #define CS_SIDE_32000_B2                            0.312495
    124 #define CS_SIDE_32000_SCALE                          14
    125 
    126 /* Stereo Enhancer coefficients for 44100Hz sample rate, scaled with 0.163834 */
    127 #define CS_MIDDLE_44100_A0                     0.233593
    128 #define CS_MIDDLE_44100_A1                    (-0.231225)
    129 #define CS_MIDDLE_44100_A2                     0.000000
    130 #define CS_MIDDLE_44100_B1                    (-0.985545)
    131 #define CS_MIDDLE_44100_B2                     0.000000
    132 #define CS_MIDDLE_44100_SCALE                        15
    133 #define CS_SIDE_44100_A0                       0.284573
    134 #define CS_SIDE_44100_A1                      (-0.258910)
    135 #define CS_SIDE_44100_A2                      (-0.025662)
    136 #define CS_SIDE_44100_B1                      (-1.572248)
    137 #define CS_SIDE_44100_B2                       0.588399
    138 #define CS_SIDE_44100_SCALE                  14
    139 
    140 /* Stereo Enhancer coefficients for 48000Hz sample rate, scaled with 0.164402 */
    141 #define CS_MIDDLE_48000_A0                     0.234445
    142 #define CS_MIDDLE_48000_A1                    (-0.232261)
    143 #define CS_MIDDLE_48000_A2                     0.000000
    144 #define CS_MIDDLE_48000_B1                    (-0.986713)
    145 #define CS_MIDDLE_48000_B2                     0.000000
    146 #define CS_MIDDLE_48000_SCALE                        15
    147 #define CS_SIDE_48000_A0                     0.272606
    148 #define CS_SIDE_48000_A1                    (-0.266952)
    149 #define CS_SIDE_48000_A2                    (-0.005654)
    150 #define CS_SIDE_48000_B1                    (-1.617141)
    151 #define CS_SIDE_48000_B2                     0.630405
    152 #define CS_SIDE_48000_SCALE                          14
    153 
    154 #ifdef HIGHER_FS
    155 /* Stereo Enhancer coefficients for 96000Hz sample rate, scaled with  0.165*/
    156 /* high pass filter with cutoff frequency 102.18 Hz*/
    157 #define CS_MIDDLE_96000_A0                     0.235532
    158 #define CS_MIDDLE_96000_A1                    (-0.234432)
    159 #define CS_MIDDLE_96000_A2                     0.000000
    160 #define CS_MIDDLE_96000_B1                    (-0.993334)
    161 #define CS_MIDDLE_96000_B2                     0.000000
    162 #define CS_MIDDLE_96000_SCALE                        15
    163 /* bandpass filter with fc1 270 and fc2 3703, designed using 2nd order butterworth */
    164 #define CS_SIDE_96000_A0                     0.016727
    165 #define CS_SIDE_96000_A1                     0.000000
    166 #define CS_SIDE_96000_A2                    (-0.016727)
    167 #define CS_SIDE_96000_B1                    (-1.793372)
    168 #define CS_SIDE_96000_B2                     0.797236
    169 #define CS_SIDE_96000_SCALE                        14
    170 
    171 /* Stereo Enhancer coefficients for 192000Hz sample rate, scaled with  0.1689*/
    172 #define CS_MIDDLE_192000_A0                     0.241219
    173 #define CS_MIDDLE_192000_A1                    (-0.240656)
    174 #define CS_MIDDLE_192000_A2                     0.000000
    175 #define CS_MIDDLE_192000_B1                    (-0.996661)
    176 #define CS_MIDDLE_192000_B2                     0.000000
    177 #define CS_MIDDLE_192000_SCALE                        15
    178 /* bandpass filter with fc1 270 and fc2 3703, designed using 2nd order butterworth */
    179 #define CS_SIDE_192000_A0                     0.008991
    180 #define CS_SIDE_192000_A1                    (-0.000000)
    181 #define CS_SIDE_192000_A2                    (-0.008991)
    182 #define CS_SIDE_192000_B1                    (-1.892509)
    183 #define CS_SIDE_192000_B2                     0.893524
    184 #define CS_SIDE_192000_SCALE                       14
    185 #endif
    186 
    187 /************************************************************************************/
    188 /*                                                                                  */
    189 /* The Reverb Unit                                                                  */
    190 /*                                                                                  */
    191 /************************************************************************************/
    192 
    193 /* Reverb delay settings in samples */
    194 #define LVCS_STEREODELAY_CS_8KHZ                     93         /* Sample rate 8kS/s */
    195 #define LVCS_STEREODELAY_CS_11KHZ                   128         /* Sample rate 11kS/s */
    196 #define LVCS_STEREODELAY_CS_12KHZ                   139         /* Sample rate 12kS/s */
    197 #define LVCS_STEREODELAY_CS_16KHZ                   186         /* Sample rate 16kS/s */
    198 #define LVCS_STEREODELAY_CS_22KHZ                   256         /* Sample rate 22kS/s */
    199 #define LVCS_STEREODELAY_CS_24KHZ                   279         /* Sample rate 24kS/s */
    200 #define LVCS_STEREODELAY_CS_32KHZ                   372         /* Sample rate 32kS/s */
    201 #define LVCS_STEREODELAY_CS_44KHZ                   512         /* Sample rate 44kS/s */
    202 #define LVCS_STEREODELAY_CS_48KHZ                   512         /* Sample rate 48kS/s */
    203 
    204 /* Reverb coefficients for 8000 Hz sample rate, scaled with 1.038030 */
    205 #define CS_REVERB_8000_A0                          0.667271
    206 #define CS_REVERB_8000_A1                         (-0.667271)
    207 #define CS_REVERB_8000_A2                          0.000000
    208 #define CS_REVERB_8000_B1                         (-0.668179)
    209 #define CS_REVERB_8000_B2                          0.000000
    210 #define CS_REVERB_8000_SCALE                         15
    211 
    212 /* Reverb coefficients for 11025Hz sample rate, scaled with 1.038030 */
    213 #define CS_REVERB_11025_A0                     0.699638
    214 #define CS_REVERB_11025_A1                    (-0.699638)
    215 #define CS_REVERB_11025_A2                     0.000000
    216 #define CS_REVERB_11025_B1                    (-0.749096)
    217 #define CS_REVERB_11025_B2                     0.000000
    218 #define CS_REVERB_11025_SCALE                  15
    219 
    220 /* Reverb coefficients for 12000Hz sample rate, scaled with 1.038030 */
    221 #define CS_REVERB_12000_A0                   0.706931
    222 #define CS_REVERB_12000_A1                  (-0.706931)
    223 #define CS_REVERB_12000_A2                   0.000000
    224 #define CS_REVERB_12000_B1                  (-0.767327)
    225 #define CS_REVERB_12000_B2                   0.000000
    226 #define CS_REVERB_12000_SCALE                15
    227 
    228 /* Reverb coefficients for 16000Hz sample rate, scaled with 1.038030 */
    229 #define CS_REVERB_16000_A0                      0.728272
    230 #define CS_REVERB_16000_A1                     (-0.728272)
    231 #define CS_REVERB_16000_A2                      0.000000
    232 #define CS_REVERB_16000_B1                     (-0.820679)
    233 #define CS_REVERB_16000_B2                      0.000000
    234 #define CS_REVERB_16000_SCALE                        15
    235 
    236 /* Reverb coefficients for 22050Hz sample rate, scaled with 1.038030 */
    237 #define CS_REVERB_22050_A0                     0.516396
    238 #define CS_REVERB_22050_A1                     0.000000
    239 #define CS_REVERB_22050_A2                    (-0.516396)
    240 #define CS_REVERB_22050_B1                    (-0.518512)
    241 #define CS_REVERB_22050_B2                    (-0.290990)
    242 #define CS_REVERB_22050_SCALE                        15
    243 
    244 
    245 /* Reverb coefficients for 24000Hz sample rate, scaled with 1.038030 */
    246 #define CS_REVERB_24000_A0                       0.479565
    247 #define CS_REVERB_24000_A1                       0.000000
    248 #define CS_REVERB_24000_A2                      (-0.479565)
    249 #define CS_REVERB_24000_B1                      (-0.637745)
    250 #define CS_REVERB_24000_B2                      (-0.198912)
    251 #define CS_REVERB_24000_SCALE                        15
    252 
    253 /* Reverb coefficients for 32000Hz sample rate, scaled with 1.038030 */
    254 #define CS_REVERB_32000_A0                      0.380349
    255 #define CS_REVERB_32000_A1                      0.000000
    256 #define CS_REVERB_32000_A2                     (-0.380349)
    257 #define CS_REVERB_32000_B1                     (-0.950873)
    258 #define CS_REVERB_32000_B2                      0.049127
    259 #define CS_REVERB_32000_SCALE                        15
    260 
    261 /* Reverb coefficients for 44100Hz sample rate, scaled with 1.038030 */
    262 #define CS_REVERB_44100_A0                         0.297389
    263 #define CS_REVERB_44100_A1                         0.000000
    264 #define CS_REVERB_44100_A2                        (-0.297389)
    265 #define CS_REVERB_44100_B1                        (-1.200423)
    266 #define CS_REVERB_44100_B2                         0.256529
    267 #define CS_REVERB_44100_SCALE                        14
    268 
    269 /* Reverb coefficients for 48000Hz sample rate, scaled with 1.038030 */
    270 #define CS_REVERB_48000_A0                       0.278661
    271 #define CS_REVERB_48000_A1                       0.000000
    272 #define CS_REVERB_48000_A2                      (-0.278661)
    273 #define CS_REVERB_48000_B1                      (-1.254993)
    274 #define CS_REVERB_48000_B2                       0.303347
    275 #define CS_REVERB_48000_SCALE                        14
    276 
    277 #ifdef HIGHER_FS
    278 /* Reverb coefficients for 96000Hz sample rate, scaled with 0.8 */
    279 /* Band pass filter with fc1=500 and fc2=8000*/
    280 #define CS_REVERB_96000_A0                       0.1602488
    281 #define CS_REVERB_96000_A1                       0.000000
    282 #define CS_REVERB_96000_A2                      (-0.1602488)
    283 #define CS_REVERB_96000_B1                      (-1.585413)
    284 #define CS_REVERB_96000_B2                       0.599377
    285 #define CS_REVERB_96000_SCALE                        14
    286 
    287 /* Reverb coefficients for 192000Hz sample rate, scaled with 0.8 */
    288 /* Band pass filter with fc1=500 and fc2=8000*/
    289 #define CS_REVERB_192000_A0                       0.0878369
    290 #define CS_REVERB_192000_A1                       0.000000
    291 #define CS_REVERB_192000_A2                      (-0.0878369)
    292 #define CS_REVERB_192000_B1                      (-1.7765764)
    293 #define CS_REVERB_192000_B2                       0.7804076
    294 #define CS_REVERB_192000_SCALE                        14
    295 
    296 #endif
    297 
    298 
    299 /* Reverb Gain Settings */
    300 #define LVCS_HEADPHONE_DELAYGAIN               0.800000         /* Algorithm delay path gain */
    301 #define LVCS_HEADPHONE_OUTPUTGAIN              1.000000         /* Algorithm output gain */
    302 #define LVCS_HEADPHONE_PROCGAIN                   18403         /* Processed path gain */
    303 #define LVCS_HEADPHONE_UNPROCGAIN                 18403         /* Unprocessed path gain */
    304 #define LVCS_HEADPHONE_GAINCORRECT             1.009343         /* Delay mixer gain correction */
    305 
    306 /************************************************************************************/
    307 /*                                                                                  */
    308 /* The Equaliser                                                                    */
    309 /*                                                                                  */
    310 /************************************************************************************/
    311 
    312 /* Equaliser coefficients for 8000 Hz sample rate, \
    313    CS scaled with 1.038497 and CSEX scaled with 0.775480 */
    314 #define CS_EQUALISER_8000_A0                     1.263312
    315 #define CS_EQUALISER_8000_A1                    (-0.601748)
    316 #define CS_EQUALISER_8000_A2                    (-0.280681)
    317 #define CS_EQUALISER_8000_B1                    (-0.475865)
    318 #define CS_EQUALISER_8000_B2                    (-0.408154)
    319 #define CS_EQUALISER_8000_SCALE                      14
    320 #define CSEX_EQUALISER_8000_A0                    0.943357
    321 #define CSEX_EQUALISER_8000_A1                   (-0.449345)
    322 #define CSEX_EQUALISER_8000_A2                   (-0.209594)
    323 #define CSEX_EQUALISER_8000_B1                   (-0.475865)
    324 #define CSEX_EQUALISER_8000_B2                   (-0.408154)
    325 #define CSEX_EQUALISER_8000_SCALE                    15
    326 
    327 /* Equaliser coefficients for 11025Hz sample rate, \
    328    CS scaled with 1.027761 and CSEX scaled with 0.767463 */
    329 #define CS_EQUALISER_11025_A0                    1.101145
    330 #define CS_EQUALISER_11025_A1                    0.139020
    331 #define CS_EQUALISER_11025_A2                   (-0.864423)
    332 #define CS_EQUALISER_11025_B1                    0.024541
    333 #define CS_EQUALISER_11025_B2                   (-0.908930)
    334 #define CS_EQUALISER_11025_SCALE                     14
    335 #define CSEX_EQUALISER_11025_A0                    0.976058
    336 #define CSEX_EQUALISER_11025_A1                   (-0.695326)
    337 #define CSEX_EQUALISER_11025_A2                   (-0.090809)
    338 #define CSEX_EQUALISER_11025_B1                   (-0.610594)
    339 #define CSEX_EQUALISER_11025_B2                   (-0.311149)
    340 #define CSEX_EQUALISER_11025_SCALE                   15
    341 
    342 /* Equaliser coefficients for 12000Hz sample rate, \
    343    CS scaled with 1.032521 and CSEX scaled with 0.771017 */
    344 #define CS_EQUALISER_12000_A0                      1.276661
    345 #define CS_EQUALISER_12000_A1                     (-1.017519)
    346 #define CS_EQUALISER_12000_A2                     (-0.044128)
    347 #define CS_EQUALISER_12000_B1                     (-0.729616)
    348 #define CS_EQUALISER_12000_B2                     (-0.204532)
    349 #define CS_EQUALISER_12000_SCALE                     14
    350 #define CSEX_EQUALISER_12000_A0                 1.007095
    351 #define CSEX_EQUALISER_12000_A1                (-0.871912)
    352 #define CSEX_EQUALISER_12000_A2                 0.023232
    353 #define CSEX_EQUALISER_12000_B1                (-0.745857)
    354 #define CSEX_EQUALISER_12000_B2                (-0.189171)
    355 #define CSEX_EQUALISER_12000_SCALE                   14
    356 
    357 /* Equaliser coefficients for 16000Hz sample rate, \
    358    CS scaled with 1.031378 and CSEX scaled with 0.770164 */
    359 #define CS_EQUALISER_16000_A0                     1.281629
    360 #define CS_EQUALISER_16000_A1                    (-1.075872)
    361 #define CS_EQUALISER_16000_A2                    (-0.041365)
    362 #define CS_EQUALISER_16000_B1                    (-0.725239)
    363 #define CS_EQUALISER_16000_B2                    (-0.224358)
    364 #define CS_EQUALISER_16000_SCALE                     14
    365 #define CSEX_EQUALISER_16000_A0                  1.081091
    366 #define CSEX_EQUALISER_16000_A1                 (-0.867183)
    367 #define CSEX_EQUALISER_16000_A2                 (-0.070247)
    368 #define CSEX_EQUALISER_16000_B1                 (-0.515121)
    369 #define CSEX_EQUALISER_16000_B2                 (-0.425893)
    370 #define CSEX_EQUALISER_16000_SCALE                   14
    371 
    372 /* Equaliser coefficients for 22050Hz sample rate, \
    373    CS scaled with 1.041576 and CSEX scaled with 0.777779 */
    374 #define CS_EQUALISER_22050_A0                   1.388605
    375 #define CS_EQUALISER_22050_A1                  (-1.305799)
    376 #define CS_EQUALISER_22050_A2                   0.039922
    377 #define CS_EQUALISER_22050_B1                  (-0.719494)
    378 #define CS_EQUALISER_22050_B2                  (-0.243245)
    379 #define CS_EQUALISER_22050_SCALE                     14
    380 #define CSEX_EQUALISER_22050_A0                   1.272910
    381 #define CSEX_EQUALISER_22050_A1                  (-1.341014)
    382 #define CSEX_EQUALISER_22050_A2                   0.167462
    383 #define CSEX_EQUALISER_22050_B1                  (-0.614219)
    384 #define CSEX_EQUALISER_22050_B2                  (-0.345384)
    385 #define CSEX_EQUALISER_22050_SCALE                   14
    386 
    387 /* Equaliser coefficients for 24000Hz sample rate, \
    388    CS scaled with 1.034495 and CSEX scaled with 0.772491 */
    389 #define CS_EQUALISER_24000_A0                    1.409832
    390 #define CS_EQUALISER_24000_A1                   (-1.456506)
    391 #define CS_EQUALISER_24000_A2                    0.151410
    392 #define CS_EQUALISER_24000_B1                   (-0.804201)
    393 #define CS_EQUALISER_24000_B2                   (-0.163783)
    394 #define CS_EQUALISER_24000_SCALE                     14
    395 #define CSEX_EQUALISER_24000_A0                  1.299198
    396 #define CSEX_EQUALISER_24000_A1                 (-1.452447)
    397 #define CSEX_EQUALISER_24000_A2                  0.240489
    398 #define CSEX_EQUALISER_24000_B1                 (-0.669303)
    399 #define CSEX_EQUALISER_24000_B2                 (-0.294984)
    400 #define CSEX_EQUALISER_24000_SCALE                   14
    401 
    402 /* Equaliser coefficients for 32000Hz sample rate, \
    403    CS scaled with 1.044559 and CSEX scaled with 0.780006 */
    404 #define CS_EQUALISER_32000_A0                     1.560988
    405 #define CS_EQUALISER_32000_A1                    (-1.877724)
    406 #define CS_EQUALISER_32000_A2                     0.389741
    407 #define CS_EQUALISER_32000_B1                    (-0.907410)
    408 #define CS_EQUALISER_32000_B2                    (-0.070489)
    409 #define CS_EQUALISER_32000_SCALE                     14
    410 #define CSEX_EQUALISER_32000_A0                  1.785049
    411 #define CSEX_EQUALISER_32000_A1                 (-2.233497)
    412 #define CSEX_EQUALISER_32000_A2                  0.526431
    413 #define CSEX_EQUALISER_32000_B1                 (-0.445939)
    414 #define CSEX_EQUALISER_32000_B2                 (-0.522446)
    415 #define CSEX_EQUALISER_32000_SCALE                   13
    416 
    417 /* Equaliser coefficients for 44100Hz sample rate, \
    418    CS scaled with 1.022170 and CSEX scaled with 0.763288 */
    419 #define CS_EQUALISER_44100_A0                  1.623993
    420 #define CS_EQUALISER_44100_A1                 (-2.270743)
    421 #define CS_EQUALISER_44100_A2                  0.688829
    422 #define CS_EQUALISER_44100_B1                 (-1.117190)
    423 #define CS_EQUALISER_44100_B2                  0.130208
    424 #define CS_EQUALISER_44100_SCALE                     13
    425 #define CSEX_EQUALISER_44100_A0                   2.028315
    426 #define CSEX_EQUALISER_44100_A1                  (-2.882459)
    427 #define CSEX_EQUALISER_44100_A2                   0.904535
    428 #define CSEX_EQUALISER_44100_B1                  (-0.593308)
    429 #define CSEX_EQUALISER_44100_B2                  (-0.385816)
    430 #define CSEX_EQUALISER_44100_SCALE                   13
    431 
    432 /* Equaliser coefficients for 48000Hz sample rate, \
    433    CS scaled with 1.018635 and CSEX scaled with 0.760648 */
    434 #define CS_EQUALISER_48000_A0                    1.641177
    435 #define CS_EQUALISER_48000_A1                   (-2.364687)
    436 #define CS_EQUALISER_48000_A2                    0.759910
    437 #define CS_EQUALISER_48000_B1                   (-1.166774)
    438 #define CS_EQUALISER_48000_B2                    0.178074
    439 #define CS_EQUALISER_48000_SCALE                     13
    440 #define CSEX_EQUALISER_48000_A0                  2.099655
    441 #define CSEX_EQUALISER_48000_A1                 (-3.065220)
    442 #define CSEX_EQUALISER_48000_A2                  1.010417
    443 #define CSEX_EQUALISER_48000_B1                 (-0.634021)
    444 #define CSEX_EQUALISER_48000_B2                 (-0.347332)
    445 #define CSEX_EQUALISER_48000_SCALE                   13
    446 
    447 
    448 #ifdef HIGHER_FS
    449 #define CS_EQUALISER_96000_A0                    1.784497
    450 #define CS_EQUALISER_96000_A1                   (-3.001435)
    451 #define CS_EQUALISER_96000_A2                    1.228422
    452 #define CS_EQUALISER_96000_B1                   (-1.477804)
    453 #define CS_EQUALISER_96000_B2                    0.481369
    454 #define CS_EQUALISER_96000_SCALE                     13
    455 #define CSEX_EQUALISER_96000_A0                  2.7573
    456 #define CSEX_EQUALISER_96000_A1                 (-4.6721)
    457 #define CSEX_EQUALISER_96000_A2                  1.9317
    458 #define CSEX_EQUALISER_96000_B1                 (-0.971718)
    459 #define CSEX_EQUALISER_96000_B2                 (-0.021216)
    460 #define CSEX_EQUALISER_96000_SCALE                   13
    461 
    462 #define CS_EQUALISER_192000_A0                    1.889582
    463 #define CS_EQUALISER_192000_A1                   (-3.456140)
    464 #define CS_EQUALISER_192000_A2                    1.569864
    465 #define CS_EQUALISER_192000_B1                   (-1.700798)
    466 #define CS_EQUALISER_192000_B2                    0.701824
    467 #define CS_EQUALISER_192000_SCALE                     13
    468 #define CSEX_EQUALISER_192000_A0                  3.4273
    469 #define CSEX_EQUALISER_192000_A1                 (-6.2936)
    470 #define CSEX_EQUALISER_192000_A2                  2.8720
    471 #define CSEX_EQUALISER_192000_B1                 (-1.31074)
    472 #define CSEX_EQUALISER_192000_B2                 0.31312
    473 #define CSEX_EQUALISER_192000_SCALE                   13
    474 #endif
    475 
    476 
    477 #define LVCS_HEADPHONE_SHIFT                          2              /* Output Shift */
    478 #define LVCS_HEADPHONE_SHIFTLOSS                  0.8477735          /* Output Shift loss */
    479 #define LVCS_HEADPHONE_GAIN                       0.2087465          /* Unprocessed path gain */
    480 #define LVCS_EX_HEADPHONE_SHIFT                       3              /* EX Output Shift */
    481 #define LVCS_EX_HEADPHONE_SHIFTLOSS               0.569225           /* EX Output Shift loss */
    482 #define LVCS_EX_HEADPHONE_GAIN                    0.07794425         /* EX Unprocessed path gain */
    483 #else
    484 /* Stereo Enhancer coefficients for 8000 Hz sample rate, scaled with 0.161258 */
    485 #define CS_MIDDLE_8000_A0                          7462         /* Floating point value 0.227720 */
    486 #define CS_MIDDLE_8000_A1                        (-7049)        /* Floating point value -0.215125 */
    487 #define CS_MIDDLE_8000_A2                             0         /* Floating point value 0.000000 */
    488 #define CS_MIDDLE_8000_B1                       (-30209)        /* Floating point value -0.921899 */
    489 #define CS_MIDDLE_8000_B2                             0         /* Floating point value 0.000000 */
    490 #define CS_MIDDLE_8000_SCALE                         15
    491 #define CS_SIDE_8000_A0                           20036         /* Floating point value 0.611441 */
    492 #define CS_SIDE_8000_A1                         (-12463)        /* Floating point value -0.380344 */
    493 #define CS_SIDE_8000_A2                          (-7573)        /* Floating point value -0.231097 */
    494 #define CS_SIDE_8000_B1                         (-20397)        /* Floating point value -0.622470 */
    495 #define CS_SIDE_8000_B2                          (-4285)        /* Floating point value -0.130759 */
    496 #define CS_SIDE_8000_SCALE                           15
    497 
    498 /* Stereo Enhancer coefficients for 11025Hz sample rate, scaled with 0.162943 */
    499 #define CS_MIDDLE_11025_A0                         7564         /* Floating point value 0.230838 */
    500 #define CS_MIDDLE_11025_A1                       (-7260)        /* Floating point value -0.221559 */
    501 #define CS_MIDDLE_11025_A2                            0         /* Floating point value 0.000000 */
    502 #define CS_MIDDLE_11025_B1                      (-30902)        /* Floating point value -0.943056 */
    503 #define CS_MIDDLE_11025_B2                            0         /* Floating point value 0.000000 */
    504 #define CS_MIDDLE_11025_SCALE                        15
    505 #define CS_SIDE_11025_A0                          18264         /* Floating point value 0.557372 */
    506 #define CS_SIDE_11025_A1                        (-12828)        /* Floating point value -0.391490 */
    507 #define CS_SIDE_11025_A2                         (-5436)        /* Floating point value -0.165881 */
    508 #define CS_SIDE_11025_B1                        (-28856)        /* Floating point value -0.880608 */
    509 #define CS_SIDE_11025_B2                           1062         /* Floating point value 0.032397 */
    510 #define CS_SIDE_11025_SCALE                          15
    511 
    512 /* Stereo Enhancer coefficients for 12000Hz sample rate, scaled with 0.162191 */
    513 #define CS_MIDDLE_12000_A0                         7534         /* Floating point value 0.229932 */
    514 #define CS_MIDDLE_12000_A1                       (-7256)        /* Floating point value -0.221436 */
    515 #define CS_MIDDLE_12000_A2                            0         /* Floating point value 0.000000 */
    516 #define CS_MIDDLE_12000_B1                      (-31051)        /* Floating point value -0.947616 */
    517 #define CS_MIDDLE_12000_B2                            0         /* Floating point value 0.000000 */
    518 #define CS_MIDDLE_12000_SCALE                        15
    519 #define CS_SIDE_12000_A0                          18298         /* Floating point value 0.558398 */
    520 #define CS_SIDE_12000_A1                        (-12852)        /* Floating point value -0.392211 */
    521 #define CS_SIDE_12000_A2                         (-5446)        /* Floating point value -0.166187 */
    522 #define CS_SIDE_12000_B1                        (-29247)        /* Floating point value -0.892550 */
    523 #define CS_SIDE_12000_B2                           1077         /* Floating point value 0.032856 */
    524 #define CS_SIDE_12000_SCALE                          15
    525 
    526 /* Stereo Enhancer coefficients for 16000Hz sample rate, scaled with 0.162371 */
    527 #define CS_MIDDLE_16000_A0                         7558         /* Floating point value 0.230638 */
    528 #define CS_MIDDLE_16000_A1                       (-7348)        /* Floating point value -0.224232 */
    529 #define CS_MIDDLE_16000_A2                            0         /* Floating point value 0.000000 */
    530 #define CS_MIDDLE_16000_B1                      (-31475)        /* Floating point value -0.960550 */
    531 #define CS_MIDDLE_16000_B2                            0         /* Floating point value 0.000000 */
    532 #define CS_MIDDLE_16000_SCALE                        15
    533 #define CS_SIDE_16000_A0                           8187         /* Floating point value 0.499695 */
    534 #define CS_SIDE_16000_A1                         (-5825)        /* Floating point value -0.355543 */
    535 #define CS_SIDE_16000_A2                         (-2362)        /* Floating point value -0.144152 */
    536 #define CS_SIDE_16000_B1                        (-17216)        /* Floating point value -1.050788 */
    537 #define CS_SIDE_16000_B2                           2361         /* Floating point value 0.144104 */
    538 #define CS_SIDE_16000_SCALE                          14
    539 
    540 /* Stereo Enhancer coefficients for 22050Hz sample rate, scaled with 0.160781 */
    541 #define CS_MIDDLE_22050_A0                         7496         /* Floating point value 0.228749 */
    542 #define CS_MIDDLE_22050_A1                       (-7344)        /* Floating point value -0.224128 */
    543 #define CS_MIDDLE_22050_A2                            0         /* Floating point value 0.000000 */
    544 #define CS_MIDDLE_22050_B1                      (-31826)        /* Floating point value -0.971262 */
    545 #define CS_MIDDLE_22050_B2                            0         /* Floating point value 0.000000 */
    546 #define CS_MIDDLE_22050_SCALE                        15
    547 #define CS_SIDE_22050_A0                           7211         /* Floating point value 0.440112 */
    548 #define CS_SIDE_22050_A1                         (-4278)        /* Floating point value -0.261096 */
    549 #define CS_SIDE_22050_A2                         (-2933)        /* Floating point value -0.179016 */
    550 #define CS_SIDE_22050_B1                        (-18297)        /* Floating point value -1.116786 */
    551 #define CS_SIDE_22050_B2                           2990         /* Floating point value 0.182507 */
    552 #define CS_SIDE_22050_SCALE                          14
    553 
    554 /* Stereo Enhancer coefficients for 24000Hz sample rate, scaled with 0.161882 */
    555 #define CS_MIDDLE_24000_A0                         7550         /* Floating point value 0.230395 */
    556 #define CS_MIDDLE_24000_A1                       (-7409)        /* Floating point value -0.226117 */
    557 #define CS_MIDDLE_24000_A2                            0         /* Floating point value 0.000000 */
    558 #define CS_MIDDLE_24000_B1                      (-31902)        /* Floating point value -0.973573 */
    559 #define CS_MIDDLE_24000_B2                            0         /* Floating point value 0.000000 */
    560 #define CS_MIDDLE_24000_SCALE                        15
    561 #define CS_SIDE_24000_A0                           6796         /* Floating point value 0.414770 */
    562 #define CS_SIDE_24000_A1                         (-4705)        /* Floating point value -0.287182 */
    563 #define CS_SIDE_24000_A2                         (-2090)        /* Floating point value -0.127588 */
    564 #define CS_SIDE_24000_B1                        (-20147)        /* Floating point value -1.229648 */
    565 #define CS_SIDE_24000_B2                           4623         /* Floating point value 0.282177 */
    566 #define CS_SIDE_24000_SCALE                          14
    567 
    568 /* Stereo Enhancer coefficients for 32000Hz sample rate, scaled with 0.160322 */
    569 #define CS_MIDDLE_32000_A0                         7484         /* Floating point value 0.228400 */
    570 #define CS_MIDDLE_32000_A1                       (-7380)        /* Floating point value -0.225214 */
    571 #define CS_MIDDLE_32000_A2                            0         /* Floating point value 0.000000 */
    572 #define CS_MIDDLE_32000_B1                      (-32117)        /* Floating point value -0.980126 */
    573 #define CS_MIDDLE_32000_B2                            0         /* Floating point value 0.000000 */
    574 #define CS_MIDDLE_32000_SCALE                        15
    575 #define CS_SIDE_32000_A0                           5973         /* Floating point value 0.364579 */
    576 #define CS_SIDE_32000_A1                         (-3397)        /* Floating point value -0.207355 */
    577 #define CS_SIDE_32000_A2                         (-2576)        /* Floating point value -0.157224 */
    578 #define CS_SIDE_32000_B1                        (-20877)        /* Floating point value -1.274231 */
    579 #define CS_SIDE_32000_B2                           5120         /* Floating point value 0.312495 */
    580 #define CS_SIDE_32000_SCALE                          14
    581 
    582 /* Stereo Enhancer coefficients for 44100Hz sample rate, scaled with 0.163834 */
    583 #define CS_MIDDLE_44100_A0                         7654         /* Floating point value 0.233593 */
    584 #define CS_MIDDLE_44100_A1                       (-7577)        /* Floating point value -0.231225 */
    585 #define CS_MIDDLE_44100_A2                            0         /* Floating point value 0.000000 */
    586 #define CS_MIDDLE_44100_B1                      (-32294)        /* Floating point value -0.985545 */
    587 #define CS_MIDDLE_44100_B2                            0         /* Floating point value 0.000000 */
    588 #define CS_MIDDLE_44100_SCALE                        15
    589 #define CS_SIDE_44100_A0                           4662         /* Floating point value 0.284573 */
    590 #define CS_SIDE_44100_A1                         (-4242)        /* Floating point value -0.258910 */
    591 #define CS_SIDE_44100_A2                          (-420)        /* Floating point value -0.025662 */
    592 #define CS_SIDE_44100_B1                        (-25760)        /* Floating point value -1.572248 */
    593 #define CS_SIDE_44100_B2                           9640         /* Floating point value 0.588399 */
    594 #define CS_SIDE_44100_SCALE                          14
    595 
    596 /* Stereo Enhancer coefficients for 48000Hz sample rate, scaled with 0.164402 */
    597 #define CS_MIDDLE_48000_A0                         7682         /* Floating point value 0.234445 */
    598 #define CS_MIDDLE_48000_A1                       (-7611)        /* Floating point value -0.232261 */
    599 #define CS_MIDDLE_48000_A2                            0         /* Floating point value 0.000000 */
    600 #define CS_MIDDLE_48000_B1                      (-32333)        /* Floating point value -0.986713 */
    601 #define CS_MIDDLE_48000_B2                            0         /* Floating point value 0.000000 */
    602 #define CS_MIDDLE_48000_SCALE                        15
    603 #define CS_SIDE_48000_A0                           4466         /* Floating point value 0.272606 */
    604 #define CS_SIDE_48000_A1                         (-4374)        /* Floating point value -0.266952 */
    605 #define CS_SIDE_48000_A2                           (-93)        /* Floating point value -0.005654 */
    606 #define CS_SIDE_48000_B1                        (-26495)        /* Floating point value -1.617141 */
    607 #define CS_SIDE_48000_B2                          10329         /* Floating point value 0.630405 */
    608 #define CS_SIDE_48000_SCALE                          14
    609 
    610 
    611 /************************************************************************************/
    612 /*                                                                                  */
    613 /* The Reverb Unit                                                                  */
    614 /*                                                                                  */
    615 /************************************************************************************/
    616 
    617 /* Reverb delay settings in samples */
    618 #define LVCS_STEREODELAY_CS_8KHZ                     93         /* Sample rate 8kS/s */
    619 #define LVCS_STEREODELAY_CS_11KHZ                   128         /* Sample rate 11kS/s */
    620 #define LVCS_STEREODELAY_CS_12KHZ                   139         /* Sample rate 12kS/s */
    621 #define LVCS_STEREODELAY_CS_16KHZ                   186         /* Sample rate 16kS/s */
    622 #define LVCS_STEREODELAY_CS_22KHZ                   256         /* Sample rate 22kS/s */
    623 #define LVCS_STEREODELAY_CS_24KHZ                   279         /* Sample rate 24kS/s */
    624 #define LVCS_STEREODELAY_CS_32KHZ                   372         /* Sample rate 32kS/s */
    625 #define LVCS_STEREODELAY_CS_44KHZ                   512         /* Sample rate 44kS/s */
    626 #define LVCS_STEREODELAY_CS_48KHZ                   512         /* Sample rate 48kS/s */
    627 
    628 /* Reverb coefficients for 8000 Hz sample rate, scaled with 1.038030 */
    629 #define CS_REVERB_8000_A0                         21865         /* Floating point value 0.667271 */
    630 #define CS_REVERB_8000_A1                       (-21865)        /* Floating point value -0.667271 */
    631 #define CS_REVERB_8000_A2                             0         /* Floating point value 0.000000 */
    632 #define CS_REVERB_8000_B1                       (-21895)        /* Floating point value -0.668179 */
    633 #define CS_REVERB_8000_B2                             0         /* Floating point value 0.000000 */
    634 #define CS_REVERB_8000_SCALE                         15
    635 
    636 /* Reverb coefficients for 11025Hz sample rate, scaled with 1.038030 */
    637 #define CS_REVERB_11025_A0                        22926         /* Floating point value 0.699638 */
    638 #define CS_REVERB_11025_A1                      (-22926)        /* Floating point value -0.699638 */
    639 #define CS_REVERB_11025_A2                            0         /* Floating point value 0.000000 */
    640 #define CS_REVERB_11025_B1                      (-24546)        /* Floating point value -0.749096 */
    641 #define CS_REVERB_11025_B2                            0         /* Floating point value 0.000000 */
    642 #define CS_REVERB_11025_SCALE                        15
    643 
    644 /* Reverb coefficients for 12000Hz sample rate, scaled with 1.038030 */
    645 #define CS_REVERB_12000_A0                        23165         /* Floating point value 0.706931 */
    646 #define CS_REVERB_12000_A1                      (-23165)        /* Floating point value -0.706931 */
    647 #define CS_REVERB_12000_A2                            0         /* Floating point value 0.000000 */
    648 #define CS_REVERB_12000_B1                      (-25144)        /* Floating point value -0.767327 */
    649 #define CS_REVERB_12000_B2                            0         /* Floating point value 0.000000 */
    650 #define CS_REVERB_12000_SCALE                        15
    651 
    652 /* Reverb coefficients for 16000Hz sample rate, scaled with 1.038030 */
    653 #define CS_REVERB_16000_A0                        23864         /* Floating point value 0.728272 */
    654 #define CS_REVERB_16000_A1                      (-23864)        /* Floating point value -0.728272 */
    655 #define CS_REVERB_16000_A2                            0         /* Floating point value 0.000000 */
    656 #define CS_REVERB_16000_B1                      (-26892)        /* Floating point value -0.820679 */
    657 #define CS_REVERB_16000_B2                            0         /* Floating point value 0.000000 */
    658 #define CS_REVERB_16000_SCALE                        15
    659 
    660 /* Reverb coefficients for 22050Hz sample rate, scaled with 1.038030 */
    661 #define CS_REVERB_22050_A0                        16921         /* Floating point value 0.516396 */
    662 #define CS_REVERB_22050_A1                            0         /* Floating point value 0.000000 */
    663 #define CS_REVERB_22050_A2                      (-16921)        /* Floating point value -0.516396 */
    664 #define CS_REVERB_22050_B1                      (-16991)        /* Floating point value -0.518512 */
    665 #define CS_REVERB_22050_B2                       (-9535)        /* Floating point value -0.290990 */
    666 #define CS_REVERB_22050_SCALE                        15
    667 
    668 /* Reverb coefficients for 24000Hz sample rate, scaled with 1.038030 */
    669 #define CS_REVERB_24000_A0                        15714         /* Floating point value 0.479565 */
    670 #define CS_REVERB_24000_A1                            0         /* Floating point value 0.000000 */
    671 #define CS_REVERB_24000_A2                      (-15714)        /* Floating point value -0.479565 */
    672 #define CS_REVERB_24000_B1                      (-20898)        /* Floating point value -0.637745 */
    673 #define CS_REVERB_24000_B2                       (-6518)        /* Floating point value -0.198912 */
    674 #define CS_REVERB_24000_SCALE                        15
    675 
    676 /* Reverb coefficients for 32000Hz sample rate, scaled with 1.038030 */
    677 #define CS_REVERB_32000_A0                        12463         /* Floating point value 0.380349 */
    678 #define CS_REVERB_32000_A1                            0         /* Floating point value 0.000000 */
    679 #define CS_REVERB_32000_A2                      (-12463)        /* Floating point value -0.380349 */
    680 #define CS_REVERB_32000_B1                      (-31158)        /* Floating point value -0.950873 */
    681 #define CS_REVERB_32000_B2                         1610         /* Floating point value 0.049127 */
    682 #define CS_REVERB_32000_SCALE                        15
    683 
    684 /* Reverb coefficients for 44100Hz sample rate, scaled with 1.038030 */
    685 #define CS_REVERB_44100_A0                         4872         /* Floating point value 0.297389 */
    686 #define CS_REVERB_44100_A1                            0         /* Floating point value 0.000000 */
    687 #define CS_REVERB_44100_A2                       (-4872)        /* Floating point value -0.297389 */
    688 #define CS_REVERB_44100_B1                      (-19668)        /* Floating point value -1.200423 */
    689 #define CS_REVERB_44100_B2                         4203         /* Floating point value 0.256529 */
    690 #define CS_REVERB_44100_SCALE                        14
    691 
    692 /* Reverb coefficients for 48000Hz sample rate, scaled with 1.038030 */
    693 #define CS_REVERB_48000_A0                         4566         /* Floating point value 0.278661 */
    694 #define CS_REVERB_48000_A1                            0         /* Floating point value 0.000000 */
    695 #define CS_REVERB_48000_A2                       (-4566)        /* Floating point value -0.278661 */
    696 #define CS_REVERB_48000_B1                      (-20562)        /* Floating point value -1.254993 */
    697 #define CS_REVERB_48000_B2                         4970         /* Floating point value 0.303347 */
    698 #define CS_REVERB_48000_SCALE                        14
    699 
    700 /* Reverb Gain Settings */
    701 #define LVCS_HEADPHONE_DELAYGAIN               0.800000         /* Algorithm delay path gain */
    702 #define LVCS_HEADPHONE_OUTPUTGAIN              1.000000         /* Algorithm output gain */
    703 #define LVCS_HEADPHONE_PROCGAIN                   18403         /* Processed path gain */
    704 #define LVCS_HEADPHONE_UNPROCGAIN                 18403         /* Unprocessed path gain */
    705 #define LVCS_HEADPHONE_GAINCORRECT             1.009343         /* Delay mixer gain correction */
    706 
    707 
    708 /************************************************************************************/
    709 /*                                                                                  */
    710 /* The Equaliser                                                                    */
    711 /*                                                                                  */
    712 /************************************************************************************/
    713 
    714 /* Equaliser coefficients for 8000 Hz sample rate, CS scaled with 1.038497 and CSEX scaled with 0.775480 */
    715 #define CS_EQUALISER_8000_A0                      20698         /* Floating point value 1.263312 */
    716 #define CS_EQUALISER_8000_A1                     (-9859)        /* Floating point value -0.601748 */
    717 #define CS_EQUALISER_8000_A2                     (-4599)        /* Floating point value -0.280681 */
    718 #define CS_EQUALISER_8000_B1                     (-7797)        /* Floating point value -0.475865 */
    719 #define CS_EQUALISER_8000_B2                     (-6687)        /* Floating point value -0.408154 */
    720 #define CS_EQUALISER_8000_SCALE                      14
    721 #define CSEX_EQUALISER_8000_A0                    30912         /* Floating point value 0.943357 */
    722 #define CSEX_EQUALISER_8000_A1                  (-14724)        /* Floating point value -0.449345 */
    723 #define CSEX_EQUALISER_8000_A2                   (-6868)        /* Floating point value -0.209594 */
    724 #define CSEX_EQUALISER_8000_B1                  (-15593)        /* Floating point value -0.475865 */
    725 #define CSEX_EQUALISER_8000_B2                  (-13374)        /* Floating point value -0.408154 */
    726 #define CSEX_EQUALISER_8000_SCALE                    15
    727 
    728 /* Equaliser coefficients for 11025Hz sample rate, CS scaled with 1.027761 and CSEX scaled with 0.767463 */
    729 #define CS_EQUALISER_11025_A0                     18041         /* Floating point value 1.101145 */
    730 #define CS_EQUALISER_11025_A1                      2278         /* Floating point value 0.139020 */
    731 #define CS_EQUALISER_11025_A2                   (-14163)        /* Floating point value -0.864423 */
    732 #define CS_EQUALISER_11025_B1                       402         /* Floating point value 0.024541 */
    733 #define CS_EQUALISER_11025_B2                   (-14892)        /* Floating point value -0.908930 */
    734 #define CS_EQUALISER_11025_SCALE                     14
    735 #define CSEX_EQUALISER_11025_A0                   31983         /* Floating point value 0.976058 */
    736 #define CSEX_EQUALISER_11025_A1                 (-22784)        /* Floating point value -0.695326 */
    737 #define CSEX_EQUALISER_11025_A2                  (-2976)        /* Floating point value -0.090809 */
    738 #define CSEX_EQUALISER_11025_B1                 (-20008)        /* Floating point value -0.610594 */
    739 #define CSEX_EQUALISER_11025_B2                 (-10196)        /* Floating point value -0.311149 */
    740 #define CSEX_EQUALISER_11025_SCALE                   15
    741 
    742 /* Equaliser coefficients for 12000Hz sample rate, CS scaled with 1.032521 and CSEX scaled with 0.771017 */
    743 #define CS_EQUALISER_12000_A0                     20917         /* Floating point value 1.276661 */
    744 #define CS_EQUALISER_12000_A1                   (-16671)        /* Floating point value -1.017519 */
    745 #define CS_EQUALISER_12000_A2                     (-723)        /* Floating point value -0.044128 */
    746 #define CS_EQUALISER_12000_B1                   (-11954)        /* Floating point value -0.729616 */
    747 #define CS_EQUALISER_12000_B2                    (-3351)        /* Floating point value -0.204532 */
    748 #define CS_EQUALISER_12000_SCALE                     14
    749 #define CSEX_EQUALISER_12000_A0                   16500         /* Floating point value 1.007095 */
    750 #define CSEX_EQUALISER_12000_A1                 (-14285)        /* Floating point value -0.871912 */
    751 #define CSEX_EQUALISER_12000_A2                     381         /* Floating point value 0.023232 */
    752 #define CSEX_EQUALISER_12000_B1                 (-12220)        /* Floating point value -0.745857 */
    753 #define CSEX_EQUALISER_12000_B2                  (-3099)        /* Floating point value -0.189171 */
    754 #define CSEX_EQUALISER_12000_SCALE                   14
    755 
    756 /* Equaliser coefficients for 16000Hz sample rate, CS scaled with 1.031378 and CSEX scaled with 0.770164 */
    757 #define CS_EQUALISER_16000_A0                     20998         /* Floating point value 1.281629 */
    758 #define CS_EQUALISER_16000_A1                   (-17627)        /* Floating point value -1.075872 */
    759 #define CS_EQUALISER_16000_A2                     (-678)        /* Floating point value -0.041365 */
    760 #define CS_EQUALISER_16000_B1                   (-11882)        /* Floating point value -0.725239 */
    761 #define CS_EQUALISER_16000_B2                    (-3676)        /* Floating point value -0.224358 */
    762 #define CS_EQUALISER_16000_SCALE                     14
    763 #define CSEX_EQUALISER_16000_A0                   17713         /* Floating point value 1.081091 */
    764 #define CSEX_EQUALISER_16000_A1                 (-14208)        /* Floating point value -0.867183 */
    765 #define CSEX_EQUALISER_16000_A2                  (-1151)        /* Floating point value -0.070247 */
    766 #define CSEX_EQUALISER_16000_B1                  (-8440)        /* Floating point value -0.515121 */
    767 #define CSEX_EQUALISER_16000_B2                  (-6978)        /* Floating point value -0.425893 */
    768 #define CSEX_EQUALISER_16000_SCALE                   14
    769 
    770 /* Equaliser coefficients for 22050Hz sample rate, CS scaled with 1.041576 and CSEX scaled with 0.777779 */
    771 #define CS_EQUALISER_22050_A0                     22751         /* Floating point value 1.388605 */
    772 #define CS_EQUALISER_22050_A1                   (-21394)        /* Floating point value -1.305799 */
    773 #define CS_EQUALISER_22050_A2                       654         /* Floating point value 0.039922 */
    774 #define CS_EQUALISER_22050_B1                   (-11788)        /* Floating point value -0.719494 */
    775 #define CS_EQUALISER_22050_B2                    (-3985)        /* Floating point value -0.243245 */
    776 #define CS_EQUALISER_22050_SCALE                     14
    777 #define CSEX_EQUALISER_22050_A0                   20855         /* Floating point value 1.272910 */
    778 #define CSEX_EQUALISER_22050_A1                 (-21971)        /* Floating point value -1.341014 */
    779 #define CSEX_EQUALISER_22050_A2                    2744         /* Floating point value 0.167462 */
    780 #define CSEX_EQUALISER_22050_B1                 (-10063)        /* Floating point value -0.614219 */
    781 #define CSEX_EQUALISER_22050_B2                  (-5659)        /* Floating point value -0.345384 */
    782 #define CSEX_EQUALISER_22050_SCALE                   14
    783 
    784 /* Equaliser coefficients for 24000Hz sample rate, CS scaled with 1.034495 and CSEX scaled with 0.772491 */
    785 #define CS_EQUALISER_24000_A0                     23099         /* Floating point value 1.409832 */
    786 #define CS_EQUALISER_24000_A1                   (-23863)        /* Floating point value -1.456506 */
    787 #define CS_EQUALISER_24000_A2                      2481         /* Floating point value 0.151410 */
    788 #define CS_EQUALISER_24000_B1                   (-13176)        /* Floating point value -0.804201 */
    789 #define CS_EQUALISER_24000_B2                    (-2683)        /* Floating point value -0.163783 */
    790 #define CS_EQUALISER_24000_SCALE                     14
    791 #define CSEX_EQUALISER_24000_A0                   21286         /* Floating point value 1.299198 */
    792 #define CSEX_EQUALISER_24000_A1                 (-23797)        /* Floating point value -1.452447 */
    793 #define CSEX_EQUALISER_24000_A2                    3940         /* Floating point value 0.240489 */
    794 #define CSEX_EQUALISER_24000_B1                 (-10966)        /* Floating point value -0.669303 */
    795 #define CSEX_EQUALISER_24000_B2                  (-4833)        /* Floating point value -0.294984 */
    796 #define CSEX_EQUALISER_24000_SCALE                   14
    797 
    798 /* Equaliser coefficients for 32000Hz sample rate, CS scaled with 1.044559 and CSEX scaled with 0.780006 */
    799 #define CS_EQUALISER_32000_A0                     25575         /* Floating point value 1.560988 */
    800 #define CS_EQUALISER_32000_A1                   (-30765)        /* Floating point value -1.877724 */
    801 #define CS_EQUALISER_32000_A2                      6386         /* Floating point value 0.389741 */
    802 #define CS_EQUALISER_32000_B1                   (-14867)        /* Floating point value -0.907410 */
    803 #define CS_EQUALISER_32000_B2                    (-1155)        /* Floating point value -0.070489 */
    804 #define CS_EQUALISER_32000_SCALE                     14
    805 #define CSEX_EQUALISER_32000_A0                   14623         /* Floating point value 1.785049 */
    806 #define CSEX_EQUALISER_32000_A1                 (-18297)        /* Floating point value -2.233497 */
    807 #define CSEX_EQUALISER_32000_A2                    4313         /* Floating point value 0.526431 */
    808 #define CSEX_EQUALISER_32000_B1                  (-3653)        /* Floating point value -0.445939 */
    809 #define CSEX_EQUALISER_32000_B2                  (-4280)        /* Floating point value -0.522446 */
    810 #define CSEX_EQUALISER_32000_SCALE                   13
    811 
    812 /* Equaliser coefficients for 44100Hz sample rate, CS scaled with 1.022170 and CSEX scaled with 0.763288 */
    813 #define CS_EQUALISER_44100_A0                     13304         /* Floating point value 1.623993 */
    814 #define CS_EQUALISER_44100_A1                   (-18602)        /* Floating point value -2.270743 */
    815 #define CS_EQUALISER_44100_A2                      5643         /* Floating point value 0.688829 */
    816 #define CS_EQUALISER_44100_B1                    (-9152)        /* Floating point value -1.117190 */
    817 #define CS_EQUALISER_44100_B2                      1067         /* Floating point value 0.130208 */
    818 #define CS_EQUALISER_44100_SCALE                     13
    819 #define CSEX_EQUALISER_44100_A0                   16616         /* Floating point value 2.028315 */
    820 #define CSEX_EQUALISER_44100_A1                 (-23613)        /* Floating point value -2.882459 */
    821 #define CSEX_EQUALISER_44100_A2                    7410         /* Floating point value 0.904535 */
    822 #define CSEX_EQUALISER_44100_B1                  (-4860)        /* Floating point value -0.593308 */
    823 #define CSEX_EQUALISER_44100_B2                  (-3161)        /* Floating point value -0.385816 */
    824 #define CSEX_EQUALISER_44100_SCALE                   13
    825 
    826 /* Equaliser coefficients for 48000Hz sample rate, CS scaled with 1.018635 and CSEX scaled with 0.760648 */
    827 #define CS_EQUALISER_48000_A0                     13445         /* Floating point value 1.641177 */
    828 #define CS_EQUALISER_48000_A1                   (-19372)        /* Floating point value -2.364687 */
    829 #define CS_EQUALISER_48000_A2                      6225         /* Floating point value 0.759910 */
    830 #define CS_EQUALISER_48000_B1                    (-9558)        /* Floating point value -1.166774 */
    831 #define CS_EQUALISER_48000_B2                      1459         /* Floating point value 0.178074 */
    832 #define CS_EQUALISER_48000_SCALE                     13
    833 #define CSEX_EQUALISER_48000_A0                   17200         /* Floating point value 2.099655 */
    834 #define CSEX_EQUALISER_48000_A1                 (-25110)        /* Floating point value -3.065220 */
    835 #define CSEX_EQUALISER_48000_A2                    8277         /* Floating point value 1.010417 */
    836 #define CSEX_EQUALISER_48000_B1                  (-5194)        /* Floating point value -0.634021 */
    837 #define CSEX_EQUALISER_48000_B2                  (-2845)        /* Floating point value -0.347332 */
    838 #define CSEX_EQUALISER_48000_SCALE                   13
    839 
    840 
    841 /************************************************************************************/
    842 /*                                                                                  */
    843 /* The Output Gain Correction                                                       */
    844 /*                                                                                  */
    845 /************************************************************************************/
    846 
    847 #define LVCS_HEADPHONE_SHIFT                          2              /* Output Shift */
    848 #define LVCS_HEADPHONE_SHIFTLOSS                  27779              /* Output Shift loss */
    849 #define LVCS_HEADPHONE_GAIN                        6840              /* Unprocessed path gain */
    850 #define LVCS_EX_HEADPHONE_SHIFT                       3              /* EX Output Shift */
    851 #define LVCS_EX_HEADPHONE_SHIFTLOSS               18600              /* EX Output Shift loss */
    852 #define LVCS_EX_HEADPHONE_GAIN                     5108              /* EX Unprocessed path gain */
    853 #endif
    854 #endif
    855 
    856