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