[XviD-devel] XVID Bframe AVIs and ffmpeg decoding

Christoph Lampert xvid-devel@xvid.org
Mon, 13 Jan 2003 18:06:46 +0100 (CET)


On Mon, 13 Jan 2003, Michael Niedermayer wrote:
> > Comments? If not, then I'll commit...
> IMHO padding is not done before startcodes but at the end of the various 
> headers, and not allways, for example according to the std. there is no 
> padding between VisObjSeq & VisObj and VidObj & VidObjLayer at least i dont 
> see any in the text

Hm, it looks mandatory to me (even though it might not be logical),
note that here it says: "first inserting a bit", and the check for byte 
alignment is only done after that. 

At the end of structures I though padding is only needed to reach byte
boundary, therefore never stuffing full 8 bits. 

gruel

"----------------------------------------------------------------
6.2.1 Start codes

All start codes shall be byte aligned. This shall be achieved by first
inserting a bit with the value zero and then, if necessary, inserting bits
with the value one before the start code prefix such that the first bit of
the start code prefix is the first (most significant) bit of a byte. For
stuffing of 1 to 8 bits, the codewords are as follows in Table 6-2.

-----------------------------------------------------------------"