[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.17.2.8, Wed Nov 19 15:46:55 2003 UTC revision 1.24, Sun Sep 3 08:46:56 2006 UTC
# Line 128  Line 128 
128  int BitstreamReadHeaders(Bitstream * bs,  int BitstreamReadHeaders(Bitstream * bs,
129                                                   DECODER * dec,                                                   DECODER * dec,
130                                                   uint32_t * rounding,                                                   uint32_t * rounding,
                                                  uint32_t * reduced_resolution,  
131                                                   uint32_t * quant,                                                   uint32_t * quant,
132                                                   uint32_t * fcode_forward,                                                   uint32_t * fcode_forward,
133                                                   uint32_t * fcode_backward,                                                   uint32_t * fcode_backward,
# Line 137  Line 136 
136    
137    
138  void BitstreamWriteVolHeader(Bitstream * const bs,  void BitstreamWriteVolHeader(Bitstream * const bs,
139                                                           const MBParam * pParam);                                                           const MBParam * pParam,
140                                                             const FRAMEINFO * const frame);
141    
142  void BitstreamWriteVopHeader(Bitstream * const bs,  void BitstreamWriteVopHeader(Bitstream * const bs,
143                                                           const MBParam * pParam,                                                           const MBParam * pParam,
# Line 146  Line 146 
146                                                           unsigned int quant);                                                           unsigned int quant);
147    
148  void BitstreamWriteUserData(Bitstream * const bs,  void BitstreamWriteUserData(Bitstream * const bs,
149                                                          uint8_t * data,                                                          const char *data,
150                                                          const int length);                                                          const unsigned int length);
151    
152    void
153    BitstreamWriteEndOfSequence(Bitstream * const bs);
154    
155    void
156    BitstreamWriteGroupOfVopHeader(Bitstream * const bs,
157                                   const MBParam * pParam,
158                                   uint32_t is_closed_gov);
159    
160    void write_video_packet_header(Bitstream * const bs,
161                                   const MBParam * pParam,
162                                   const FRAMEINFO * const frame,
163                                   int mbnum);
164    
165    /*****************************************************************************
166     * Bitstream
167     ****************************************************************************/
168    
169    /* Input buffer should be readable as full chunks of 8bytes, including
170    the end of the buffer. Padding might be appropriate. If only chunks
171    of 4bytes are applicable, define XVID_SAFE_BS_TAIL. Note that this will
172    slow decoding, so consider this as a last-resort solution */
173    /* #define XVID_SAFE_BS_TAIL */
174    
175  /* initialise bitstream structure */  /* initialise bitstream structure */
176    
# Line 180  Line 203 
203  #endif  #endif
204          bs->bufb = tmp;          bs->bufb = tmp;
205    
         bs->buf = 0;  
206          bs->pos = bs->initpos = bitpos*8;          bs->pos = bs->initpos = bitpos*8;
207            /* preserve the intervening bytes */
208            if (bs->initpos > 0)
209                    bs->buf = bs->bufa & (0xffffffff << (32 - bs->initpos));
210            else
211                    bs->buf = 0;
212          bs->length = length;          bs->length = length;
213  }  }
214    
# Line 207  Line 234 
234  #endif  #endif
235          bs->bufb = tmp;          bs->bufb = tmp;
236    
237            /* preserve the intervening bytes */
238            if (bs->initpos > 0)
239                    bs->buf = bs->bufa & (0xffffffff << (32 - bs->initpos));
240            else
241          bs->buf = 0;          bs->buf = 0;
242          bs->pos = bs->initpos;          bs->pos = bs->initpos;
243  }  }
# Line 242  Line 273 
273                  uint32_t tmp;                  uint32_t tmp;
274    
275                  bs->bufa = bs->bufb;                  bs->bufa = bs->bufb;
276    #if defined(XVID_SAFE_BS_TAIL)
277                    if (bs->tail<(bs->start+((bs->length+3)>>2)))
278    #endif
279                    {
280                  tmp = *((uint32_t *) bs->tail + 2);                  tmp = *((uint32_t *) bs->tail + 2);
281  #ifndef ARCH_IS_BIG_ENDIAN  #ifndef ARCH_IS_BIG_ENDIAN
282                  BSWAP(tmp);                  BSWAP(tmp);
283  #endif  #endif
284                  bs->bufb = tmp;                  bs->bufb = tmp;
285                  bs->tail++;                  bs->tail++;
286                    }
287    #if defined(XVID_SAFE_BS_TAIL)
288                    else {
289                            bs->bufb = 0;
290                    }
291    #endif
292                  bs->pos -= 32;                  bs->pos -= 32;
293          }          }
294  }  }

Legend:
Removed from v.1.17.2.8  
changed lines
  Added in v.1.24

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