From df6f2f9a3c88a7a4a8ad0382ee4ee7c9a3ee3256 Mon Sep 17 00:00:00 2001 From: Dan Everton Date: Tue, 22 May 2007 09:50:31 +0000 Subject: Upgrade to libspeex 1.2beta2. Very minor performance increase (0.6% on coldfire). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13461 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libspeex/bits.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'apps/codecs/libspeex/bits.c') diff --git a/apps/codecs/libspeex/bits.c b/apps/codecs/libspeex/bits.c index 6173246380..379fe748d4 100644 --- a/apps/codecs/libspeex/bits.c +++ b/apps/codecs/libspeex/bits.c @@ -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<charPtr=0; + bits->bitPtr=0; + bits->overflow=0; + +} + void speex_bits_destroy(SpeexBits *bits) { if (bits->owner) @@ -97,7 +111,7 @@ void speex_bits_read_from(SpeexBits *bits, char *chars, int len) int nchars = len / BYTES_PER_CHAR; if (nchars > bits->buf_size) { - speex_warning_int("Packet is larger than allocated buffer: ", len); + speex_notify("Packet is larger than allocated buffer"); if (bits->owner) { char *tmp = (char*)speex_realloc(bits->chars, nchars); @@ -110,7 +124,7 @@ void speex_bits_read_from(SpeexBits *bits, char *chars, int len) speex_warning("Could not resize input buffer: truncating input"); } } else { - speex_warning("Do not own input buffer: truncating input"); + speex_warning("Do not own input buffer: truncating oversize input"); nchars=bits->buf_size; } } @@ -159,10 +173,10 @@ void speex_bits_read_whole_bytes(SpeexBits *bits, char *chars, int nbytes) bits->chars=tmp; } else { nchars=bits->buf_size-(bits->nbBits>>LOG2_BITS_PER_CHAR)-1; - speex_warning("Could not resize input buffer: truncating input"); + speex_warning("Could not resize input buffer: truncating oversize input"); } } else { - speex_warning("Do not own input buffer: truncating input"); + speex_warning("Do not own input buffer: truncating oversize input"); nchars=bits->buf_size; } } @@ -223,7 +237,7 @@ void speex_bits_pack(SpeexBits *bits, int data, int nbBits) if (bits->charPtr+((nbBits+bits->bitPtr)>>LOG2_BITS_PER_CHAR) >= bits->buf_size) { - speex_warning("Buffer too small to pack bits"); + speex_notify("Buffer too small to pack bits"); if (bits->owner) { int new_nchars = ((bits->buf_size+5)*3)>>1; -- cgit v1.2.3