Re: YUV to RGB

Ralph Giles <[email protected]>
Newsgroups gmane.comp.multimedia.ogg.theora.devel
Message-ID <[email protected]>
On Mon, Jan 14, 2008 at 10:59:39PM -0800, wesley kiriinya wrote:

>  I'm trying to write an OpenGL application that plays theora frames. SDL is not an option. Is there a function/routine that can do this for me efficiently or do I have to write my own with a bit of SSE so that the YUV to RGB conversion is fast enough. Also wouldn't it be OK if a Theora stream could be encoded in RGB instead of YUV or is there already something like this? I'm writing a decoder not an encoder.

If you're doing OpenGL, the best thing is to write a fragment shader to 
do the conversion. In most applications the GPU can more easily spare 
the cycles.

For one implementation on the host side, see:

  http://svn.annodex.net/liboggplay/trunk/src/liboggplay/oggplay_yuv2rgb.c

There are many others, of various speed and quality.

I'd eventually like to add to-from RGB routines to the reference 
implementation, but that's post-1.0.

HTH,
 -r
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.