Commit 321cfc8e authored by Monty's avatar Monty
Browse files

analysis output / trailing whitespace cleanup


svn path=/trunk/vorbis/; revision=16226
parent 96057350
......@@ -26,8 +26,6 @@
#include "os.h"
#include "misc.h"
int analysis_noisy=1;
/* decides between modes, dispatches to the appropriate mapping. */
int vorbis_analysis(vorbis_block *vb, ogg_packet *op){
int ret,i;
......@@ -41,7 +39,7 @@ int vorbis_analysis(vorbis_block *vb, ogg_packet *op){
/* first things first. Make sure encode is ready */
for(i=0;i<PACKETBLOBS;i++)
oggpack_reset(vbi->packetblob[i]);
/* we only have one mapping type (0), and we let the mapping code
itself figure out what soft mode to use. This allows easier
bitrate management */
......@@ -54,7 +52,7 @@ int vorbis_analysis(vorbis_block *vb, ogg_packet *op){
/* The app is using a bitmanaged mode... but not using the
bitrate management interface. */
return(OV_EINVAL);
op->packet=oggpack_get_buffer(&vb->opb);
op->bytes=oggpack_bytes(&vb->opb);
op->b_o_s=0;
......@@ -65,43 +63,42 @@ int vorbis_analysis(vorbis_block *vb, ogg_packet *op){
return(0);
}
#ifdef ANALYSIS
int analysis_noisy=1;
/* there was no great place to put this.... */
void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off){
#if 0
int j;
FILE *of;
char buffer[80];
/* 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(bark){
float b=toBARK((4000.f*j/n)+.25);
fprintf(of,"%f ",b);
}else
if(off!=0)
fprintf(of,"%f ",(double)(j+off)/8000.);
else
fprintf(of,"%f ",(double)j);
if(dB){
float val;
if(v[j]==0.)
val=-140.;
else
val=todB(v+j);
fprintf(of,"%f\n",val);
}else{
fprintf(of,"%f\n",v[j]);
}
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(bark){
float b=toBARK((4000.f*j/n)+.25);
fprintf(of,"%f ",b);
}else
if(off!=0)
fprintf(of,"%f ",(double)(j+off)/8000.);
else
fprintf(of,"%f ",(double)j);
if(dB){
float val;
if(v[j]==0.)
val=-140.;
else
val=todB(v+j);
fprintf(of,"%f\n",val);
}else{
fprintf(of,"%f\n",v[j]);
}
fclose(of);
/* } */
#endif
}
fclose(of);
}
void _analysis_output(char *base,int i,float *v,int n,int bark,int dB,
......@@ -109,7 +106,7 @@ void _analysis_output(char *base,int i,float *v,int n,int bark,int dB,
if(analysis_noisy)_analysis_output_always(base,i,v,n,bark,dB,off);
}
#endif
......
......@@ -19,21 +19,25 @@
#define _V_RANDOM_H_
#include "vorbis/codec.h"
extern int analysis_noisy;
extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
extern void _vorbis_block_ripcord(vorbis_block *vb);
#ifdef ANALYSIS
extern int analysis_noisy;
extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB,
ogg_int64_t off);
extern void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,
ogg_int64_t off);
#endif
#ifdef DEBUG_MALLOC
#define _VDBG_GRAPHFILE "malloc.m"
#undef _VDBG_GRAPHFILE
extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);
extern void _VDBG_free(void *ptr,char *file,long line);
extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);
extern void _VDBG_free(void *ptr,char *file,long line);
#ifndef MISC_C
#ifndef MISC_C
#undef _ogg_malloc
#undef _ogg_calloc
#undef _ogg_realloc
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment