1 /********************************************************************
3 * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
6 * PLEASE READ THESE TERMS DISTRIBUTING. *
8 * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-2000 *
9 * by Monty <monty@xiph.org> and The XIPHOPHORUS Company *
10 * http://www.xiph.org/ *
12 ********************************************************************
14 function: generic euclidian distance metric for VQ codebooks
15 last mod: $Id: genericdata.c,v 1.2 2000/01/05 15:04:57 xiphmont Exp $
17 ********************************************************************/
25 char *vqext_booktype="GENERICdata";
27 quant_meta q={0,0,0,0}; /* non sequence data; each scalar
30 double *vqext_weight(vqgen *v,double *p){
35 /* candidate,actual */
36 double vqext_metric(vqgen *v,double *e, double *p){
39 for(i=0;i<v->elements;i++){
43 return sqrt(acc/v->elements);
46 void vqext_addpoint_adj(vqgen *v,double *b,int start,int dim,int cols){
47 vqgen_addpoint(v,b+start,NULL);
50 void vqext_preprocess(vqgen *v){