[FFmpeg-devel] [PATCH] RoQ video encoder

Eric Lasota riot
Sat Jun 2 10:40:07 CEST 2007


I've discovered a very interesting property (bug?) of the Quake 3 
decoder, which will require a workaround:

if (!roq_flags) {
    two = four = 256;
} else {
    two  = roq_flags>>8;
    if (!two) two = 256;
    four = roq_flags&0xff;
}

Most third-party decoders interpret 0 cb4 entries and any number of cb2 
entries as 256 cb4 entries if the codebook packet is larger than is 
necessary to store the cb2 entries.  However, Quake 3's implementation 
does not do this, it always interprets it as zero unless the number of 
cb2 entries is also zero.

Sample:
http://icculus.org/~riot/bf2intro_miniseg.roq.bz2

First frame has 256 cb4 entries and 247 cb2 entries, which causes major 
artifacts in Quake 3, but not any third-party decoder.  I'll submit a 
patch to remedy this later.




More information about the ffmpeg-devel mailing list