X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Fanalysis.c;h=0e11a167be8dec155075c672fba38be75d5995bb;hb=679433ebb8287744a9801f847b7a105dbc2a0404;hp=4fb90c33b0cab9862ca13a026c07662e3fb826fa;hpb=2637317a9b56e7c6439f6ba8459dc574db3402ef;p=platform%2Fupstream%2Flibvorbis.git diff --git a/lib/analysis.c b/lib/analysis.c index 4fb90c3..0e11a16 100644 --- a/lib/analysis.c +++ b/lib/analysis.c @@ -5,13 +5,12 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * - * by the XIPHOPHORUS Company http://www.xiph.org/ * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * + * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: single-block PCM analysis mode dispatch - last mod: $Id: analysis.c,v 1.55 2002/07/11 06:40:48 xiphmont Exp $ ********************************************************************/ @@ -26,11 +25,10 @@ #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; + int ret,i; + vorbis_block_internal *vbi=vb->internal; vb->glue_bits=0; vb->time_bits=0; @@ -38,8 +36,9 @@ int vorbis_analysis(vorbis_block *vb, ogg_packet *op){ vb->res_bits=0; /* first things first. Make sure encode is ready */ - oggpack_reset(&vb->opb); - + for(i=0;ipacketblob[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 */ @@ -52,7 +51,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; @@ -63,49 +62,50 @@ 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){ 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