svn path=/trunk/vorbis/; revision=2632
********************************************************************
function: channel mapping 0 implementation
********************************************************************
function: channel mapping 0 implementation
- last mod: $Id: mapping0.c,v 1.39 2001/12/16 04:15:46 xiphmont Exp $
+ last mod: $Id: mapping0.c,v 1.40 2001/12/18 00:55:53 segher Exp $
********************************************************************/
********************************************************************/
for(i=0;i<vi->channels;i++){
float scale=4.f/n;
for(i=0;i<vi->channels;i++){
float scale=4.f/n;
/* the following makes things clearer to *me* anyway */
float *pcm =vb->pcm[i];
/* the following makes things clearer to *me* anyway */
float *pcm =vb->pcm[i];
float *logmax =work;
float *logmask =work+n/2;*/
float *logmax =work;
float *logmask =work+n/2;*/
_analysis_output("pcm",seq+i,pcm,n,0,0);
/* window the PCM data */
_analysis_output("pcm",seq+i,pcm,n,0,0);
/* window the PCM data */
logfft[0]=todB(fft);
local_ampmax[i]=logfft[0];
for(j=1;j<n-1;j+=2){
logfft[0]=todB(fft);
local_ampmax[i]=logfft[0];
for(j=1;j<n-1;j+=2){
- float temp=scale*FAST_HYPOT(fft[j],fft[j+1]);
- temp=logfft[(j+1)>>1]=todB(&temp);
+ float temp=fft[j]*fft[j]+fft[j+1]*fft[j+1];
+ temp=logfft[(j+1)>>1]=scale_dB+.5f*todB(&temp);
if(temp>local_ampmax[i])local_ampmax[i]=temp;
}
if(temp>local_ampmax[i])local_ampmax[i]=temp;
}