[vorbis-dev] granulepos start/end revisited

Arc Riley arc at xiph.org
Thu May 20 23:00:57 PDT 2004



On Fri, May 21, 2004 at 03:32:05PM +1000, Andr? Pang wrote:
> 
> One disadvantage of this approach is that you need to assign some sort 
> of identifier for each subtitle, because to "turn off" a subtitle, you 
> need to refer to which subtitle you want to turn off (A or B).  You can 
> re-use identifiers, of course, but if you make the identifier a simple 
> 32-bit integer, that's plenty of IDs available.  You also get a bit 
> more overhead because you have extra packets.
> 
> The big advantage is that you don't have overlapping granulepos's, 
> which greatly simplifies a player implementation: you don't have to 
> maintain an internal table where you need to track when something turns 
> on or off, you just turn off when you receive the packet that tells you 
> to turn off.  You probably simplify seeking and buffering code greatly, 
> too (though I haven't thought about this greatly).  You also don't have 
> to use a start-time granulepos, an end-time granulepos will do just 
> fine, so this scheme will work right now, as opposed to whenever 
> start-time granulepos code gets implemented.

This is not a big advantage, because you are still keeping track of 
subtitles so you know which ID turns which one off.  It's far more 
simpler, especially on the encoder side, to simply state how long a 
phrase should last and periodically repeat it if it's especially long.

The issue at the heart of this is that they can overlap and one phrase 
does not immediatly follow another. This is what makes it discontinuous, 
and this is why start-time granulepos is needed.  

It doesn't really simplify matters at all, as far as I can see, with 
this "on/off" approach and adds to the number of things that can go 
wrong in the stream (ie, what happens when the user seeks) and thus 
number of things that need to be tested against.  Knowing ahead of time 
how long a phrase is valid for eliminates alot of these issues.
--- >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