[theora] converting YUV to RGB

Mihai Balea mihai at hates.ms
Sat May 5 08:45:10 PDT 2007


We're doing software yuv to rgb conversion in our project  
(iaxclient). Here's a link to the code, scroll down for the  
conversion part


I'm not saying this is the definitive way of doing it, it just work  
pretty well for us. You can reuse the code if LGPL license works for  

I've seen some examples of doing the conversion in a fragment shader.  
If you know your code will run on a hardware that has fragment  
shaders, then by all means, do that. It will free up the cpu for  
other things.  GL_LUMINANCE8 textures will give you monochrome  
images, so it's not a good choice if you want full color video.


On May 3, 2007, at 6:25 AM, Kostas Kostiadis wrote:

> Hello all,
> I'd like to convert the theora yuv_buffer to RGB that I can render  
> onto a texture.
> Googling around, there are a tone of different formulae to do so.
> There is this (with lots of corrections and amendments further down  
> the page):
> http://www.fourcc.org/fccyvrgb.php
> and there is the MSDN stuff that says you need to convert 4:2:0 and  
> 4:2:2 to 4:4:4 first, before you do anything,
> and then it has it's own set of formulae here:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ 
> wceddraw/html/_dxce_converting_between_yuv_and_rgb.asp
> I was wondering if anyone has a definitive answer on this ;-)
> Also, performance wise, is it better to do the conversion to RGB in  
> a shader, or is it better to use GL_LUMINANCE8 textures?
> cheers,
> _________________________________________________
> kostas kostiadis | lead programmer | climax action
> work: kos at climaxgroup.com | www.climaxgroup.com
> home: kos at kostiadis.com | www.kostiadis.com
> _______________________________________________
> theora mailing list
> theora at xiph.org
> http://lists.xiph.org/mailman/listinfo/theora

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/theora/attachments/20070505/e707a7ff/attachment.htm

More information about the theora mailing list