[XviD-devel] YUV panar

Ivan Kalvachev ivan at cacad.com
Sat Nov 1 21:24:47 CET 2003


Hi,
 I had took a look of xvid decoder routines, and i had found some things
that are could be done better.
What I am talking about? The basic thing - colorspaces. And especially
YUV one.
So what are the issues.
 1. I run into XVID_CSP_USER, the same colorspace name exist in api3, but
is used with completely different purpose (in api4 it is changed to
XVID_CSP_INTERNAL)
This is quite confusing and misleading, I recommend to remove it.

 2. The XVID_CSP_USER in api4 is the only colorspace method that correctly
uses YUV's  dec.output.plane[] and dec.output.stride[].
XVID_CSP_YV12 and XVID_CSP_I420 are calculating their own UV planes
according to Y plane. I guess this i some legacy win32 issue, but this may
lead to segfault as e.g. MPlayer uses memaling for each plane.
These one plane calculations should be moved from xvid and put into vfw &
dshow!
I know that you would try keep it, and will try to argue that it is good
as it is, but believe me, it is lame.

 3. Why YV12 have swapped UV planes? Read the www.fourcc.org and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/graphics/hh/graphics/dxvaguide_7xgn.asp
I420 is the one that have UV planes swapped not YV12!!!!
And IYUV is not YV12! It is Inverted YUV.
I guess that vfw and dshow have another UV swapping (just like ve_xvid used
to have) and that they should also be fixed. (yeh right before release
//--------------------------------------------------------------------

So in short. USER becomes I420. YV12 becomes USER with normal order UV
planes.
VFW and DSHOW filter got fixed to normal behavior.

I know these are minor issues, but they are affecting the API, and it is
good to be sorted out ASAP, and to have clean API for the release.
I have done patch, but be careful with it, it is not tested!
(well it works with mplayer)

Best Regards
   Ivan Kalvachev
  iive


More information about the XviD-devel mailing list