Remove the original html documentation. The docbook version is now on
authorRalph Giles <giles@xiph.org>
Thu, 31 Oct 2002 21:19:44 +0000 (21:19 +0000)
committerRalph Giles <giles@xiph.org>
Thu, 31 Oct 2002 21:19:44 +0000 (21:19 +0000)
par or better. Don't forget to make the docs before you roll a
distribution.

svn path=/trunk/vorbis/; revision=4074

doc/Makefile.am
doc/index.html
doc/vorbis-ogg.html [deleted file]
doc/vorbis-spec-bitpack.html [deleted file]
doc/vorbis-spec-codebook.html [deleted file]
doc/vorbis-spec-floor0.html [deleted file]
doc/vorbis-spec-floor1.html [deleted file]
doc/vorbis-spec-intro.html [deleted file]
doc/vorbis-spec-ref.html [deleted file]
doc/vorbis-spec-res.html [deleted file]

index aea786a..6e8e25c 100644 (file)
@@ -42,14 +42,6 @@ doc_DATA = components.png \
        vorbis-clip.txt \
        vorbis-errors.txt \
        vorbis-fidelity.html \
-       vorbis-ogg.html \
-       vorbis-spec-bitpack.html \
-       vorbis-spec-codebook.html \
-       vorbis-spec-floor0.html \
-       vorbis-spec-floor1.html \
-       vorbis-spec-intro.html \
-       vorbis-spec-ref.html \
-       vorbis-spec-res.html \
        vorbis.html \
        vorbisword2.png \
        wait.png \
index f9e4af8..fb9837f 100644 (file)
@@ -16,17 +16,13 @@ Ogg Vorbis Documentation
 <li><a href="stereo.html">Vorbis channel coupling and stereo-specific application</a>
 </ul>
 
-<h2>Ogg Vorbis I specification documents</h2>
+<h2>Ogg Vorbis I specification</h2>
+
 <ul>
-<li><a href="vorbis-spec-intro.html">Vorbis specification introduction and description</a>
-<li><a href="vorbis-spec-bitpack.html">Vorbis bitpacking convention</a>
-<li><a href="vorbis-spec-codebook.html">Vorbis probability model and codebooks</a>
-<li><a href="vorbis-spec-ref.html">Vorbis codec setup and packet decode</a>
+<li>Vorbis I specification 
+      [<a href="Vorbis_I_spec.html">html</a>]
+      [<a href="Vorbis_I_spec.pdf">pdf</a>]
 <li><a href="v-comment.html">Vorbis comment header specification</a>
-<li><a href="vorbis-spec-floor0.html">Vorbis floor type 0 setup and decode</a>
-<li><a href="vorbis-spec-floor1.html">Vorbis floor type 1 setup and decode</a>
-<li><a href="vorbis-spec-res.html">Vorbis residue types 0, 1 and 2 setup and decode</a>
-<li><a href="vorbis-ogg.html">Embedding Vorbis encoded audio in an Ogg bitstream</a>
 <li><a href="draft-moffitt-vorbis-rtp-00.txt">Embedding Vorbis encoded audio in an RTP payload format</a>
 </ul>
 
diff --git a/doc/vorbis-ogg.html b/doc/vorbis-ogg.html
deleted file mode 100644 (file)
index 080c854..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<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: embedding Vorbis into an Ogg stream
-</font></h1>
-
-<em>Last update to this document: July 14, 2002</em><br>
-
-<h1>Overview</h1>
-
-This document describes using Ogg logical and physical transport
-streams to encapsulate Vorbis compressed audio packet data into file
-form.<p>
-
-_<a href="vorbis-spec-intro.html">Ogg Vorbis I format specification:
-high-level description</a>_ provides an overview of the construction
-of Vorbis audio packets.<p> The _<a href="oggstream.html">Ogg
-bitstream overview</a>_ and <a href="framing.html">Ogg logical
-bitstream and framing spec</a>_ provide detailed descriptions of Ogg
-transport streams.  This specification document assumes a working
-knowledge of the concepts covered in these named backround
-documents.  Please read them first.<p>
-
-
-<h2>Restrictions</h2>
-
-The Ogg/Vorbis I specification currently dictates that Ogg/Vorbis
-streams use Ogg transport streams in degenerate, unmultiplexed
-form only. That is:
-
-<ul>
-<li>A meta-headerless Ogg file encapsulates the Vorbis I packets
-<li>The Ogg stream may be chained, i.e. contain multiple, contigous logical streams (links).
-<li>The Ogg stream must be unmultiplexed (only one stream, a Vorbis audio stream, per link)
-</ul>
-
-This is not to say that it is not currently possible to multiplex
-Vorbis with other media types into a multi-stream Ogg file.  At the
-time this document was written, Ogg was becoming a popular container
-for low-bitrate movies consisting of DiVX video and Vorbis audio.
-However, a 'Vorbis I audio file' is taken to imply Vorbis audio
-existing alone within a degenerate Ogg stream.  A compliant 'Vorbis
-audio player' is not required to implement Ogg support beyond the
-specific support of Vorbis within a degenrate ogg stream (naturally,
-application authors are encouraged to support full multiplexed Ogg
-handling).
-<p>
-
-<h2>MIME type</h2>
-
-The correct MIME type of any Ogg file is <tt>application/x-ogg</tt>.
-However, if a file is a Vorbis I audio file (which implies a
-degenerate Ogg stream including only unmultiplexed Vorbis audio), the
-mime type <tt>audio/x-vorbis</tt> is also allowed.
-
-<h1>Encapsulation</h1>
-
-Ogg encapsulation of a Vorbis packet stream is straightforward.<p>
-
-<ul>
-<li>The first Vorbis packet [the indentification header], which
-uniquely identifies a stream as Vorbis audio, is placed alone in the
-first page of the logical Ogg stream.  This results in a first Ogg
-page of exactly 58 bytes at the very beginning of the logical stream.<p>
-
-<li>This first page is marked 'beginning of stream' in the page flags.<p>
-
-<li>The second and third vorbis packets [comment and setup
-headers] may span one or more pages beginning on the second page of
-the logical stream.  However many pages they span, the third header
-packet finishes the page on which it ends.  The next [first audio] packet
-must begin on a fresh page.<p>
-
-<li>The granule position of these first pages containing only headers is
-zero.<p>
-
-<li>The first audio packet of the logical stream begins a fresh Ogg page.<p>
-
-<li>Packets are placed into ogg pages in order until the end of stream.<p>
-
-<li>The last page is marked 'end of stream' in the page flags.<p>
-
-<li>Vorbis packets may span page boundaries. <p>
-
-<li>The granule position of pages containing Vorbis audio is in units
-of PCM audio samples (per channel; a stereo stream's granule position
-does not increment at twice the speed of a mono stream).<p>
-
-<li>The granule position of a page represents the end PCM sample
-position of the last packet <em>completed</em> on that page.  A page
-that is entirely spanned by a single packet (that completes on a
-subsequent page) has no granule position, and the granule position is
-set to '-1'.<p>
-
-<li>The granule (PCM) position of the first page need not indicate
-    that the stream started at position zero.  Although the granule
-    position belongs to the last completed packet on the page and a 
-    valid granule position must be positive, by
-    inference it may indicate that the PCM position of the beginning
-    of audio is positive or negative.<p>
-    
-  <ul>
-    <li>A positive starting value simply indicates that this stream begins at
-        some positive time offset, potentially within a larger
-        program. This is a common case when connecting to the middle
-        of broadcast stream.<p>  <li>A negative value indicates that
-        output samples preceeding time zero should be discarded during
-        decoding; this technique is used to allow sample-granularity
-        editing of the stream start time of already-encoded Vorbis
-        streams.  The number of samples to be discarded must not exceed 
-        the overlap-add span of the first two audio packets.<p>
-  </uL>
-  In both of these cases in which the initial audio PCM starting
-  offset is nonzero, the second finished audio packet must flush the
-  page on which it appears and the third packet begin a fresh page.
-  This allows the decoder to always be able to perform PCM position
-  adjustments before needing to return any PCM data from synthesis, 
-  resulting in correct positioning information without any aditional
-  seeking logic.<p>
-
-  (Note however that failure to do so should, at worst, cause a
-  decoder implementation to return incorrect positioning information
-  for seeking operations at the very beginning of the stream.)<p>
-
-<li> A granule position on the final page in a stream that indicates
-less audio data than the final packet would normally return is used to
-end the stream on other than even frame boundaries.  The difference
-between the actual available data returned and the declared amount
-indicates how many trailing samples to discard from the decoding
-process.<p>
-</ul>
-<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>
-
-</body>
-
diff --git a/doc/vorbis-spec-bitpack.html b/doc/vorbis-spec-bitpack.html
deleted file mode 100644 (file)
index bb19239..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-<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: bitpacking convention
-</font></h1>
-
-<em>Last update to this document: July 14, 2002</em><br>
-
-<h1>Overview</h1>
-
-The Vorbis codec uses relatively unstructured raw packets containing
-arbitrary-width binary integer fields.  Logically, these packets are a
-bitstream in which bits are coded one-by-one by the encoder and then
-read one-by-one in the same monotonically increasing order by the
-decoder.  Most current binary storage arrangements group bits into a
-native word size of eight bits (octets), sixteen bits, thirty-two bits
-or, less commonly other fixed word sizes.  The Vorbis bitpacking
-convention specifies the correct mapping of the logical packet
-bitstream into an actual representation in fixed-width words.
-
-<h2>octets, bytes and words</h2>
-
-In most contemporary architectures, a 'byte' is synonymous with an
-'octet', that is, eight bits.  This has not always been the case;
-seven, ten, eleven and sixteen bit 'bytes' have been used.  For
-purposes of the bitpacking convention, a byte implies the native,
-smallest integer storage representation offered by a platform.  On
-modern platforms, this is generally assumed to be eight bits (not
-necessarily because of the processor but because of the
-filesystem/memory architecture.  Modern filesystems invariably offer
-bytes as the fundamental atom of storage).  A 'word' is an integer
-size that is a grouped multiple of this smallest size.<p>
-
-The most ubiquitous architectures today consider a 'byte' to be an
-octet (eight bits) and a word to be a group of two, four or eight
-bytes (16,32 or 64 bits).  Note however that the Vorbis bitpacking
-convention is still well defined for any native byte size; Vorbis uses
-the native bit-width of a given storage system. This document assumes
-that a byte is one octet for purposes of example.<p>
-
-<h2>bit order</h2>
-
-A byte has a well-defined 'least significant' bit [LSb], which is the
-only bit set when the byte is storing the two's complement integer
-value +1.  A byte's 'most significant' bit [MSb] is at the opposite
-end of the byte. Bits in a byte are numbered from zero at the LSb to
-<i>n</i> (<i>n</i>=7 in an octet) for the MSb.<n>
-
-<h2>byte order</h2>
-
-Words are native groupings of multiple bytes.  Several byte orderings
-are possible in a word; the common ones are 3-2-1-0 ('big endian' or
-'most significant byte first' in which the highest-valued byte comes
-first), 0-1-2-3 ('little endian' or 'least significant byte first' in
-which the lowest value byte comes first) and less commonly 3-1-2-0 and
-0-2-1-3 ('mixed endian').<p>
-
-The Vorbis bitpacking convention specifies storage and bitstream
-manipulation at the byte, not word, level, thus host word ordering is
-of a concern only during optimization when writing high performance
-code that operates on a word of storage at a time rather than by byte.
-Logically, bytes are always coded and decoded in order from byte zero
-through byte <em>n</em>.<p>
-
-<h2>coding bits into byte sequences</h2>
-
-The Vorbis codec has need to code arbitrary bit-width integers, from
-zero to 32 bits wide, into packets.  These integer fields are not
-aligned to the boundaries of the byte representation; the next field
-is written at the bit position that the previous field ends.<p>
-
-The encoder logically packs integers by writing the LSb of an binary
-integer to the logical bitstream first, followed by next least
-significant bit, etc, until the requested number of bits have been
-coded.  When packing the bits into bytes, the encoder begins by
-placing the LSb of the integer to be written into the least
-significant unused bit position of the destination byte, followed by
-the next-least significant bit of the source integer and so on up to
-the requested number of bits.  When all bits of the destination byte
-have been filled, encoding continues by zeroing all bits of the next
-byte and writing the next bit into the bit position 0 of that byte.
-Decoding follows the same process as encoding, but by reading bits
-from the byte stream and reassembling them into integers.<p>
-
-<h2>signedness</h2>
-
-The signedness of a specific number resulting from decode is to be
-interpreted by the decoder given decode context.  That is, the three
-bit binary pattern 'b111' can be taken to represent either 'seven' as
-an unsigned integer, or '-1' as a signed, two's complement integer.
-The encoder and decoder are responsible for knowing if fields are to
-be treated as signed or unsigned.
-
-
-<h2>coding example</h2>
-
-Code the 4 bit integer value '12' [b1100] into an empty bytestream.
-Bytestream result:
-
-<pre>  
-              |
-              V
-
-        7 6 5 4 3 2 1 0
-byte 0 [0 0 0 0 1 1 0 0]  <-
-byte 1 [               ]
-byte 2 [               ]
-byte 3 [               ]
-             ...
-byte n [               ]  bytestream length == 1 byte
-
-</pre>
-
-Continue by coding the 3 bit integer value '-1' [b111]:
-
-<pre>
-        |
-        V
-
-        7 6 5 4 3 2 1 0
-byte 0 [0 1 1 1 1 1 0 0]  <-
-byte 1 [               ]
-byte 2 [               ]
-byte 3 [               ]
-             ... 
-byte n [               ]  bytestream length == 1 byte
-</pre>
-
-Continue by coding the 7 bit integer value '17' [b0010001]:
-
-<pre>
-          |
-          V    
-
-        7 6 5 4 3 2 1 0
-byte 0 [1 1 1 1 1 1 0 0]
-byte 1 [0 0 0 0 1 0 0 0]  <-
-byte 2 [               ]
-byte 3 [               ]
-             ...
-byte n [               ]  bytestream length == 2 bytes
-                          bit cursor == 6
-</pre>
-
-Continue by coding the 13 bit integer value '6969' [b110 11001110 01]:
-
-<pre>
-                |
-                V
-
-        7 6 5 4 3 2 1 0
-byte 0 [1 1 1 1 1 1 0 0]
-byte 1 [0 1 0 0 1 0 0 0]
-byte 2 [1 1 0 0 1 1 1 0]
-byte 3 [0 0 0 0 0 1 1 0]  <-
-             ...
-byte n [               ]  bytestream length == 4 bytes
-
-</pre>
-
-<h2>decoding example</h2>
-
-Reading from the beginning of the bytestream encoded in the above example:
-
-<pre>
-                      |
-                      V
-                      
-        7 6 5 4 3 2 1 0
-byte 0 [1 1 1 1 1 1 0 0]  <-
-byte 1 [0 1 0 0 1 0 0 0]
-byte 2 [1 1 0 0 1 1 1 0]
-byte 3 [0 0 0 0 0 1 1 0]  bytestream length == 4 bytes
-
-</pre>
-
-We read two, two-bit integer fields, resulting in the returned numbers
-'b00' and 'b11'.  Two things are worth noting here:
-
-<ul>
-<li>Although these four bits were originally written as a single four-bit
-integer, reading some other combination of bit-widths from the
-bitstream is well defined.  There are no artificial alignment
-boundaries maintained in the bitstream.  <li>The second value is the
-two-bit-wide integer 'b11'.  This value may be interpreted either as
-the unsigned value '3', or the signed value '-1'.  Signedness is
-dependent on decode context.
-</uL>
-
-
-<h2>end-of-packet alignment</h2>
-
-The typical use of bitpacking is to produce many independent
-byte-aligned packets which are embedded into a larger byte-aligned
-container structure, such as an Ogg transport bitstream.  Externally,
-each bytestream (encoded bitstream) must begin and end on a byte
-boundary.  Often, the encoded bitstream is not an integer number of
-bytes, and so there is unused (uncoded) space in the last byte of a
-packet.<p>
-
-Unused space in the last byte of a bytestream is always zeroed during
-the coding process.  Thus, should this unused space be read, it will
-return binary zeroes.<p>
-
-Attempting to read past the end of an encoded packet results in an
-'end-of-packet' condition.  End-of-packet is not to be considered an
-error; it is merely a state indicating that there is insufficient
-remaining data to fulfill the desired read size.  Vorbis uses truncated
-packets as a normal mode of operation, and as such, decoders must
-handle reading past the end of a packet as a typical mode of
-operation. Any further read operations after an 'end-of-packet'
-condition shall also return 'end-of-packet'.<p>
-
-
-<h2> reading zero bits</h2>
-
-Reading a zero-bit-wide integer returns the value '0' and does not
-increment the stream cursor.  Reading to the end of the packet (but
-not past, such that an 'end-of-packet' condition has not triggered)
-and then reading a zero bit integer shall succeed, returning 0, and
-not trigger an end-of-packet condition.  Reading a zero-bit-wide
-integer after a previous read sets 'end-of-packet' shall also fail
-with 'end-of-packet'<p>
-
-<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>
-
-</body>
-
diff --git a/doc/vorbis-spec-codebook.html b/doc/vorbis-spec-codebook.html
deleted file mode 100644 (file)
index 4dee871..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-<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: probability model and codebooks
-</font></h1>
-
-<em>Last update to this document: August 8, 2002</em><br>
-
-<h1>Overview</h1>
-
-Unlike practically every other mainstream audio codec, Vorbis has no
-statically configured probability model, instead packing all entropy
-decoding configuration, VQ and Huffman, into the bitstream itself in
-the third header, the codec setup header.  This packed configuration
-consists of multiple 'codebooks', each containing a specific
-Huffman-equivalent representation for decoding compressed codewords as
-well as an optional lookup table of output vector values to which a
-decoded Huffman value is applied as an offset, generating the final
-decoded output corresponding to a given compressed codeword.
-
-<h2>bitwise operation</h2>
-
-The codebook mechanism is built on top of the <a
-href="vorbis-spec-bitpack.html">Vorbis bitpacker</a>; both the
-codebooks themselves and the codewords they decode are unrolled from a
-packet as a series of arbitrary-width values read from the stream
-according to the <a href="vorbis-spec-bitpack.html">Vorbis bitpacking
-convention</a>.
-
-<h1>Packed Codebook Format</h1>
-
-For purposes of the below examples, we assume that the storage
-system's native byte width is eight bits.  This is not universally
-true; see <a href="vorbis-spec-bitpack.html">the Vorbis bitpacking
-convention</a> document for discussion relating to non-eight-bit
-bytes.<p>
-
-<h2>codebook decode</h2>
-
-A codebook begins with a 24 bit sync pattern, 0x564342:
-
-<pre>
-byte 0: [ 0 1 0 0 0 0 1 0 ] (0x42)
-byte 1: [ 0 1 0 0 0 0 1 1 ] (0x43)
-byte 2: [ 0 1 0 1 0 1 1 0 ] (0x56)
-</pre>
-
-16 bit <tt>[codebook_dimensions]</tt> and 24 bit <tt>[codebook_entries]</tt> fields:
-
-<pre>
-
-byte 3: [ X X X X X X X X ] 
-byte 4: [ X X X X X X X X ] [codebook_dimensions] (16 bit unsigned)
-
-byte 5: [ X X X X X X X X ] 
-byte 6: [ X X X X X X X X ] 
-byte 7: [ X X X X X X X X ] [codebook_entries] (24 bit unsigned)
-
-</pre>
-
-Next is the <tt>[ordered]</tt> bit flag:
-
-<pre>
-
-byte 8: [               X ] [ordered] (1 bit)
-
-</pre>
-
-Each entry, numbering a
-total of <tt>[codebook_entries]</tt>, is assigned a codeword length.
-We now read the list of codeword lengths and store these lengths in
-the array <tt>[codebook_codeword_lengths]</tt>. Decode of lengths is
-according to whether the <tt>[ordered]</tt> flag is set or unset.
-
-<ul>
-
-  <li>If the <tt>[ordered]</tt> flag is unset, the codeword list is not
-  length ordered and the decoder needs to read each codeword length
-  one-by-one.<p> The decoder first reads one additional bit flag, the
-  <tt>[sparse]</tt> flag.  This flag determines whether or not the
-  codebook contains unused entries that are not to be included in the
-  codeword decode tree:<p>
-
-<pre>
-byte 8: [             X 1 ] [sparse] flag (1 bit)
-</pre>
-
-  The decoder now performs for each of the <tt>[codebook_entries]</tt> code book entries:
-
-<pre>
-  
-  1) if([sparse] is set){
-
-         2) [flag] = read one bit;
-         3) if([flag] is set){
-
-              4) [length] = read a five bit unsigned integer;
-              5) codeword length for this entry is [length]+1;
-
-            } else {
-
-              6) this entry is unused.  mark it as such.
-
-            }
-
-     } else the sparse flag is not set {
-
-        7) [length] = read a five bit unsigned integer;
-        8) the codeword length for this entry is [length]+1;
-        
-     }
-
-</pre>
-
-  <li>If the <tt>[ordered]</tt> flag is set, the codeword list for this
-  codebook is encoded in ascending length order.  Rather than reading
-  a length for every codeword, the encoder reads the number of
-  codewords per length.  That is, beginning at entry zero:
-
-<pre>
-  1) [current_entry] = 0;
-  2) [current_length] = read a five bit unsigned integer and add 1;
-  3) [number] = read <a
-  href="helper.html#ilog">ilog</a>([codebook_entries] - [current_entry]) bits as an unsigned integer
-  4) set the entries [current_entry] through [current_entry]+[number]-1, inclusive, 
-     of the [codebook_codeword_lengths] array to [current_length]
-  5) set [current_entry] to [number] + [current_entry]
-  6) increment [current_length] by 1
-  7) if [current_entry] is greater than [codebook_entries] ERROR CONDITION; the decoder will
-     not be able to read this stream.
-  8) if [current_entry] is less than [codebook_entries], repeat process starting at 3)
-  9) done.
-</pre>
-
-</ul>
-
-After all codeword lengths have been decoded, the decoder reads the
-vector lookup table.  Vorbis I supports three lookup types:
-<ol><li>No lookup
-<li>Implicitly populated value mapping (lattice VQ)
-<li>Explicitly populated value mapping (tessellated or 'foam' VQ)
-</ol>
-
-The lookup table type is read as a four bit unsigned integer:
-<pre>
-  1) [codebook_lookup_type] = read four bits as an unsigned integer
-</pre>
-
-Codebook decode precedes according to <tt>[codebook_lookup_type]</tt>:
-<ul>
-<li> Lookup type zero indicates no lookup to be read.  Proceed past
-lookup decode.  
-
-<li> Lookup types one and two are similar, differing only in the
-number of lookup values to be read.  Lookup type one reads a list of
-values that are permuted in a set pattern to build a list of vectors,
-each vector of order <tt>[codebook_dimensions]</tt> scalars.  Lookup
-type two builds the same vector list, but reads each scalar for each
-vector explicitly, rather than building vectors from a smaller list of
-possible scalar values.  Lookup decode proceeds as follows:
-
-<pre>
-  1) [codebook_minimum_value] = <a href="helper.html#float32_unpack">float32_unpack</a>( read 32 bits as an unsigned integer) 
-  2) [codebook_delta_value] = <a href="helper.html#float32_unpack">float32_unpack</a>( read 32 bits as an unsigned integer) 
-  3) [codebook_value_bits] = read 4 bits as an unsigned integer and add 1
-  4) [codebook_sequence_p] = read 1 bit as a boolean flag
-
-  if ( [codebook_lookup_type] is 1 ) {
-   
-     5) [codebook_lookup_values] = <a href="helper.html#lookup1_values">lookup1_values</a>( <tt>[codebook_entries]</tt>, <tt>[codebook_dimensions]</tt> )
-
-  } else {
-
-     6) [codebook_lookup_values] = <tt>[codebook_entries]</tt> * <tt>[codebook_dimensions]</tt>
-
-  }
-
-  7) read a total of [codebook_lookup_values] unsigned integers of [codebook_value_bits] each; 
-     store these in order in the array [codebook_multiplicands]
-
-</pre>
-<li>A <tt>[codebook_lookup_type]</tt> of greater than two is reserved and indicates
-a stream that's not decodable by the specification in this document.
-
-</ul>
-
-An 'end of packet' during any read operation in the above steps is
-considered an error condition rendering the stream undecodable.<p>
-
-<h2>Huffman decision tree representation</h2>
-
-The <tt>[codebook_codeword_lengths]</tt> array and
-<tt>[codebook_entries]</tt> value uniquely define the Huffman decision
-tree used for entropy decoding.<p>
-
-Briefly, each used codebook entry (recall that length-unordered
-codebooks support unused codeword entries) is assigned, in order, the
-lowest valued unused binary Huffman codeword possible.  Assume the
-following codeword length list:<p>
-
-<pre>
-entry 0: length 2
-entry 1: length 4
-entry 2: length 4
-entry 3: length 4
-entry 4: length 4
-entry 5: length 2
-entry 6: length 3
-entry 7: length 3
-</pre>
-
-Assigning codewords in order (lowest possible value of the appropriate
-length to highest) results in the following codeword list:<p>
-
-<pre>
-entry 0: length 2 codeword 00
-entry 1: length 4 codeword 0100
-entry 2: length 4 codeword 0101
-entry 3: length 4 codeword 0110
-entry 4: length 4 codeword 0111
-entry 5: length 2 codeword 10
-entry 6: length 3 codeword 110
-entry 7: length 3 codeword 111
-</pre>
-
-<em>note that unlike most binary numerical values in this document, we
-intend the above codewords to be read and used bit by bit from left to
-right, thus the codeword '001' is the bit string 'zero, zero, one'.
-When determining 'lowest possible value' in the assignment definition
-above, the leftmost bit is the MSb.</em><p>
-
-It is clear that the codeword length list represents a Huffman
-decision tree with the entry numbers equivalent to the leaves numbered
-left-to-right:<p>
-
-<img src="hufftree.png"><p>
-
-As we assign codewords in order, we see that each choice constructs a
-new leaf in the leftmost possible position.<p>
-
-Note that it's possible to underspecify or overspecify a Huffman tree
-via the length list.  In the above example, if codeword seven were
-eliminated, it's clear that the tree is unfinished:<p>
-
-<img src="hufftree-under.png"><p>
-
-Similarly, in the original codebook, it's clear that the tree is fully
-populated and a ninth codeword is impossible.  Both underspecified and
-overspecified trees are an error condition rendering the stream
-undecodable.<p>
-
-Codebook entries marked 'unused' are simply skipped in the assigning
-process.  They have no codeword and do not appear in the decision
-tree, thus it's impossible for any bit pattern read from the stream to
-decode to that entry number.<p>
-
-<h2>VQ lookup table vector representation</h2>
-
-Unpacking the VQ lookup table vectors relies on the following values:
-<ul>
-<li> the <tt>[codebook_multiplicands]</tt> array
-<li> <tt>[codebook_minimum_value]</tt>
-<li> <tt>[codebook_delta_value]</tt>
-<li> <tt>[codebook_sequence_p]</tt>
-<li> <tt>[codebook_lookup_type]</tt>
-<li> <tt>[codebook_entries]</tt>
-<li> <tt>[codebook_dimensions]</tt>
-<li> <tt>[codebook_lookup_values]</tt>
-</tt>
-</ul>
-
-Decoding [unpacking] a specific vector in the vector lookup table
-proceeds according to <tt>[codebook_lookup_type]</tt>.  The unpacked
-vector values are what a codebook would return during audio packet
-decode in a VQ context.<p>
-
-<h3>Vector value decode: Lookup type 1</h3>
-
-Lookup type one specifies a lattice VQ lookup table built
-algorithmically from a list of scalar values.  Calculate [unpack] the
-final values of a codebook entry vector from the entries in
-<tt>[codebook_multiplicands]</tt> as follows (<tt>[value_vector]</tt>
-is the output vector representing the vctor of values for entry number
-<tt>[lookup_offset]</tt> in this codebook):<p>
-
-<pre>
-  1) [last] = 0;
-  2) [index_divisor] = 1;
-  3) iterate [i] over the range 0 ... [codebook_dimensions]-1 (once for each scalar value in the value vector) {
-       
-       4) [multiplicand_offset] = ( [lookup_offset] divided by [index_divisor] using integer 
-          division ) integer modulo [codebook_lookup_values]
-
-       5) vector [value_vector] element [i] = 
-            ( [codebook_multiplicands] array element number [multiplicand_offset] ) *
-            [codebook_delta_value] + [codebook_minimum_value] + [last];
-
-       6) if ( [codebook_sequence_p] is set ) then set [last] = vector [value_vector] element [i]
-
-       7) [index_divisor] = [index_divisor] * [codebook_lookup_values]
-
-     }
-  8) vector calculation completed.
-</pre>
-
-<h3>Vector value decode: Lookup type 2</h3>
-
-Lookup type two specifies a VQ lookup table in which each scalar in
-each vector is explicitly set by the <tt>[codebook_multiplicands]</tt>
-array in a one-to-one mapping.  Calculate [unpack] the
-final values of a codebook entry vector from the entries in
-<tt>[codebook_multiplicands]</tt> as follows (<tt>[value_vector]</tt>
-is the output vector representing the vctor of values for entry number
-<tt>[lookup_offset]</tt> in this codebook):<p>
-
-<pre>
-  1) [last] = 0;
-  2) [multiplicand_offset] = [lookup_offset] * [codebook_dimensions]
-  3) iterate [i] over the range 0 ... [codebook_dimensions]-1 (once for each scalar value in the value vector) {
-
-       4) vector [value_vector] element [i] = 
-            ( [codebook_multiplicands] array element number [multiplicand_offset] ) *
-            [codebook_delta_value] + [codebook_minimum_value] + [last];
-
-       5) if ( [codebook_sequence_p] is set ) then set [last] = vector [value_vector] element [i] 
-
-       6) increment [multiplicand_offset]
-
-     }
-  7) vector calculation completed.
-</pre>
-
-<h1>Use of the codebook abstraction</h1>
-
-The decoder uses the codebook abstraction much as it does the
-bit-unpacking convention; a specific codebook reads a
-codeword from the bitstream, decoding it into an entry number, and then
-returns that entry number to the decoder (when used in a scalar
-entropy coding context), or uses that entry number as an offset into
-the VQ lookup table, returning a vector of values (when used in a context
-desiring a VQ value). Scalar or VQ context is always explicit; any call
-to the codebook mechanism requests either a scalar entry number or a
-lookup vector.<p>
-
-Note that VQ lookup type zero indicates that there is no lookup table;
-requesting decode using a codebook of lookup type 0 in any context
-expecting a vector return value (even in a case where a vector of
-dimension one) is forbidden.  If decoder setup or decode requests such
-an action, that is an error condition rendering the packet
-undecodable.<p>
-
-Using a codebook to read from the packet bitstream consists first of
-reading and decoding the next codeword in the bitstream. The decoder
-reads bits until the accumulated bits match a codeword in the
-codebook.  This process can be though of as logically walking the
-Huffman decode tree by reading one bit at a time from the bitstream,
-and using the bit as a decision boolean to take the 0 branch (left in
-the above examples) or the 1 branch (right in the above examples).
-Walking the tree finishes when the decode process hits a leaf in the
-decision tree; the result is the entry number corresponding to that
-leaf.  Reading past the end of a packet propagates the 'end-of-stream'
-condition to the decoder.<p>
-
-When used in a scalar context, the resulting codeword entry is the
-desired return value.<p>
-
-When used in a VQ context, the codeword entry number is used as an
-offset into the VQ lookup table.  The value returned to the decoder is
-the vector of scalars corresponding to this offset.<p>
-
-<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>
-
-</body>
-
diff --git a/doc/vorbis-spec-floor0.html b/doc/vorbis-spec-floor0.html
deleted file mode 100644 (file)
index b2ecc15..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-<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: floor type 0 setup and decode
-</font></h1>
-
-<em>Last update to this document: July 19, 2002</em><br>
-
-<h1>Overview</h1>
-
-Vorbis floor type zero uses Line Spectral Pair [LSP, also alternately
-known as Line Spectral Frequency or LSF] representation to encode a
-smooth spectral envelope curve as the frequency response of the LSP
-filter.  This representation is equivalent to a traditional all-pole
-infinite impulse response filter as would be used in linear predictive
-coding; LSP representation may be converted to LPC representation and
-vice-versa.<p>
-
-<h1>Floor 0 format</h1>
-
-Floor zero configuration consists of six integer fields and a list of
-VQ codebooks for use in coding/decoding the LSP filter coefficient
-values used by each frame. <p>
-
-<h2>header decode</h2>
-
-Configuration information for instances of floor zero decodes from the
-codec setup header (third packet).  configuration decode proceeds as
-follows:<p>
-
-<pre>
-  1) [floor0_order] = read an unsigned integer of 8 bits
-  2) [floor0_rate] = read an unsigned integer of 16 bits
-  3) [floor0_bark_map_size] = read an unsigned integer of 16 bits
-  4) [floor0_amplitude_bits] = read an unsigned integer of six bits
-  5) [floor0_amplitude_offset] = read an unsigned integer of eight bits
-  6) [floor0_number_of_books] = read an unsigned integer of four bits and add 1
-  7) if any of [floor0_order], [floor0_rate], [floor0_bark_map_size], [floor0_amplitude_bits],
-     [floor0_amplitude_offset] or [floor0_number_of_books] are less than zero, the stream is not decodable
-  8) array [floor0_book_list] = read a list of [floor0_number_of_books] unsigned integers of eight bits each;
-</pre>
-
-An end-of-packet condition during any of these bitstream reads renders
-this stream undecodable.  In addition, any element of the array
-<tt>[floor0_book_list]</tt> that is greater than the maximum codebook
-number for this bitstream is an error condition that also renders the
-stream undecodable.
-
-<a name=decode>
-<h2>packet decode</h2></a>
-
-Extracting a floor0 curve from an audio packet consists of first
-decoding the curve amplitude and <tt>[floor0_order]</tt> LSP
-coefficient values from the bitstream, and then computing the floor
-curve, which is defined as the frequency response of the decoded LSP
-filter.<p>
-
-Packet decode proceeds as follows:<p>
-<pre>
-  1) [amplitude] = read an unsigned integer of [floor0_amplitude_bits] bits
-  2) if ( [amplitude] is greater than zero ) {
-       3) [coefficients] is an empty, zero length vector
-
-       4) [booknumber] = read an unsigned integer of <a href="helper.html#ilog">ilog</a>( [floor0_number_of_books] ) bits
-       5) if ( [booknumber] is greater than the highest number decode codebook ) then packet is undecodable
-       6) [lastval] = zero;
-       7) vector [temp_vector] = read vector from bitstream using codebook number [booknumber] in VQ context.
-       8) add the scalar value [last] to each scalar in vector [temp_vector]
-       9) [last] = the value of the last scalar in vector [temp_vector]
-      10) concatenate [temp_vector] onto the end of the [coefficients] vector
-      11) if (length of vector [coefficients] is less than [floor0_order], continue at step 6
-
-     }
-
- 12) done.
-</pre>
-
-Take note of the following properties of decode:
-<ul>
-<li>An <tt>[amplitude]</tt> value of zero must result in a return code that indicates this channel is unused in this frame (the output of the channel will be all-zeroes in synthesis).  Several later stages of decode don't occur for an unused channel.<p>
-<li>An end-of-packet condition during decode should be considered a
-nominal occruence; if end-of-packet is reached during any read
-operation above, floor decode is to return 'unused' status as if the
-<tt>[amplitude]</tt> value had read zero at the beginning of decode.
-
-<li>The book number used for decode
-can, in fact, be stored in the bitstream in <a
-href="helper.html#ilog">ilog</a>( <tt>[floor0_number_of_books]</tt> -
-1 ) bits.  Nevertheless, the above specification is correct and values
-greater than the maximum possible book value are reserved. <p>
-
-<li>The number of scalars read into the vector <tt>[coefficients]</tt>
-may be greater than <tt>[floor0_order]</tt>, the number actually
-required for curve computation.  For example, if the VQ codebook used
-for the floor currently being decoded has a
-<tt>[codebook_dimensions]</tt> value of three and
-<tt>[floor0_order]</tt> is ten, the only way to fill all the needed
-scalars in <tt>[coefficients]</tt> is to to read a total of twelve
-scalars as four vectors of three scalars each.  This is not an error
-condition, and care must be taken not to allow a buffer overflow in
-decode. The extra values are not used and may be ignored or discarded.
-</ul>
-<a name=synth>
-<h2>curve computation</h2></a>
-
-Given an <tt>[amplitude]</tt> integer and <tt>[coefficients]</tt>
-vector from packet decode as well as the [floor0_order],
-[floor0_rate], [floor0_bark_map_size], [floor0_amplitude_bits] and
-[floor0_amplitude_offset] values from floor setup, and an output
-vector size <tt>[n]</tt> specified by the decode process, we compute a
-floor output vector.<p>
-
-If the value <tt>[amplitude]</tt> is zero, the return value is a
-length <tt>[n]</tt> vector with all-zero scalars.  Otherwise, begin by
-assuming the following definitions for the given vector to be
-synthesized:<p>
-
-<img src="lspmap.png"><p>
-
-The above is used to synthesize the LSP curve on a Bark-scale frequency
-axis, then map the result to a linear-scale frequency axis.
-Similarly, the below calculation synthesizes the output LSP curve [output] on a log
-(dB) amplitude scale, mapping it to linear amplitude in the last step:<p>
-
-<pre>
-  1) [i] = 0
-  2) if ( [floor0_order] is odd ) {
-
-       3) calculate [p] and [q] according to: <br>
-          <img src="oddlsp.png">
-
-     } else [floor0_order] is even {
-
-       4) calculate [p] and [q] according to: <br>
-          <img src="evenlsp.png">
-
-     }
-
-  5) calculate [linear_floor_value] according to:<br>
-     <img src="floorval.png">
-
-  6) [iteration_condition] = map element [i]
-  7) [output] element [i] = [linear_floor_value]
-  8) increment [i]
-  9) if ( map element [i] is equal to [iteration_condition] ) continue at step 7
- 10) if ( [i] is less than [n] ) continue at step 2
- 11) done
-
-</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>
-
-</body>
-
diff --git a/doc/vorbis-spec-floor1.html b/doc/vorbis-spec-floor1.html
deleted file mode 100644 (file)
index a81c210..0000000
+++ /dev/null
@@ -1,400 +0,0 @@
-<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: floor type 1 setup and decode
-</font></h1>
-
-<em>Last update to this document: October 15, 2002</em><br>
-
-<h1>Overview</h1>
-
-Vorbis floor type one uses a piecewise straight-line representation to
-encode a spectral envelope curve. The representation plots this curve
-mechanically on a linear frequency axis and a logarithmic (dB)
-amplitude axis. The integer plotting algorithm used is similar to
-Bresenham's algorithm.<p>
-
-<h1>Floor 1 format</h1>
-
-<h2>model</h2> Floor type one represents a spectral curve as a series of
-line segments.  Synthesis constructs a floor curve using iterative
-prediction in a process roughly equivalent to the following simplified
-description:<p>
-
-<ul><li> the first line segment (base case) is a logical line spanning
-from x_0,y_0 to x_1,y_1 where in the base case x_0=0 and x_1=[n], the
-full range of the spectral floor to be computed.<p>
-
-<li>the induction step chooses a point x_new within an existing
-logical line segment and produces a y_new value at that point computed
-from the existing line's y value at x_new (as plotted by the line) and
-a difference value decoded from the bitstream packet.<p>
-
-<li>floor computation produces two new line segments, one running from
-x_0,y_0 to x_new,y_new and from x_new,y_new to x_1,y_1. This step is
-performed logically even if y_new represents no change to the
-amplitude value at x_new so that later refinement is additionally
-bounded at x_new.<p>
-
-<li>the induction step repeats, using a list of x values specified in
-the codec setup header at floor 1 initialization time.  Computation
-is completed at the end of the x value list.
-
-</ul>
-
-Consider the following example, with values chosen for ease of
-understanding rather than representing typical configuration:<p>
-
-For the below example, we assume a floor setup with an [n] of 128.
-The list of selected X values in increasing order is
-0,16,32,48,64,80,96,112 and 128.  In list order, the values interleave
-as 0, 128, 64, 32, 96, 16, 48, 80 and 112.  The corresponding
-list-order Y values as decoded from an example packet are 110, 20, -5,
--45, 0, -25, -10, 30 and -10.  We compute the floor in the following
-way, beginning with the first line:<p>
-
-<img src="floor1-1.png"><p>
-
-We now draw new logical lines to reflect the correction to new_Y, and
-iterate for X positions 32 and 96:<p>
-
-<img src="floor1-2.png"><p>
-
-Although the new Y value at X position 96 is unchanged, it is still
-used later as an endpoint for further refinement.  From here on, the
-pattern should be clear; we complete the floor computation as follows:<p>
-
-<img src="floor1-3.png"><p>
-<img src="floor1-4.png"><p>
-
-A more efficient algorithm with carefully defined integer rounding
-behavior is used for actual decode, as described later.  The actual
-algorithm splits Y value computation and line plotting into two steps
-with modifications to the above algorithm to eliminate noise
-accumulation through integer roundoff/truncation. <p>
-
-<h2>header decode</h2>
-
-A list of floor X values is stored in the packet header in interleaved
-format (used in list order during packet decode and synthesis).  This
-list is split into partitions, and each partition is assigned to a
-partition class.  X positions 0 and [n] are implicit and do not belong
-to an explicit partition or partition class.<p>
-
-A partition class consists of a representation vector width (the
-number of Y values which the partition class encodes at once), a
-'subclass' value representing the number of alternate entropy books
-the partition class may use in representing Y values, the list of
-[subclass] books and a master book used to encode which alternate
-books were chosen for representation in a given packet.  The
-master/subclass mechanism is meant to be used as a flexible
-representation cascade while still using codebooks only in a scalar
-context.<p>
-
-<pre>
-
-  1) [floor1_partitions] = read 5 bits as unsigned integer
-  2) [maximum_class] = -1
-  3) iterate [i] over the range 0 ... [floor1_partitions]-1 {
-       
-        4) vector [floor1_partition_class_list] element [i] = read 4 bits as unsigned integer
-
-     }
-
-  5) [maximum_class] = largest integer scalar value in vector [floor1_partition_class_list]
-  6) iterate [i] over the range 0 ... [maximum_class] {
-
-        7) vector [floor1_class_dimensions] element [i] = read 3 bits as unsigned integer and add 1
-       8) vector [floor1_class_subclasses] element [i] = read 2 bits as unsigned integer
-        9) if ( vector [floor1_class_subclasses] element [i] is nonzero ) {
-            
-             10) vector [floor1_class_masterbooks] element [i] = read 8 bits as unsigned integer
-           
-           }
-
-       11) iterate [j] over the range 0 ... (2 exponent [floor1_class_subclasses] element [i]) - 1  {
-
-             12) array [floor1_subclass_books] element [i],[j] = 
-                 read 8 bits as unsigned integer and subtract one
-           }
-      }
-
- 13) [floor1_multiplier] = read 2 bits as unsigned integer and add one
- 14) [rangebits] = read 4 bits as unsigned integer
- 15) vector [floor1_X_list] element [0] = 0
- 16) vector [floor1_X_list] element [1] = 2 exponent [rangebits];
- 17) [floor1_values] = 2
- 18) iterate [i] over the range 0 ... [floor1_partitions]-1 {
-
-       19) [current_class_number] = vector [floor1_partition_class_list] element [i]
-       20) iterate [j] over the range 0 ... ([floor1_class_dimensions] element [current_class_number])-1 {
-             21) vector [floor1_X_list] element ([j] + [floor1_values]) = 
-                 read [rangebits] bits as unsigned integer
-            }
-
-       22) [floor1_values] = [floor1_values] + [floor1_class_dimensions] element [i]
-     }
- 23) done
-</pre>
-
-An end-of-packet condition while reading any aspect of a floor 1
-configuration during setup renders a stream undecodable.  In
-addition, a <tt>[floor1_class_masterbooks]</tt> or
-<tt>[floor1_subclass_books]</tt> scalar element greater than the
-highest numbered codebook configured in this stream is an error
-condition that renders the stream undecodable.<p>
-
-<a name=decode>
-<h2>packet decode</h2></a>
-
-Packet decode begins by checking the <tt>[nonzero]</tt> flag:<p>
-
-<pre>
-  1) [nonzero] = read 1 bit as boolean
-</pre>
-
-If <tt>[nonzero]</tt> is unset, that indicates this channel contained
-no audio energy in this frame.  Decode immediately returns a status
-indicating this floor curve (and thus this channel) is unused this
-frame.  (A return status of 'unused' is different from decoding a
-floor that has all points set to minimum representation amplitude,
-which happens to be approximately -140dB).
-
-Assuming <tt>[nonzero]</tt> is set, decode proceeds as follows:<p>
-
-<pre>
-  1) [range] = vector { 256, 128, 86, 64 } element ([floor1_multiplier]-1)
-  2) vector [floor1_Y] element [0] = read <a href="helper.html#ilog">ilog</a>([range]-1) bits as unsigned integer
-  3) vector [floor1_Y] element [1] = read <a href="helper.html#ilog">ilog</a>([range]-1) bits as unsigned integer
-  4) [offset] = 2;
-  5) iterate [i] over the range 0 ... [floor1_partitions]-1 {
-
-       6) [class] = vector [floor1_partition_class]  element [i]
-       7) [cdim]  = vector [floor1_class_dimensions] element [class]
-       8) [cbits] = vector [floor1_class_subclasses] element [class]
-       9) [csub]  = (2 exponent [cbits])-1
-      10) [cval]  = 0
-      11) if ( [cbits] is greater than zero ) {
-             12) [cval] = read from packet using codebook number
-                 (vector [floor1_class_masterbooks] element [class]) in scalar context
-          }
-      
-      13) iterate [j] over the range 0 ... [cdim]-1 {
-       
-             14) [book] = array [floor1_subclass_books] element [class],([cval] bitwise AND [csub])
-             15) [cval] = [cval] right shifted [cbits] bits
-            16) if ( [book] is not less than zero ) {
-            
-                  17) vector [floor1_Y] element ([j]+[offset]) = read from packet using codebook 
-                       [book] in scalar context
-
-                 } else [book] is less than zero {
-
-                  18) vector [floor1_Y] element ([j]+[offset]) = 0
-
-                 }
-          }
-             
-      19) [offset] = [offset] + [cdim]
-         
-     }
-  
- 20) done
-</pre>
-
-An end-of-packet condition during curve decode should be considered a
-nominal occurrence; if end-of-packet is reached during any read
-operation above, floor decode is to return 'unused' status as if the
-<tt>[nonzero]</tt> flag had been unset at the beginning of decode.
-
-Vector <tt>[floor1_Y]</tt> contains the values from packet decode
-needed for floor 1 synthesis.<p>
-
-<a name=synth>
-<h2>curve computation</h2></a>
-
-Curve computation is split into two logical steps; the first step
-derives final Y amplitude values from the encoded, wrapped difference
-values taken from the bitstream.  The second step plots the curve
-lines.  Also, although zero-difference values are used in the
-iterative prediction to find final Y values, these points are
-conditionally skipped during final line computation in step two.
-Skipping zero-difference values allows a smoother line fit.  <p>
-
-Although some aspects of the below algorithm look like inconsequential
-optimizations, implementors are warned to follow the details closely.
-Deviation from implementing a strictly equivalent algorithm can result
-in serious decoding errors.<p>
-
-<h3>step 1: amplitude value synthesis</h3>
-
-Unwrap the always-positive-or-zero values read from the packet into
-+/- difference values, then apply to line prediction.<p>
-
-<pre>
-  1) [range] = vector { 256, 128, 86, 64 } element ([floor1_multiplier]-1)
-  2) vector [floor1_step2_flag] element [0] = set
-  3) vector [floor1_step2_flag] element [1] = set
-  4) vector [floor1_final_Y] element [0] = vector [floor1_Y] element [0]
-  5) vector [floor1_final_Y] element [1] = vector [floor1_Y] element [1]
-  6) iterate [i] over the range 2 ... [floor1_values]-1 {
-    
-       7) [low_neighbor_offset] = <a href="helper.html#low_neighbor">low_neighbor</a>([floor1_X_list],[i])
-       8) [high_neighbor_offset] = <a href="helper.html#high_neighbor">high_neighbor</a>([floor1_X_list],[i])
-
-       9) [predicted] = <a href="helper.html#render_point">render_point</a>( vector [floor1_X_list] element [low_neighbor_offset],
-                                     vector [floor1_final_Y] element [low_neighbor_offset],
-                                      vector [floor1_X_list] element [high_neighbor_offset],
-                                     vector [floor1_final_Y] element [high_neighbor_offset],
-                                      vector [floor1_X_list] element [i] )
-
-      10) [val] = vector [floor1_Y] element [i]
-      11) [highroom] = [range] - [predicted]
-      12) [lowroom]  = [predicted]
-      13) if ( [highroom] is less than [lowroom] ) {
-
-            14) [room] = [highroom] * 2
-         
-          } else [highroom] is not less than [lowroom] {
-                     
-            15) [root] = [lowroom] * 2
-        
-          }
-
-      16) if ( [val] is nonzero ) {
-
-            17) vector [floor1_step2_flag] element [low_neighbor_offset] = set
-            18) vector [floor1_step2_flag] element [high_neighbor_offset] = set
-            19) vector [floor1_step2_flag] element [i] = set
-            20) if ( [val] is greater than or equal to [room] ) {
-                  21) if ( [hiroom] is greater than [lowroom] ) {
-
-                        22) vector [floor1_final_Y] element [i] = [val] - [lowroom] + [predicted]
-                    
-                     } else [hiroom] is not greater than [lowroom] {
-              
-                        23) vector [floor1_final_Y] element [i] = [predicted] - [val] + [hiroom] - 1
-                   
-                      }
-               
-                } else [val] is less than [room] {
-                
-                 24) if ([val] is odd) {
-                 
-                        25) vector [floor1_final_Y] element [i] = 
-                            [predicted] - (([val] + 1) divided by  2 using integer division)
-
-                      } else [val] is even {
-
-                        26) vector [floor1_final_Y] element [i] = 
-                            [predicted] + ([val] / 2 using integer division)
-                          
-                      }
-
-                }      
-
-          } else [val] is zero {
-
-            27) vector [floor1_step2_flag] element [i] = unset
-            28) vector [floor1_final_Y] element [i] = [predicted]
-
-          }
-
-     }
-
- 29) done
-
-</pre>
-
-<h3>step 2: curve synthesis</h3>
-
-Curve synthesis generates a return vector <tt>[floor]</tt> of length
-<tt>[n]</tt> (where <tt>[n]</tt> is provided by the decode process
-calling to floor decode).  Floor 1 curve synthesis makes use of the
-<tt>[floor1_X_list]</tt>, <tt>[floor1_final_Y]</tt> and
-<tt>[floor1_step2_flag]</tt> vectors, as well as [floor1_multiplier]
-and [floor1_values] values.<p>
-
-Decode begins by sorting the scalars from vectors
-<tt>[floor1_X_list]</tt>, <tt>[floor1_final_Y]</tt> and
-<tt>[floor1_step2_flag]</tt> together into new vectors
-<tt>[floor1_X_list]'</tt>, <tt>[floor1_final_Y]'</tt> and
-<tt>[floor1_step2_flag]'</tt> according to ascending sort order of the
-values in <tt>[floor1_X_list]</tt>.  That is, sort the values of
-<tt>[floor1_X_list]</tt> and then apply the same permutation to
-elements of the other two vectors so that the X, Y and step2_flag
-values still match.<p>
-
-Then compute the final curve in one pass:<p>
-
-<pre>
-  1) [hx] = 0
-  2) [lx] = 0
-  3) [ly] = vector [floor1_final_Y]' element [0] * [floor1_multiplier]
-  4) iterate [i] over the range 1 ... [floor1_values]-1 {
-
-       5) if ( [floor1_step2_flag]' is set ) {
-
-             6) [hy] = [floor1_final_Y]' element [i] * [floor1_multiplier]
-            7) [hx] = [floor1_X_list]' element [i]
-             8) <a href="helper.html#render_line">render_line</a>( [lx], [ly], [hx], [hy], [floor] )
-             9) [lx] = [hx]
-           10) [ly] = [hy]
-          }
-     }
- 11) if ( [hx] is less than [n] ) {
-
-       12) <a href="helper.html#render_line">render_line</a>( [hx], [hy], [n], [hy], [floor] )
-
-     }
-
- 13) if ( [hx] is greater than [n] ) {
-
-       14) truncate vector [floor] to [n] elements
-
-     }
- 15) for each scalar in vector [floor], perform a lookup substitution using 
-     the scalar value from [floor] as an offset into the vector <a href="floor1_inverse_dB_table.html">[floor1_inverse_dB_static_table]</a>
-
- 16) done
-
-</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>
-
-</body>
-
diff --git a/doc/vorbis-spec-intro.html b/doc/vorbis-spec-intro.html
deleted file mode 100644 (file)
index cde504e..0000000
+++ /dev/null
@@ -1,534 +0,0 @@
-<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: introduction and description
-</font></h1>
-
-<em>Last update to this document: July 18, 2002</em><br>
-
-<h1>Overview</h1>
-
-This document provides a high level description of the Vorbis codec's
-construction.  A bit-by-bit specification appears beginning in the <a
-href="vorbis-spec-ref.html">packet specification and reference</a>
-document.  The other reference documents assumes a high-level
-understanding of the Vorbis decode process, which is provided in this
-document.<p>
-
-<h2>Application</h2>
-
-Vorbis is a general purpose perceptual audio CODEC intended to allow
-maximum encoder flexibility, thus allowing it to scale competitively
-over an exceptionally wide range of bitrates.  At the high
-quality/bitrate end of the scale (CD or DAT rate stereo, 16/24 bits),
-it is in the same league as MPEG-2 and MPC.  Similarly, the 1.0
-encoder can encode high-quality CD and DAT rate stereo at below 48kpbs
-without resampling to a lower rate.  Vorbis is also intended for
-lower and higher sample rates (from 8kHz telephony to 192kHz digital
-masters) and a range of channel representations (monaural,
-polyphonic, stereo, quadraphonic, 5.1, ambisonic, or up to 255
-discrete channels).<p>
-
-<h2>Classification</h2>
-
-Vorbis I is a forward-adaptive monolithic transform CODEC based on the
-Modified Discrete Cosine Transform.  The codec is structured to allow
-addition of a hybrid wavelet filterbank in Vorbis II to offer better
-transient response and reproduction using a transform better suited to
-localized time events.
-
-<h2>Assumptions</h2>
-
-The Vorbis CODEC design assumes a complex, psychoacoustically-aware
-encoder and simple, low-complexity decoder. Vorbis decode is
-computationally simpler than mp3, although it does require more
-working memory as Vorbis has no static probability model; the vector
-codebooks used in the first stage of decoding from the bitstream are
-packed, in their entirety, into the Vorbis bitstream headers.  In
-packed form, these codebooks occupy only a few kilobytes; the extent
-to which they are pre-decoded into a cache is the dominant factor in
-decoder memory usage.<p>
-
-Vorbis provides none of its own framing, synchronization or protection
-against errors; it is solely a method of accepting input audio,
-dividing it into individual frames and compressing these frames into
-raw, unformatted 'packets'.  The decoder then accepts these raw
-packets in sequence, decodes them, synthesizes audio frames from
-them, and reassembles the frames into a facsimile of the original
-audio stream. Vorbis is a free-form VBR codec and packets have no
-minimum size, maximum size, or fixed/expected size.  Packets
-are designed that they may be truncated (or padded) and remain
-decodable; this is not to be considered an error condition and is used
-extensively in bitrate management in peeling.  Both the transport
-mechanism and decoder must allow that a packet may be any size, or
-end before or after packet decode expects.<p>
-
-Vorbis packets are thus intended to be used with a transport mechanism
-that provides free-form framing, sync, positioning and error correction
-in accordance with these design assumptions, such as Ogg (for file
-transport) or RTP (for network multicast).  For purposes of a few
-examples in this document, we will assume that Vorbis is to be
-embedded in an Ogg stream specifically, although this is by no means a
-requirement or fundamental assumption in the Vorbis design.<p>
-
-<a href="vorbis-ogg.html">The specifications for embedding Vorbis into
-an Ogg transport stream is in a separate document.</a><p>
-
-<h2>Codec Setup and Probability Model</h2>
-
-Vorbis's heritage is as a research CODEC and its current design
-reflects a desire to allow multiple decades of continuous encoder
-improvement before running out of room within the codec specification.
-For these reasons, configurable aspects codec setup intentionally
-lean toward the extreme of forward adaptive.<p>
-
-The single most controversial design decision in Vorbis [and the most
-unusual for a Vorbis developer to keep in mind] is that the entire
-probability model of the codec, the Huffman and VQ codebooks, is
-packed into the bitstream header along with extensive CODEC setup
-parameters (often several hundred fields).  This makes it impossible,
-as it would be with MPEG audio layers, to embed a simple frame type
-flag in each audio packet, or begin decode at any frame in the stream
-without having previously fetched the codec setup header. [Note:
-Vorbis *can* initiate decode at any arbitrary packet within a
-bitstream so long as the codec has been initialized/setup with the
-setup headers].<p>
-
-Thus, Vorbis headers are both required for decode to begin and
-relatively large as bitstream headers go.  The header size is
-unbounded, although for streaming a rule-of-thumb of 4kB or less is
-recommended (and Xiph.Org's Vorbis encoder follows this suggestion).<p>
-
-Our own design work indicates the the primary liability of the
-required header is in mindshare; it is an unusual design and thus
-causes some amount of complaint among engineers as this runs against
-current design trends (and also points out limitations in some
-existing software/interface designs, such as Windows' ACM codec
-framework).  However, we find that it does not fundamentally limit
-Vorbis's suitable application space.<p>
-
-<h2>Format Specification</h2>
-
-The Vorbis format is well-defined by its decode specification; any
-encoder that produces packets that are correctly decoded by the
-reference Vorbis decoder described below may be considered a proper
-Vorbis encoder.  A decoder must faithfully and completely implement
-the specification defined below [except where noted] to be considered
-a proper Vorbis decoder.<p>
-
-<h2>Hardware Profile</h2>
-
-Although Vorbis decode is computationally simple, it may still run
-into specific limitations of an embedded design.  For this reason,
-embedded designs are allowed to deviate in limited ways from the
-'full' decode specification yet still be certified compliant.  These
-optional omissions are labelled in the spec where relevant.<p>
-
-<h1>Decoder Configuration</h1>
-
-Decoder setup consists of configuration of multiple, self-contained
-component abstractions that perform specific functions in the decode
-pipeline.  Each different component instance of a specific type is
-semantically interchangeable; decoder configuration consists both of
-internal component configuration, as well as arrangement of specific
-instances into a decode pipeline.  Componentry arrangement is roughly
-as follows:<p>
-
-<img src="components.png"><p>
-
-<h2> Global Config </h2>
-
-Global codec configuration consists of a few audio related fields
-(sample rate, channels), Vorbis version (always '0' in Vorbis I),
-bitrate hints, and the lists of component instances.  All other
-configuration is in the context of specific components.<p>
-
-<h2> Mode </h2>
-Each Vorbis frame is coded according to a master 'mode'.  A bitstream
-may use one or many modes.<p>
-
-The mode mechanism is used to encode a frame according to one of
-multiple possible methods with the intention of choosing a method best
-suited to that frame.  Different modes are, e.g. how frame size
-is changed from frame to frame. The mode number of a frame serves as a
-top level configuration switch for all other specific aspects of frame
-decode.<p>
-
-A 'mode' configuration consists of a frame size setting, window type
-(always 0, the Vorbis window, in Vorbis I), transform type (always
-type 0, the MDCT, in Vorbis I) and a mapping number.  The mapping
-number specifies which mapping configuration instance to use for
-low-level packet decode and synthesis.<p>
-
-<h2> Mapping </h2>
-
-A mapping contains a channel coupling description and a list of
-'submaps' that bundle sets of channel vectors together for grouped
-encoding and decoding. These submaps are not references to external
-components; the submap list is internal and specific to a mapping.<p>
-
-A 'submap' is a configuration/grouping that applies to a subset of
-floor and residue vectors within a mapping.  The submap functions as a
-last layer of indirection such that specific special floor or residue
-settings can be applied not only to all the vectors in a given mode,
-but also specific vectors in a specific mode.  Each submap specifies
-the proper floor and residue instance number to use for decoding that
-submap's spectral floor and spectral residue vectors.<p>
-
-As an example:<p>
-
-Assume a Vorbis stream that contains six channels in the standard 5.1
-format.  The sixth channel, as is normal in 5.1, is bass only.
-Therefore it would be wasteful to encode a full-spectrum version of it
-as with the other channels.  The submapping mechanism can be used to
-apply a full range floor and residue encoding to channels 0 through 4,
-and a bass-only representation to the bass channel, thus saving space.
-In this example, channels 0-4 belong to submap 0 (which indicates use
-of a full-range floor) and channel 5 belongs to submap 1, which uses a
-bass-only representation.<p>
-
-<h2> Floor </h2>
-
-Vorbis encodes a spectral 'floor' vector for each PCM channel.  This
-vector is a low-resolution representation of the audio spectrum for
-the given channel in the current frame, generally used akin to a
-whitening filter.  It is named a 'floor' because the Xiph.Org
-reference encoder has historically used it as a unit-baseline for
-spectral resolution.<p>
-
-A floor encoding may be of two types.  Floor 0 uses a packed LSP
-representation on a dB amplitude scale and Bark frequency scale.
-Floor 1 represents the curve as a piecewise linear interpolated
-representation on a dB amplitude scale and linear frequency scale.
-The two floors are semantically interchangeable in
-encoding/decoding. However, floor type 1 provides more stable
-inter-frame behavior, and so is the preferred choice in all
-coupled-stereo and high bitrate modes.  Floor 1 is also considerably
-less expensive to decode than floor 0.<p>
-
-Floor 0 is not to be considered deprecated, but it is of limited
-modern use.  No known Vorbis encoder past Xiph.org's own beta 4 makes
-use of floor 0.<p>
-
-The values coded/decoded by a floor are both compactly formatted and
-make use of entropy coding to save space.  For this reason, a floor
-configuration generally refers to multiple codebooks in the codebook
-component list.  Entropy coding is thus provided as an abstraction,
-and each floor instance may choose from any and all available
-codebooks when coding/decoding.<p>
-
-<h2> Residue </h2>
-
-The spectral residue is the fine structure of the audio spectrum
-once the floor curve has been subtracted out.  In simplest terms, it
-is coded in the bitstream using cascaded (multi-pass) vector
-quantization according to one of three specific packing/coding
-algorithms numbered 0 through 2.  The packing algorithm details are
-configured by residue instance.  As with the floor components, the
-final VQ/entropy encoding is provided by external codebook instances
-and each residue instance may choose from any and all available
-codebooks.<p>
-
-<h2> Codebooks </h2>
-
-Codebooks are a self-contained abstraction that perform entropy
-decoding and, optionally, use the entropy-decoded integer value as an
-offset into an index of output value vectors, returning the indicated
-vector of values.<p>
-
-The entropy coding in a Vorbis I codebook is provided by a standard
-Huffman binary tree representation.  This tree is tightly packed using
-one of several methods, depending on whether codeword lengths are
-ordered or unordered, or the tree is sparse.<p>
-
-The codebook vector index is similarly packed according to index
-characteristic.  Most commonly, the vector index is encoded as a
-single list of values of possible values that are then permuted into
-a list of n-dimensional rows (lattice VQ).<p>
-
-
-<h1>High-level Decode Process</h1>
-
-<h2>Decode setup</h2> 
-
-Before decoding can begin, a decoder must initialize using the
-bitstream headers matching the stream to be decoded.  Vorbis uses
-three header packets; all are required, in-order, by this
-specification. Once set up, decode may begin at any audio packet
-belonging to the Vorbis stream. In Vorbis I, all packets after the
-three initial headers are audio packets. <p>
-
-The header packets are, in order, the identification
-header, the comments header, and the setup header.<p>
-
-<h3>Identification Header</h3>
-
-The identification header identifies the bitstream as Vorbis, Vorbis
-version, and the simple audio characteristics of the stream such as
-sample rate and number of channels.<p>
-
-<h3>Comment Header</h3>
-
-The comment header includes user text comments ["tags"] and a vendor
-string for the application/library that produced the bitstream.  The
-encoding of the comment header is described within this document; the
-proper use of the comment fields is described in <a href="v-comment.html">the Ogg Vorbis comment field specification</a>.<p>
-
-<h3>Setup Header</h3>
-
-The setup header includes extensive CODEC setup information as well as
-the complete VQ and Huffman codebooks needed for decode.<p>
-
-<h2>Decode Procedure</h2>
-
-The decoding and synthesis procedure for all audio packets is
-fundamentally the same.  
-<ol>
-<li>decode packet type flag
-<li>decode mode number
-<li>decode window shape [long windows only]
-<li>decode floor
-<li>decode residue into residue vectors
-<li>inverse channel coupling of residue vectors
-<li>generate floor curve from decoded floor data
-<li>compute dot product of floor and residue, producing audio spectrum vector
-<li>inverse monolithic transform of audio spectrum vector, always an MDCT in Vorbis I
-<li>overlap/add left-hand output of transform with right-hand output of previous frame
-<li>store right hand-data from transform of current frame for future lapping.
-<li>if not first frame, return results of overlap/add as audio result of current frame
-</ol>
-
-Note that clever rearrangement of the synthesis arithmetic is
-possible; as an example, one can take advantage of symmetries in the
-MDCT to store the right-hand transform data of a partial MDCT for a
-50% inter-frame buffer space savings, and then complete the transform
-later before overlap/add with the next frame.  This optimization
-produces entirely equivalent output and is naturally perfectly legal.
-The decoder must be <em>entirely mathematically equivalent</em> to the
-specification, it need not be a literal semantic implementation.
-
-<h3>Packet type decode</h3> 
-
-Vorbis I uses four packet types. The first three packet types mark each
-of the three Vorbis headers described above.  The fourth packet type
-marks an audio packet. All others packet types are reserved; packets
-marked with a reserved flag type should be ignored.<p>
-
-Following the three header packets, all packets in a Vorbis I stream
-are audio.  The first step of audio packet decode is to read and
-verify the packet type; <em>a non-audio packet when audio is expected
-indicates stream corruption or a non-compliant stream. The decoder
-must ignore the packet and not attempt decoding it to audio</em>.
-
-<h3>Mode decode</h3>
-
-Vorbis allows an encoder to set up multiple, numbered packet 'modes',
-as described earlier, all of which may be used in a given Vorbis
-stream. The mode is encoded as an integer used as a direct offset into
-the mode instance index. <p>
-
-<a name=window>
-<h3>Window shape decode [long windows only]</h3></a>
-
-Vorbis frames may be one of two PCM sample sizes specified during
-codec setup.  In Vorbis I, legal frame sizes are powers of two from 64
-to 8192 samples.  Aside from coupling, Vorbis handles channels as
-independent vectors and these frame sizes are in samples per channel.<p>
-
-Vorbis uses an overlapping transform, namely the MDCT, to blend one
-frame into the next, avoiding most inter-frame block boundary
-artifacts.  The MDCT output of one frame is windowed according to MDCT
-requirements, overlapped 50% with the output of the previous frame and
-added.  The window shape assures seamless reconstruction.  <p>
-
-This is easy to visualize in the case of equal sized-windows:<p>
-<img src="window1.png"><p>
-
-
-And slightly more complex in the case of overlapping unequal sized
-windows:<p>
-
-<img src="window2.png"><p>
-
-In the unequal-sized window case, the window shape of the long window
-must be modified for seamless lapping as above.  It is possible to
-correctly infer window shape to be applied to the current window from
-knowing the sizes of the current, previous and next window.  It is
-legal for a decoder to use this method; However, in the case of a long
-window (short windows require no modification), Vorbis also codes two
-flag bits to specify pre- and post- window shape.  Although not
-strictly necessary for function, this minor redundancy allows a packet
-to be fully decoded to the point of lapping entirely independently of
-any other packet, allowing easier abstraction of decode layers as well
-as allowing a greater level of easy parallelism in encode and
-decode.<p>
-
-A description of valid window functions for use with an inverse MDCT
-can be found in the paper <a
-href="http://www.iocon.com/resource/docs/ps/eusipco_corrected.ps">_The
-use of multirate filter banks for coding of high quality digital
-audio_</a>, by T. Sporer, K. Brandenburg and B. Edler.  Vorbis windows
-all use the slope function y=sin(2PI*sin^2(x/n)).<p>
-
-<h3>floor decode</h3>
-
-Each floor is encoded/decoded in channel order, however each floor
-belongs to a 'submap' that specifies which floor configuration to
-use.  All floors are decoded before residue decode begins.<p>
-
-<h3>residue decode</h3> 
-
-Although the number of residue vectors equals the number of channels,
-channel coupling may mean that the raw residue vectors extracted
-during decode do not map directly to specific channels.  When channel
-coupling is in use, some vectors will correspond to coupled magnitude
-or angle.  The coupling relationships are described in the codec setup
-and may differ from frame to frame, due to different mode numbers.<p>
-
-Vorbis codes residue vectors in groups by submap; the coding is done
-in submap order from submap 0 through n-1.  This differs from floors
-which are coded using a configuration provided by submap number, but
-are coded individually in channel order.<p>
-
-<h3>inverse channel coupling</h3>
-
-A detailed discussion of stereo in the Vorbis codec can be found in
-the document <a href="stereo.html">_Stereo Channel Coupling in the
-Vorbis CODEC_</a>.  Vorbis is not limited to only stereo coupling, but
-the stereo document also gives a good overview of the generic coupling
-mechanism.<p>
-
-Vorbis coupling applies to pairs of residue vectors at a time;
-decoupling is done in-place a pair at a time in the order and using
-the vectors specified in the current mapping configuration.  The
-decoupling operation is the same for all pairs, converting square
-polar representation (where one vector is magnitude and the second
-angle) back to Cartesian representation. <p>
-
-After decoupling, in order, each pair of vectors on the coupling list
-in, the resulting residue vector represents the fine spectral detail
-of each output channel.<p>
-
-<h3>generate floor curve</h3>
-
-The decoder may choose to generate the floor curve at any appropriate
-time.  It is reasonable to generate the output curve when the floor
-data is decoded from the raw packet, or it can be generated after
-inverse coupling and applied to the spectral residue directly,
-combining generation and the dot product into one step and eliminating
-some working space.<p>
-
-Both floor 0 and floor 1 generate a linear-range, linear-domain output
-vector to be multiplied (dot product) by the linear-range,
-linear-domain spectral residue.<p>
-
-<h3>compute floor/residue dot product</h3>
-
-This step is straightforward; for each output channel, the decoder
-multiplies the floor curve and residue vectors element by element,
-producing the finished audio spectrum of each channel.<p>
-
-One point is worth mentioning about this dot product; a common mistake
-in a fixed point implementation might be to assume that a 32 bit
-fixed-point representation for floor and residue and direct
-multiplication of the vectors is sufficient for acceptable spectral
-depth in all cases because it happens to mostly work with the current
-Xiph.Org reference encoder. <p>
-
-However, floor vector values can span ~140dB (~24 bits unsigned), and
-the audio spectrum vector should represent a minimum of 120dB (~21
-bits with sign), even when output is to a 16 bit PCM device.  For the
-residue vector to represent full scale if the floor is nailed to
--140dB, it must be able to span 0 to +140dB.  For the residue vector
-to reach full scale if the floor is nailed at 0dB, it must be able to
-represent -140dB to +0dB.  Thus, in order to handle full range
-dynamics, a residue vector may span -140dB to +140dB entirely within
-spec.  A 280dB range is approximately 48 bits with sign; thus the
-residue vector must be able to represent a 48 bit range and the dot
-product must be able to handle an effective 48 bit times 24 bit
-multiplication.  This range may be achieved using large (64 bit or
-larger) integers, or implementing a movable binary point
-representation.<p>
-
-<h3>inverse monolithic transform (MDCT)</h3>
-
-The audio spectrum is converted back into time domain PCM audio via an
-inverse Modified Discrete Cosine Transform (MDCT).  A detailed
-description of the MDCT is available in the paper <a
-href="http://www.iocon.com/resource/docs/ps/eusipco_corrected.ps">_The
-use of multirate filter banks for coding of high quality digital
-audio_</a>, by T. Sporer, K. Brandenburg and B. Edler.<p>
-
-Note that the PCM produced directly from the MDCT is not yet finished
-audio; it must be lapped with surrounding frames using an appropriate
-window (such as the Vorbis window) before the MDCT can be considered
-orthogonal.<p>
-
-<h3>overlap/add data</h3>
-
-Windowed MDCT output is overlapped and added with the right hand data
-of the previous window such that the 3/4 point of the previous window
-is aligned with the 1/4 point of the current window (as illustrated in
-the window overlap diagram). At this point, the audio data between the
-center of the previous frame and the center of the current frame is
-now finished and ready to be returned. <p>
-
-
-<h3>cache right hand data</h3>
-
-The decoder must cache the right hand portion of the current frame to
-be lapped with the left hand portion of the next frame.
-
-<h3>return finished audio data</h3>
-
-The overlapped portion produced from overlapping the previous and
-current frame data is finished data to be returned by the decoder.
-This data spans from the center of the previous window to the center
-of the current window.  In the case of same-sized windows, the amount
-of data to return is one-half block consisting of and only of the
-overlapped portions. When overlapping a short and long window, much of
-the returned range is not actually overlap.  This does not damage
-transform orthogonality.  Pay attention however to returning the
-correct data range; the amount of data to be returned is:<p>
-<tt>window_blocksize(previous_window)/4+window_blocksize(current_window)/4</tt>
-from the center of the previous window to the center of the current
-window.<p>
-
-Data is not returned from the first frame; it must be used to 'prime'
-the decode engine.  The encoder accounts for this priming when
-calculating PCM offsets; after the first frame, the proper PCM output
-offset is '0' (as no data has been returned yet).<p>
-
-<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>
-
-</body>
-
diff --git a/doc/vorbis-spec-ref.html b/doc/vorbis-spec-ref.html
deleted file mode 100644 (file)
index 2d24e3a..0000000
+++ /dev/null
@@ -1,551 +0,0 @@
-<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: codec setup and packet decode
-</font></h1>
-
-<em>Last update to this document: October 15, 2002</em><br>
-
-<h1>Overview</h1>
-
-This document serves as the top-level reference document for the
-bit-by-bit decode specification of Vorbis I.  This document assumes a
-high-level understanding of the Vorbis decode process, which is
-provided in the document <a href="vorbis-spec-intro.html">Ogg Vorbis I
-format specification: introduction and description</a>.  <a
-href="vorbis-spec-bitpack.html">Ogg Vorbis I format specification:
-bitpacking convention</a> covers reading and writing bit fields from
-and to bitstream packets.<p>
-
-<h1>Header decode and decode setup</h1>
-
-A Vorbis bitstream begins with three header packets. The header
-packets are, in order, the identification header, the comments header,
-and the setup header. All are required for decode compliance.  An
-end-of-packet condition during decoding the first or third header
-packet renders the stream undecodable.  End-of-packet decoding the
-comment header is a non-fatal error condition.<p>
-
-<h2>Common header decode</h2>
-
-Each header packet begins with the same header fields
-
-<pre>
-  1) [packet_type] : 8 bit value
-  2) 0x76, 0x6f, 0x72, 0x62, 0x69, 0x73: the characters 'v','o','r','b','i','s' as six octets
-</pre>
-
-Decode continues according to packet type; the identification header
-is type 1, the comment header type 3 and the setup header type 5
-(these types are all odd as a packet with a leading single bit of '0'
-is an audio packet).  The packets must occur in the order of
-identification, comment, setup.
-
-<h2>Identification Header</h2>
-
-The identification header is a short header of only a few fields used
-to declare the stream definitively as Vorbis, and provide a few externally
-relevant pieces of information about the audio stream. The
-identification header is coded as follows:<p>
-
-<pre>
- 1) [vorbis_version] = read 32 bits as unsigned integer
- 2) [audio_channels] = read 8 bit integer as unsigned
- 3) [audio_sample_rate] = read 32 bits as unsigned integer
- 4) [bitrate_maximum] = read 32 bits as signed integer
- 5) [bitrate_nominal] = read 32 bits as signed integer
- 6) [bitrate_minimum] = read 32 bits as signed integer
- 7) [blocksize_0] = 2 exponent (read 4 bits as unsigned integer)
- 8) [blocksize_1] = 2 exponent (read 4 bits as unsigned integer)
- 9) [framing_flag] = read one bit
-</pre>
-
-<tt>[vorbis_version]</tt> is to read '0' in order to be compatible
-with this document.  Both <tt>[audio_channels]</tt> and
-<tt>[audio_sample_rate]</tt> must read greater than zero.  Allowed final
-blocksize values are 64, 128, 256, 512, 1024, 2048, 4096 and 8192 in
-Vorbis I.  <tt>[blocksize_0]</tt> must be less than or equal to
-<tt>[blocksize_1]</tt>.  The framing bit must be nonzero.  Failure to
-meet any of these conditions renders a stream undecodable.<p>
-
-The bitrate fields above are used only as hints. The nominal bitrate
-field especially may be considerably off in purely VBR streams.  The
-fields are meaningful only when greater than zero.<p>
-<ul><li>All three fields set to the same value implies a fixed rate, or tightly bounded, nearly fixed-rate bitstream
-    <li>Only nominal set implies a VBR or ABR stream that averages the nominal bitrate
-    <li>Maximum and or minimum set implies a VBR bitstream that obeys the bitrate limits
-    <li>None set indicates the encoder does not care to speculate.
-</ul>
-
-
-<h2>Comment Header</h2>
-
-Comment header decode and data specification is covered in <a
-href="v-comment.html">Ogg Vorbis I format specification: comment field
-and header specification</a>.
-
-<h2>Setup Header</h2>
-
-Vorbis codec setup is configurable to an extreme degree:<p>
-
-<img src="components.png"><p>
-
-The setup header contains the bulk of the codec setup information
-needed for decode.  The setup header contains, in order, the lists of
-codebook configurations, time-domain transform configurations
-(placeholders in Vorbis I), floor configurations, residue
-configurations, channel mapping configurations and mode
-configurations. It finishes with a framing bit of '1'.  Header decode
-proceeds in the following order:<p>
-
-<h3>codebooks</h3>
-
-<ol>
-<li><tt>[vorbis_codebook_count]</tt> = read eight bits as unsigned integer and add one
-<li>Decode <tt>[vorbis_codebook_count]</tt> codebooks in order as defined
-in <a href="vorbis-spec-codebook.html">the codebook specification
-document</a>.  Save each configuration, in order, in an array of
-codebook configurations <tt>[vorbis_codebook_configurations]</tt>.
-</ol>
-
-<h3>time domain transforms</h3>
-
-These hooks are placeholders in Vorbis I.  Nevertheless, the
-configuration placeholder values must be read to maintain bitstream
-sync.<p>
-
-<ol>
-<li><tt>[vorbis_time_count]</tt> = read 6 bits as unsigned integer and add one
-<li>read <tt>[vorbis_time_count]</tt> 16 bit values; each value should be zero.  If any value is nonzero, this is an error condition and the stream is undecodable.
-</ol>
-
-<h3>floors</h3>
-
-Vorbis uses two floor types; header decode is handed to the decode
-abstraction of the appropriate type.
-
-<ol>
-<li><tt>[vorbis_floor_count]</tt> = read 6 bits as unsigned integer and add one
-<li>For each <tt>[i]</tt> of <tt>[vorbis_floor_count]</tt> floor numbers:
-  <ol>
-  <li>read the floor type: vector <tt>[vorbis_floor_types]</tt> element <tt>[i]</tt> = read 16 bits as unsigned integer
-  <li>If the floor type is zero, decode the floor configuration as defined in <a href="vorbis-spec-floor0.html">the floor type 0 specification document</a>; save this configuration in slot <tt>[i]</tt> of the floor configuration array <tt>[vorbis_floor_configurations]</tt>.
-  <li>If the floor type is one, decode the floor configuration as defined in <a href="vorbis-spec-floor1.html">the floor type 1 specification document</a>; save this configuration in slot <tt>[i]</tt> of the floor configuration array <tt>[vorbis_floor_configurations]</tt>.
-  <li>If the the floor type is greater than one, this stream is undecodable; ERROR CONDITION
-  </ol>
-</ol>
-
-<h3>residues</h3>
-
-Vorbis uses three residue types; header decode of each type is identical.
-
-<ol>
-<li><tt>[vorbis_residue_count]</tt> = read 6 bits as unsigned integer and add one
-<li>For each of <tt>[vorbis_residue_count]</tt> residue numbers:
-  <ol>
-  <li>read the residue type; vector <tt>[vorbis_residue_types]</tt> element <tt>[i]</tt> = read 16 bits as unsigned integer
-  <li>If the residue type is zero, one or two, decode the residue configuration as defined in <a href="vorbis-spec-res.html">the residue specification document</a>; save this configuration in slot <tt>[i]</tt> of the residue configuration array <tt>[vorbis_residue_configurations]</tt>.
-  <li>If the the residue type is greater than two, this stream is undecodable; ERROR CONDITION
-  </ol>
-</ol>
-
-<h3>mappings</h3>
-
-Mappings are used to set up specific pipelines for encoding
-multichannel audio with varying channel mapping applications. Vorbis I
-uses a single mapping type (0), with implicit PCM channel mappings.<p>
-
-<ol>
-<li><tt>[vorbis_mapping_count]</tt> = read 6 bits as unsigned integer and add one<p>
-<li>For each <tt>[i]</tt> of <tt>[vorbis_mapping_count]</tt> mapping numbers:<p>
-  <ol>
-  <li>read the mapping type: 16 bits as unsigned integer.  There's no reason to save the mapping type in Vorbis I.<p>
-  <li>If the mapping type is nonzero, the stream is undecodable<p>
-  <li>If the mapping type is zero:<p>
-     <ol> <li>read 1 bit as a boolean flag<p>
-             <ol><li>if set, <tt>[vorbis_mapping_submaps]</tt> = read 4 bits as unsigned integer and add one<p>
-                 <li>if unset, <tt>[vorbis_mapping_submaps]</tt> = 1<p>
-             </ol>
-          <li>read 1 bit as a boolean flag<p>
-            <ol><li>if set, square polar channel mapping is in use:<p>
-                  <ol><li><tt>[vorbis_mapping_coupling_steps]</tt> = read 8 bits as unsigned integer and add one<p>
-                      <li>for <tt>[j]</tt> each of <tt>[vorbis_mapping_coupling_steps]</tt> steps:<p>
-                          <ol>
-                          <li>vector <tt>[vorbis_mapping_magnitude]</tt> element <tt>[j]</tt>= read <a href="helper.html#ilog">ilog</a>([audio_channels] - 1) bits as unsigned integer<p>
-                          <li>vector <tt>[vorbis_mapping_angle]</tt> element <tt>[j]</tt>= read <a href="helper.html#ilog">ilog</a>([audio_channels] - 1) bits as unsigned integer<p>
-                          <li>the numbers read in the above two steps are channel numbers representing the channel to treat as magnitude and the channel to treat as angle, respectively.  If for any coupling step the angle channel number equals the magnitude channel number, the magnitude channel number is greater than <tt>[audio_channels]</tt>-1, or the angle channel is greater than <tt>[audio_channels]</tt>-1, the stream is undecodable.<p>
-                          </ol>
-                   </ol>
-               <li>if unset, <tt>[vorbis_mapping_coupling_steps]</tt> = 0
-              </ol>
-           <li>read 2 bits (reserved field); if the value is nonzero, the stream is undecodable<p>
-           <li>if <tt>[vorbis_mapping_submaps]</tt> is greater than one, we read channel multiplex settings.  For each <tt>[j]</tt> of <tt>[audio_channels]</tt> channels:<p>
-               <ol><li>vector <tt>[vorbis_mapping_mux]</tt> element <tt>[j]</tt> = read 4 bits as unsigned integer<p>
-                   <li>if the value is greater than the highest numbered submap (<tt>[vorbis_mapping_submaps]</tt> - 1), this in an error condition rendering the stream undecodable<p>
-               </ol>
-           <li>for each submap <tt>[j]</tt> of <tt>[vorbis_mapping_submaps]</tt> submaps, read the floor and residue numbers for use in decoding that submap:
-              <ol><li>read and discard 8 bits (the unused time configuration placeholder)<p>
-                  <li>read 8 bits as unsigned integer for the floor number; save in vector <tt>[vorbis_mapping_submap_floor]</tt> element <tt>[j]</tt><p>
-                  <li>verify the floor number is not greater than the highest number floor configured for the bitstream.  If it is, the bitstream is undecodable<p>
-                  <li>read 8 bits as unsigned integer for the residue number; save in vector <tt>[vorbis_mapping_submap_residue]</tt> element <tt>[j]</tt><p>
-                  <li>verify the residue number is not greater than the highest number residue configured for the bitstream.  If it is, the bitstream is undecodable<p>
-              </ol>
-
-
-           <li>save this mapping configuration in slot <tt>[i]</tt> of the mapping configuration array <tt>[vorbis_mapping_configurations]</tt>.
-
-     </ol>
-  </ol>
-</ol>
-
-<h3>modes</h3>
-
-<ol>
-<li><tt>[vorbis_mode_count]</tt> = read 6 bits as unsigned integer and add one<p>
-<li>For each of <tt>[vorbis_mode_count]</tt> mode numbers:<p>
-  <ol>
-  <li><tt>[vorbis_mode_blockflag]</tt> = read 1 bit<p>
-  <li><tt>[vorbis_mode_windowtype]</tt> = read 16 bits as unsigned integer<p>
-  <li><tt>[vorbis_mode_transformtype]</tt> = read 16 bits as unsigned integer<p>
-  <li><tt>[vorbis_mode_mapping]</tt> = read 8 bits as unsigned integer<p>
-  <li>verify ranges; zero is the only legal value in Vorbis I for <tt>[vorbis_mode_windowtype]</tt> and <tt>[vorbis_mode_transformtype]</tt>.  <tt>[vorbis_mode_mapping]</tt> must not be greater than the highest number mapping in use.  Any illegal values render the stream undecodable.<p>
-  <li>save this mode configuration in slot <tt>[i]</tt> of the mode configuration array <tt>[vorbis_mode_configurations]</tt>.<p>
-
-  </ol>
-  <li>read 1 bit as a framing flag.  If unset, a framing error occurred and the stream is not decodable.
-
-</ol><p>
-
-After reading mode descriptions, setup header decode is complete.<p>
-
-<h1>Audio packet decode and synthesis</h1>
-
-Following the three header packets, all packets in a Vorbis I stream
-are audio.  The first step of audio packet decode is to read and
-verify the packet type; <em>a non-audio packet when audio is expected
-indicates stream corruption or a non-compliant stream. The decoder
-must ignore the packet and not attempt decoding it to audio</em>.
-
-<h2>packet type, mode and window decode</h2>
-
-<ol>
-<li>read 1 bit <tt>[packet_type]</tt>; check that packet type is 0 (audio)<p>
-<li>read <a href="helper.html#ilog">ilog</a>([vorbis_mode_count]-1) bits <tt>[mode_number]</tt><p>
-<li>decode blocksize <tt>[n]</tt> is equal to <tt>[blocksize_0]</tt> if  <tt>[vorbis_mode_blockflag]</tt> is 0, else <tt>[n]</tt> is equal to <tt>[blocksize_1]</tt><p.
-<li>perform window selection and setup; this window is used later by the inverse MDCT:<p>
-   <ol><li>if this is a long window (the <tt>[vorbis_mode_blockflag]</tt> flag of this mode is set):<p>
-       <ol>
-         <li>read 1 bit for <tt>[previous_window_flag]</tt><p>
-         <li>read 1 bit for <tt>[next_window_flag]</tt><p>
-
-         <li>if <tt>[previous_window_flag]</tt> is not set, the left half
-         of the window will be a hybrid window for lapping with a
-         short block.  See <a href="vorbis-spec-intro.html#window">the
-         'Window' subheading of the specification introduction
-         document</a> for an illustration of overlapping dissimilar
-         windows. Else, the left half window will have normal long
-         shape.<p>
-
-         <li>if <tt>[next_window_flag]</tt> is not set, the right half of
-         the window will be a hybrid window for lapping with a short
-         block.  See <a href="vorbis-spec-intro.html#window">the
-         'Window' subheading of the specification introduction
-         document</a> for an illustration of overlapping dissimilar
-         windows. Else, the left right window will have normal long
-         shape.<p>
-       </ol>
-       <li> if this is a short window, the window is always the same 
-       short-window shape.<p>
-
-  </ol>
-</ol>
-
-Vorbis windows all use the slope function y=sin( .5 * PI * sin^2( (x+.5) /
-n * PI) ) where n is window size and x ranges 0...n-1, but dissimilar
-lapping requirements can affect overall shape.  Window generation
-proceeds as follows:<p>
-
-<ol>
-<li> <tt>[window_center]</tt> = <tt>[n]</tt> / 2
-<li> <tt>[left_window_start]</tt>
-<li> if (<tt>[vorbis_mode_blockflag]</tt> is set and <tt>[previous_window_flag]</tt> is not set) then 
-    <ol><li><tt>[left_window_start]</tt> = <tt>[n]</tt>/4 - <tt>[blocksize_0]</tt>/4
-        <li><tt>[left_window_end]</tt> = <tt>[n]</tt>/4 + <tt>[blocksize_0]</tt>/4
-        <li><tt>[left_n]</tt> = <tt>[blocksize_0]</tt>/2
-    </ol>
-    else
-    <ol><li><tt>[left_window_start]</tt> = 0
-        <li><tt>[left_window_end]</tt> = <tt>[window_center]</tt>
-        <li><tt>[left_n]</tt> = <tt>[n]</tt>/2
-    </ol>
-
-<li> if (<tt>[vorbis_mode_blockflag]</tt> is set and <tt>[next_window_flag]</tt> is not set) then 
-    <ol><li><tt>[right_window_start]</tt> = <tt>[n]*3</tt>/4 - <tt>[blocksize_0]</tt>/4
-        <li><tt>[right_window_end]</tt> = <tt>[n]*3</tt>/4 + <tt>[blocksize_0]</tt>/4
-        <li><tt>[right_n]</tt> = <tt>[blocksize_0]</tt>/2
-    </ol>
-    else
-    <ol><li><tt>[right_window_start]</tt> = <tt>[window_center]</tt>
-        <li><tt>[right_window_end]</tt> = <tt>[n]</tt>
-        <li><tt>[right_n]</tt> = <tt>[n]</tt>/2
-    </ol>
-<li> window from range 0 ... <tt>[left_window_start]</tt>-1 inclusive is zero
-
-<li> for <tt>[i]</tt> in range <tt>[left_window_start]</tt> ... <tt>[left_window_end]</tt>-1, window(<tt>[i]</tt>) = sin(.5 * PI * sin^2( (<tt>[i]</tt>-<tt>[left_window_start]</tt>+.5) / <tt>[left_n]</tt> * .5 * PI) )
-
-
-<li> window from range <tt>[left_window_end]</tt> ... <tt>[right_window_start]</tt>-1 inclusive is one
-
-<li> for <tt>[i]</tt> in range <tt>[right_window_start]</tt> ... <tt>[right_window_end]</tt>-1, window(<tt>[i]</tt>) = sin(.5 * PI * sin^2( (<tt>[i]</tt>-<tt>[right_window_start]</tt>+.5) / <tt>[right_n]</tt> * .5 * PI/2. + .5 * PI) )
-
-<li> window from range <tt>[rigth_window_start]</tt> ... <tt>[n]</tt>-1 is zero
-
-</ol><p>
-
-An end-of-packet condition up to this point should be considered an
-error that discards this packet from the stream.  An end of packet
-condition past this point is to be considered a possible nominal
-occurrence.<p>
-
-
-<h2>floor curve decode</h2>
-
-From this point on, we assume out decode context is using mode number
-<tt>[mode_number]</tt> from configuration array
-<tt>[vorbis_mode_configurations]</tt> and the map number
-<tt>[vorbis_mode_mapping]</tt> (specified by the current mode) taken
-from the mapping configuration array
-<tt>[vorbis_mapping_configurations]</tt>.<p>
-
-Floor curves are decoded one-by-one in channel order.<p>
-
-For each floor <tt>[i]</tt> of <tt>[audio_channels]</tt>
-  <ol><li><tt>[submap_number]</tt> = element <tt>[i]</tt> of vector [vorbis_mapping_mux] <p>
-
-      <li><tt>[floor_number]</tt> = element <tt>[submap_number]</tt> of vector [vorbis_submap_floor]<p>
-      <li>if the floor type of this floor (vector <tt>[vorbis_floor_types]</tt> element <tt>[floor_number]</tt>) is zero then decode the floor for channel <tt>[i]</tt> according to the <a href="vorbis-spec-floor0.html#decode">floor 0 decode algorithm</a><p>
-      <li>if the type of this floor is one then decode the floor for channel <tt>[i]</tt> according to the <a href="vorbis-spec-floor1.html#decode">floor 1 decode algorithm</a><p>
-      <li>save the needed decoded floor information for channel for later synthesis<p>
-      <li>if the decoded floor returned 'unused', set vector <tt>[no_residue]</tt> element <tt>[i]</tt> to true, else set vector <tt>[no_residue]</tt> element <tt>[i]</tt> to false<p>
-</ol>
-
-An end-of-packet condition during floor decode shall result in packet
-decode zeroing all channel output vectors and skipping to the
-add/overlap output stage.<p>
-
-<h2>nonzero vector propagate</h2>
-
-A possible result of floor decode is that a specific vector is marked
-'unused' which indicates that that final output vector is all-zero
-values (and the floor is zero).  The residue for that vector is not
-coded in the stream, save for one complication.  If some vectors are
-used and some are not, channel coupling could result in mixing a
-zeroed and nonzeroed vector to produce two nonzeroed vectors.<p>
-
-for each <tt>[i]</tt> from 0 ... <tt>[vorbis_mapping_coupling_steps]</tt>-1
-
-<ol><li>if either <tt>[no_residue]</tt> entry for channel
-(<tt>[vorbis_mapping_magnitude]</tt> element <tt>[i]</tt>) or (channel
-<tt>[vorbis_mapping_angle]</tt> element <tt>[i]</tt>) are set to false, then both
-must be set to false.  Note that an 'unused' floor has no decoded floor
-information; it is important that this is remembered at floor curve
-synthesis time.
-</ol>
-
-<h2>residue decode</h2>
-
-Unlike floors, which are decoded in channel order, the residue vectors
-are decoded in submap order.<p>
-
-for each submap <tt>[i]</tt> in order from 0 ... <tt>[vorbis_mapping_submaps]</tt>-1<p>
-<ol><li><tt>[ch]</tt> = 0<p>
-    <li>for each channel <tt>[j]</tt> in order from 0 ... <tt>[audio_channels]</tt><p>
-        <ol><li>if channel <tt>[j]</tt> is in submap <tt>[i]</tt> (vector <tt>[vorbis_mapping_mux]</tt> element <tt>[j]</tt> is equal to <tt>[i]</tt>)<p>
-           <ol><li>if vector <tt>[no_residue]</tt> element <tt>[j]</tt> is true<p>
-                <ol><li>vector <tt>[do_not_decode_flag]</tt> element <tt>[channels_in_bundle]</tt> is set<p>
-               </ol>else<ol><li>vector <tt>[do_not_decode_flag]</tt> element <tt>[channels_in_bundle]</tt> is unset<p>
-                </ol>
-                <li>increment <tt>[ch]</tt><p>
-             </ol>
-         </ol>
-     <li><tt>[residue_number]</tt> = vector <tt>[vorbis_mapping_submap_residue]</tt> element <tt>[i]</tt><p>
-
-     <li><tt>[residue_type]</tt> = vector <tt>[vorbis_residue_types]</tt> element <tt>[residue_number]</tt><p>
-     <li>decode <tt>[ch]</tt> vectors using residue <tt>[residue_number]</tt>, according to type <tt>[residue_type]</tt>, also passing vector <tt>[do_not_decode_flag]</tt> to indicate which vectors in the bundle should not be decoded. Correct per-vector decode length is <tt>[n]</tt>/2.<p>
-           
-    <li><tt>[ch]</tt> = 0<p>
-    <li>for each channel <tt>[j]</tt> in order from 0 ... <tt>[audio_channels]</tt><p>
-        <ol><li>if channel <tt>[j]</tt> is in submap <tt>[i]</tt> (vector <tt>[vorbis_mapping_mux]</tt> element <tt>[j]</tt> is equal to <tt>[i]</tt>)<p>
-           <ol><li>residue vector for channel <tt>[j]</tt> is set to decoded residue vector <tt>[ch]</tt><p>
-               <li>increment <tt>[ch]</tt>
-            </ol>
-         </ol>
-</ol>
-
-<h2>inverse coupling</h2>
-
-for each <tt>[i]</tt> from <tt>[vorbis_mapping_coupling_steps]</tt>-1 descending to 0
-
-<ol>
-
-<li><tt>[magnitude_vector]</tt> = the residue vector for channel
-(vector <tt>[vorbis_mapping_magnitude]</tt> element <tt>[i]</tt>)
-
-<li><tt>[angle_vector]</tt> = the residue vector for channel (vector
-<tt>[vorbis_mapping_angle]</tt> element <tt>[i]</tt>)
-
-<li>for each scalar value <tt>[M]</tt> in vector <tt>[magnitude_vector]</tt> and the corresponding scalar value <tt>[A]</tt> in vector <tt>[angle_vector]</tt>:
-   <ol><li>if (<tt>[M]</tt> is greater than zero)
-       <ol><li>if (<tt>[A]</tt> is greater than zero)
-           <ol>
-               <li><tt>[new_M]</tt> = <tt>[M]</tt>
-               <li><tt>[new_A]</tt> = <tt>[M]</tt>-<tt>[A]</tt>
-           </ol>
-           else
-           <ol>
-               <li><tt>[new_A]</tt> = <tt>[M]</tt>
-               <li><tt>[new_M]</tt> = <tt>[M]</tt>+<tt>[A]</tt>
-           </ol>
-        </ol>
-        else
-        <ol><li>if (<tt>[A]</tt> is greater than zero)
-           <ol>
-               <li><tt>[new_M]</tt> = <tt>[M]</tt>
-               <li><tt>[new_A]</tt> = <tt>[M]</tt>+<tt>[A]</tt>
-           </ol>
-           else
-           <ol>
-               <li><tt>[new_A]</tt> = <tt>[M]</tt>
-               <li><tt>[new_M]</tt> = <tt>[M]</tt>-<tt>[A]</tt>
-           </ol>
-        </ol><p>
-
-       <li>set scalar value <tt>[M]</tt> in vector <tt>[magnitude_vector]</tt> to <tt>[new_M]</tt>
-       <li>set scalar value <tt>[A]</tt> in vector <tt>[angle_vector]</tt> to <tt>[new_A]</tt>
-    </ol>
-</ol>
-
-<h2>dot product</h2>
-
-For each channel, synthesize the floor curve from the decoded floor
-information, according to packet type. Note that the vector synthesis
-length for floor computation is <tt>[n]</tt>/2.<p>
-
-For each channel, multiply each element of the floor curve by each
-element of that channel's residue vector.  The result is the dot
-product the floor and residue vectors for each channel; the produced
-vectors are the length <tt>[n]</tt>/2 audio spectrum for each
-channel.<p>
-
-One point is worth mentioning about this dot product; a common mistake
-in a fixed point implementation might be to assume that a 32 bit
-fixed-point representation for floor and residue and direct
-multiplication of the vectors is sufficient for acceptable spectral
-depth in all cases because it happens to mostly work with the current
-Xiph.Org reference encoder. <p>
-
-However, floor vector values can span ~140dB (~24 bits unsigned), and
-the audio spectrum vector should represent a minimum of 120dB (~21
-bits with sign), even when output is to a 16 bit PCM device.  For the
-residue vector to represent full scale if the floor is nailed to
--140dB, it must be able to span 0 to +140dB.  For the residue vector
-to reach full scale if the floor is nailed at 0dB, it must be able to
-represent -140dB to +0dB.  Thus, in order to handle full range
-dynamics, a residue vector may span -140dB to +140dB entirely within
-spec.  A 280dB range is approximately 48 bits with sign; thus the
-residue vector must be able to represent a 48 bit range and the dot
-product must be able to handle an effective 48 bit times 24 bit
-multiplication.  This range may be achieved using large (64 bit or
-larger) integers, or implementing a movable binary point
-representation.<p>
-
-<h2>inverse MDCT</h2>
-
-Convert the audio spectrum vector of each channel back into time
-domain PCM audio via an inverse Modified Discrete Cosine Transform
-(MDCT).  A detailed description of the MDCT is available in the paper
-<a
-href="http://www.iocon.com/resource/docs/ps/eusipco_corrected.ps">_The
-use of multirate filter banks for coding of high quality digital
-audio_</a>, by T. Sporer, K. Brandenburg and B. Edler.  The window
-function used for the MDCT is the window determined earlier.<p>
-
-<h2>overlap_add</h2>
-
-Windowed MDCT output is overlapped and added with the right hand data
-of the previous window such that the 3/4 point of the previous window
-is aligned with the 1/4 point of the current window (as illustrated in
-<a href="vorbis-spec-intro.html#window">the 'Window' portion of the
-specification introduction document</a>.  The overlapped portion
-produced from overlapping the previous and current frame data is
-finished data to be returned by the decoder.  This data spans from the
-center of the previous window to the center of the current window.  In
-the case of same-sized windows, the amount of data to return is
-one-half block consisting of and only of the overlapped portions. When
-overlapping a short and long window, much of the returned range is not
-actually overlap.  This does not damage transform orthogonality.  Pay
-attention however to returning the correct data range; the amount of
-data to be returned is:<p>
-<tt>window_blocksize(previous_window)/4+window_blocksize(current_window)/4</tt>
-from the center (element windowsize/2) of the previous window to the
-center (element windowsize/2-1, inclusive) of the current window.<p>
-
-Data is not returned from the first frame; it must be used to 'prime'
-the decode engine.  The encoder accounts for this priming when
-calculating PCM offsets; after the first frame, the proper PCM output
-offset is '0' (as no data has been returned yet).<p>
-
-<h2>output channel order</h2>
-
-Vorbis I specifies only a channel mapping type 0.  In mapping type 0,
-channel mapping is implicitly defined as follows for standard audio
-applications:<p>
-
-<dl>
-<dt>one channel:<dd> the stream is monophonic
-<dt>two channels:<dd> the stream is stereo.  channel order: left, right
-<dt>three channels:<dd> the stream is a 1d-surround encoding.  channel order: left, center, right
-<dt>four channels:<dd> the stream is quadraphonic surround.  channel order: front left, front right, rear left, rear right
-<dt>five channels:<dd> the stream is five-channel surround.  channel order: front left, front center, front right, rear left, rear right
-<dt>six channels:<dd> the stream is 5,1 surround.  channel order: front left, front center, front right, rear left, rear right, LFE
-<dt>greater than six channels:<dd> channel use and order is defined by the application
-</dl>
-
-Applications using Vorbis for dedicated purposes may define channel
-mapping as seen fit.  Future channel mappings (such as three and four
-channel <a href="http://www.ambisonic.net">Ambisonics</a>) will make
-use of channel mappings other than mapping 0.<p>
-
-<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>
-
-</body>
-
diff --git a/doc/vorbis-spec-res.html b/doc/vorbis-spec-res.html
deleted file mode 100644 (file)
index 1500843..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-<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: residue setup and decode
-</font></h1>
-
-<em>Last update to this document: July 19, 2002</em><br>
-
-<h1>Overview</h1>
-
-A residue vector represents the fine detail of the audio spectrum of
-one channel in an audio frame after the encoder subtracts the floor
-curve and performs any channel coupling.  A residue vector may
-represent spectral lines, spectral magnitude, spectral phase or
-hybrids as mixed by channel coupling.  The exact semantic content of
-the vector does not matter to the residue abstraction.<p>
-
-Whatever the exact qualities, the Vorbis residue abstraction codes the
-residue vectors into the bitstream packet, and then reconstructs the
-vectors during decode.  Vorbis makes use of three different encoding
-variants (numbered 0, 1 and 2) of the same basic vector encoding
-abstraction.<p>
-
-<h1>Residue format</h1>
-
-Reside format partitions each vector in the vector bundle into chunks,
-classifies each chunk, encodes the chunk classifications and finally
-encodes the chunks themselves using the the specific VQ arrangement
-defined for each selected selected classification.  The exact
-interleaving and partitioning vary by residue encoding number, however
-the high-level process used to classify and encode the residue vector
-is the same in all three variants.<p>
-
-A set of coded residue vectors are all of the same length.  High level
-coding structure, ignoring for the moment exactly how a partition is
-encoded and simply trusting that it is, is as follows:<p>
-
-<ul>
-<li>Each vector is partitioned into multiple equal sized chunks
-according to configuration specified.  If we have a vector size of
-<i>n</i>, a partition size <i>residue_partition_size</i>, and a total
-of <i>ch</i> residue vectors, the total number of partitioned chunks
-coded is <i>n</i>/<i>residue_partition_size</i>*<i>ch</i>.  It is
-important to note that the integer division truncates.  In the below
-example, we assume an example <i>residue_partition_size</i> of 8.<p>
-
-<li>Each partition in each vector has a classification number that
-specifies which of multiple configured VQ codebook setups are used to
-decode that partition.  The classification numbers of each partition
-can be thought of as forming a vector in their own right, as in the
-illustration below.  Just as the residue vectors are coded in grouped
-partitions to increase encoding efficiency, the classification vector
-is also partitioned into chunks.  The integer elements of each scalar
-in a classification chunk are built into a single scalar that
-represents the classification numbers in that chunk.  In the below
-example, the classification codeword encodes two classification
-numbers.<p>
-
-<li>The values in a residue vector may be encoded monolithically in a
-single pass through the residue vector, but more often efficient
-codebook design dictates that each vector is encoded as the additive
-sum of several passes through the residue vector using more than one
-VQ codebook.  Thus, each residue value potentially accumulates values
-from multiple decode passes.  The classification value associated with
-a partition is the same in each pass, thus the classification codeword
-is coded only in the first pass.<p>
-
-</ul>
-
-<img src="residue-pack.png"><p>
-
-<h2>residue 0</h2>
-
-Residue 0 and 1 differ only in the way the values within a residue
-partition are interleaved during partition encoding (visually treated
-as a black box- or cyan box or brown box- in the above figure).<p>
-
-Residue encoding 0 interleaves VQ encoding according to the
-dimension of the codebook used to encode a partition in a specific
-pass.  The dimension of the codebook need not be the same in multiple
-passes, however the partition size must be an even multiple of the
-codebook dimension.<p>
-
-As an example, assume a partition vector of size eight, to be encoded
-by residue 0 using codebook sizes of 8, 4, 2 and 1:<p>
-
-<pre>
-
-            original residue vector: [ 0 1 2 3 4 5 6 7 ]
-
-codebook dimensions = 8  encoded as: [ 0 1 2 3 4 5 6 7 ]
-
-codebook dimensions = 4  encoded as: [ 0 2 4 6 ], [ 1 3 5 7 ]
-
-codebook dimensions = 2  encoded as: [ 0 4 ], [ 1 5 ], [ 2 6 ], [ 3 7 ]
-
-codebook dimensions = 1  encoded as: [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7 ]
-
-</pre>
-
-It is worth mentioning at this point that no configurable value in the
-residue coding setup is restricted to a power of two.<p>
-
-<h2> residue 1 </h2>
-
-Residue 1 does not interleave VQ encoding.  It represents partition
-vector scalars in order.  As with residue 0, however, partition length
-must be an integer multiple of the codebook dimension, although
-dimension may vary from pass to pass.
-
-As an example, assume a partition vector of size eight, to be encoded
-by residue 0 using codebook sizes of 8, 4, 2 and 1:<p>
-
-<pre>
-
-            original residue vector: [ 0 1 2 3 4 5 6 7 ]
-
-codebook dimensions = 8  encoded as: [ 0 1 2 3 4 5 6 7 ]
-
-codebook dimensions = 4  encoded as: [ 0 1 2 3 ], [ 4 5 6 7 ]
-
-codebook dimensions = 2  encoded as: [ 0 1 ], [ 2 3 ], [ 4 5 ], [ 6 7 ]
-
-codebook dimensions = 1  encoded as: [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7 ]
-
-</pre>
-
-<h2> residue 2 </h2>
-
-Residue type two can be thought of as a variant of residue type 1.
-Rather than encoding multiple passed-in vectors as in residue type 1,
-the <i>ch</i> passed in vectors of length <i>n</i> are first
-interleaved and flattened into a single vector of length
-<i>ch</i>*<i>n</i>.  Encoding then proceeds as in type 1. Decoding is
-as in type 1 with decode interleave reversed. If operating on a single
-vector to begin with, residue type 1 and type 2 are equivalent.<p>
-
-<img src="residue2.png"><p>
-
-<h1>Residue decode</h1>
-
-<h2>header decode</h2>
-
-Header decode for all three residue types is identical.<p>
-<pre>
-  1) [residue_begin] = read 24 bits as unsigned integer
-  2) [residue_end] = read 24 bits as unsigned integer
-  3) [residue_partition_size] = read 24 bits as unsigned integer and add one
-  4) [residue_classifications] = read 6 bits as unsigned integer and add one
-  5) [residue_classbook] = read 8 bits as unsigned integer
-</pre>
-
-<tt>[residue_begin]</tt> and <tt>[residue_end]</tt> select the specific
-sub-portion of each vector that is actually coded; it implements akin
-to a bandpass where, for coding purposes, the vector effectively
-begins at element <tt>[residue_begin]</tt> and ends at
-<tt>[residue_end]</tt>.  Preceding and following values in the unpacked
-vectors are zeroed.  Note that for residue type 2, these values as
-well as <tt>[residue_partition_size]</tt>apply to the interleaved
-vector, not the individual vectors before interleave.
-<tt>[residue_partition_size]</tt> is as explained above,
-<tt>[residue_classifications]</tt> is the number of possible
-classification to which a partition can belong and
-<tt>[residue_classbook]</tt> is the codebook number used to code
-classification codewords.  The number of dimensions in book
-<tt>[residue_classbook]</tt> determines how many classification values
-are grouped into a single classification codeword.<p>
-
-Next we read a bitmap pattern that specifies which partition classes
-code values in which passes.<p>
-
-<pre>
-  1) iterate [i] over the range 0 ... [residue_classifications]-1 {
-  
-       2) [high_bits] = 0
-       3) [low_bits] = read 3 bits as unsigned integer
-       4) [bitflag] = read one bit as boolean
-       5) if ( [bitflag] is set ) then [high_bits] = read five bits as unsigned integer
-       6) vector [residue_cascade] element [i] = [high_bits] * 8 + [low_bits]
-     }
-  7) done
-</pre>
-
-Finally, we read in a list of book numbers, each corresponding to
-specific bit set in the cascade bitmap.  We loop over the possible
-codebook classifications and the maximum possible number of encoding
-stages (8 in Vorbis I, as constrained by the elements of the cascade
-bitmap being eight bits):<p>
-
-<pre>
-  1) iterate [i] over the range 0 ... [residue_classifications]-1 {
-  
-       2) iterate [j] over the range 0 ... 7 {
-  
-            3) if ( vector [residue_cascade] element [i] bit [j] is set ) {
-
-                 4) array [residue_books] element [i][j] = read 8 bits as unsigned integer
-
-               } else {
-
-                 5) array [residue_books] element [i][j] = unused
-
-               }
-          }
-      }
-
-  6) done
-</pre>
-
-An end-of-packet condition at any point in header decode renders the
-stream undecodable.  In addition, any codebook number greater than the
-maximum numbered codebook set up in this stream also renders the
-stream undecodable.<p>
-
-<h2>packet decode</h2>
-
-Format 0 and 1 packet decode is identical except for specific
-partition interleave.  Format 2 packet decode can be built out of the
-format 1 decode process.  Thus we describe first the decode
-infrastructure identical to all three formats.<p>
-
-In addition to configuration information, the residue decode process
-is passed the number of vectors in the submap bundle and a vector of
-flags indicating if any of the vectors are not to be decoded.  If the
-passed in number of vectors is 3 and vector number 1 is marked 'do not
-decode', decode skips vector 1 during the decode loop.  However, even
-'do not decode' vectors are allocated and zeroed.<p>
-
-The following convenience values are conceptually useful to clarifying
-the decode process:<p>
-
-<pre>
-  1) [classvals_per_codeword] = [codebook_dimensions] value of codebook [residue_classbook]
-  2) [n_to_read] = [residue_end] - [residue-begin]
-  3) [partitions_to_read] = [n_to_read] / [residue_partition_size]
-</pre>
-
-Packet decode proceeds as follows, matching the description offered earlier in the document.  We assume that the number of vectors being encoded, <tt>[ch]</tt> is provided by the higher level decoding process.<p>  
-<pre>
-  1) allocate and zero all vectors that will be returned.
-  2) iterate [pass] over the range 0 ... 7 {
-
-       3) [partition_count] = 0
-       4) if ([pass] is zero) {
-     
-            5) iterate [j] over the range 0 .. [ch]-1 {
-
-                 6) if vector [j] is not marked 'do not decode' {
-
-                      7) [temp] = read from packet using codebook [residue_classbook] in scalar context
-                      8) iterate [k] descending over the range [classvals_per_codeword]-1 ... 0 {
-
-                           9) array [classifications] element [j],([partition_count]+[k]) =
-                              [temp] integer modulo [residue_classifications]
-                          10) [temp] = [temp] / [residue_classifications] using integer division
-
-                         }
-      
-                    }
-            
-               }
-        
-          }
-
-      11) [classword_count] = 0
-      12) iterate [j] over the range 0 .. [ch]-1 {
-
-            13) if vector [j] is not marked 'do not decode' {
-
-  
-                 14) [vqclass] = array [classifications] element [j],([partition_count]+[classword_count])
-                 15) [vqbook] = array [residue_books] element [vqclass],[pass]
-                 16) if ([vqbook] is not 'unused') {
-   
-                       17) decode partition into output vector number [j], starting at scalar 
-                           offset [residue_begin]+[partition_count]*[residue_partition_size] using 
-                           codebook number [vqbook] in VQ context
-                     }
-               }
-
-          }
-
-      18) increment [classword_count]
-      19) increment [partition_count]
-      20) if ([classword_count] is less than [classvals_per_codeword]) AND 
-             ([partition_count] is less than [partitions_to_read) then continue at step 11
-      21) if ([partition_count] is less than [partitions_to_read) then continue at step 4
-    }
- 22) done
-
-</pre>
-
-An end-of-packet condition during packet decode is to be considered a
-nominal occurrence.  Decode returns the result of vector decode up to
-that point.<p>
-
-<h2>format 0 specifics</h2>
-
-Format zero decodes partitions exactly as described earlier in the
-'Residue Format: residue 0' section.  The following pseudocode
-presents the same algorithm. Assume:<p>
-
-<ul>
-<li> <tt>[n]</tt> is the value in
-<tt>[residue_partition_size]</tt>
-<li><tt>[v]</tt> is the residue vector
-<li><tt>[offset]</tt> is the beginning read offset in [v]
-</ul>
-
-<pre>
- 1) [step] = [n] / [codebook_dimensions]
- 2) iterate [i] over the range 0 ... [step]-1 {
-
-      3) vector [entry_temp] = read vector from packet using current codebook in VQ context
-      4) iterate [j] over the range 0 ... [codebook_dimensions]-1 {
-
-           5) vector [v] element ([offset]+[i]+[j]*[step]) =
-               vector [v] element ([offset]+[i]+[j]*[step]) +
-                vector [entry_temp] element [j]
-
-         }
-
-    }
-
-  6) done
-
-</pre>
-<p>
-
-
-<h2>format 1 specifics</h2>
-
-Format 1 decodes partitions exactly as described earlier in the
-'Residue Format: residue 1' section.  The following pseudocode
-presents the same algorithm. Assume:<p>
-
-<ul>
-<li> <tt>[n]</tt> is the value in
-<tt>[residue_partition_size]</tt>
-<li><tt>[v]</tt> is the residue vector
-<li><tt>[offset]</tt> is the beginning read offset in [v]
-</ul>
-
-<pre>
- 1) [i] = 0
- 2) vector [entry_temp] = read vector from packet using current codebook in VQ context
- 3) iterate [j] over the range 0 ... [codebook_dimensions]-1 {
-
-      5) vector [v] element ([offset]+[i]) =
-         vector [v] element ([offset]+[i]) +
-          vector [entry_temp] element [j]
-      6) increment [i]
-
-    }
-  4) if ( [i] is less than [n] ) continue at step 2
-  5) done
-</pre>
-<p>
-
-<h2>format 2 specifics</h2>
-Format 2 is reducible to format 1 through the following steps, performed in order: <p>
-
-<ol>
-<li>Assume format 2 is to decode <i>ch</i> vectors of length <i>n</i>.
-<li>Decode, using format 1, a single vector <tt>[v]</tt>of length <i>ch</i>*<i>n</i>.
-<li>Deinterleave this single vector <tt>[v]</tt> into <i>ch</i> independent vectors according to:<p>
-<pre>
-  1) iterate [i] over the range 0 ... [n]-1 {
-
-       2) iterate [j] over the range 0 ... [ch]-1 {
-
-            3) output vector number [j] element [i] = vector [t] element ([i] * [ch] +[j])
-
-          }
-     }
-
-  4) done
-</pre>
-</ol>
-<p>
-
-Format 2 handles 'do not decode' vectors differently that residue 0 or
-1; if all vectors are marked 'do not decode', no decode occurrs.
-However, if at least one vector is to be decoded, all the vectors are
-decoded.<p>
-
-<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>
-
-</body>
-