[XviD-devel] RE: possible vfw YV12 stride bug

Ivan Kalvachev ivan at cacad.com
Tue Jan 27 20:40:19 CET 2004


I resend this letter, as i didn't get it in the maillist
and i don't see it in the archives. I hope it will pass your spam
protection ...

I think it is the right time to remind you about
CSP_USER vs CSP_YV12 vs CSP_I420
these issues are still not fixed, but they should
be fixed before final 1.0 version.
Pleace do it now, or
you will have to patch interface later.

in short:
 remove the current implementation of CSP_YV12 and I420
rename CSP_USER to CSP_YV12 and add new CSP_I420 that is
like CSP_USER - always use stride and make
alignment like the one bellow problem of the caller - vfw and dshow

Best Regards
   Ivan Kalvachev
  iive

Klaus Post (KPO) said:
> 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
>
>
> _______________________________________________
> XviD-devel mailing list
> XviD-devel at xvid.org
> http://list.xvid.org/mailman/listinfo/xvid-devel
>





More information about the XviD-devel mailing list