[Alsa-devel] [RFC 5/8] snd-aoa: add codecs

Takashi Iwai tiwai at suse.de
Sat Jun 3 00:31:49 EST 2006


At Thu, 01 Jun 2006 13:58:49 +0200,
Johannes Berg wrote:
> 
> --- /dev/null
> +++ b/sound/aoa/codecs/snd-aoa-codec-tas-gain-table.h
> @@ -0,0 +1,209 @@
> +/*
> + This is the program used to generate below table.
> +
> +#include <stdio.h>
> +#include <math.h>
> +int main() {
> +  int dB2;
> +  printf("/" "* This file is only included exactly once!\n");
> +  printf(" *\n");
> +  printf(" * If they'd only tell us that generating this table was\n");
> +  printf(" * as easy as calculating\n");
> +  printf(" *      hwvalue = 1048576.0*exp(0.057564628*dB*2)\n");
> +  printf(" * :) *" "/\n");
> +  printf("static int tas_gaintable[] = {\n");
> +  printf("	0x000000, /" "* -infinity dB *" "/\n");
> +  for (dB2=-140;dB2<=36;dB2++)
> +    printf("	0x%.6x, /" "* %-02.1f dB *" "/\n", (int)(1048576.0*exp(0.057564628*dB2)), dB2/2.0);
> +  printf("};\n\n");
> +}

FYI:  We're currently implementing a dB conversion.  So, this will be 
unneeded in future.

But I'll included this as it is now at committing, and fix the dB
things later.


Takashi



More information about the Linuxppc-dev mailing list