comparison common.c @ 24:08265a63313e libavcodec

added MJPEG decoder + comments
author glantau
date Mon, 06 Aug 2001 00:47:03 +0000
parents 907b67420d84
children 5aa6292a1660
comparison
equal deleted inserted replaced
23:1e131bc21101 24:08265a63313e
119 flush_buffer(s); 119 flush_buffer(s);
120 s->bit_cnt=0; 120 s->bit_cnt=0;
121 s->bit_buf=0; 121 s->bit_buf=0;
122 } 122 }
123 123
124 /* for jpeg : espace 0xff with 0x00 after it */ 124 /* for jpeg : escape 0xff with 0x00 after it */
125 void jput_bits(PutBitContext *s, int n, unsigned int value) 125 void jput_bits(PutBitContext *s, int n, unsigned int value)
126 { 126 {
127 unsigned int bit_buf, b; 127 unsigned int bit_buf, b;
128 int bit_cnt, i; 128 int bit_cnt, i;
129 129
399 } 399 }
400 return table_index; 400 return table_index;
401 } 401 }
402 402
403 403
404 /* wrap and size allow to handle most types of storage. */ 404 /* Build VLC decoding tables suitable for use with get_vlc().
405
406 'nb_bits' set thee decoding table size (2^nb_bits) entries. The
407 bigger it is, the faster is the decoding. But it should not be too
408 big to save memory and L1 cache. '9' is a good compromise.
409
410 'nb_codes' : number of vlcs codes
411
412 'bits' : table which gives the size (in bits) of each vlc code.
413
414 'codes' : table which gives the bit pattern of of each vlc code.
415
416 'xxx_wrap' : give the number of bytes between each entry of the
417 'bits' or 'codes' tables.
418
419 'xxx_size' : gives the number of bytes of each entry of the 'bits'
420 or 'codes' tables.
421
422 'wrap' and 'size' allows to use any memory configuration and types
423 (byte/word/long) to store the 'bits' and 'codes' tables.
424 */
405 int init_vlc(VLC *vlc, int nb_bits, int nb_codes, 425 int init_vlc(VLC *vlc, int nb_bits, int nb_codes,
406 const void *bits, int bits_wrap, int bits_size, 426 const void *bits, int bits_wrap, int bits_size,
407 const void *codes, int codes_wrap, int codes_size) 427 const void *codes, int codes_wrap, int codes_size)
408 { 428 {
409 vlc->bits = nb_bits; 429 vlc->bits = nb_bits;