[cvs] / xvidcore / src / bitstream / bitstream.h Repository:
ViewVC logotype

Diff of /xvidcore/src/bitstream/bitstream.h

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

revision 1.10, Sun Jun 30 10:46:29 2002 UTC revision 1.10.2.2, Sat Nov 2 15:52:30 2002 UTC
# Line 133  Line 133 
133    
134  void BitstreamWriteVolHeader(Bitstream * const bs,  void BitstreamWriteVolHeader(Bitstream * const bs,
135                                                           const MBParam * pParam,                                                           const MBParam * pParam,
136                                                           const FRAMEINFO * frame);                                                           const FRAMEINFO * const frame);
137    
138  void BitstreamWriteVopHeader(Bitstream * const bs,  void BitstreamWriteVopHeader(Bitstream * const bs,
139                                                           const MBParam * pParam,                                                           const MBParam * pParam,
140                                                           const FRAMEINFO * frame,                                                           const FRAMEINFO * const frame,
141                                                           int vop_coded);                                                           int vop_coded);
142    
143  void BitstreamWriteUserData(Bitstream * const bs,  void BitstreamWriteUserData(Bitstream * const bs,
# 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.1.10  
changed lines
  Added in v.1.10.2.2

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