Hardware RGB to YUV conversion

Started by
2 comments, last by tangobravo 16 years, 9 months ago
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.
Advertisement
Using a standard DirectDraw blit will convert an RGB surface to YUV for your overlay.
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]
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

This topic is closed to new replies.

Advertisement