Video decoding to YUY2 texture id Direct3D11

Started by
1 comment, last by mightypanda 9 years, 7 months ago

In D3D9 we used succesfully D3DFMT_YUY2 textures to display YUY2 buffers coming from decoded movies, much faster than asking the decoder to do the RGB conversion.

However it seems in D3D11 there is some confusion about how to create a YUY2 texture.

Any advice?
(we actually use SharpDX)

All the best

Stefano

Advertisement

Bit offtopic. If you're not restricted to yuy2, i.e. if you can ask decoder to produce planar images in YV12/I420 instead of packed YUY2, you can make it in more generic way - use three separate grayscale textures for Y/U/V planes, and perform yuv->rgb conversion with shader, it's just a matter of 3 dotproducts.

Hi there, thanks for the reply.

Yes i can decode both YV12 and NV12.

What i would like to avoid is having different textures, but putting the encoded data in the texture as received and perform the RGB conversion in a shader (which i believe is what dx9 D3DFMT_YV12 texture format and others did implicitly).

Do you have any example?

All the best

Stefano

Bit offtopic. If you're not restricted to yuy2, i.e. if you can ask decoder to produce planar images in YV12/I420 instead of packed YUY2, you can make it in more generic way - use three separate grayscale textures for Y/U/V planes, and perform yuv->rgb conversion with shader, it's just a matter of 3 dotproducts.

This topic is closed to new replies.

Advertisement