From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [RFC 5/8] snd-aoa: add codecs Date: Fri, 02 Jun 2006 16:31:49 +0200 Message-ID: References: <20060601115844.343214000@sipsolutions.net> <20060601115848.075177000@sipsolutions.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id 2340D156 for ; Fri, 2 Jun 2006 16:31:50 +0200 (MEST) In-Reply-To: <20060601115848.075177000@sipsolutions.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Johannes Berg Cc: linuxppc-dev@ozlabs.org, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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 > +#include > +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