VirtualBox

source: vbox/trunk/src/libs/libvorbis-1.3.7/vq/vqgen.h@ 103131

Last change on this file since 103131 was 96468, checked in by vboxsync, 2 years ago

libs/libvorbis-1.3.7: Re-exporting, hopefully this time everything is there. bugref:10275

File size: 2.3 KB
Line 
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 https://xiph.org/ *
10 * *
11 ********************************************************************
12
13 function: build a VQ codebook
14
15 ********************************************************************/
16
17#ifndef _VQGEN_H_
18#define _VQGEN_H_
19
20typedef struct vqgen{
21 int seeded;
22 int sorted;
23
24 int it;
25 int elements;
26
27 int aux;
28 float mindist;
29 int centroid;
30
31 /* point cache */
32 float *pointlist;
33 long points;
34 long allocated;
35
36 /* entries */
37 float *entrylist;
38 long *assigned;
39 float *bias;
40 long entries;
41 float *max;
42
43 float (*metric_func) (struct vqgen *v,float *entry,float *point);
44 float *(*weight_func) (struct vqgen *v,float *point);
45
46 FILE *asciipoints;
47} vqgen;
48
49typedef struct {
50 long min; /* packed 24 bit float */
51 long delta; /* packed 24 bit float */
52 int quant; /* 0 < quant <= 16 */
53 int sequencep; /* bitflag */
54} quant_meta;
55
56static inline float *_point(vqgen *v,long ptr){
57 return v->pointlist+((v->elements+v->aux)*ptr);
58}
59
60static inline float *_aux(vqgen *v,long ptr){
61 return _point(v,ptr)+v->aux;
62}
63
64static inline float *_now(vqgen *v,long ptr){
65 return v->entrylist+(v->elements*ptr);
66}
67
68extern void vqgen_init(vqgen *v,
69 int elements,int aux,int entries,float mindist,
70 float (*metric)(vqgen *,float *, float *),
71 float *(*weight)(vqgen *,float *),int centroid);
72extern void vqgen_addpoint(vqgen *v, float *p,float *aux);
73
74extern float vqgen_iterate(vqgen *v,int biasp);
75extern void vqgen_unquantize(vqgen *v,quant_meta *q);
76extern void vqgen_quantize(vqgen *v,quant_meta *q);
77extern void vqgen_cellmetric(vqgen *v);
78
79#endif
80
81
82
83
84
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette