Lines Matching refs:nbBits
78 bits->nbBits=buf_size<<LOG2_BITS_PER_CHAR; in speex_bits_set_bit_buffer()
96 bits->nbBits=0; in speex_bits_reset()
141 bits->nbBits=nchars<<LOG2_BITS_PER_CHAR; in speex_bits_read_from()
149 int nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR); in speex_bits_flush()
152 bits->nbBits -= bits->charPtr<<LOG2_BITS_PER_CHAR; in speex_bits_flush()
161 if (((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR)+nchars > bits->buf_size) in speex_bits_read_whole_bytes()
166 char *tmp = (char*)speex_realloc(bits->chars, (bits->nbBits>>LOG2_BITS_PER_CHAR)+nchars+1); in speex_bits_read_whole_bytes()
169 bits->buf_size=(bits->nbBits>>LOG2_BITS_PER_CHAR)+nchars+1; in speex_bits_read_whole_bytes()
172 nchars=bits->buf_size-(bits->nbBits>>LOG2_BITS_PER_CHAR)-1; in speex_bits_read_whole_bytes()
182 pos=bits->nbBits>>LOG2_BITS_PER_CHAR; in speex_bits_read_whole_bytes()
185 bits->nbBits+=nchars<<LOG2_BITS_PER_CHAR; in speex_bits_read_whole_bytes()
192 int charPtr, bitPtr, nbBits; in speex_bits_write() local
197 nbBits=bits->nbBits; in speex_bits_write()
201 bits->nbBits=nbBits; in speex_bits_write()
203 if (max_nchars > ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR)) in speex_bits_write()
204 max_nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR); in speex_bits_write()
215 if (max_nchars > ((bits->nbBits)>>LOG2_BITS_PER_CHAR)) in speex_bits_write_whole_bytes()
216 max_nchars = ((bits->nbBits)>>LOG2_BITS_PER_CHAR); in speex_bits_write_whole_bytes()
225 bits->nbBits &= (BITS_PER_CHAR-1); in speex_bits_write_whole_bytes()
229 EXPORT void speex_bits_pack(SpeexBits *bits, int data, int nbBits) in speex_bits_pack() argument
233 if (bits->charPtr+((nbBits+bits->bitPtr)>>LOG2_BITS_PER_CHAR) >= bits->buf_size) in speex_bits_pack()
254 while(nbBits) in speex_bits_pack()
257 bit = (d>>(nbBits-1))&1; in speex_bits_pack()
267 bits->nbBits++; in speex_bits_pack()
268 nbBits--; in speex_bits_pack()
272 EXPORT int speex_bits_unpack_signed(SpeexBits *bits, int nbBits) in speex_bits_unpack_signed() argument
274 unsigned int d=speex_bits_unpack_unsigned(bits,nbBits); in speex_bits_unpack_signed()
276 if (d>>(nbBits-1)) in speex_bits_unpack_signed()
278 d |= (-1)<<nbBits; in speex_bits_unpack_signed()
283 EXPORT unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits) in speex_bits_unpack_unsigned() argument
286 if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+nbBits>bits->nbBits) in speex_bits_unpack_unsigned()
290 while(nbBits) in speex_bits_unpack_unsigned()
300 nbBits--; in speex_bits_unpack_unsigned()
305 EXPORT unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits) in speex_bits_peek_unsigned() argument
311 if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+nbBits>bits->nbBits) in speex_bits_peek_unsigned()
319 while(nbBits) in speex_bits_peek_unsigned()
329 nbBits--; in speex_bits_peek_unsigned()
336 if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+1>bits->nbBits) in speex_bits_peek()
345 if (((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+n>bits->nbBits) || bits->overflow){ in speex_bits_advance()
358 return bits->nbBits-((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr); in speex_bits_remaining()
363 return ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR); in speex_bits_nbytes()