Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > d76e9d0335eb50de9ef01195761a76f9 > files > 78

lib64kate-devel-0.3.7-1mdv2010.1.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libkate: Granule encoding</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">


<h1><a class="anchor" id="granule">Granule encoding </a></h1><p>Ogg leaves the encoding of granules up to a particular codec, only mandating that granules be non decreasing with time.</p>
<p>The Kate bitstream format uses a linear mapping between time and granule, described here.</p>
<p>A Kate granule position is composed of two different parts:</p>
<ul>
<li>a base granule, in the high bits</li>
<li>a granule offset, in the low bits</li>
</ul>
<div class="fragment"><pre class="fragment">
+----------------+----------------+
| base           | offset         |
+----------------+----------------+
</pre></div><p>The number of bits these parts occupy is variable, and each stream may choose how many bits to dedicate to each. The <a class="el" href="structkate__info.html">kate_info</a> structure for a stream holds that information in the granule_shift field, so each part may be reconstructed from a granulepos.</p>
<p>The <a class="el" href="structkate__info.html">kate_info</a> structure for a stream also holds a rational fraction representing the time span of granule units.</p>
<p>The granule rate is defined by the two fields: </p>
<div class="fragment"><pre class="fragment"><a class="code" href="structkate__info.html#a7eb196702d96e5676b27838cadfd6acf">kate_info::gps_numerator</a>
<a class="code" href="structkate__info.html#a00c2253966d5a22cc3e56f4f98dd4995">kate_info::gps_denominator</a>
</pre></div><p>The number of bits reserved for the offset is defined by the field: </p>
<div class="fragment"><pre class="fragment"><a class="code" href="structkate__info.html#a1bf457732577344fa6d0f035d30d1e13">kate_info::granule_shift</a>
</pre></div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Wed Dec 23 04:05:07 2009 for libkate by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>