Jump to content
  • Advertisement
Sign in to follow this  
7Days

YUV422 upsampling

This topic is 4552 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have a files (an image) that is a YCbCr 422 format. I would like to upsample it, and transform it to RGB in a shader, is it possible??? I already try to pass it as a texture (using glTexImage2D),but it does not work. Actually my file is like this: YYYYYYYYYYYYY(512*512 times) CrCrCrCrCrCrCr(512*256 times) CbCbCbCbCbCbCb(512*256 times)... I really don't know how to pass the texture, and then in my fragment shader I try to access the good pixel: uniform sampler2D image; varying vec2 TexCoord; void main() { float red, green, blue; red = texture2D(image, TexCoord).r; green = texture2D(image, TexCoord+vec2(0, 0.5)).r; blue = texture2D(image, TexCoord+vec2(0, 0.75)).r; gl_FragColor =vec4(red, green, blue, 1.0); } But as I pass in a wrong way my texture I got something bizarre... glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RED, GL_FLOAT, my_texture); that is the way I pass my texture... I use GL_RED, so that the fragment read only one data (no RGB)... So how can I pass the texture, and is it possible to perfrom upsampling on the GPU????

Share this post


Link to post
Share on other sites
Advertisement
Thanks for those who read this post, but I finally found how to perform upsampling.

:)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!