Merge branch_beta3 onto the mainline.
[platform/upstream/libvorbis.git] / vq / bookutil.h
1 /********************************************************************
2  *                                                                  *
3  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
4  * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5  * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH    *
6  * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.        *
7  *                                                                  *
8  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2000             *
9  * by Monty <monty@xiph.org> and the XIPHOPHORUS Company            *
10  * http://www.xiph.org/                                             *
11  *                                                                  *
12  ********************************************************************
13
14  function: utility functions for loading .vqh and .vqd files
15  last mod: $Id: bookutil.h,v 1.8 2000/11/06 00:07:25 xiphmont Exp $
16
17  ********************************************************************/
18
19 #ifndef _V_BOOKUTIL_H_
20 #define _V_BOOKUTIL_H_
21
22 #include <stdio.h>
23 #include <sys/time.h>
24
25 #include "vorbis/codebook.h"
26
27 extern char     *get_line(FILE *in);
28 extern char     *setup_line(FILE *in);
29 extern int       get_line_value(FILE *in,float *value);
30 extern int       get_next_value(FILE *in,float *value);
31 extern int       get_next_ivalue(FILE *in,long *ivalue);
32 extern void      reset_next_value(void);
33 extern int       get_vector(codebook *b,FILE *in,int start,int num,float *a);
34 extern char     *find_seek_to(FILE *in,char *s);
35
36 extern codebook *codebook_load(char *filename);
37 extern void write_codebook(FILE *out,char *name,const static_codebook *c);
38
39 extern void spinnit(char *s,int n);
40 extern void build_tree_from_lengths(int vals, long *hist, long *lengths);
41 extern void build_tree_from_lengths0(int vals, long *hist, long *lengths);
42
43 #endif
44