[Theora] will there be theora_decode_RGBout() ?

Ralph Giles giles at xiph.org
Fri Jul 1 00:52:14 PDT 2005


On Thu, Jun 30, 2005 at 10:55:21AM +0200, david kment wrote:

> i would like to know whether there will be some function to decode to some plain 24 bit RGB buffer in the future.

I'd like to add such a thing, but it probably won't be until after the 
1.0 release. Makes more sense to do a more general api addition where
we return a general frame structure that can support various colourspace
and pixel ordering options.

I supposed in the meantime having something in examples woud be a good
idea. Want to write something?

> i think this feature is sometimes important, especially when using different surface layers, or when modifying
> the buffer in realtime.

If you're trying to do these things in realtime it might be faster to 
convert your other layers to planar YUV, and let the video card handle 
the conversion back for display like the example player. Depends which
layer has the highest framerate, I guess.

> if this feature will definitely not be, could someone tell me how i can convert to some RGB buffer in realtime?
> i already tried different example codes, but i did not succeed, since i do not seem to understand the way the YCbCr data works....

If it helps any, the YUV data is stored in planar format, which means
each component is a separate image. Also the "U" and "V" channels can
be subsampled by a factor of two from the full Y resolution. So to
convert to normal RGB triplets, you have to combine pixels from the
three planes, interpolate the U and V channels up to full resolution
and then rotate to get RGB. The spec has full details of how to do
this accurately, but most people don't bother with accurate colour
and just do something fast.

 -r



More information about the Theora mailing list