[theora-dev] further debugging of my ogg/theora decoder

salsaman salsaman at gmail.com
Wed Nov 12 13:13:06 PST 2008

On Wed, Nov 12, 2008 at 4:28 PM, Ralph Giles <giles at xiph.org> wrote:

> On Wed, Nov 12, 2008 at 2:50 AM, salsaman <salsaman at gmail.com> wrote:
> >  I would like to know if theora uses clamped or unclamped YUV.
> I don't know what you mean by that. Theora supports two calibrated
> colour spaces, one equivalent to NTSC and one equivalent to PAL. Most
> videos I've seen use the 'uncalibrated' option when allows full range
> in all three 8-bit Y'CrCb channels, and doesn't say how that should be
> converted to RGB.
> These are TH_CS_ITU_REC_470M, TH_CS_ITU_REC_470BG, and
> TH_CS_UNSPECIFIED, respectively, set/read through the colorspace
> element of the th_info struct.
> Is that what you meant?
>  -r

Ah OK, I read the spec. The YUV extension is given as {219,224,224} which
means "clamped" to me. (Unclamped would be {255,255,255} ).

One final (I hope) question:

suppose I start decoding from a page with granulepos (kframe=x, frame =y)
and I continue decoding in sequence until I reach the next page with a
non-negative granulepos (kframe=a, frame=b). Is it possible that there could
be another keyframe between x and a ? In other words, do "hidden" keyframes
exist in the ogg stream, or is it safe to assume that every keyframe has at
least one (non-negative) granulepos ?

Let me give an example. Suppose I am seeking for frame 20. I find a
granulepos of (18,22). Good, so I know that the keyframe is 18 + an offset
of 2. So now I seek again to find the largest granulepos before 18. I find
(10,12). Great.
So I start decoding from (10,12) and I reach a keyframe. Can I assume this
keyframe is 18, and then just decode two more frames ? Or is it possible
that 13,14,15,16 or 17 could also be keyframes ? (The former is the case if
and only if encoding a new keyframe forces and end-of-page and non-negative
granulepos to be written.)

I don't fully understand this negative-granulepos setting. For example, I
have a video file where the first 10 or so pages have negative gpos, and
then I get a page with (keyframe=1, frame=5). So what happened to (1,1)
(1,2) (1,3) and (1,4) ? Surely it cannot be the case that all 5 frames are
produced on the last page ?

Then the next page is (1,6) so why is this on a page on its own, without any
continuation ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/theora-dev/attachments/20081112/0f64557d/attachment.htm 

More information about the theora-dev mailing list