Granule encoding

Ogg leaves the encoding of granules up to a particular codec, only mandating that granules be non decreasing with time.

The Kate bitstream format uses a linear mapping between time and granule, described here.

A Kate granule position is composed of two different parts:

+----------------+----------------+
| base           | offset         |
+----------------+----------------+

The number of bits these parts occupy is variable, and each stream may choose how many bits to dedicate to each. The kate_info structure for a stream holds that information in the granule_shift field, so each part may be reconstructed from a granulepos.

The kate_info structure for a stream also holds a rational fraction representing the time span of granule units.

The granule rate is defined by the two fields:

kate_info::gps_numerator
kate_info::gps_denominator

The number of bits reserved for the offset is defined by the field:

kate_info::granule_shift

Generated on Sun Aug 21 23:47:09 2011 for libkate by  doxygen 1.6.0