[ogg-dev] Seeking to granules in discontinuous streams

Conrad Parker conrad at metadecks.org
Thu Feb 14 04:03:40 PST 2008


Hi,

sorry, there is a bug in the CMML spec and wiki page ... I discussed
this with Silvia earlier this week but haven't gotten around to
correcting it yet.

CMML granulepos is much like theora's; the previous granule is stored
in the higher bits, and the delta since then is stored in the lower
bits. The current timestamp is the sum of the two. This is the
behavior of the implementations (and has been for many years), and
what is supposed to be in the spec ...

Conrad.

On 14/02/2008, ogg.k.ogg.k at googlemail.com <ogg.k.ogg.k at googlemail.com> wrote:
> Some more thinking about this whole granulepos splitting. Sorry for
>  the badgering :)
>
>  The CMML way was presented as a similar way as the Theora way, which I didn't
>  see (I actually use such a system to allow multiple events to start at
>  the same time,
>  and this feels like the Theora way).
>  Theora can find any frame's previous keyframe granulepos by clearing
>  the low bits
>  of the frame's granulepos. In CMML, this is the other way round: you
>  have to shift
>  left by 32 to get the previous frame. This is what puzzled me I think.
>
>  Now, if one were to swap the 2 32 bit granulepos bits in CMML granules, then you
>  would still get a strictly increasing granulepos (since the previous
>  pointer can never
>  get backwards in time), and this would be more similar to Theora (eg,
>  clear off the low
>  bits). The high bits are now the backlink, and the low bits are the
>  granulepos are the
>  actual granule of the current packet (not an offset from the frame as
>  Theora does,
>  but closer to what it does).
>
>  You still lose 32 bits of granulespace, of course, which really
>  bothers me. At millisecond
>  precision, 32 bits (signed) just give 24 days. Yeah, I know I've said
>  it before :)
>
>  Anyway, this makes a generic seeking algorithm handle Theora and CMML the same
>  way, clear off the low bits below the granule shift and start off from there.
>
> _______________________________________________
>  ogg-dev mailing list
>  ogg-dev at xiph.org
>  http://lists.xiph.org/mailman/listinfo/ogg-dev
>
>


More information about the ogg-dev mailing list