[vorbis-dev] some more granulepos questions

Conrad Parker conrad at metadecks.org
Sun Nov 16 17:05:09 PST 2003



On Sat, Nov 15, 2003 at 07:09:57PM -0800, Joshua Haberman wrote:
> I've made a lot of progress on my lossless Vorbis editing project.  I
> have a few more questions about granulepos issues I don't quite
> understand.
> 
> granulepos is a property of Ogg pages, yet it is a field in the
> ogg_packet struct.  When reading packets from an Ogg stream, the
> granulepos is set to -1 for all packets except the last packet in a
> page.  From this I infer that
> 
> - for encoding, the granulepos needs to be correctly set for every
> packet submitted to the stream because any packet could be the last on a
> page.  If it is the last on a page, its granulepos is used for that
> page's granulepos.
> 
> - for decoding, the stream cannot determine a granulepos for each packet
> since it doesn't know anything about the codec, so it uses -1 to
> indicate that it doesn't know.  For the last packet on a page, it uses
> the page's granulepos.
> 
> Q1.  Is this accurate?

yes, that info is lost at the ogg level

for packets that don't end a page, you may be able to reconstruct the
granulepos using codec-specific knowledge, hence the other magic in
vcut (which I'm not too familiar with :)

Conrad.
--- >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 at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list