diff options
author | Monty <xiphmont@xiph.org> | 2001-05-27 06:44:07 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2001-05-27 06:44:07 +0000 |
commit | 939a038b6faf62b95d599e72564498c71db4b2af (patch) | |
tree | f89c69453cd40460ba7ec76b8c12ce92e31f383f /lib/analysis.c | |
parent | d734a5096d793cb30e4c1f45519f193bf968b249 (diff) | |
download | libvorbis-git-939a038b6faf62b95d599e72564498c71db4b2af.tar.gz |
Floor 1
Res 1
Vorbisfile fixes/opts
now all on mainline
svn path=/trunk/vorbis/; revision=1458
Diffstat (limited to 'lib/analysis.c')
-rw-r--r-- | lib/analysis.c | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/lib/analysis.c b/lib/analysis.c index 5273b034..85f2368c 100644 --- a/lib/analysis.c +++ b/lib/analysis.c @@ -11,7 +11,7 @@ ******************************************************************** function: single-block PCM analysis mode dispatch - last mod: $Id: analysis.c,v 1.43 2001/02/26 03:50:41 xiphmont Exp $ + last mod: $Id: analysis.c,v 1.44 2001/05/27 06:43:59 xiphmont Exp $ ********************************************************************/ @@ -75,32 +75,40 @@ int vorbis_analysis(vorbis_block *vb,ogg_packet *op){ } /* there was no great place to put this.... */ -void _analysis_output(char *base,int i,float *v,int n,int bark,int dB){ -#ifdef ANALYSIS +void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB){ int j; FILE *of; char buffer[80]; - sprintf(buffer,"%s_%d.m",base,i); - of=fopen(buffer,"w"); - - if(!of)perror("failed to open data dump file"); - for(j=0;j<n;j++){ - if(dB && v[j]==0) - fprintf(of,"\n\n"); - else{ - if(bark) - fprintf(of,"%g ",toBARK(22050.f*j/n)); - else - fprintf(of,"%g ",(double)j); - - if(dB){ - fprintf(of,"%g\n",todB(fabs(v[j]))); - }else{ - fprintf(of,"%g\n",v[j]); + // if(i==5870){ + sprintf(buffer,"%s_%d.m",base,i); + of=fopen(buffer,"w"); + + if(!of)perror("failed to open data dump file"); + + for(j=0;j<n;j++){ + if(dB && v[j]==0) + fprintf(of,"\n\n"); + else{ + if(bark) + fprintf(of,"%g ",toBARK(22050.f*j/n)); + else + fprintf(of,"%g ",(double)j); + + if(dB){ + fprintf(of,"%g\n",todB(v+j)); + }else{ + fprintf(of,"%g\n",v[j]); + } } } - } - fclose(of); + fclose(of); + // } +} + +void _analysis_output(char *base,int i,float *v,int n,int bark,int dB){ +#ifdef ANALYSIS + _analysis_output_always(base,i,v,n,bark,dB); #endif } + |