[theora] Ogg Index A-mod

Ben Schwartz bmschwar at fas.harvard.edu
Mon May 10 10:09:33 PDT 2010

On Mon, 2010-04-26 at 12:21 +1200, Chris Pearce wrote:
> > The spec suggests that for most streams a granularity of 2 seconds or 64
> > KB is sufficient.  I think that corresponds to a granulepos scaling shift
> > of granuleshift+log2(2 seconds / granulerate)

> So, for the granulepos, you suggest the scaling shift to be: 
> granuleshift + log2(2 / granulerate)
> For Theora streams this will be: granuleshift + log2(2 / frames_per_second)
> log2(2 / frames_per_second) is going to be negative for streams with 
> more than 2 frames per second.

Oops!  You're right, I should have written

granuleshift + log2(2 seconds * granulerate).

> We'd also have to be wary of compound errors, e.g. if a keypoint's 
> a-mod-encoded offset decodes to some value less than it's actual value, 
> the delta of all subsequent keyframes need to be adjusted to compensate

Absolutely.  This seems fairly trivial to me.  During encoding, one
first rounds off the values, and then calculates differences.


More information about the theora mailing list