X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=vq%2Fmetrics.c;h=e344a8def2e78a51e5867fbcaa5e8c609ce6dfa4;hb=047e98b20f19e534f0aede6f69593624dfb65dcd;hp=6f7233c5f17735f30718e1dde07809b685070f73;hpb=b6dd3d990ac5e3c8a9b9143cbc80f86cbca361a8;p=platform%2Fupstream%2Flibvorbis.git diff --git a/vq/metrics.c b/vq/metrics.c index 6f7233c..e344a8d 100644 --- a/vq/metrics.c +++ b/vq/metrics.c @@ -1,18 +1,17 @@ /******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * - * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH * - * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * 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-2000 * - * by Monty and the XIPHOPHORUS Company * - * http://www.xiph.org/ * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * + * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: function calls to collect codebook metrics - last mod: $Id: metrics.c,v 1.12 2000/12/21 21:04:49 xiphmont Exp $ + last mod: $Id$ ********************************************************************/ @@ -101,12 +100,12 @@ void cell_spacing(codebook *c){ if(c->c->lengthlist[j]>0){ float localmin=-1.; for(k=0;kc->entries;k++){ - if(c->c->lengthlist[k]>0){ - float this=_dist(c->c->dim,_now(c,j),_now(c,k)); - if(j!=k && - (localmin==-1 || thisc->lengthlist[k]>0){ + float this=_dist(c->c->dim,_now(c,j),_now(c,k)); + if(j!=k && + (localmin==-1 || thisvaluelist+i*dim)[k], - sqrt((histogram_errorsq[book]+i*dim)[k]/histogram[book][i])); + fprintf(out,"%d, %g, %g\n", + i*dim+k,(b->valuelist+i*dim)[k], + sqrt((histogram_errorsq[book]+i*dim)[k]/histogram[book][i])); } } fclose(out); @@ -181,9 +180,9 @@ void process_postprocess(codebook **bs,char *basename){ for(i=0;ivaluelist+i*dim)[k], - (histogram_error[book]+i*dim)[k]/histogram[book][i]); + fprintf(out,"%d, %g, %g\n", + i*dim+k,(b->valuelist+i*dim)[k], + (histogram_error[book]+i*dim)[k]/histogram[book][i]); } } fclose(out); @@ -197,10 +196,10 @@ void process_postprocess(codebook **bs,char *basename){ for(i=0;ivaluelist+i*dim)[k], - (b->valuelist+i*dim)[k]+(histogram_lo[book]+i*dim)[k], - (b->valuelist+i*dim)[k]+(histogram_hi[book]+i*dim)[k]); + fprintf(out,"%d, %g, %g, %g\n", + i*dim+k,(b->valuelist+i*dim)[k], + (b->valuelist+i*dim)[k]+(histogram_lo[book]+i*dim)[k], + (b->valuelist+i*dim)[k]+(histogram_hi[book]+i*dim)[k]); } } fclose(out); @@ -208,7 +207,7 @@ void process_postprocess(codebook **bs,char *basename){ } float process_one(codebook *b,int book,float *a,int dim,int step,int addmul, - float base){ + float base){ int j,entry; float amplitude=0.f; @@ -241,7 +240,7 @@ float process_one(codebook *b,int book,float *a,int dim,int step,int addmul, histogram[book][entry]++; bits+=vorbis_book_codelen(b,entry); - + for(j=0;j.vqh [ +|* ]... \n" - " datafile.vqd [datafile.vqd]...\n\n" - " data can be taken on stdin. -i indicates interleaved coding.\n" - " Output goes to output files:\n" - " basename-me.m: gnuplot: mean error by entry value\n" - " basename-mse.m: gnuplot: mean square error by entry value\n" - " basename-worst.m: gnuplot: worst error by entry value\n" - " basename-distance.m: gnuplot file showing distance probability\n" - "\n"); + "usage: vqmetrics [-i] +|*.vqh [ +|* ]... \n" + " datafile.vqd [datafile.vqd]...\n\n" + " data can be taken on stdin. -i indicates interleaved coding.\n" + " Output goes to output files:\n" + " basename-me.m: gnuplot: mean error by entry value\n" + " basename-mse.m: gnuplot: mean square error by entry value\n" + " basename-worst.m: gnuplot: worst error by entry value\n" + " basename-distance.m: gnuplot file showing distance probability\n" + "\n"); }