1 /******************************************************************** 2 * * 3 * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * 4 * * 5 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 6 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 7 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 8 * * 9 * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * 10 * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * 11 * * 12 ******************************************************************** 13 14 function: basic shared codebook operations 15 16 ********************************************************************/ 17 18 #ifndef _V_CODEBOOK_H_ 19 #define _V_CODEBOOK_H_ 20 21 #include "ogg.h" 22 23 typedef struct codebook{ 24 long dim; /* codebook dimensions (elements per vector) */ 25 long entries; /* codebook entries */ 26 long used_entries; /* populated codebook entries */ 27 28 int dec_maxlength; 29 void *dec_table; 30 int dec_nodeb; 31 int dec_leafw; 32 int dec_type; /* 0 = entry number 33 1 = packed vector of values 34 2 = packed vector of column offsets, maptype 1 35 3 = scalar offset into value array, maptype 2 */ 36 37 ogg_int32_t q_min; 38 int q_minp; 39 ogg_int32_t q_del; 40 int q_delp; 41 int q_seq; 42 int q_bits; 43 int q_pack; 44 void *q_val; 45 46 } codebook; 47 48 extern void vorbis_book_clear(codebook *b); 49 extern int vorbis_book_unpack(oggpack_buffer *b,codebook *c); 50 51 extern long vorbis_book_decode(codebook *book, oggpack_buffer *b); 52 extern long vorbis_book_decodevs_add(codebook *book, ogg_int32_t *a, 53 oggpack_buffer *b,int n,int point); 54 extern long vorbis_book_decodev_set(codebook *book, ogg_int32_t *a, 55 oggpack_buffer *b,int n,int point); 56 extern long vorbis_book_decodev_add(codebook *book, ogg_int32_t *a, 57 oggpack_buffer *b,int n,int point); 58 extern long vorbis_book_decodevv_add(codebook *book, ogg_int32_t **a, 59 long off,int ch, 60 oggpack_buffer *b,int n,int point); 61 62 extern int _ilog(unsigned int v); 63 64 65 #endif 66