[Theora-dev] yuv2rgb

Alen Ladavac alenl-ml at croteam.com
Thu Dec 9 07:39:18 PST 2004


Phew.... sorry for just trying to help a poor guy who clearly states he's a
newb. It won't happen again. I'll try to be a Puritan and preach the true
religion.

Lluis, it doesn't matter if you can't get the component planes correctly,
just remember that "Thou shalt always order Cr and Cb components properly,
and pray to the true color space..." ;)

----- Original Message -----
From: "Timothy B. Terriberry" <tterribe at vt.edu>
To: "Alen Ladavac" <alenl-ml at croteam.com>
Cc: <theora-dev at xiph.org>
Sent: Thursday, December 09, 2004 08:21
Subject: Re: [Theora-dev] yuv2rgb


> Alen Ladavac wrote:
> > Here are some usefull references:
> >
> > a) checkout http://www.fourcc.org/yuv.php
> > b) search for "Video Rendering with 8-Bit YUV Formats" on
> > http://msdn.microsoft.com/library
> >
> > To help you filter the information you are interested in, the format
that
> > theora uses internally is officially called YV12.
> >
> > That's regarding the color format. I hope you understand the image
layout
> > tricks with negative strides etc.
>
> I would ignore FOURCC codes altogether. They both overspecify things
> like memory layout that do not apply to the libtheora API and
> underspecify things like chroma siting locations, RGB primaries, etc.
>
> Step 1 to understanding video colorspaces: there is no such space as YUV.
>
> Alen nicely proves the point of why you should never use the term by
> suggesting Theora uses YV12. Theora uses Y'CbCr, however most (but not
> all) interpretations of YV12 really mean Y'CrCb, with the chroma
> components swapped. Unlike U and V, Cb and Cr have an unambiguous
> interpretation. In the current libtheora API, U corresponds to Cb and V
> corresponds to Cr (future API revisions will hopefully fix this to refer
> to them as Cb and Cr directly).
>
> Step 2: There is more than one RGB space.
> The red, green, and blue primaries in your television are not the same
> as in your monitor. They're not even the same between NTSC and PAL
> televisions. Know what your target is and use the right conversion.
>
> Having said that, Chapter 4 of the Theora spec
> (http://www.theora.org/doc/Theora_I_spec.pdf) provides explicit detail
> on the exact colorspaces Theora supports, and how to convert between them.
>



More information about the Theora-dev mailing list