[vorbis-dev] granulepos start/end revisited

André Pang ozone at algorithm.com.au
Thu May 20 23:27:08 PDT 2004



On 21/05/2004, at 4:00 PM, Arc Riley wrote:

>> 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.

I disagree.  SMIL does a similar thing (permitting overlapping 
durations), and it makes the decoding process ... rather challenging.  
e.g. See

     http://www.w3.org/TR/smil20/smil-timing.html#q80

for a description of how to implement SMIL's durations.  I'm not 
implying that the Writ's implementation will end up being that complex, 
of course: my point is that there's more logic needed just to make sure 
that your table, which tells you when to turn off subtitles, is 
correct, especially once seeking comes into play.  How is this any 
simpler than turning subtitles off/on via state changes?

To put it another way, I'll challenge anyone to write a "simple" 
implementation of this, and take a bet that if state changes were used, 
it'd be an order of magnitude simpler.  Especially one seeking becomes 
involved ...

> 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.

Re-read my message: I am saying that if you model subtitles with state 
changes instead of using durations, you (a) don't have packets which 
overlap in time anymore (because state changes are instantaneous), and 
(b) you don't need start-time granulepos.  You can still have 
overlapping subtitles with state changes, but you don't need Ogg itself 
to support overlapping granules, which opens up a whole can o'worms.

> 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.

As I say above, I disagree with these points, and think the contrary is 
true.  Using state changes, I think the encoder logic is possibly a bit 
more complex, and the decoder logic becomes much simpler.

<p>
-- 
% Andre Pang : trust.in.love.to.save

--- >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