********************************************************************
function: utility functions for loading .vqh and .vqd files
- last mod: $Id: bookutil.c,v 1.7 2000/01/28 09:05:19 xiphmont Exp $
+ last mod: $Id: bookutil.c,v 1.8 2000/02/07 19:39:44 xiphmont Exp $
********************************************************************/
while(1){
double C=0.;
- double *p=b->valuelist+t->p[ptr]*c->dim;
- double *q=b->valuelist+t->q[ptr]*c->dim;
+ double *p=b->valuelist+t->p[ptr];
+ double *q=b->valuelist+t->q[ptr];
for(k=0;k<c->dim;k++){
n[k]=p[k]-q[k];
for(k=0;k<c->dim;k++)
C+=n[k]*val[k];
+
if(C>0.) /* in A */
ptr= -t->ptr0[ptr];
else /* in B */
********************************************************************
function: utility main for building codebooks from training sets
- last mod: $Id: build.c,v 1.9 2000/01/21 13:42:36 xiphmont Exp $
+ last mod: $Id: build.c,v 1.10 2000/02/07 19:39:45 xiphmont Exp $
********************************************************************/
for(j=0;j<c.encode_tree->aux;){
fprintf(out,"\t");
for(k=0;k<8 && j<c.encode_tree->aux;k++,j++)
- fprintf(out,"%6ld,",c.encode_tree->p[j]);
+ fprintf(out,"%6ld,",c.encode_tree->p[j]*c.elements);
fprintf(out,"\n");
}
fprintf(out,"};\n\n");
for(j=0;j<c.encode_tree->aux;){
fprintf(out,"\t");
for(k=0;k<8 && j<c.encode_tree->aux;k++,j++)
- fprintf(out,"%6ld,",c.encode_tree->q[j]);
+ fprintf(out,"%6ld,",c.encode_tree->q[j]*c.elements);
fprintf(out,"\n");
}
fprintf(out,"};\n\n");