root/sound/aoa/codecs/tas-gain-table.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /* SPDX-License-Identifier: GPL-2.0 */
   2 /*
   3  This is the program used to generate below table.
   4 
   5 #include <stdio.h>
   6 #include <math.h>
   7 int main() {
   8   int dB2;
   9   printf("/" "* This file is only included exactly once!\n");
  10   printf(" *\n");
  11   printf(" * If they'd only tell us that generating this table was\n");
  12   printf(" * as easy as calculating\n");
  13   printf(" *      hwvalue = 1048576.0*exp(0.057564628*dB*2)\n");
  14   printf(" * :) *" "/\n");
  15   printf("static int tas_gaintable[] = {\n");
  16   printf("      0x000000, /" "* -infinity dB *" "/\n");
  17   for (dB2=-140;dB2<=36;dB2++)
  18     printf("    0x%.6x, /" "* %-02.1f dB *" "/\n", (int)(1048576.0*exp(0.057564628*dB2)), dB2/2.0);
  19   printf("};\n\n");
  20 }
  21 
  22 */
  23 
  24 /* This file is only included exactly once!
  25  *
  26  * If they'd only tell us that generating this table was
  27  * as easy as calculating
  28  *      hwvalue = 1048576.0*exp(0.057564628*dB*2)
  29  * :) */
  30 static int tas_gaintable[] = {
  31         0x000000, /* -infinity dB */
  32         0x00014b, /* -70.0 dB */
  33         0x00015f, /* -69.5 dB */
  34         0x000174, /* -69.0 dB */
  35         0x00018a, /* -68.5 dB */
  36         0x0001a1, /* -68.0 dB */
  37         0x0001ba, /* -67.5 dB */
  38         0x0001d4, /* -67.0 dB */
  39         0x0001f0, /* -66.5 dB */
  40         0x00020d, /* -66.0 dB */
  41         0x00022c, /* -65.5 dB */
  42         0x00024d, /* -65.0 dB */
  43         0x000270, /* -64.5 dB */
  44         0x000295, /* -64.0 dB */
  45         0x0002bc, /* -63.5 dB */
  46         0x0002e6, /* -63.0 dB */
  47         0x000312, /* -62.5 dB */
  48         0x000340, /* -62.0 dB */
  49         0x000372, /* -61.5 dB */
  50         0x0003a6, /* -61.0 dB */
  51         0x0003dd, /* -60.5 dB */
  52         0x000418, /* -60.0 dB */
  53         0x000456, /* -59.5 dB */
  54         0x000498, /* -59.0 dB */
  55         0x0004de, /* -58.5 dB */
  56         0x000528, /* -58.0 dB */
  57         0x000576, /* -57.5 dB */
  58         0x0005c9, /* -57.0 dB */
  59         0x000620, /* -56.5 dB */
  60         0x00067d, /* -56.0 dB */
  61         0x0006e0, /* -55.5 dB */
  62         0x000748, /* -55.0 dB */
  63         0x0007b7, /* -54.5 dB */
  64         0x00082c, /* -54.0 dB */
  65         0x0008a8, /* -53.5 dB */
  66         0x00092b, /* -53.0 dB */
  67         0x0009b6, /* -52.5 dB */
  68         0x000a49, /* -52.0 dB */
  69         0x000ae5, /* -51.5 dB */
  70         0x000b8b, /* -51.0 dB */
  71         0x000c3a, /* -50.5 dB */
  72         0x000cf3, /* -50.0 dB */
  73         0x000db8, /* -49.5 dB */
  74         0x000e88, /* -49.0 dB */
  75         0x000f64, /* -48.5 dB */
  76         0x00104e, /* -48.0 dB */
  77         0x001145, /* -47.5 dB */
  78         0x00124b, /* -47.0 dB */
  79         0x001361, /* -46.5 dB */
  80         0x001487, /* -46.0 dB */
  81         0x0015be, /* -45.5 dB */
  82         0x001708, /* -45.0 dB */
  83         0x001865, /* -44.5 dB */
  84         0x0019d8, /* -44.0 dB */
  85         0x001b60, /* -43.5 dB */
  86         0x001cff, /* -43.0 dB */
  87         0x001eb7, /* -42.5 dB */
  88         0x002089, /* -42.0 dB */
  89         0x002276, /* -41.5 dB */
  90         0x002481, /* -41.0 dB */
  91         0x0026ab, /* -40.5 dB */
  92         0x0028f5, /* -40.0 dB */
  93         0x002b63, /* -39.5 dB */
  94         0x002df5, /* -39.0 dB */
  95         0x0030ae, /* -38.5 dB */
  96         0x003390, /* -38.0 dB */
  97         0x00369e, /* -37.5 dB */
  98         0x0039db, /* -37.0 dB */
  99         0x003d49, /* -36.5 dB */
 100         0x0040ea, /* -36.0 dB */
 101         0x0044c3, /* -35.5 dB */
 102         0x0048d6, /* -35.0 dB */
 103         0x004d27, /* -34.5 dB */
 104         0x0051b9, /* -34.0 dB */
 105         0x005691, /* -33.5 dB */
 106         0x005bb2, /* -33.0 dB */
 107         0x006121, /* -32.5 dB */
 108         0x0066e3, /* -32.0 dB */
 109         0x006cfb, /* -31.5 dB */
 110         0x007370, /* -31.0 dB */
 111         0x007a48, /* -30.5 dB */
 112         0x008186, /* -30.0 dB */
 113         0x008933, /* -29.5 dB */
 114         0x009154, /* -29.0 dB */
 115         0x0099f1, /* -28.5 dB */
 116         0x00a310, /* -28.0 dB */
 117         0x00acba, /* -27.5 dB */
 118         0x00b6f6, /* -27.0 dB */
 119         0x00c1cd, /* -26.5 dB */
 120         0x00cd49, /* -26.0 dB */
 121         0x00d973, /* -25.5 dB */
 122         0x00e655, /* -25.0 dB */
 123         0x00f3fb, /* -24.5 dB */
 124         0x010270, /* -24.0 dB */
 125         0x0111c0, /* -23.5 dB */
 126         0x0121f9, /* -23.0 dB */
 127         0x013328, /* -22.5 dB */
 128         0x01455b, /* -22.0 dB */
 129         0x0158a2, /* -21.5 dB */
 130         0x016d0e, /* -21.0 dB */
 131         0x0182af, /* -20.5 dB */
 132         0x019999, /* -20.0 dB */
 133         0x01b1de, /* -19.5 dB */
 134         0x01cb94, /* -19.0 dB */
 135         0x01e6cf, /* -18.5 dB */
 136         0x0203a7, /* -18.0 dB */
 137         0x022235, /* -17.5 dB */
 138         0x024293, /* -17.0 dB */
 139         0x0264db, /* -16.5 dB */
 140         0x02892c, /* -16.0 dB */
 141         0x02afa3, /* -15.5 dB */
 142         0x02d862, /* -15.0 dB */
 143         0x03038a, /* -14.5 dB */
 144         0x033142, /* -14.0 dB */
 145         0x0361af, /* -13.5 dB */
 146         0x0394fa, /* -13.0 dB */
 147         0x03cb50, /* -12.5 dB */
 148         0x0404de, /* -12.0 dB */
 149         0x0441d5, /* -11.5 dB */
 150         0x048268, /* -11.0 dB */
 151         0x04c6d0, /* -10.5 dB */
 152         0x050f44, /* -10.0 dB */
 153         0x055c04, /* -9.5 dB */
 154         0x05ad50, /* -9.0 dB */
 155         0x06036e, /* -8.5 dB */
 156         0x065ea5, /* -8.0 dB */
 157         0x06bf44, /* -7.5 dB */
 158         0x07259d, /* -7.0 dB */
 159         0x079207, /* -6.5 dB */
 160         0x0804dc, /* -6.0 dB */
 161         0x087e80, /* -5.5 dB */
 162         0x08ff59, /* -5.0 dB */
 163         0x0987d5, /* -4.5 dB */
 164         0x0a1866, /* -4.0 dB */
 165         0x0ab189, /* -3.5 dB */
 166         0x0b53be, /* -3.0 dB */
 167         0x0bff91, /* -2.5 dB */
 168         0x0cb591, /* -2.0 dB */
 169         0x0d765a, /* -1.5 dB */
 170         0x0e4290, /* -1.0 dB */
 171         0x0f1adf, /* -0.5 dB */
 172         0x100000, /* 0.0 dB */
 173         0x10f2b4, /* 0.5 dB */
 174         0x11f3c9, /* 1.0 dB */
 175         0x13041a, /* 1.5 dB */
 176         0x14248e, /* 2.0 dB */
 177         0x15561a, /* 2.5 dB */
 178         0x1699c0, /* 3.0 dB */
 179         0x17f094, /* 3.5 dB */
 180         0x195bb8, /* 4.0 dB */
 181         0x1adc61, /* 4.5 dB */
 182         0x1c73d5, /* 5.0 dB */
 183         0x1e236d, /* 5.5 dB */
 184         0x1fec98, /* 6.0 dB */
 185         0x21d0d9, /* 6.5 dB */
 186         0x23d1cd, /* 7.0 dB */
 187         0x25f125, /* 7.5 dB */
 188         0x2830af, /* 8.0 dB */
 189         0x2a9254, /* 8.5 dB */
 190         0x2d1818, /* 9.0 dB */
 191         0x2fc420, /* 9.5 dB */
 192         0x3298b0, /* 10.0 dB */
 193         0x35982f, /* 10.5 dB */
 194         0x38c528, /* 11.0 dB */
 195         0x3c224c, /* 11.5 dB */
 196         0x3fb278, /* 12.0 dB */
 197         0x4378b0, /* 12.5 dB */
 198         0x477829, /* 13.0 dB */
 199         0x4bb446, /* 13.5 dB */
 200         0x5030a1, /* 14.0 dB */
 201         0x54f106, /* 14.5 dB */
 202         0x59f980, /* 15.0 dB */
 203         0x5f4e52, /* 15.5 dB */
 204         0x64f403, /* 16.0 dB */
 205         0x6aef5e, /* 16.5 dB */
 206         0x714575, /* 17.0 dB */
 207         0x77fbaa, /* 17.5 dB */
 208         0x7f17af, /* 18.0 dB */
 209 };
 210 

/* [<][>][^][v][top][bottom][index][help] */