summaryrefslogtreecommitdiff
path: root/codebook.h
diff options
context:
space:
mode:
authorcvs2svn <nobody@xiph.org>2004-03-20 20:06:36 +0000
committercvs2svn <nobody@xiph.org>2004-03-20 20:06:36 +0000
commit083f54322feb6f8526b98712fb4baee07589ffbb (patch)
treea56e19e9ccb5ae1962437f2ae547810e25ca015b /codebook.h
downloadtremor-083f54322feb6f8526b98712fb4baee07589ffbb.tar.gz
This commit was manufactured by cvs2svn to create branch
'lowmem-no-byte'. git-svn-id: https://svn.xiph.org/branches/lowmem-no-byte/Tremor@5975 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'codebook.h')
-rw-r--r--codebook.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/codebook.h b/codebook.h
new file mode 100644
index 0000000..7519597
--- /dev/null
+++ b/codebook.h
@@ -0,0 +1,65 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: basic shared codebook operations
+
+ ********************************************************************/
+
+#ifndef _V_CODEBOOK_H_
+#define _V_CODEBOOK_H_
+
+#include "ogg.h"
+
+typedef struct codebook{
+ long dim; /* codebook dimensions (elements per vector) */
+ long entries; /* codebook entries */
+ long used_entries; /* populated codebook entries */
+
+ int dec_maxlength;
+ void *dec_table;
+ int dec_nodeb;
+ int dec_leafw;
+ int dec_type; /* 0 = entry number
+ 1 = packed vector of values
+ 2 = packed vector of column offsets, maptype 1
+ 3 = scalar offset into value array, maptype 2 */
+
+ ogg_int32_t q_min;
+ int q_minp;
+ ogg_int32_t q_del;
+ int q_delp;
+ int q_seq;
+ int q_bits;
+ int q_pack;
+ void *q_val;
+
+} codebook;
+
+extern void vorbis_book_clear(codebook *b);
+extern int vorbis_book_unpack(oggpack_buffer *b,codebook *c);
+
+extern long vorbis_book_decode(codebook *book, oggpack_buffer *b);
+extern long vorbis_book_decodevs_add(codebook *book, ogg_int32_t *a,
+ oggpack_buffer *b,int n,int point);
+extern long vorbis_book_decodev_set(codebook *book, ogg_int32_t *a,
+ oggpack_buffer *b,int n,int point);
+extern long vorbis_book_decodev_add(codebook *book, ogg_int32_t *a,
+ oggpack_buffer *b,int n,int point);
+extern long vorbis_book_decodevv_add(codebook *book, ogg_int32_t **a,
+ long off,int ch,
+ oggpack_buffer *b,int n,int point);
+
+extern int _ilog(unsigned int v);
+
+
+#endif