[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.9, Fri Jun 28 15:14:40 2002 UTC revision 1.10.2.3, Thu Nov 7 10:28:15 2002 UTC
# Line 82  Line 82 
82  //#define VIDOBJLAY_TYPE_SIMPLE_SCALABLE    2  //#define VIDOBJLAY_TYPE_SIMPLE_SCALABLE    2
83  #define VIDOBJLAY_TYPE_CORE                             3  #define VIDOBJLAY_TYPE_CORE                             3
84  #define VIDOBJLAY_TYPE_MAIN                             4  #define VIDOBJLAY_TYPE_MAIN                             4
85    //#define VIDOBJLAY_TYPE_NBIT                           5
86    //#define VIDOBJLAY_TYPE_ANIM_TEXT                      6
87    //#define VIDOBJLAY_TYPE_ANIM_MESH                      7
88    //#define VIDOBJLAY_TYPE_SIMPLE_FACE            8
89    //#define VIDOBJLAY_TYPE_STILL_SCALABLE         9
90    #define VIDOBJLAY_TYPE_ART_SIMPLE               10
91    //#define VIDOBJLAY_TYPE_CORE_SCALABLE          11
92    #define VIDOBJLAY_TYPE_ACE                              12
93    //#define VIDOBJLAY_TYPE_SIMPLE_FBA                     13
94    
95    
96  //#define VIDOBJLAY_AR_SQUARE           1  //#define VIDOBJLAY_AR_SQUARE           1
# Line 97  Line 106 
106  #define VIDOBJLAY_SHAPE_BINARY_ONLY             2  #define VIDOBJLAY_SHAPE_BINARY_ONLY             2
107  #define VIDOBJLAY_SHAPE_GRAYSCALE               3  #define VIDOBJLAY_SHAPE_GRAYSCALE               3
108    
109    
110    #define SPRITE_NONE             0
111    #define SPRITE_STATIC   1
112    #define SPRITE_GMC              2
113    
114    
115  #define VO_START_CODE   0x8  #define VO_START_CODE   0x8
116  #define VOL_START_CODE  0x12  #define VOL_START_CODE  0x12
117  #define VOP_START_CODE  0x1b6  #define VOP_START_CODE  0x1b6
# Line 117  Line 132 
132  #define RESYNC_MARKER 1  #define RESYNC_MARKER 1
133    
134    
135  int  int read_video_packet_header(Bitstream *bs,
136  read_video_packet_header(Bitstream *bs, int addbits);                                                  DECODER * dec,
137                                                    const int addbits,
138                                                    int * quant,
139                                                    int * fcode_forward,
140                                                    int  * fcode_backward,
141                                                    int * intra_dc_threshold);
142    
143    
144  // header stuff  // header stuff
145  int BitstreamReadHeaders(Bitstream * bs,  int BitstreamReadHeaders(Bitstream * bs,
146                                                   DECODER * dec,                                                   DECODER * dec,
147                                                   uint32_t * rounding,                                                   uint32_t * rounding,
148                                                     uint32_t * reduced_resolution,
149                                                   uint32_t * quant,                                                   uint32_t * quant,
150                                                   uint32_t * fcode_forward,                                                   uint32_t * fcode_forward,
151                                                   uint32_t * fcode_backward,                                                   uint32_t * fcode_backward,
152                                                   uint32_t * intra_dc_threshold);                                                   uint32_t * intra_dc_threshold,
153                                                     VECTOR * gmc_mv);
154    
155    
156  void BitstreamWriteVolHeader(Bitstream * const bs,  void BitstreamWriteVolHeader(Bitstream * const bs,
157                                                           const MBParam * pParam,                                                           const MBParam * pParam,
158                                                           const FRAMEINFO * frame);                                                           const FRAMEINFO * const frame);
159    
160  void BitstreamWriteVopHeader(Bitstream * const bs,  void BitstreamWriteVopHeader(Bitstream * const bs,
161                                                           const MBParam * pParam,                                                           const MBParam * pParam,
162                                                           const FRAMEINFO * frame,                                                           const FRAMEINFO * const frame,
163                                                           int vop_coded);                                                           int vop_coded);
164    
165  void BitstreamWriteUserData(Bitstream * const bs,  void BitstreamWriteUserData(Bitstream * const bs,
# Line 337  Line 359 
359  }  }
360    
361    
 /* 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);  
         }  
 }  
   
   
362  /* read n bits from bitstream */  /* read n bits from bitstream */
363    
364  static uint32_t __inline  static uint32_t __inline
# Line 412  Line 421 
421          }          }
422  }  }
423    
424    
425    static const int stuffing_codes[8] =
426    {
427                    /* nbits     stuffing code */
428            0,              /* 1          0 */
429            1,              /* 2          01 */
430            3,              /* 3          011 */
431            7,              /* 4          0111 */
432            0xf,    /* 5          01111 */
433            0x1f,   /* 6          011111 */
434            0x3f,   /* 7          0111111 */
435            0x7f,   /* 8          01111111 */
436    };
437    
438    /* pad bitstream to the next byte boundary */
439    
440    static void __inline
441    BitstreamPad(Bitstream * const bs)
442    {
443            int bits = 8 - (bs->pos % 8);
444            if (bits < 8)
445            {
446                    BitstreamPutBits(bs, stuffing_codes[bits - 1], bits);
447            }
448    }
449    
450    
451    /* pad bitstream to the next byte boundary
452       alway pad: even if currently at the byte boundary */
453    
454    static void __inline
455    BitstreamPadAlways(Bitstream * const bs)
456    {
457            int bits = 8 - (bs->pos % 8);
458            BitstreamPutBits(bs, stuffing_codes[bits - 1], bits);
459    }
460    
461    
462  #endif                                                  /* _BITSTREAM_H_ */  #endif                                                  /* _BITSTREAM_H_ */

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10.2.3

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