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.10 2000/01/06 13:57:14 xiphmont Exp $
17 ********************************************************************/
38 double (*metric_func) (struct vqgen *v,double *entry,double *point);
39 double *(*weight_func) (struct vqgen *v,double *point);
43 long min; /* packed 24 bit float */
44 long delta; /* packed 24 bit float */
45 int quant; /* 0 < quant <= 16 */
46 int sequencep; /* bitflag */
49 static inline double *_point(vqgen *v,long ptr){
50 return v->pointlist+((v->elements+v->aux)*ptr);
53 static inline double *_aux(vqgen *v,long ptr){
54 return _point(v,ptr)+v->aux;
57 static inline double *_now(vqgen *v,long ptr){
58 return v->entrylist+(v->elements*ptr);
61 extern void vqgen_init(vqgen *v,int elements,int aux,int entries,
62 double (*metric)(vqgen *,double *, double *),
63 double *(*weight)(vqgen *,double *));
64 extern void vqgen_addpoint(vqgen *v, double *p,double *aux);
66 extern double vqgen_iterate(vqgen *v);
67 extern void vqgen_unquantize(vqgen *v,quant_meta *q);
68 extern void vqgen_quantize(vqgen *v,quant_meta *q);