1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
6 * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
11 ********************************************************************
13 function: build a VQ codebook
14 last mod: $Id: vqgen.h,v 1.17 2001/02/02 03:52:28 xiphmont Exp $
16 ********************************************************************/
44 float (*metric_func) (struct vqgen *v,float *entry,float *point);
45 float *(*weight_func) (struct vqgen *v,float *point);
51 long min; /* packed 24 bit float */
52 long delta; /* packed 24 bit float */
53 int quant; /* 0 < quant <= 16 */
54 int sequencep; /* bitflag */
57 static inline float *_point(vqgen *v,long ptr){
58 return v->pointlist+((v->elements+v->aux)*ptr);
61 static inline float *_aux(vqgen *v,long ptr){
62 return _point(v,ptr)+v->aux;
65 static inline float *_now(vqgen *v,long ptr){
66 return v->entrylist+(v->elements*ptr);
69 extern void vqgen_init(vqgen *v,
70 int elements,int aux,int entries,float mindist,
71 float (*metric)(vqgen *,float *, float *),
72 float *(*weight)(vqgen *,float *),int centroid);
73 extern void vqgen_addpoint(vqgen *v, float *p,float *aux);
75 extern float vqgen_iterate(vqgen *v,int biasp);
76 extern void vqgen_unquantize(vqgen *v,quant_meta *q);
77 extern void vqgen_quantize(vqgen *v,quant_meta *q);
78 extern void vqgen_cellmetric(vqgen *v);