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: build a VQ codebook
15 last mod: $Id: vqgen.h,v 1.13 2000/05/08 20:49:51 xiphmont Exp $
17 ********************************************************************/
42 double (*metric_func) (struct vqgen *v,double *entry,double *point);
43 double *(*weight_func) (struct vqgen *v,double *point);
47 long min; /* packed 24 bit float */
48 long delta; /* packed 24 bit float */
49 int quant; /* 0 < quant <= 16 */
50 int sequencep; /* bitflag */
53 static inline double *_point(vqgen *v,long ptr){
54 return v->pointlist+((v->elements+v->aux)*ptr);
57 static inline double *_aux(vqgen *v,long ptr){
58 return _point(v,ptr)+v->aux;
61 static inline double *_now(vqgen *v,long ptr){
62 return v->entrylist+(v->elements*ptr);
65 extern void vqgen_init(vqgen *v,
66 int elements,int aux,int entries,double mindist,
67 double (*metric)(vqgen *,double *, double *),
68 double *(*weight)(vqgen *,double *));
69 extern void vqgen_addpoint(vqgen *v, double *p,double *aux);
71 extern double vqgen_iterate(vqgen *v,int biasp);
72 extern void vqgen_unquantize(vqgen *v,quant_meta *q);
73 extern void vqgen_quantize(vqgen *v,quant_meta *q);
74 extern void vqgen_cellmetric(vqgen *v);