[xiph-commits] r12917 - in trunk/speex: include/speex libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Fri May 4 03:04:38 PDT 2007
Author: jm
Date: 2007-05-04 03:04:37 -0700 (Fri, 04 May 2007)
New Revision: 12917
Modified:
trunk/speex/include/speex/speex_bits.h
trunk/speex/libspeex/bits.c
Log:
added speex_bits_set_bit_buffer (still untested)
Modified: trunk/speex/include/speex/speex_bits.h
===================================================================
--- trunk/speex/include/speex/speex_bits.h 2007-05-04 09:47:07 UTC (rev 12916)
+++ trunk/speex/include/speex/speex_bits.h 2007-05-04 10:04:37 UTC (rev 12917)
@@ -64,6 +64,9 @@
/** Initializes SpeexBits struct using a pre-allocated buffer*/
void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size);
+/** Sets the bits in a SpeexBits struct to use data from an existing buffer (for decoding without copying data) */
+void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size);
+
/** Frees all resources associated to a SpeexBits struct. Right now this does nothing since no resources are allocated, but this could change in the future.*/
void speex_bits_destroy(SpeexBits *bits);
Modified: trunk/speex/libspeex/bits.c
===================================================================
--- trunk/speex/libspeex/bits.c 2007-05-04 09:47:07 UTC (rev 12916)
+++ trunk/speex/libspeex/bits.c 2007-05-04 10:04:37 UTC (rev 12917)
@@ -67,6 +67,20 @@
speex_bits_reset(bits);
}
+void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size)
+{
+ bits->chars = (char*)buff;
+ bits->buf_size = buf_size;
+
+ bits->owner=0;
+
+ bits->nbBits=buf_size<<LOG2_BITS_PER_CHAR;
+ bits->charPtr=0;
+ bits->bitPtr=0;
+ bits->overflow=0;
+
+}
+
void speex_bits_destroy(SpeexBits *bits)
{
if (bits->owner)
More information about the commits
mailing list