Build script now builds an oggenc binary with flac support.
[vorbis-lancer-gcc.git] / aotuv-b5_20061024 / vq / vqgen.h
blob93a644381c0be8806984c1fa2aad07635e155748
1 /********************************************************************
2 * *
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
7 * *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
10 * *
11 ********************************************************************
13 function: build a VQ codebook
14 last mod: $Id: vqgen.h 7187 2004-07-20 07:24:27Z xiphmont $
16 ********************************************************************/
18 #ifndef _VQGEN_H_
19 #define _VQGEN_H_
21 typedef struct vqgen{
22 int seeded;
23 int sorted;
25 int it;
26 int elements;
28 int aux;
29 float mindist;
30 int centroid;
32 /* point cache */
33 float *pointlist;
34 long points;
35 long allocated;
37 /* entries */
38 float *entrylist;
39 long *assigned;
40 float *bias;
41 long entries;
42 float *max;
44 float (*metric_func) (struct vqgen *v,float *entry,float *point);
45 float *(*weight_func) (struct vqgen *v,float *point);
47 FILE *asciipoints;
48 } vqgen;
50 typedef struct {
51 long min; /* packed 24 bit float */
52 long delta; /* packed 24 bit float */
53 int quant; /* 0 < quant <= 16 */
54 int sequencep; /* bitflag */
55 } quant_meta;
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);
80 #endif