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

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

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

revision 229, Thu Jun 20 14:05:58 2002 UTC revision 248, Fri Jun 28 15:14:40 2002 UTC
# Line 41  Line 41 
41    *                                                                                                                                                        *    *                                                                                                                                                        *
42    *  Revision history:                                                         *    *  Revision history:                                                         *
43    *                                                                            *    *                                                                            *
44    *  26.03.2002 interlacing support - modified putvol/vopheaders paramters    *  28.06.2002 addded BitstreamNumBitsToByteAlign()                           *
45      *                    BitstreamShowBitsFromByteAlign()                        *
46      *  26.03.2002 interlacing support - modified putvol/vopheaders paramters     *
47    *  04.03.2002 putbits speedup (Isibaar)                                      *    *  04.03.2002 putbits speedup (Isibaar)                                      *
48    *  03.03.2002 merged BITREADER and BITWRITER (Isibaar)                       *    *  03.03.2002 merged BITREADER and BITWRITER (Isibaar)                       *
49    *      16.12.2001     inital version                                                     *    *      16.12.2001     inital version                                                     *
# Line 110  Line 112 
112  #define S_VOP   3  #define S_VOP   3
113  #define N_VOP   4  #define N_VOP   4
114    
115    // resync-specific
116    #define NUMBITS_VP_RESYNC_MARKER  17
117    #define RESYNC_MARKER 1
118    
119    
120    int
121    read_video_packet_header(Bitstream *bs, int addbits);
122    
123    
124  // header stuff  // header stuff
125  int BitstreamReadHeaders(Bitstream * bs,  int BitstreamReadHeaders(Bitstream * bs,
# Line 230  Line 240 
240  }  }
241    
242    
243    // number of bits to next byte alignment
244    static __inline uint32_t
245    BitstreamNumBitsToByteAlign(Bitstream *bs)
246    {
247            uint32_t n = (32 - bs->pos) % 8;
248            return n == 0 ? 8 : n;
249    }
250    
251    
252    // show nbits from next byte alignment
253    static __inline uint32_t
254    BitstreamShowBitsFromByteAlign(Bitstream *bs, int bits)
255    {
256            int bspos = bs->pos + BitstreamNumBitsToByteAlign(bs);
257            int nbit = (bits + bspos) - 32;
258    
259            if (bspos >= 32) {
260                    return bs->bufb >> (32 - nbit);
261            } else  if (nbit > 0) {
262                    return ((bs->bufa & (0xffffffff >> bspos)) << nbit) | (bs->
263                                                                                                                                     bufb >> (32 -
264                                                                                                                                                      nbit));
265            } else {
266                    return (bs->bufa & (0xffffffff >> bspos)) >> (32 - bspos - bits);
267            }
268    
269    }
270    
271    
272    
273  /* move forward to the next byte boundary */  /* move forward to the next byte boundary */
274    
275  static __inline void  static __inline void

Legend:
Removed from v.229  
changed lines
  Added in v.248

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