zenilib: zenilib/jni/external/libvorbis/vq/bookutil.c File Reference

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
Functions | Variables
bookutil.c File Reference
`#include <stdlib.h>`
`#include <stdio.h>`
`#include <math.h>`
`#include <string.h>`
`#include <errno.h>`
`#include "bookutil.h"`

Go to the source code of this file.

## Functions

int | _best (codebook *book, float *a, int step)
void | build_tree_from_lengths (int vals, long *hist, long *lengths)
void | build_tree_from_lengths0 (int vals, long *hist, long *lengths)
codebook * | codebook_load (char *filename)
char * | find_seek_to (FILE *in, char *s)
char * | get_line (FILE *in)
int | get_line_value (FILE *in, float *value)
int | get_next_ivalue (FILE *in, long *ivalue)
int | get_next_value (FILE *in, float *value)
int | get_vector (codebook *b, FILE *in, int start, int n, float *a)
void | reset_next_value (void)
char * | setup_line (FILE *in)
void | spinnit (char *s, int n)
void | write_codebook (FILE *out, char *name, const static_codebook *c)

## Variables

static int | lbufsize =0
static char * | linebuffer =NULL
static float | sequence_base =0.f
static int | v_sofar =0
static char * | value_line_buff =NULL

## Function Documentation

int _best | ( | codebook * | book,
|  | float * | a,
|  | int | step
| ) |  |

Definition at line 25 of file bookutil.c.

References codebook::c, codebook::delta, codebook::dim, e, codebook::entries, i, int, j, static_codebook::lengthlist, m, codebook::minval, and codebook::quantvals.

void build_tree_from_lengths | ( | int | vals,
|  | long * | hist,
|  | long * | lengths
| ) |  |

Definition at line 338 of file bookutil.c.

References _ogg_malloc, free, i, j, memcpy, and spinnit().

Referenced by build_tree_from_lengths0(), and main().

void build_tree_from_lengths0 | ( | int | vals,
|  | long * | hist,
|  | long * | lengths
| ) |  |

Definition at line 407 of file bookutil.c.

References _ogg_calloc, build_tree_from_lengths(), free, and i.

Referenced by main().

codebook* codebook_load | ( | char * | filename | ) |

Definition at line 233 of file bookutil.c.

References _book_maptype1_quantvals(), _book_unquantize(), _ogg_calloc, _ogg_malloc, codebook::c, static_codebook::dim, static_codebook::entries, find_seek_to(), get_line(), get_next_ivalue(), i, static_codebook::lengthlist, static_codebook::maptype, NULL, static_codebook::q_delta, static_codebook::q_min, static_codebook::q_quant, static_codebook::q_sequencep, static_codebook::quantlist, reset_next_value(), codebook::valuelist, and vorbis_book_init_encode().

Referenced by main().

char* find_seek_to | ( | FILE * | in,
|  | char * | s
| ) |  |

Definition at line 216 of file bookutil.c.

References get_line(), and NULL.

Referenced by codebook_load().

char* get_line | ( | FILE * | in | ) |

Definition at line 85 of file bookutil.c.

References _ogg_malloc, _ogg_realloc, EOF, lbufsize, linebuffer, and NULL.

Referenced by codebook_load(), find_seek_to(), get_next_value(), main(), and setup_line().

int get_line_value | ( | FILE * | in,
|  | float * | value
| ) |  |

Definition at line 131 of file bookutil.c.

References NULL, and value_line_buff.

Referenced by get_next_value(), get_vector(), and getval().

int get_next_ivalue | ( | FILE * | in,
|  | long * | ivalue
| ) |  |

Definition at line 159 of file bookutil.c.

References get_next_value(), and ret.

Referenced by codebook_load(), and main().

int get_next_value | ( | FILE * | in,
|  | float * | value
| ) |  |

Definition at line 148 of file bookutil.c.

References get_line(), get_line_value(), and value_line_buff.

Referenced by get_next_ivalue(), get_vector(), and getval().

int get_vector | ( | codebook * | b,
|  | FILE * | in,
|  | int | start,
|  | int | n,
|  | float * | a
| ) |  |

Definition at line 181 of file bookutil.c.

References codebook::c, static_codebook::dim, get_line_value(), get_next_value(), i, static_codebook::q_sequencep, reset_next_value(), sequence_base, and v_sofar.

void reset_next_value | ( | void |  | ) |

Definition at line 168 of file bookutil.c.

References NULL, sequence_base, v_sofar, and value_line_buff.

Referenced by codebook_load(), get_vector(), getval(), main(), and setup_line().

char* setup_line | ( | FILE * | in | ) |

Definition at line 174 of file bookutil.c.

References get_line(), reset_next_value(), and value_line_buff.

Referenced by main().

void spinnit | ( | char * | s,
|  | int | n
| ) |  |

Definition at line 306 of file bookutil.c.

References NULL.

Referenced by build_tree_from_lengths(), main(), meshcomp(), process_vector(), vqgen_addpoint(), vqgen_iterate(), and vqgen_sortmesh().

void write_codebook | ( | FILE * | out,
|  | char * | name,
|  | const static_codebook * | c
| ) |  |

Definition at line 437 of file bookutil.c.

References _book_maptype1_quantvals(), static_codebook::dim, static_codebook::entries, i, j, k, static_codebook::lengthlist, static_codebook::maptype, static_codebook::q_delta, static_codebook::q_min, static_codebook::q_quant, static_codebook::q_sequencep, and static_codebook::quantlist.

Referenced by main().

## Variable Documentation

int lbufsize =0

static

Definition at line 84 of file bookutil.c.

Referenced by get_line().

char* linebuffer =NULL

static

Definition at line 83 of file bookutil.c.

Referenced by get_line().

float sequence_base =0.f

static

Definition at line 166 of file bookutil.c.

Referenced by get_vector(), and reset_next_value().

int v_sofar =0

static

Definition at line 167 of file bookutil.c.

Referenced by get_vector(), and reset_next_value().

char* value_line_buff =NULL

static

Definition at line 129 of file bookutil.c.

Referenced by get_line_value(), get_next_value(), reset_next_value(), and setup_line().