zenilib: zenilib/jni/external/libvorbis/vq/vqgen.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vqgen.h
Go to the documentation of this file.
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 Xiph.Org Foundation http://www.xiph.org/ *
10 * *
11 ********************************************************************
12
13 function: build a VQ codebook
14 last mod: $Id: vqgen.h 16037 2009-05-26 21:10:58Z xiphmont $
15
16 ********************************************************************/
17
18 #ifndef _VQGEN_H_
19 #define _VQGEN_H_
20
21 typedef struct vqgen{
22 int seeded;
23 int sorted;
24
25 int it;
26 int elements;
27
28 int aux;
29 float mindist;
30 int centroid;
31
32 /* point cache */
33 float *pointlist;
34 long points;
35 long allocated;
36
37 /* entries */
38 float *entrylist;
39 long *assigned;
40 float *bias;
41 long entries;
42 float *max;
43
44 float (*metric_func) (struct vqgen *v,float *entry,float *point);
45 float *(*weight_func) (struct vqgen *v,float *point);
46
47 FILE *asciipoints;
48 } vqgen;
49
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;
56
57 static inline float *_point(vqgen *v,long ptr){
58 return v->pointlist+((v->elements+v->aux)*ptr);
59 }
60
61 static inline float *_aux(vqgen *v,long ptr){
62 return _point(v,ptr)+v->aux;
63 }
64
65 static inline float *_now(vqgen *v,long ptr){
66 return v->entrylist+(v->elements*ptr);
67 }
68
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);
74
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);
79
80 #endif
81
82
83
84
85
vqgen::mindist
float mindist
Definition: vqgen.h:29
quant_meta::min
long min
Definition: vqgen.h:51
vqgen_unquantize
void vqgen_unquantize(vqgen *v, quant_meta *q)
Definition: vqgen.c:224
_aux
static float * _aux(vqgen *v, long ptr)
Definition: vqgen.h:61
quant_meta
Definition: vqgen.h:50
weight
GLuint GLuint GLfloat weight
Definition: glew.h:12401
vqgen::centroid
int centroid
Definition: vqgen.h:30
vqgen::points
long points
Definition: vqgen.h:34
vqgen
struct vqgen vqgen
vqgen::allocated
long allocated
Definition: vqgen.h:35
v
const GLdouble * v
Definition: glew.h:1377
vqgen::assigned
long * assigned
Definition: vqgen.h:39
vqgen::seeded
int seeded
Definition: vqgen.h:22
vqgen_quantize
void vqgen_quantize(vqgen *v, quant_meta *q)
Definition: vqgen.c:165
entries
new_palette entries
Definition: pngrutil.c:1486
p
GLfloat GLfloat p
Definition: glew.h:14938
vqgen::bias
float * bias
Definition: vqgen.h:40
vqgen_init
void vqgen_init(vqgen *v, int elements, int aux, int entries, float mindist, float(*metric)(vqgen *, float *, float *), float *(*weight)(vqgen *, float *), int centroid)
Definition: vqgen.c:240
vqgen::pointlist
float * pointlist
Definition: vqgen.h:33
vqgen::metric_func
float(* metric_func)(struct vqgen *v, float *entry, float *point)
Definition: vqgen.h:44
vqgen_iterate
float vqgen_iterate(vqgen *v, int biasp)
Definition: vqgen.c:333
vqgen::max
float * max
Definition: vqgen.h:42
vqgen::it
int it
Definition: vqgen.h:25
vqgen_addpoint
void vqgen_addpoint(vqgen *v, float *p, float *a)
Definition: vqgen.c:270
q
GLdouble GLdouble GLdouble GLdouble q
Definition: glew.h:1400
vqgen::aux
int aux
Definition: vqgen.h:28
vqgen
Definition: vqgen.h:21
vqgen::entrylist
float * entrylist
Definition: vqgen.h:38
vqgen::sorted
int sorted
Definition: vqgen.h:23
vqgen_cellmetric
void vqgen_cellmetric(vqgen *v)
Definition: vqgen.c:89
vqgen::asciipoints
FILE * asciipoints
Definition: vqgen.h:47
_point
static float * _point(vqgen *v, long ptr)
Definition: vqgen.h:57
quant_meta::delta
long delta
Definition: vqgen.h:52
quant_meta::quant
int quant
Definition: vqgen.h:53
vqgen::entries
long entries
Definition: vqgen.h:41
vqgen::elements
int elements
Definition: vqgen.h:26
_now
static float * _now(vqgen *v, long ptr)
Definition: vqgen.h:65
quant_meta::sequencep
int sequencep
Definition: vqgen.h:54