[XviD-devel] Invalid stuffing bits

Bobololo b0b0l0l0 at free.fr
Mon Mar 17 23:04:47 CET 2003


Hello,

While checking for interoperability between mpeg4 codecs, I've noticed that
the latest release of xvid (0.9.1)  doesn't stuff the last byte of a VOP
correctly as specified in the 14496-2 standard.

A quick look at the sources shows that in encoder_encode() the stuffing is
done as below :

    BitstreamPutBits(&bs, 0xFFFF, 16);
    BitstreamPutBits(&bs, 0xFFFF, 16);
    BitstreamPad(&bs);

According to my understanding of this code (correct me if I'm wrong), it
won't be able to produce the right stuffing pattern since it misses the
leading '0' bit. Moreover, it adds several unexpected '0xFF' bytes that
could lead to a heratic interpretation from the decoder in very specific
conditions (raw ES decoding with error resilience and BVOP support for
instance).

I hope this will help you to improve xvid compliance with the standard since
the fix is really easy :)


Bobololo.



More information about the XviD-devel mailing list