X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=vq%2Fvqgen.c;h=0c2f39fb8cc5383d23f5d58f1c1efccb1c17868e;hb=c6195c0098ecca45c52afab2874b4265df0399ce;hp=2b972b5f58e4da86e326946b4b72f7ca4a6a7027;hpb=450addf448f772dad4138742e401725c2d84b879;p=platform%2Fupstream%2Flibvorbis.git diff --git a/vq/vqgen.c b/vq/vqgen.c index 2b972b5..0c2f39f 100644 --- a/vq/vqgen.c +++ b/vq/vqgen.c @@ -85,12 +85,10 @@ void _vqgen_seed(vqgen *v){ /* External calls *******************************************************/ void vqgen_init(vqgen *v,int elements,int entries, - double (*metric)(vqgen *,double *, double *), - int quant){ + double (*metric)(vqgen *,double *, double *)){ memset(v,0,sizeof(vqgen)); v->elements=elements; - v->quantbits=quant; v->allocated=32768; v->pointlist=malloc(v->allocated*v->elements*sizeof(double)); @@ -251,29 +249,6 @@ double vqgen_iterate(vqgen *v){ #endif } - { - /* midpoints must be quantized. but we need to know the range in - order to do so */ - double min,max; - - for(k=0;kelements;k++){ - double delta; - min=max=_now(v,0)[k]; - - for(j=1;jentries;j++){ - double val=_now(v,j)[k]; - if(valmax)max=val; - } - - delta=(max-min)/((1<quantbits)-1); - for(j=0;jentries;j++){ - double val=_now(v,j)[k]; - _now(v,j)[k]=min+delta*rint((val-min)/delta); - } - } - } - asserror/=(v->entries*fdesired); fprintf(stderr,": dist %g(%g) metric error=%g \n", asserror,fdesired,meterror/v->points); @@ -592,7 +567,7 @@ void vqgen_book(vqgen *v,vqbook *b){ b->lengthlist=malloc(b->entries*sizeof(long)); /* first, generate the encoding decision heirarchy */ - fprintf(stderr,"Total leaves: %ld\n", + fprintf(stderr,"Total leaves: %d\n", lp_split(v,b,entryindex,v->entries, pointindex,v->points,0,0)); /* run all training points through the decision tree to get a final