[MPlayer-dev-eng] nvidia_vid YV12 support
Sascha Sommer
saschasommer at freenet.de
Thu Jan 1 14:23:43 CET 2004
> Hello!
>
> I've had a look at nvidia_vid.c and I *think* that I understood enough
> of what's going on to be of some help.
>
> My major problem (as is anyones, I guess) is the lack of documentation
> for nVidia GPUs. But then, in a discussion between Dmitry Baryshkov
> and Sascha Sommer Sep/03 <003501c38384$d998d720$38b2ebd9 at oemcomputer>
> etc. there are some docs mentioned, and the register names shown as
> comments in nvidia_vid.c (NV_PVIDEO_FORMAT etc.) have to come from
> somewhere...
>
Yeah. I'd like to have these docs too. The register names are simply copyed
from the code
of rivatv (rivatv.sf.net). Afair there were some other docs there but they
didn't contain
the needed information.
> I've already had a look the deactivated YV12 section and activated it
> just for fun and played around a bit with the parameters, but what I
> can see is - while definitely based on the incoming video stream -
> severely distorted geometrically (line length mismatch) and color-wise
> (shades of magenta on green).
>
> After setting NV_PVIDEO_FORMAT.b16 to turn on YV12 mode the
> "best-looking" set-up so far is:
>
> vinfo->dest.pitch.y = 1;
> vinfo->dest.pitch.u = 1;
> vinfo->dest.pitch.v = 1;
>
> info->pitch = info->width;
>
> vinfo->offset.y = 0;
> vinfo->offset.v = info->width*info->height*2;
> vinfo->offset.u = info->width*info->height*3;
>
> vinfo->frame_size = info->width * info->height * 3;
Well, I am not sure if Geforce cards directly support yv12 for overlay.
I found out that the directx driver for my riva128
converts the yv12 to yuy2 frames first. I think they use some kind
of dma blits to do this (it is to fast for software conversion moreover
the card supports some other native formats like yvu9 and indeo3).
Only YUY2 and UYVY are supported by the overlay engine.
Now that I had a look at vidix header again. dest.pitch.y should really
be the pitch and not 16 or 1 or whatever. For planar yv12 pitch.u and
pitch.v are probably pitch.y/2 but I don't know. The best idea would
be to trace the windows driver. You could dump the frame the overlay
is displaying and then find out if it is yv12 or yuy2. If you have windows
installed I could send you some dump app that displays a frame via
directx and dumps the register values.
If the Geforce's overlay engine can really display yv12 it should be trivial
to add support for it. If it also uses these dma blits like riva128 and TNT
cards it gets a bit complicated. There is code in rivatv that can do this
hw conversion for TNT and later but it would require to write a kernel mode
driver. Unfortunatelly I have no agp slot and a small purse what makes it a
bit
hard to find hw to play with.
Sascha
More information about the MPlayer-dev-eng
mailing list