<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hello,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>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</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><A href="http://iaxclient.svn.sourceforge.net/viewvc/iaxclient/branches/team/mihai/iaxclient/lib/video.c?view=markup">http://iaxclient.svn.sourceforge.net/viewvc/iaxclient/branches/team/mihai/iaxclient/lib/video.c?view=markup</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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 you.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Mihai</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><DIV><DIV>On May 3, 2007, at 6:25 AM, Kostas Kostiadis wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2">Hello all,</FONT></SPAN></DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2"></FONT></SPAN> </DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2">I'd like to convert the theora yuv_buffer to RGB that I can render onto a texture.</FONT></SPAN></DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2">Googling around, there are a tone of different formulae to do so.</FONT></SPAN></DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2">There is this (with lots of corrections and amendments further down the page):</FONT></SPAN></DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2"></FONT></SPAN> </DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2"><A href="http://www.fourcc.org/fccyvrgb.php">http://www.fourcc.org/fccyvrgb.php</A></FONT></SPAN></DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2"></FONT></SPAN> </DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2">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,</FONT></SPAN></DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2">and then it has it's own set of formulae here:</FONT></SPAN></DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2"></FONT></SPAN> </DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2"><A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddraw/html/_dxce_converting_between_yuv_and_rgb.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddraw/html/_dxce_converting_between_yuv_and_rgb.asp</A></FONT></SPAN></DIV> <DIV><FONT face="Arial" color="#800000" size="2"></FONT> </DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2"></FONT></SPAN> </DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2">I was wondering if anyone has a definitive answer on this ;-)</FONT></SPAN></DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2"></FONT></SPAN> </DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2">Also, performance wise, is it better to do the conversion to RGB in a shader, or is it better to use GL_LUMINANCE8 textures?</FONT></SPAN></DIV> <DIV><FONT face="Arial" color="#800000" size="2"></FONT> </DIV> <DIV><SPAN class="009291310-03052007"><FONT face="Arial" color="#800000" size="2">cheers,</FONT></SPAN></DIV> <DIV align="left"><FONT face="Verdana" size="1">_________________________________________________<BR><B>kostas kostiadis | lead programmer | <FONT color="#ff0000">climax action</FONT><BR></B><FONT color="#666666">work: </FONT><A href="mailto:kos@climaxgroup.com"><FONT color="#666666">kos@climaxgroup.com</FONT></A><FONT color="#666666"> | </FONT><A href="http://www.climaxgroup.com/"><FONT color="#666666">www.climaxgroup.com</FONT></A><FONT color="#666666"><BR></FONT><FONT color="#999999">home: </FONT><A href="mailto:kos@kostiadis.com"><FONT color="#999999">kos@kostiadis.com</FONT></A><FONT color="#999999"> | </FONT><A href="http://www.kostiadis.com/"><FONT color="#999999">www.kostiadis.com</FONT></A></FONT></DIV> <DIV><FONT face="Arial" size="1"></FONT> </DIV> <DIV> </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">theora mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:theora@xiph.org">theora@xiph.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://lists.xiph.org/mailman/listinfo/theora">http://lists.xiph.org/mailman/listinfo/theora</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>