| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 |
<meta http-equiv="X-UA-Compatible" content="IE=11"/> |
| 6 |
<meta name="generator" content="Doxygen 1.9.4"/> |
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 |
<title>libkate: Granule encoding</title> |
| 9 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 |
<script type="text/javascript" src="jquery.js"></script> |
| 11 |
<script type="text/javascript" src="dynsections.js"></script> |
| 12 |
<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 16 |
<div id="titlearea"> |
| 17 |
<table cellspacing="0" cellpadding="0"> |
| 18 |
<tbody> |
| 19 |
<tr id="projectrow"> |
| 20 |
<td id="projectalign"> |
| 21 |
<div id="projectname">libkate<span id="projectnumber"> 0.4.3</span> |
| 22 |
</div> |
| 23 |
</td> |
| 24 |
</tr> |
| 25 |
</tbody> |
| 26 |
</table> |
| 27 |
</div> |
| 28 |
<!-- end header part --> |
| 29 |
<!-- Generated by Doxygen 1.9.4 --> |
| 30 |
<script type="text/javascript" src="menudata.js"></script> |
| 31 |
<script type="text/javascript" src="menu.js"></script> |
| 32 |
<script type="text/javascript"> |
| 33 |
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ |
| 34 |
$(function() { |
| 35 |
initMenu('',false,false,'search.php','Search'); |
| 36 |
}); |
| 37 |
/* @license-end */ |
| 38 |
</script> |
| 39 |
<div id="main-nav"></div> |
| 40 |
</div><!-- top --> |
| 41 |
<div><div class="header"> |
| 42 |
<div class="headertitle"><div class="title">Granule encoding </div></div> |
| 43 |
</div><!--header--> |
| 44 |
<div class="contents"> |
| 45 |
<div class="textblock"><p >Ogg leaves the encoding of granules up to a particular codec, only mandating that granules be non decreasing with time.</p> |
| 46 |
<p >The Kate bitstream format uses a linear mapping between time and granule, described here.</p> |
| 47 |
<p >A Kate granule position is composed of two different parts:</p><ul> |
| 48 |
<li>a base granule, in the high bits</li> |
| 49 |
<li>a granule offset, in the low bits</li> |
| 50 |
</ul> |
| 51 |
<pre class="fragment">+----------------+----------------+ |
| 52 |
| base | offset | |
| 53 |
+----------------+----------------+ |
| 54 |
</pre><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> |
| 55 |
<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> |
| 56 |
<p >The granule rate is defined by the two fields: </p><div class="fragment"><div class="line"><a class="code hl_variable" href="structkate__info.html#a7eb196702d96e5676b27838cadfd6acf">kate_info::gps_numerator</a></div> |
| 57 |
<div class="line"><a class="code hl_variable" href="structkate__info.html#a00c2253966d5a22cc3e56f4f98dd4995">kate_info::gps_denominator</a></div> |
| 58 |
<div class="ttc" id="astructkate__info_html_a00c2253966d5a22cc3e56f4f98dd4995"><div class="ttname"><a href="structkate__info.html#a00c2253966d5a22cc3e56f4f98dd4995">kate_info::gps_denominator</a></div><div class="ttdeci">kate_uint32_t gps_denominator</div><div class="ttdef"><b>Definition:</b> kate.h:287</div></div> |
| 59 |
<div class="ttc" id="astructkate__info_html_a7eb196702d96e5676b27838cadfd6acf"><div class="ttname"><a href="structkate__info.html#a7eb196702d96e5676b27838cadfd6acf">kate_info::gps_numerator</a></div><div class="ttdeci">kate_uint32_t gps_numerator</div><div class="ttdef"><b>Definition:</b> kate.h:286</div></div> |
| 60 |
</div><!-- fragment --><p >The number of bits reserved for the offset is defined by the field: </p><div class="fragment"><div class="line"><a class="code hl_variable" href="structkate__info.html#a1bf457732577344fa6d0f035d30d1e13">kate_info::granule_shift</a></div> |
| 61 |
<div class="ttc" id="astructkate__info_html_a1bf457732577344fa6d0f035d30d1e13"><div class="ttname"><a href="structkate__info.html#a1bf457732577344fa6d0f035d30d1e13">kate_info::granule_shift</a></div><div class="ttdeci">unsigned char granule_shift</div><div class="ttdef"><b>Definition:</b> kate.h:283</div></div> |
| 62 |
</div><!-- fragment --> </div></div><!-- contents --> |
| 63 |
</div><!-- PageDoc --> |
| 64 |
<!-- start footer part --> |
| 65 |
<hr class="footer"/><address class="footer"><small> |
| 66 |
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 |
| 67 |
</small></address> |
| 68 |
</body> |
| 69 |
</html> |