zenilib
0.5.3.0
|
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "vqgen.h"
#include "bookutil.h"
Go to the source code of this file.
Macros | |
#define | vN(data, i) (data+v->elements*i) |
Functions | |
float | _dist (vqgen *v, float *a, float *b) |
void | _vqgen_seed (vqgen *v) |
float * | _weight_null (vqgen *v, float *a) |
int | directdsort (const void *a, const void *b) |
static int | meshcomp (const void *a, const void *b) |
void | vqgen_addpoint (vqgen *v, float *p, float *a) |
void | vqgen_cellmetric (vqgen *v) |
void | vqgen_init (vqgen *v, int elements, int aux, int entries, float mindist, float(*metric)(vqgen *, float *, float *), float *(*weight)(vqgen *, float *), int centroid) |
float | vqgen_iterate (vqgen *v, int biasp) |
void | vqgen_quantize (vqgen *v, quant_meta *q) |
void | vqgen_sortmesh (vqgen *v) |
void | vqgen_unquantize (vqgen *v, quant_meta *q) |
Variables | |
static int | sortit =0 |
static int | sortsize =0 |
Definition at line 57 of file vqgen.c.
Referenced by vqgen_iterate().
float _dist | ( | vqgen * | v, |
float * | a, | ||
float * | b | ||
) |
Definition at line 60 of file vqgen.c.
References vqgen::elements, and i.
Referenced by vqgen_cellmetric(), and vqgen_init().
Definition at line 76 of file vqgen.c.
References _now(), _point(), vqgen::elements, vqgen::entries, i, memcpy, and vqgen::seeded.
Referenced by vqgen_iterate().
float* _weight_null | ( | vqgen * | v, |
float * | a | ||
) |
Definition at line 71 of file vqgen.c.
Referenced by vqgen_init().
Definition at line 83 of file vqgen.c.
Referenced by vqgen_cellmetric(), and vqgen_iterate().
Definition at line 270 of file vqgen.c.
References _ogg_realloc, _point(), vqgen::allocated, vqgen::asciipoints, vqgen::aux, vqgen::elements, k, memcpy, vqgen::mindist, vqgen::pointlist, vqgen::points, and spinnit().
Definition at line 89 of file vqgen.c.
References _dist(), _now(), vqgen::assigned, directdsort(), vqgen::entries, entries, i, vqgen::it, j, k, vqgen::max, max, min, and qsort().
void vqgen_init | ( | vqgen * | v, |
int | elements, | ||
int | aux, | ||
int | entries, | ||
float | mindist, | ||
float(*)(vqgen *, float *, float *) | metric, | ||
float *(*)(vqgen *, float *) | weight, | ||
int | centroid | ||
) |
Definition at line 240 of file vqgen.c.
References _dist(), _ogg_calloc, _ogg_malloc, _weight_null(), vqgen::allocated, vqgen::asciipoints, vqgen::assigned, vqgen::aux, vqgen::bias, vqgen::centroid, vqgen::elements, vqgen::entries, entries, vqgen::entrylist, vqgen::max, memset, vqgen::metric_func, vqgen::mindist, vqgen::pointlist, and vqgen::weight_func.
Definition at line 333 of file vqgen.c.
References _now(), _ogg_malloc, _point(), _vqgen_seed(), vqgen::assigned, vqgen::bias, vqgen::centroid, directdsort(), vqgen::elements, vqgen::entries, fabs(), free, i, vqgen::it, j, k, vqgen::max, memset, vqgen::metric_func, vqgen::points, qsort(), vqgen::seeded, vqgen::sorted, spinnit(), vN, vqgen_sortmesh(), and vqgen::weight_func.
void vqgen_quantize | ( | vqgen * | v, |
quant_meta * | q | ||
) |
Definition at line 165 of file vqgen.c.
References _float32_pack(), _float32_unpack(), _now(), quant_meta::delta, vqgen::elements, vqgen::entries, j, k, quant_meta::min, quant_meta::quant, and quant_meta::sequencep.
Definition at line 305 of file vqgen.c.
References _point(), vqgen::aux, vqgen::elements, i, memcpy, meshcomp(), vqgen::mindist, vqgen::pointlist, vqgen::points, qsort(), vqgen::sorted, and spinnit().
Referenced by vqgen_iterate().
void vqgen_unquantize | ( | vqgen * | v, |
quant_meta * | q | ||
) |
Definition at line 224 of file vqgen.c.
References _float32_unpack(), _now(), quant_meta::delta, vqgen::elements, vqgen::entries, fabs(), j, k, quant_meta::min, and quant_meta::sequencep.