Commit b366708d authored by jm's avatar jm
Browse files

added speex_bits_set_bit_buffer (still untested)


git-svn-id: http://svn.xiph.org/trunk/speex@12917 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent d068c2b7
......@@ -64,6 +64,9 @@ void speex_bits_init(SpeexBits *bits);
/** 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);
......
......@@ -67,6 +67,20 @@ void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size)
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment