diff options
author | Monty <xiphmont@xiph.org> | 2000-01-05 10:15:00 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2000-01-05 10:15:00 +0000 |
commit | fabd9fca0c0543344a67455c5c285772a968d2c6 (patch) | |
tree | b0ef1ad0f0687bd669d9d680d9ceb0b4430b45cc /vq/vqgen.h | |
parent | 652d2ed76323192989fde63ef434e8392d16f7b8 (diff) | |
download | libvorbis-git-fabd9fca0c0543344a67455c5c285772a968d2c6.tar.gz |
More VQ utility work. Utils now include:
lspvqtrain
genericvqtrain
vqbuild
vqcascade
Monty
svn path=/trunk/vorbis/; revision=224
Diffstat (limited to 'vq/vqgen.h')
-rw-r--r-- | vq/vqgen.h | 40 |
1 files changed, 6 insertions, 34 deletions
@@ -12,13 +12,15 @@ ******************************************************************** function: build a VQ codebook - last mod: $Id: vqgen.h,v 1.8 1999/12/30 07:27:05 xiphmont Exp $ + last mod: $Id: vqgen.h,v 1.9 2000/01/05 10:14:58 xiphmont Exp $ ********************************************************************/ #ifndef _VQGEN_H_ #define _VQGEN_H_ +#include <sys/time.h> + typedef struct vqgen{ int it; int elements; @@ -39,36 +41,6 @@ typedef struct vqgen{ double *(*weight_func) (struct vqgen *v,double *point); } vqgen; -typedef struct vqbook{ - long dim; /* codebook dimensions (elements per vector) */ - long entries; /* codebook entries */ - - long min; /* packed 24 bit float; quant value 0 maps to minval */ - long delta; /* packed 24 bit float; val 1 - val 0 == delta */ - int quant; /* 0 < quant <= 16 */ - int sequencep; /* bitflag */ - - double *valuelist; /* list of dim*entries actual entry values */ - long *quantlist; /* list of dim*entries quantized entry values */ - long *codelist; /* list of bitstream codewords for each entry */ - long *lengthlist; /* codeword lengths in bits */ - - /* auxiliary encoding/decoding information */ - /* encode: provided pre-calculated partitioning tree */ - /* decode: hufftree */ - long *ptr0; - long *ptr1; - - /* auxiliary encoding information. Not used in decode */ - double *n; /* decision hyperplanes: sum(x_i*n_i)[0<=i<dim]=c */ - double *c; - long *p; - long *q; - long aux; - long alloc; - -} vqbook; - typedef struct { long min; /* packed 24 bit float */ long delta; /* packed 24 bit float */ @@ -96,12 +68,12 @@ extern void vqgen_addpoint(vqgen *v, double *p,double *aux); extern double vqgen_iterate(vqgen *v); extern void vqgen_unquantize(vqgen *v,quant_meta *q); extern void vqgen_quantize(vqgen *v,quant_meta *q); + +extern void spinnit(char *s,int n); + extern long float24_pack(double val); extern double float24_unpack(long val); -extern void vqsp_book(vqgen *v,vqbook *b,long *quantlist); -extern int vqenc_entry(vqbook *b,double *val); - #endif |