[MPlayer-dev-eng] nvidia_vid YV12 support

Joachim Breuer jmbreuer at gmx.net
Thu Jan 1 15:33:05 CET 2004


"Sascha Sommer" <saschasommer at freenet.de> writes:

>> 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.

Great pointer (at least I think I have glanced a solution to an
annoying problem I have with text mode display on the attached panel),
but not what's needed here exactly... as you said.

>> 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.

Side note: I also tried the YUY2 mode of nvidia_vid as it currently
is, this also gives me what looks like correct colors but wrong
geometry (line length mismatch, so that a small part of the 2nd line
is rendered at the end of the 1st and so on, showing the image in
sorts of diagonal stripes).

> 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

All right, I'll fiddle some more :-)

> 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.

That would be very much appreciated. Do you also happen to know a
DirectX test app which requests an FB of format <whatever> (YV12 in
our case) and displays something in that? Just to be sure that the
application (WMP?!) really asked for YV12, and did not do some "oh,
this looks like nVidia, I'll better request some other format and use
some other renderer" magic.

> 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.

Well, I happen to have (uid0 access to) 2 machines with the AGP slot
and the GF4 Ti4200 installed. What I do not yet have is in-depth
understanding of what the nVidia GPUs really do and what any GPUs
"usually" do regarding YUV/whatever overlays. Especially I haven't got
more clue than anyone else what the NV25 can/cannot do at all.

But maybe we can work something out together.


So long,
   Joe

-- 
"I use emacs, which might be thought of as a thermonuclear
 word processor."
-- Neal Stephenson, "In the beginning... was the command line"




More information about the MPlayer-dev-eng mailing list