[XviD-devel] RE: possible vfw YV12 stride bug
Klaus Post (KPO)
KPO at zenaria.com
Wed Jan 21 10:21:25 CET 2004
Hi!
(( I somehow seem to have been disconnected from the mailinglist, but I
found this in the archive. Now also a plain text version. Sorry for the
trouble ;) )
>>In compress(), codec.c, stride is being computed as:
- Yes, it is wrong!
- In general, VFW stride is always rounded up to nearest 4-byte
boundary. The first line is ok:
frame.input.stride[0] = (((icc->lpbiInput->biWidth *
icc->lpbiInput->biBitCount) + 31) & ~31) >> 3;
However - YV12 is special.
Y-Plane is also 4-byte aligned, so it should be:
if (frame.input.csp == XVID_CSP_I420 || frame.input.csp ==
XVID_CSP_YV12)
frame.input.stride[0] = (((icc->lpbiInput->biWidth
+ 3) >> 2;
UV planes are _always_ HALF of the Y-plane, so U&V planes are only 2byte
aligned.
This is at least my experience from AviSynth YV12 implementation.
Klaus Post, Producer
More information about the XviD-devel
mailing list