summaryrefslogtreecommitdiff
path: root/apps/codecs/libspeex/bits.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libspeex/bits.c')
-rw-r--r--apps/codecs/libspeex/bits.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/apps/codecs/libspeex/bits.c b/apps/codecs/libspeex/bits.c
index 4629012c57..78b38db44e 100644
--- a/apps/codecs/libspeex/bits.c
+++ b/apps/codecs/libspeex/bits.c
@@ -151,13 +151,9 @@ void speex_bits_read_from(SpeexBits *bits, char *chars, int len)
151 151
152static void speex_bits_flush(SpeexBits *bits) 152static void speex_bits_flush(SpeexBits *bits)
153{ 153{
154 int i;
155 int nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR); 154 int nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR);
156 if (bits->charPtr>0) 155 if (bits->charPtr>0)
157 { 156 SPEEX_MOVE(bits->chars, &bits->chars[bits->charPtr], nchars-bits->charPtr);
158 for (i=bits->charPtr;i<nchars; i++)
159 bits->chars[i-bits->charPtr]=bits->chars[i];
160 }
161 bits->nbBits -= bits->charPtr<<LOG2_BITS_PER_CHAR; 157 bits->nbBits -= bits->charPtr<<LOG2_BITS_PER_CHAR;
162 bits->charPtr=0; 158 bits->charPtr=0;
163} 159}
@@ -232,8 +228,6 @@ int speex_bits_write_whole_bytes(SpeexBits *bits, char *chars, int max_nbytes)
232 bits->chars[0]=bits->chars[max_nchars]; 228 bits->chars[0]=bits->chars[max_nchars];
233 else 229 else
234 bits->chars[0]=0; 230 bits->chars[0]=0;
235 for (i=1;i<((bits->nbBits)>>LOG2_BITS_PER_CHAR)+1;i++)
236 bits->chars[i]=0;
237 bits->charPtr=0; 231 bits->charPtr=0;
238 bits->nbBits &= (BITS_PER_CHAR-1); 232 bits->nbBits &= (BITS_PER_CHAR-1);
239 return max_nchars*BYTES_PER_CHAR; 233 return max_nchars*BYTES_PER_CHAR;