[vorbis-dev] granulepos start/end revisited
giles at ghostscript.com
Tue May 18 14:28:32 PDT 2004
On Tue, May 18, 2004 at 05:49:35PM +1000, Andr? Pang wrote:
> A simple question (with a complex answer, no doubt): what's the
> rationale for having a start-time encoded granulepos? It adds (1)
> another dependency, and (2) the need for mode core to handle both start
> times and end times, which will also touch many parts of Ogg and
> possibly affect the code base of the codecs as well.
Well, aside from ogm, there's not been too much deployment of
> To frame the question another way, what's wrong with the current
> end-time granulepos scheme? I've read through all the discussions and
> IRC meeting logs, and still don't understand the necessity for it.
Another way to think about it is a kludge for keeping relevent data
together when you're interleaving bitstreams of significantly different
data rates. A page from a low bitrate stream may cover the same interval
of time as many pages from a high-bitrate stream. If the pages are
sorted by their end-times, that means the page for the low bitrate
stream comes at the end of the sequence of pages from the high-bitrate
This is the opposite of what you want: you must either buffer all that
high bitrate data until you get to the low bitrate data and can begin
decoding, or you have to seek each stream individually like avi.
What you want is the low-bitrate stream's page at the beginning instead.
So you can't sort pages by their end times. Monty's proposal wants to
use any page's granulepos as a seeking signpost, so the rule became
'order by granulepos time' rather than 'order by end time' and you
adjust what the granulepos describes to get around the sorting problem.
The tradeoff is that seeking is harder in streams sorted by start time,
because it is paradoxically more difficult to determine if all the data
you need is ahead of the time you've jumped to. I believe the idea is
to only require proper decode from the seekpoint for streams that use
end-time granulepos (and hence sorting).
--- >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