[XviD-devel] corruption of VideoObjectLayer width and height values when setting frame rate at 8 fps

Andrea Barbieri andrea.barbieri at movingimageresearch.com
Sun Sep 9 15:55:05 CEST 2007


AB:=Andrea Barbieri

AB> Hello,
AB> 
AB> AB:=Andrea Barbieri
AB> 
AB> AB> Hello,
AB> AB> 
AB> AB> I just found a peculiar bug in xvidcore-1.1.3 (I think it has 
AB> AB> been present since version 1.0.0)
AB> AB> 
AB> AB> I have built the library and the example executables under 
AB> AB> CygWin.
AB> AB> 
AB> AB> when I use xvid_encraw like this: ./xvid_encraw -lumimasking 
AB> AB> -framerate 7.5 -turbo -single -type 0 -i 
AB> AB> /cygdrive/c/Users/ab/foo.yuv -o /cygdrive/c/Users/ab/foo1.xvid 
AB> AB> -w 720 -h 480
AB> AB> 
AB> AB> or with any other frame rates (apart from 8.0) the VOL 
AB> AB> parameters video_object_layer_width and 
AB> AB> video_object_layer_height are set correctly to 720 and 480 
AB> AB> respectively.
AB> AB> 
AB> AB> as soon as I switch to a framerate of 8.0 those two parameters 
AB> AB> get corrupted to 1441 and 961 respectively (it looks like they 
AB> AB> get set to twice plus one of the original values).
AB> AB> 
AB> AB> I am using MPEG4P2 parser to look inside the generated bitsream 
AB> AB> http://sourceforge.net/projects/mpegparser/
AB> 
AB> looking into the actual source code for mpegparser it seems the 
AB> computation of the number of bits to read from 
AB> vop_time_inc_resolution could be wrong...
AB> 
AB> they use N rather than N-1 for the computation ... leading to a 
AB> value of 4 bits rather than the actual value of 3 bits (which is 
AB> indeed used/written by xvid_encraw and xvidcore).


looking at encoder.c, line 173:
pEnc->mbParam.fbase = create->fincr <= 0 ? 25 : create->fbase;

wouldn't it be better if it got changed to:
pEnc->mbParam.fbase = create->fbase;

this way if fincr is set to 0 the VOL header will have:
time_inc_resolution = fbase (rather than always 25)
fixed_vop_rate = 0

best regards,
andrea
-- 
Andrea Barbieri
Moving Image Research http://www.movingimageresearch.com/
The Workshop, Hampton Lane, Bristol, BS6 6LE, UK
Tel: +44 117 9732200  FAX: +44 117 9732210
PGP ID=0x034DFD5A  KeyFingerprint=C168EA9A7189538D214F1281A7529F32034DFD5A


More information about the XviD-devel mailing list