[vorbis-dev] granulepos

Ralph Giles
Sun, 18 Feb 2001 12:04:49 -0000

On Sun, 18 Feb 2001, Martin C. Martin wrote:

> I can't seem to find any docs on the "granulepos" field.
What does it
> represent?  I know it's zero for header pages and non-zero for body
> pages, but that it can also be -1.  When is it -1?

The docs for this are at http://xiph.org/ogg/vorbis/doc/framing.html

The 'granulepos' field, called 'PCM absolute position' in the
spec is the
index number of the last sample that can be decoded using the packets that
end on that page. A 'sample' would be a the pcm position for audio (e.g.
two 16-bit numbers, one for each channel) or the frame number for video.

It's a 64 bit unsigned integer, so a value of '-1' is really
0xFFFFFFFFFFFFFFFF. Other places (like the stream length) this means
infintity, but I don't know why you'd use that for the granulepos field
of
a page header.

> And while I'm at it, is there any invalid serial number, that is
> guarenteed never to appear in a page?  0?  -1?

The spec says only that it's a 32-bit integer that must be unique within
the physical bitstream.

Hope that helps,
 -ralph

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to
'vorbis-dev-request@xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is
needed.
Unsubscribe messages sent to the list will be ignored/filtered.