Hi,<br><br>Be aware that the SSE implementation in oggplay is not perfect - in particular it does not correctly do linear interpolation of 4 pixel values for chrominance (instead it uses 2 values per pixel). Actually, strictly speaking I think it's MMX from memory (using fixed-point integer arithmetic instead of floating-point arithmetic).
<br><br>Fragment shaders vs. vector-based CPU instructions is an interesting trade off - on the one hand fragment shaders free up CPU cycles; on the other the vector-based routine is a fraction of the cost of Theora decoding (I measure about 11%) and I bet more existing Intel-based machines support MMX than fragment shading.
<br><br>Cheers,<br> -Shane<br><br><div class="gmail_quote">On Jan 15, 2008 6:48 PM, Ralph Giles <<a href="mailto:giles@xiph.org">giles@xiph.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Mon, Jan 14, 2008 at 10:59:39PM -0800, wesley kiriinya wrote:<br><br>> 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.
<br><br></div>If you're doing OpenGL, the best thing is to write a fragment shader to<br>do the conversion. In most applications the GPU can more easily spare<br>the cycles.<br><br>For one implementation on the host side, see:
<br><br> <a href="http://svn.annodex.net/liboggplay/trunk/src/liboggplay/oggplay_yuv2rgb.c" target="_blank">http://svn.annodex.net/liboggplay/trunk/src/liboggplay/oggplay_yuv2rgb.c</a><br><br>There are many others, of various speed and quality.
<br><br>I'd eventually like to add to-from RGB routines to the reference<br>implementation, but that's post-1.0.<br><br>HTH,<br> -r<br>_______________________________________________<br>theora-dev mailing list<br>
<a href="mailto:theora-dev@xiph.org">theora-dev@xiph.org</a><br><a href="http://lists.xiph.org/mailman/listinfo/theora-dev" target="_blank">http://lists.xiph.org/mailman/listinfo/theora-dev</a><br></blockquote></div><br>