Sign in to follow this  
mightypanda

Video decoding to YUY2 texture id Direct3D11

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

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