[svn] / branches / dev-api-3 / xvidcore / src / bitstream / bitstream.h Repository:
ViewVC logotype

Diff of /branches/dev-api-3/xvidcore/src/bitstream/bitstream.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 392, Wed Sep 4 18:44:41 2002 UTC revision 577, Thu Oct 3 12:06:42 2002 UTC
# Line 337  Line 337 
337  }  }
338    
339    
 /* pad bitstream to the next byte boundary */  
   
 static void __inline  
 BitstreamPad(Bitstream * const bs)  
 {  
         uint32_t remainder = bs->pos % 8;  
   
         if (remainder) {  
                 BitstreamForward(bs, 8 - remainder);  
         }  
 }  
   
   
340  /* read n bits from bitstream */  /* read n bits from bitstream */
341    
342  static uint32_t __inline  static uint32_t __inline
# Line 412  Line 399 
399          }          }
400  }  }
401    
402    
403    static const int stuffing_codes[8] =
404    {
405                    /* nbits     stuffing code */
406            0,              /* 1          0 */
407            1,              /* 2          01 */
408            3,              /* 3          011 */
409            7,              /* 4          0111 */
410            0xf,    /* 5          01111 */
411            0x1f,   /* 6          011111 */
412            0x3f,   /* 7          0111111 */
413            0x7f,   /* 8          01111111 */
414    };
415    
416    /* pad bitstream to the next byte boundary */
417    
418    static void __inline
419    BitstreamPad(Bitstream * const bs)
420    {
421            int bits = 8 - (bs->pos % 8);
422            if (bits < 8)
423            {
424                    BitstreamPutBits(bs, stuffing_codes[bits - 1], bits);
425            }
426    }
427    
428    
429    /* pad bitstream to the next byte boundary
430       alway pad: even if currently at the byte boundary */
431    
432    static void __inline
433    BitstreamPadAlways(Bitstream * const bs)
434    {
435            int bits = 8 - (bs->pos % 8);
436            BitstreamPutBits(bs, stuffing_codes[bits - 1], bits);
437    }
438    
439    
440  #endif                                                  /* _BITSTREAM_H_ */  #endif                                                  /* _BITSTREAM_H_ */

Legend:
Removed from v.392  
changed lines
  Added in v.577

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4