-<HTML><HEAD><TITLE>xiph.org: Ogg Vorbis documentation</TITLE>
-<BODY bgcolor="#ffffff" text="#202020" link="#006666" vlink="#000000">
-<nobr><img src="white-ogg.png"><img src="vorbisword2.png"></nobr><p>
-
-<h1><font color=#000070>
-Ogg Vorbis I format specification: helper equations
-</font></h1>
-
-<em>Last update to this document: October 15, 2002</em><p>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"/>
+<title>Ogg Vorbis Documentation</title>
+
+<style type="text/css">
+body {
+ margin: 0 18px 0 18px;
+ padding-bottom: 30px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #333333;
+ font-size: .8em;
+}
+
+a {
+ color: #3366cc;
+}
+
+img {
+ border: 0;
+}
+
+#xiphlogo {
+ margin: 30px 0 16px 0;
+}
+
+#content p {
+ line-height: 1.4;
+}
+
+h1, h1 a, h2, h2 a, h3, h3 a {
+ font-weight: bold;
+ color: #ff9900;
+ margin: 1.3em 0 8px 0;
+}
+
+h1 {
+ font-size: 1.3em;
+}
+
+h2 {
+ font-size: 1.2em;
+}
+
+h3 {
+ font-size: 1.1em;
+}
+
+li {
+ line-height: 1.4;
+}
+
+#copyright {
+ margin-top: 30px;
+ line-height: 1.5em;
+ text-align: center;
+ font-size: .8em;
+ color: #888888;
+ clear: both;
+}
+</style>
+
+</head>
+
+<body>
+
+<div id="xiphlogo">
+ <a href="http://www.xiph.org/"><img src="fish_xiph_org.png" alt="Fish Logo and Xiph.Org"/></a>
+</div>
+
+<h1>Ogg Vorbis I format specification: helper equations</h1>
<h1>Overview</h1>
-The equations below are used in multiple places by the Vorbis codec
-specification. Rather than cluttering up the main specification
+<p>The equations below are used in multiple places by the Vorbis codec
+specification. Rather than cluttering up the main specification
documents, they are defined here and linked in the main documents
-where appropriate.<p>
-
-<a name=log><h2>ilog</h2></a>
+where appropriate.</p>
+<h2><a name="log">ilog</a></h2>
-The "ilog(x)" function returns the position number (1 through n) of the highest set bit in the two's complement integer value
-<tt>[x]</tt>. Values of <tt>[x]</tt> less than zero are defined to return zero.
+<p>The "ilog(x)" function returns the position number (1 through n) of the
+highest set bit in the two's complement integer value
+<tt>[x]</tt>. Values of <tt>[x]</tt> less than zero are defined to return zero.</p>
<pre>
1) [return_value] = 0;
6) done
</pre>
-Examples:
+<p>Examples:</p>
-<ul><li> ilog(0) = 0;
- <li> ilog(1) = 1;
- <li> ilog(2) = 2;
- <li> ilog(3) = 2;
- <li> ilog(4) = 3;
- <li> ilog(7) = 3;
- <li> ilog(negative number) = 0;
-</uL>
+<ul>
+<li>ilog(0) = 0;</li>
+<li>ilog(1) = 1;</li>
+<li>ilog(2) = 2;</li>
+<li>ilog(3) = 2;</li>
+<li>ilog(4) = 3;</li>
+<li>ilog(7) = 3;</li>
+<li>ilog(negative number) = 0;</li>
+</ul>
-<a name=float32_unpack><h2>float32_unpack</h2></a>
+<h2><a name="float32_unpack">float32_unpack</a></h2>
-"float32_unpack(x)" is intended to translate the packed binary
+<p>"float32_unpack(x)" is intended to translate the packed binary
representation of a Vorbis codebook float value into the
-representation used by the decoder for floating point numbers. For
+representation used by the decoder for floating point numbers. For
purposes of this example, we will unpack a Vorbis float32 into a
-host-native floating point number.<p>
+host-native floating point number.</p>
<pre>
1) [mantissa] = [x] bitwise AND 0x1fffff (unsigned result)
5) return [mantissa] * ( 2 ^ ( [exponent] - 788 ) )
</pre>
-<a name=lookup1_values><h2>lookup1_values</h2></a>
+<h2><a name="lookup1_values">lookup1_values</a></h2>
-"lookup1_values(codebook_entries,codebook_dimensions)" is used to
+<p>"lookup1_values(codebook_entries,codebook_dimensions)" is used to
compute the correct length of the value index for a codebook VQ lookup
-table of lookup type 1. The values on this list are permuted to
+table of lookup type 1. The values on this list are permuted to
construct the VQ vector lookup table of size
-<tt>[codebook_entries]</tt>.<p>
+<tt>[codebook_entries]</tt>.</p>
-The return value for this function is defined to be 'the greatest
+<p>The return value for this function is defined to be 'the greatest
integer value for which <tt>[return_value] to the power of
[codebook_dimensions] is less than or equal to
-[codebook_entries]</tt>'.
+[codebook_entries]</tt>'.</p>
-<a name=low_neighbor><h2>low_neighbor</h2></a>
+<h2><a name="low_neighbor">low_neighbor</a></h2>
-"low_neighbor(v,x)" finds the position <i>n</i> in vector [v] of
+<p>"low_neighbor(v,x)" finds the position <i>n</i> in vector [v] of
the greatest value scalar element for which <i>n</i> is less than
<tt>[x]</tt> and <tt>vector [v] element <i>n</i> is less
-than vector [v] element [x]</tt>.
+than vector [v] element [x]</tt>.</p>
-<a name=high_neighbor><h2>high_neighbor</h2></a>
+<h2><a name="high_neighbor">high_neighbor</a></h2>
-"high_neighbor(v,x)" finds the position <i>n</i> in vector [v] of
+<p>"high_neighbor(v,x)" finds the position <i>n</i> in vector [v] of
the lowest value scalar element for which <i>n</i> is less than
<tt>[x]</tt> and <tt>vector [v] element <i>n</i> is greater
-than vector [v] element [x]</tt>.
+than vector [v] element [x]</tt>.</p>
-<a name=render_point><h2>render_point</h2></a>
+<h2><a name="render_point">render_point</a></h2>
-"render_point(x0,y0,x1,y1,X)" is used to find the Y value at point X
-along the line specified by x0, x1, y0 and y1. This function uses an
+<p>"render_point(x0,y0,x1,y1,X)" is used to find the Y value at point X
+along the line specified by x0, x1, y0 and y1. This function uses an
integer algorithm to solve for the point directly without calculating
-intervening values along the line.<p>
+intervening values along the line.</p>
<pre>
1) [dy] = [y1] - [y0]
9) done
</pre>
-<a name=render_line><h2>render_line</h2></a>
+<h2><a name="render_line">render_line</a></h2>
-Floor decode type one uses the integer line drawing algorithm of
+<p>Floor decode type one uses the integer line drawing algorithm of
"render_line(x0, y0, x1, y1, v)" to construct an integer floor
curve for contiguous piecewise line segments. Note that it has not
been relevant elsewhere, but here we must define integer division as
-rounding division of both positive and negative numbers toward zero.
+rounding division of both positive and negative numbers toward zero.</p>
<pre>
1) [dy] = [y1] - [y0]
}
</pre>
-<hr>
-<a href="http://www.xiph.org/">
-<img src="white-xifish.png" align=left border=0>
-</a>
-<font size=-2 color=#505050>
-
-Ogg is a <a href="http://www.xiph.org">Xiph.org Foundation</a> effort
-to protect essential tenets of Internet multimedia from corporate
-hostage-taking; Open Source is the net's greatest tool to keep
-everyone honest. See <a href="http://www.xiph.org/about.html">About
-the Xiph.org Foundation</a> for details.
-<p>
-
-Ogg Vorbis is the first Ogg audio CODEC. Anyone may freely use and
-distribute the Ogg and Vorbis specification, whether in a private,
-public or corporate capacity. However, the Xiph.org Foundation and
-the Ogg project (xiph.org) reserve the right to set the Ogg Vorbis
-specification and certify specification compliance.<p>
-
-Xiph.org's Vorbis software CODEC implementation is distributed under a
-BSD-like license. This does not restrict third parties from
-distributing independent implementations of Vorbis software under
-other licenses.<p>
-
-Ogg, Vorbis, Xiph.org Foundation and their logos are trademarks (tm)
-of the <a href="http://www.xiph.org/">Xiph.org Foundation</a>. These
-pages are copyright (C) 1994-2002 Xiph.org Foundation. All rights
-reserved.<p>
+<div id="copyright">
+ The Xiph Fish Logo is a
+ trademark (™) of Xiph.Org.<br/>
-</body>
+ These pages © 1994 - 2005 Xiph.Org. All rights reserved.
+</div>
+</body>
+</html>