Sign in to follow this  
agentgonzo

Hardware RGB to YUV conversion

Recommended Posts

I'm trying to use direct3D and render to an overlay surface (DirectDraw). I've got this working fine for ATI cards as they support RGB overlays, but I'm having trouble with NVidia cards as they only support YUV overlay colour spaces, but renders all Direct3D in RGB. Is there a way to perform the conversion from RGB (the direct3d render target) to YUV (the overlay surface) on the graphics card? Obviously its too slow to try this on the CPU. The rendering needs to be outputted to the overlay so I'm forced to be using DirectX7 for the directdraw capabilities.

Share this post


Link to post
Share on other sites
Whenever I do a standard Blit to a YUV directdraw surface (UYVY at the moment) from an RGB source, I get an 0x80004001 not supported at the current time error.

Am I doing something wrong? All the other blits from RGB to RGB or from YUV to YUV work fine:

yuvSurface->Blt(&rect, rgbSurface, &rect, NULL, NULL)

Many thanks.

It's on an NVidia 7900 if that helps.


Edit: Ignore that - changing to YUY2 means that I can blit directly to it. Thanks for the help!

[Edited by - agentgonzo on July 12, 2007 8:41:09 AM]

Share this post


Link to post
Share on other sites
Hi all,

I'm having a similar problem - I'm trying to blit something from the primary surface to an overlay. The blit always fails with DDERR_UNSUPPORTED. I can blit the primary surface to an RGB surface in both SYSTEMMEMORY or VIDEOMEMORY, but not to a yuv surface. I also can't seem to create a yuv surface in SYSTEMMEMORY - so it could be I'm doing something wrong with surface creation. I get the same results with YUY2 and UYVY.

Is the conversion-on-blit hardware dependent? I'm using an Nvidia 5200 (really low-end card, but should be OK for my purposes).

Thanks for any input

Simon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this