[XviD-devel] illegal MPEG-4 Bitstream Syntax / RAW YUV input swaped

Andreas Dehnhardt xvid-devel@xvid.org
Fri, 03 Jan 2003 23:55:53 +0100


Jim Hauxwell wrote:
> Hi,
> 
> About the repatition of BitStreamWriteVolHeader().  In the spec it says
> 
> The Visual Object Sequence Header, the Visual Object Header and the Video
> Object Layer Header may be repeated in a single visual bitstream. Repeating
> these headers enables random access into the visual bitstream and recovery
> of these headers when the original headers are corrupted by errors. This
> header repetition is used only when visual_object_type in the Visual Object
> Header indicates that visual object type is video. (i.e. visual_object_type
> == "video ID") All of the data elements in the Visual Object Sequence
> Header, the Visual Object Header and the Video Object Layer Header repeated
> in a visual bitstream shall have the same value as in the original headers,
> except that first_half_vbv_occupancy and latter_half_vbv_occupancy may be
> changed to specify the VBV occupancy just before the removal of the first
> VOP following the repeated Video Object Layer Header.
> 
> So I guess that its OK to repeat the headers.
> 



Sorry, you're right!! I just found the section about repetition
of those headers. (chapter 6.2.1 at the end, for those who have the
spec document). That means, there is a bug in the standard MPEG-4
decoder. They call "assert(uiVopStartCode == VOP_START_CODE);" while
parsing the next VOP. But according to the standard text, there may be
an VO/VOL-Header.

So we have no problem in xvid.


Christoph Lampert wrote:
 >But since there are some features which can only be changed in VO/VOL
 >headers (qpel? GMC mode?) and since you seem to know the syntax: Can't we
 >somehow "define" that the sequence is finished at a certain point and a
 >new sequence starts with the next I-frame, including a new VO/VOL header
 >etc?



According to the spec, we may repeat the headers, but we cannot
change the features.

"the Visual Object Header and the Video Object Layer Header repeated
  in a visual bitstream shall have the same value as in the original headers"

For GMC, the number of warping parameters and warping accuracy are global
parameters for the whole sequence. You can always disable GMC by using
P-VOPs or Intra/Inter-coded MBs inside a S(GMC)-VOP.





Andreas