Lines Matching refs:bits

59 void oggpack_writetrunc(oggpack_buffer *b,long bits){  in oggpack_writetrunc()  argument
60 long bytes=bits>>3; in oggpack_writetrunc()
62 bits-=bytes*8; in oggpack_writetrunc()
64 b->endbit=bits; in oggpack_writetrunc()
66 *b->ptr&=mask[bits]; in oggpack_writetrunc()
70 void oggpackB_writetrunc(oggpack_buffer *b,long bits){ in oggpackB_writetrunc() argument
71 long bytes=bits>>3; in oggpackB_writetrunc()
73 bits-=bytes*8; in oggpackB_writetrunc()
75 b->endbit=bits; in oggpackB_writetrunc()
77 *b->ptr&=mask8B[bits]; in oggpackB_writetrunc()
82 void oggpack_write(oggpack_buffer *b,unsigned long value,int bits){ in oggpack_write() argument
96 value&=mask[bits]; in oggpack_write()
97 bits+=b->endbit; in oggpack_write()
101 if(bits>=8){ in oggpack_write()
103 if(bits>=16){ in oggpack_write()
105 if(bits>=24){ in oggpack_write()
107 if(bits>=32){ in oggpack_write()
117 b->endbyte+=bits/8; in oggpack_write()
118 b->ptr+=bits/8; in oggpack_write()
119 b->endbit=bits&7; in oggpack_write()
123 void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits){ in oggpackB_write() argument
137 value=(value&mask[bits])<<(32-bits); in oggpackB_write()
138 bits+=b->endbit; in oggpackB_write()
142 if(bits>=8){ in oggpackB_write()
144 if(bits>=16){ in oggpackB_write()
146 if(bits>=24){ in oggpackB_write()
148 if(bits>=32){ in oggpackB_write()
158 b->endbyte+=bits/8; in oggpackB_write()
159 b->ptr+=bits/8; in oggpackB_write()
160 b->endbit=bits&7; in oggpackB_write()
164 int bits=8-b->endbit; in oggpack_writealign() local
165 if(bits<8) in oggpack_writealign()
166 oggpack_write(b,0,bits); in oggpack_writealign()
170 int bits=8-b->endbit; in oggpackB_writealign() local
171 if(bits<8) in oggpackB_writealign()
172 oggpackB_write(b,0,bits); in oggpackB_writealign()
177 long bits, in oggpack_writecopy_helper() argument
184 long bytes=bits/8; in oggpack_writecopy_helper()
185 bits-=bytes*8; in oggpack_writecopy_helper()
213 if(bits){ in oggpack_writecopy_helper()
215 w(b,(unsigned long)(ptr[bytes]>>(8-bits)),bits); in oggpack_writecopy_helper()
217 w(b,(unsigned long)(ptr[bytes]),bits); in oggpack_writecopy_helper()
221 void oggpack_writecopy(oggpack_buffer *b,void *source,long bits){ in oggpack_writecopy() argument
222 oggpack_writecopy_helper(b,source,bits,oggpack_write,0); in oggpack_writecopy()
225 void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits){ in oggpackB_writecopy() argument
226 oggpack_writecopy_helper(b,source,bits,oggpackB_write,1); in oggpackB_writecopy()
260 long oggpack_look(oggpack_buffer *b,int bits){ in oggpack_look() argument
262 unsigned long m=mask[bits]; in oggpack_look()
264 bits+=b->endbit; in oggpack_look()
268 if(b->endbyte*8+bits>b->storage*8)return(-1); in oggpack_look()
272 if(bits>8){ in oggpack_look()
274 if(bits>16){ in oggpack_look()
276 if(bits>24){ in oggpack_look()
278 if(bits>32 && b->endbit) in oggpack_look()
287 long oggpackB_look(oggpack_buffer *b,int bits){ in oggpackB_look() argument
289 int m=32-bits; in oggpackB_look()
291 bits+=b->endbit; in oggpackB_look()
295 if(b->endbyte*8+bits>b->storage*8)return(-1); in oggpackB_look()
299 if(bits>8){ in oggpackB_look()
301 if(bits>16){ in oggpackB_look()
303 if(bits>24){ in oggpackB_look()
305 if(bits>32 && b->endbit) in oggpackB_look()
323 void oggpack_adv(oggpack_buffer *b,int bits){ in oggpack_adv() argument
324 bits+=b->endbit; in oggpack_adv()
325 b->ptr+=bits/8; in oggpack_adv()
326 b->endbyte+=bits/8; in oggpack_adv()
327 b->endbit=bits&7; in oggpack_adv()
330 void oggpackB_adv(oggpack_buffer *b,int bits){ in oggpackB_adv() argument
331 oggpack_adv(b,bits); in oggpackB_adv()
347 long oggpack_read(oggpack_buffer *b,int bits){ in oggpack_read() argument
349 unsigned long m=mask[bits]; in oggpack_read()
351 bits+=b->endbit; in oggpack_read()
356 if(b->endbyte*8+bits>b->storage*8)goto overflow; in oggpack_read()
360 if(bits>8){ in oggpack_read()
362 if(bits>16){ in oggpack_read()
364 if(bits>24){ in oggpack_read()
366 if(bits>32 && b->endbit){ in oggpack_read()
376 b->ptr+=bits/8; in oggpack_read()
377 b->endbyte+=bits/8; in oggpack_read()
378 b->endbit=bits&7; in oggpack_read()
383 long oggpackB_read(oggpack_buffer *b,int bits){ in oggpackB_read() argument
385 long m=32-bits; in oggpackB_read()
387 bits+=b->endbit; in oggpackB_read()
392 if(b->endbyte*8+bits>b->storage*8)goto overflow; in oggpackB_read()
395 else if(!bits)return(0L); in oggpackB_read()
399 if(bits>8){ in oggpackB_read()
401 if(bits>16){ in oggpackB_read()
403 if(bits>24){ in oggpackB_read()
405 if(bits>32 && b->endbit) in oggpackB_read()
414 b->ptr+=bits/8; in oggpackB_read()
415 b->endbyte+=bits/8; in oggpackB_read()
416 b->endbit=bits&7; in oggpackB_read()
511 void cliptest(unsigned long *b,int vals,int bits,int *comp,int compsize){ in cliptest() argument
517 oggpack_write(&o,b[i],bits?bits:ilog(b[i])); in cliptest()
527 int tbit=bits?bits:ilog(b[i]); in cliptest()
546 void cliptestB(unsigned long *b,int vals,int bits,int *comp,int compsize){ in cliptestB() argument
552 oggpackB_write(&o,b[i],bits?bits:ilog(b[i])); in cliptestB()
562 int tbit=bits?bits:ilog(b[i]); in cliptestB()