Re: Re: YUV to RGB
Mihai Balea <[email protected]>
| Newsgroups | gmane.comp.multimedia.ogg.theora.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, If you're looking for some pretty fast, portable C code, here's another version that uses pre-calculated lookup tables (starts around line 665): http://iaxclient.svn.sourceforge.net/viewvc/iaxclient/branches/2.0/ lib/video.c?revision=1199&view=markup This is part of the iaxclient project, which is licensed under LGPL, so if LGPL works for you, you can re-use the code. If LGPL is not acceptable, you can probably re-implement the idea. Mihai On Jan 15, 2008, at 5:52 AM, Shane Stephens wrote: > Hi, > > 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). > > 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. > > Cheers, > -Shane > > On Jan 15, 2008 6:48 PM, Ralph Giles <[email protected]> wrote: > 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 > _______________________________________________ > theora-dev mailing list > [email protected] > http://lists.xiph.org/mailman/listinfo/theora-dev > > _______________________________________________ > theora-dev mailing list > [email protected] > http://lists.xiph.org/mailman/listinfo/theora-dev _______________________________________________ theora-dev mailing list [email protected] http://lists.xiph.org/mailman/listinfo/theora-dev
smime.p7s
(application/pkcs7-signature, 2.4 KB) - not displayed