[xiph-commits] r9945 - in websites/xiph.org: ogg vorbis vorbis/doc

nehal at svn.xiph.org nehal at svn.xiph.org
Sun Sep 4 10:25:45 PDT 2005


Author: nehal
Date: 2005-09-04 10:25:32 -0700 (Sun, 04 Sep 2005)
New Revision: 9945

Added:
   websites/xiph.org/vorbis/doc/
   websites/xiph.org/vorbis/docs.html
   websites/xiph.org/vorbis/donate.html
   websites/xiph.org/vorbis/download.html
   websites/xiph.org/vorbis/download/
   websites/xiph.org/vorbis/download_old.html
   websites/xiph.org/vorbis/faq.html
   websites/xiph.org/vorbis/flac.html
   websites/xiph.org/vorbis/hardware.html
   websites/xiph.org/vorbis/hardware.jpg
   websites/xiph.org/vorbis/hardware/
   websites/xiph.org/vorbis/index.html
   websites/xiph.org/vorbis/index_old.html
   websites/xiph.org/vorbis/letter.html
   websites/xiph.org/vorbis/listen.html
   websites/xiph.org/vorbis/mail.html
   websites/xiph.org/vorbis/neuros.html
   websites/xiph.org/vorbis/october.html
   websites/xiph.org/vorbis/oggtop.include
   websites/xiph.org/vorbis/ogm.html
   websites/xiph.org/vorbis/openletter.html
   websites/xiph.org/vorbis/portables.html
   websites/xiph.org/vorbis/update.html
   websites/xiph.org/vorbis/vorbis-1.0-spec.tgz
Removed:
   websites/xiph.org/ogg/vorbis/
   websites/xiph.org/vorbis/doc/.cvsignore
   websites/xiph.org/vorbis/doc/Makefile
   websites/xiph.org/vorbis/doc/Makefile.am
   websites/xiph.org/vorbis/doc/Makefile.in
   websites/xiph.org/vorbis/doc/Vorbis_I_spec-20040119.html
   websites/xiph.org/vorbis/doc/Vorbis_I_spec-20040119.pdf
   websites/xiph.org/vorbis/doc/Vorbis_I_spec.html
   websites/xiph.org/vorbis/doc/Vorbis_I_spec.pdf
   websites/xiph.org/vorbis/doc/components.png
   websites/xiph.org/vorbis/doc/draft-moffitt-vorbis-rtp-00.txt
   websites/xiph.org/vorbis/doc/eightphase.png
   websites/xiph.org/vorbis/doc/evenlsp.png
   websites/xiph.org/vorbis/doc/floor1-1.png
   websites/xiph.org/vorbis/doc/floor1-2.png
   websites/xiph.org/vorbis/doc/floor1-3.png
   websites/xiph.org/vorbis/doc/floor1-4.png
   websites/xiph.org/vorbis/doc/floor1_inverse_dB_table.html
   websites/xiph.org/vorbis/doc/floorval.png
   websites/xiph.org/vorbis/doc/fourphase.png
   websites/xiph.org/vorbis/doc/framing.html
   websites/xiph.org/vorbis/doc/helper.html
   websites/xiph.org/vorbis/doc/hufftree-under.png
   websites/xiph.org/vorbis/doc/hufftree.png
   websites/xiph.org/vorbis/doc/index.html
   websites/xiph.org/vorbis/doc/lspmap.png
   websites/xiph.org/vorbis/doc/oddlsp.png
   websites/xiph.org/vorbis/doc/oggstream.html
   websites/xiph.org/vorbis/doc/programming.html
   websites/xiph.org/vorbis/doc/residue-pack.png
   websites/xiph.org/vorbis/doc/residue2.png
   websites/xiph.org/vorbis/doc/squarepolar.png
   websites/xiph.org/vorbis/doc/stereo.html
   websites/xiph.org/vorbis/doc/stream.png
   websites/xiph.org/vorbis/doc/v-comment.html
   websites/xiph.org/vorbis/doc/vorbis-clip.txt
   websites/xiph.org/vorbis/doc/vorbis-errors.txt
   websites/xiph.org/vorbis/doc/vorbis-fidelity.html
   websites/xiph.org/vorbis/doc/vorbis-ogg.html
   websites/xiph.org/vorbis/doc/vorbis-spec-bitpack.html
   websites/xiph.org/vorbis/doc/vorbis-spec-codebook.html
   websites/xiph.org/vorbis/doc/vorbis-spec-floor0.html
   websites/xiph.org/vorbis/doc/vorbis-spec-floor1.html
   websites/xiph.org/vorbis/doc/vorbis-spec-intro.html
   websites/xiph.org/vorbis/doc/vorbis-spec-ref.html
   websites/xiph.org/vorbis/doc/vorbis-spec-res.html
   websites/xiph.org/vorbis/doc/vorbis.html
   websites/xiph.org/vorbis/doc/vorbisenc/
   websites/xiph.org/vorbis/doc/vorbisfile/
   websites/xiph.org/vorbis/doc/vorbisword2.png
   websites/xiph.org/vorbis/doc/wait.png
   websites/xiph.org/vorbis/doc/white-ogg.png
   websites/xiph.org/vorbis/doc/white-xifish.png
   websites/xiph.org/vorbis/doc/window1.png
   websites/xiph.org/vorbis/doc/window2.png
Log:
move /ogg/vorbis to /vorbis

Copied: websites/xiph.org/vorbis/doc (from rev 9943, websites/xiph.org/ogg/vorbis/doc)

Deleted: websites/xiph.org/vorbis/doc/.cvsignore
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/.cvsignore	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/.cvsignore	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in

Deleted: websites/xiph.org/vorbis/doc/Makefile
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/Makefile	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/Makefile	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,335 +0,0 @@
-# Generated automatically from Makefile.in by configure.
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-SHELL = /bin/sh
-
-srcdir = .
-top_srcdir = ..
-prefix = /usr
-exec_prefix = ${prefix}
-
-bindir = ${exec_prefix}/bin
-sbindir = ${exec_prefix}/sbin
-libexecdir = ${exec_prefix}/libexec
-datadir = ${prefix}/share
-sysconfdir = ${prefix}/etc
-sharedstatedir = ${prefix}/com
-localstatedir = ${prefix}/var
-libdir = ${exec_prefix}/lib
-infodir = ${prefix}/info
-mandir = ${prefix}/man
-includedir = ${prefix}/include
-oldincludedir = /usr/include
-
-DESTDIR =
-
-pkgdatadir = $(datadir)/libvorbis
-pkglibdir = $(libdir)/libvorbis
-pkgincludedir = $(includedir)/libvorbis
-
-top_builddir = ..
-
-ACLOCAL = aclocal
-AUTOCONF = autoconf
-AUTOMAKE = automake
-AUTOHEADER = autoheader
-
-INSTALL = /usr/bin/install -c
-INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_SCRIPT = ${INSTALL_PROGRAM}
-transform = s,x,x,
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_alias = powerpc-unknown-linux-gnu
-host_triplet = powerpc-unknown-linux-gnu
-AS = @AS@
-CC = gcc-cvs
-CPP = gcc-cvs -E
-DEBUG = -g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES
-DLLTOOL = @DLLTOOL@
-ECHO = echo
-EXEEXT = 
-LIBS = -lm -L/usr/lib -logg
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-LN_S = ln -s
-MAKEINFO = makeinfo
-OBJDUMP = @OBJDUMP@
-OBJEXT = o
-OGG_CFLAGS = -I/usr/include
-OGG_LIBS = -L/usr/lib -logg
-PACKAGE = libvorbis
-PROFILE = -pg -g -O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT
-RANLIB = ranlib
-STRIP = strip
-VERSION = 1.0
-VE_LIB_AGE = 0
-VE_LIB_CURRENT = 2
-VE_LIB_REVISION = 0
-VF_LIB_AGE = 0
-VF_LIB_CURRENT = 3
-VF_LIB_REVISION = 0
-V_LIB_AGE = 2
-V_LIB_CURRENT = 2
-V_LIB_REVISION = 0
-pthread_lib = -lpthread
-
-AUTOMAKE_OPTIONS = foreign
-
-SUBDIRS = vorbisfile vorbisenc
-
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
-
-doc_DATA = eightphase.png            fourphase.png            programming.html            squarepolar.png            stereo.html            v-comment.html            vorbis-clip.txt            vorbis-errors.txt            vorbis.html            vorbisword2.png            wait.png            white-ogg.png            white-xifish.png
-
-
-EXTRA_DIST = $(doc_DATA)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_CLEAN_FILES = 
-DATA =  $(doc_DATA)
-
-DIST_COMMON =  Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP_ENV = --best
-all: all-redirect
-.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile
-
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
-	cd $(top_builddir) \
-	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-install-docDATA: $(doc_DATA)
-	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(docdir)
-	@list='$(doc_DATA)'; for p in $$list; do \
-	  if test -f $(srcdir)/$$p; then \
-	    echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(docdir)/$$p"; \
-	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(docdir)/$$p; \
-	  else if test -f $$p; then \
-	    echo " $(INSTALL_DATA) $$p $(DESTDIR)$(docdir)/$$p"; \
-	    $(INSTALL_DATA) $$p $(DESTDIR)$(docdir)/$$p; \
-	  fi; fi; \
-	done
-
-uninstall-docDATA:
-	@$(NORMAL_UNINSTALL)
-	list='$(doc_DATA)'; for p in $$list; do \
-	  rm -f $(DESTDIR)$(docdir)/$$p; \
-	done
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-
-
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive  \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
-	@set fnord $(MAKEFLAGS); amf=$$2; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@set fnord $(MAKEFLAGS); amf=$$2; \
-	dot_seen=no; \
-	rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
-	  rev="$$subdir $$rev"; \
-	  test "$$subdir" != "." || dot_seen=yes; \
-	done; \
-	test "$$dot_seen" = "no" && rev=". $$rev"; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS)'; \
-	unique=`for i in $$list; do echo $$i; done | \
-	  awk '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	here=`pwd` && cd $(srcdir) \
-	  && mkid -f$$here/ID $$unique $(LISP)
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
-	tags=; \
-	here=`pwd`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-   if test "$$subdir" = .; then :; else \
-	    test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
-   fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)'; \
-	unique=`for i in $$list; do echo $$i; done | \
-	  awk '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
-	  || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags  $$unique $(LISP))
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
-	-rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = doc
-
-distdir: $(DISTFILES)
-	here=`cd $(top_builddir) && pwd`; \
-	top_distdir=`cd $(top_distdir) && pwd`; \
-	distdir=`cd $(distdir) && pwd`; \
-	cd $(top_srcdir) \
-	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign doc/Makefile
-	@for file in $(DISTFILES); do \
-	  d=$(srcdir); \
-	  if test -d $$d/$$file; then \
-	    cp -pr $$d/$$file $(distdir)/$$file; \
-	  else \
-	    test -f $(distdir)/$$file \
-	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-	    || cp -p $$d/$$file $(distdir)/$$file || :; \
-	  fi; \
-	done
-	for subdir in $(SUBDIRS); do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d $(distdir)/$$subdir \
-	    || mkdir $(distdir)/$$subdir \
-	    || exit 1; \
-	    chmod 777 $(distdir)/$$subdir; \
-	    (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-info-am:
-info: info-recursive
-dvi-am:
-dvi: dvi-recursive
-check-am: all-am
-check: check-recursive
-installcheck-am:
-installcheck: installcheck-recursive
-install-exec-am:
-install-exec: install-exec-recursive
-
-install-data-am: install-docDATA
-install-data: install-data-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-recursive
-uninstall-am: uninstall-docDATA
-uninstall: uninstall-recursive
-all-am: Makefile $(DATA)
-all-redirect: all-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs: installdirs-recursive
-installdirs-am:
-	$(mkinstalldirs)  $(DESTDIR)$(docdir)
-
-
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-rm -f Makefile $(CONFIG_CLEAN_FILES)
-	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-
-maintainer-clean-generic:
-mostlyclean-am:  mostlyclean-tags mostlyclean-generic
-
-mostlyclean: mostlyclean-recursive
-
-clean-am:  clean-tags clean-generic mostlyclean-am
-
-clean: clean-recursive
-
-distclean-am:  distclean-tags distclean-generic clean-am
-	-rm -f libtool
-
-distclean: distclean-recursive
-
-maintainer-clean-am:  maintainer-clean-tags maintainer-clean-generic \
-		distclean-am
-	@echo "This command is intended for maintainers to use;"
-	@echo "it deletes files that may require special tools to rebuild."
-
-maintainer-clean: maintainer-clean-recursive
-
-.PHONY: uninstall-docDATA install-docDATA install-data-recursive \
-uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all installdirs-am \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:

Deleted: websites/xiph.org/vorbis/doc/Makefile.am
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/Makefile.am	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/Makefile.am	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,23 +0,0 @@
-## Process this with automake to create Makefile.in
-
-AUTOMAKE_OPTIONS = foreign
-
-SUBDIRS = vorbisfile vorbisenc
-
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
-
-doc_DATA = eightphase.png \
-           fourphase.png \
-           programming.html \
-           squarepolar.png \
-           stereo.html \
-           v-comment.html \
-           vorbis-clip.txt \
-           vorbis-errors.txt \
-           vorbis.html \
-           vorbisword2.png \
-           wait.png \
-           white-ogg.png \
-           white-xifish.png
-
-EXTRA_DIST = $(doc_DATA)

Deleted: websites/xiph.org/vorbis/doc/Makefile.in
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/Makefile.in	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/Makefile.in	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,335 +0,0 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-SHELL = @SHELL@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_alias = @host_alias@
-host_triplet = @host@
-AS = @AS@
-CC = @CC@
-CPP = @CPP@
-DEBUG = @DEBUG@
-DLLTOOL = @DLLTOOL@
-ECHO = @ECHO@
-EXEEXT = @EXEEXT@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-MAKEINFO = @MAKEINFO@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OGG_CFLAGS = @OGG_CFLAGS@
-OGG_LIBS = @OGG_LIBS@
-PACKAGE = @PACKAGE@
-PROFILE = @PROFILE@
-RANLIB = @RANLIB@
-STRIP = @STRIP@
-VERSION = @VERSION@
-VE_LIB_AGE = @VE_LIB_AGE@
-VE_LIB_CURRENT = @VE_LIB_CURRENT@
-VE_LIB_REVISION = @VE_LIB_REVISION@
-VF_LIB_AGE = @VF_LIB_AGE@
-VF_LIB_CURRENT = @VF_LIB_CURRENT@
-VF_LIB_REVISION = @VF_LIB_REVISION@
-V_LIB_AGE = @V_LIB_AGE@
-V_LIB_CURRENT = @V_LIB_CURRENT@
-V_LIB_REVISION = @V_LIB_REVISION@
-pthread_lib = @pthread_lib@
-
-AUTOMAKE_OPTIONS = foreign
-
-SUBDIRS = vorbisfile vorbisenc
-
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
-
-doc_DATA = eightphase.png            fourphase.png            programming.html            squarepolar.png            stereo.html            v-comment.html            vorbis-clip.txt            vorbis-errors.txt            vorbis.html            vorbisword2.png            wait.png            white-ogg.png            white-xifish.png
-
-
-EXTRA_DIST = $(doc_DATA)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_CLEAN_FILES = 
-DATA =  $(doc_DATA)
-
-DIST_COMMON =  Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP_ENV = --best
-all: all-redirect
-.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile
-
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
-	cd $(top_builddir) \
-	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-install-docDATA: $(doc_DATA)
-	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(docdir)
-	@list='$(doc_DATA)'; for p in $$list; do \
-	  if test -f $(srcdir)/$$p; then \
-	    echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(docdir)/$$p"; \
-	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(docdir)/$$p; \
-	  else if test -f $$p; then \
-	    echo " $(INSTALL_DATA) $$p $(DESTDIR)$(docdir)/$$p"; \
-	    $(INSTALL_DATA) $$p $(DESTDIR)$(docdir)/$$p; \
-	  fi; fi; \
-	done
-
-uninstall-docDATA:
-	@$(NORMAL_UNINSTALL)
-	list='$(doc_DATA)'; for p in $$list; do \
-	  rm -f $(DESTDIR)$(docdir)/$$p; \
-	done
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-
- at SET_MAKE@
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive  \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
-	@set fnord $(MAKEFLAGS); amf=$$2; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@set fnord $(MAKEFLAGS); amf=$$2; \
-	dot_seen=no; \
-	rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
-	  rev="$$subdir $$rev"; \
-	  test "$$subdir" != "." || dot_seen=yes; \
-	done; \
-	test "$$dot_seen" = "no" && rev=". $$rev"; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS)'; \
-	unique=`for i in $$list; do echo $$i; done | \
-	  awk '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	here=`pwd` && cd $(srcdir) \
-	  && mkid -f$$here/ID $$unique $(LISP)
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
-	tags=; \
-	here=`pwd`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-   if test "$$subdir" = .; then :; else \
-	    test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
-   fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)'; \
-	unique=`for i in $$list; do echo $$i; done | \
-	  awk '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
-	  || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags  $$unique $(LISP))
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
-	-rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = doc
-
-distdir: $(DISTFILES)
-	here=`cd $(top_builddir) && pwd`; \
-	top_distdir=`cd $(top_distdir) && pwd`; \
-	distdir=`cd $(distdir) && pwd`; \
-	cd $(top_srcdir) \
-	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign doc/Makefile
-	@for file in $(DISTFILES); do \
-	  d=$(srcdir); \
-	  if test -d $$d/$$file; then \
-	    cp -pr $$d/$$file $(distdir)/$$file; \
-	  else \
-	    test -f $(distdir)/$$file \
-	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-	    || cp -p $$d/$$file $(distdir)/$$file || :; \
-	  fi; \
-	done
-	for subdir in $(SUBDIRS); do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d $(distdir)/$$subdir \
-	    || mkdir $(distdir)/$$subdir \
-	    || exit 1; \
-	    chmod 777 $(distdir)/$$subdir; \
-	    (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-info-am:
-info: info-recursive
-dvi-am:
-dvi: dvi-recursive
-check-am: all-am
-check: check-recursive
-installcheck-am:
-installcheck: installcheck-recursive
-install-exec-am:
-install-exec: install-exec-recursive
-
-install-data-am: install-docDATA
-install-data: install-data-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-recursive
-uninstall-am: uninstall-docDATA
-uninstall: uninstall-recursive
-all-am: Makefile $(DATA)
-all-redirect: all-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs: installdirs-recursive
-installdirs-am:
-	$(mkinstalldirs)  $(DESTDIR)$(docdir)
-
-
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-rm -f Makefile $(CONFIG_CLEAN_FILES)
-	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-
-maintainer-clean-generic:
-mostlyclean-am:  mostlyclean-tags mostlyclean-generic
-
-mostlyclean: mostlyclean-recursive
-
-clean-am:  clean-tags clean-generic mostlyclean-am
-
-clean: clean-recursive
-
-distclean-am:  distclean-tags distclean-generic clean-am
-	-rm -f libtool
-
-distclean: distclean-recursive
-
-maintainer-clean-am:  maintainer-clean-tags maintainer-clean-generic \
-		distclean-am
-	@echo "This command is intended for maintainers to use;"
-	@echo "it deletes files that may require special tools to rebuild."
-
-maintainer-clean: maintainer-clean-recursive
-
-.PHONY: uninstall-docDATA install-docDATA install-data-recursive \
-uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all installdirs-am \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:

Deleted: websites/xiph.org/vorbis/doc/Vorbis_I_spec-20040119.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/Vorbis_I_spec-20040119.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/Vorbis_I_spec-20040119.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,2271 +0,0 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Vorbis I specification</title><meta name="generator" content="DocBook XSL Stylesheets V1.64.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id2810119"></a>Vorbis I specification</h1></div><div><h3 class="corpauthor">Xiph.org Foundation</h3></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#vorbis-spec-intro">1. Introduction and Description</a></span></dt><dd><dl><dt><span class="section"><a href="#id2937303">1.1. Overview</a></span></dt><dt><span class="section"><a href="#id2919915">1.2. Decoder Configuration</a></span></dt><dt><span class="section"><a href="#id2912309">1.3. High-level Decode Process</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-bitpacking">2. Bitpacking Convention</a></span></dt><dd><dl><dt><span class="section"><a href="#id2897686">2.1. Overview</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-codebook">3. Probability Model and Codebooks</a></span></dt><dd><dl><dt><span class="section"><a href="#id2906886">3.1. Overview</a></span></dt><dt><span class="section"><a href="#id2944898">3.2. Packed codebook format</a></span></dt><dt><span class="section"><a href="#id2901687">3.3. Use of the codebook abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-codec">4. Codec Setup and Packet Decode</a></span></dt><dd><dl><dt><span class="section"><a href="#id2901896">4.1. Overview</a></span></dt><dt><span class="section"><a href="#id2897591">4.2. Header decode and decode setup</a></span></dt><dt><span class="section"><a href="#id2900420">4.3. Audio packet decode and synthesis</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-comment">5. comment field and header specification</a></span></dt><dd><dl><dt><span class="section"><a href="#id2940356">5.1. Overview</a></span></dt><dt><span class="section"><a href="#id2940397">5.2. Comment encoding</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-floor0">6. Floor type 0 setup and decode</a></span></dt><dd><dl><dt><span class="section"><a href="#id2946983">6.1. Overview</a></span></dt><dt><span class="section"><a href="#id2944376">6.2. Floor 0 format</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-floor1">7. Floor type 1 setup and decode</a></span></dt><dd><dl><dt><span class="section"><a href="#id2907016">7.1. Overview</a></span></dt><dt><span class="section"><a href="#id2923546">7.2. Floor 1 format</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-residue">8. Residue setup and decode</a></span></dt><dd><dl><dt><span class="section"><a href="#id2932325">8.1. Overview</a></span></dt><dt><span class="section"><a href="#id2949726">8.2. Residue format</a></span></dt><dt><span class="section"><a href="#id2889077">8.3. residue 0</a></span></dt><dt><span class="section"><a href="#id2901450">8.4. residue 1</a></span></dt><dt><span class="section"><a href="#id2901481">8.5. residue 2</a></span></dt><dt><span class="section"><a href="#id2903780">8.6. Residue decode</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-helper">9. Helper equations</a></span></dt><dd><dl><dt><span class="section"><a href="#id2939423">9.1. Overview</a></span></dt><dt><span class="section"><a href="#id2892245">9.2. Functions</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-tables">10. Tables</a></span></dt><dd><dl><dt><span class="section"><a href="#vorbis-spec-floor1_inverse_dB_table">10.1. floor1_inverse_dB_table</a></span></dt></dl></dd><dt><span class="appendix"><a href="#vorbis-over-ogg">A. Embedding Vorbis into an Ogg stream</a></span></dt><dd><dl><dt><span class="section"><a href="#id2946040">A.1. Overview</a></span></dt><dd><dl><dt><span class="section"><a href="#id2915136">A.1.1. Restrictions</a></span></dt><dt><span class="section"><a href="#id2924373">A.1.2. MIME type</a></span></dt></dl></dd><dt><span class="section"><a href="#id2946406">A.2. Encapsulation</a></span></dt></dl></dd><dt><span class="appendix"><a href="#vorbis-over-rtp">B. Vorbis encapsulation in RTP</a></span></dt><dt><span class="appendix"><a href="#footer">C. Colophon</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-intro"></a>1. Introduction and Description</h2></div><div><p class="releaseinfo">
- $Id: 01-introduction.xml,v 1.8 2002/12/19 06:10:12 xiphmont Exp $
-<span class="emphasis"><em>Last update to this document: July 18, 2002</em></span>
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2937303"></a>1.1. Overview</h3></div></div><div></div></div><p>
-This document provides a high level description of the Vorbis codec's
-construction.  A bit-by-bit specification appears beginning in 
-<a href="#vorbis-spec-codec" title="4. Codec Setup and Packet Decode">Section 4, &#8220;Codec Setup and Packet Decode&#8221;</a>.
-The later sections assume a high-level
-understanding of the Vorbis decode process, which is 
-provided here.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2919323"></a>1.1.1. Application</h4></div></div><div></div></div><p>
-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 48kbps
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2932763"></a>1.1.2. Classification</h4></div></div><div></div></div><p>
-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.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2937484"></a>1.1.3. Assumptions</h4></div></div><div></div></div><p>
-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><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 variable bit rate (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><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><p>
-The specification for embedding Vorbis into
-an Ogg transport stream is in <a href="#vorbis-over-ogg" title="A. Embedding Vorbis into an Ogg stream">Appendix A, <i>Embedding Vorbis into an Ogg stream</i></a>.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2929071"></a>1.1.4. Codec Setup and Probability Model</h4></div></div><div></div></div><p>
-Vorbis' 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 of codec setup intentionally
-lean toward the extreme of forward adaptive.</p><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.
-</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
-Vorbis <span class="emphasis"><em>can</em></span> initiate decode at any arbitrary packet within a
-bitstream so long as the codec has been initialized/setup with the
-setup headers.</p></div><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><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' suitable application space.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2927492"></a>1.1.5. Format Specification</h4></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2911476"></a>1.1.6. Hardware Profile</h4></div></div><div></div></div><p>
-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></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2919915"></a>1.2. Decoder Configuration</h3></div></div><div></div></div><p>
-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><div class="mediaobject"><img src="components.png" alt="decoder pipeline configuration"></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2912154"></a>1.2.1. Global Config</h4></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2912169"></a>1.2.2. Mode</h4></div></div><div></div></div><p>
-Each Vorbis frame is coded according to a master 'mode'.  A bitstream
-may use one or many modes.</p><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2912199"></a>1.2.3. Mapping</h4></div></div><div></div></div><p>
-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><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><p>
-As an example:</p><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2918771"></a>1.2.4. Floor</h4></div></div><div></div></div><p>
-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><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><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2912274"></a>1.2.5. Residue</h4></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2910094"></a>1.2.6. Codebooks</h4></div></div><div></div></div><p>
-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><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><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></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2912309"></a>1.3. High-level Decode Process</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2912315"></a>1.3.1. Decode Setup</h4></div></div><div></div></div><p>
-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><p>
-The header packets are, in order, the identification
-header, the comments header, and the setup header.</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2912336"></a>1.3.1.1. Identification Header</h5></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2912349"></a>1.3.1.2. Comment Header</h5></div></div><div></div></div><p>
-The comment header includes user text comments ("tags") and a vendor
-string for the application/library that produced the bitstream.  The
-encoding and proper use of the comment header is described in 
-<a href="#vorbis-spec-comment" title="5. comment field and header specification">Section 5, &#8220;comment field and header specification&#8221;</a>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2912367"></a>1.3.1.3. Setup Header</h5></div></div><div></div></div><p>
-The setup header includes extensive CODEC setup information as well as
-the complete VQ and Huffman codebooks needed for decode.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2912381"></a>1.3.2. Decode Procedure</h4></div></div><div></div></div><div class="highlights"><p>
-The decoding and synthesis procedure for all audio packets is
-fundamentally the same.
-</p><div class="orderedlist"><ol type="1"><li>decode packet type flag</li><li>decode mode number</li><li>decode window shape (long windows only)</li><li>decode floor</li><li>decode residue into residue vectors</li><li>inverse channel coupling of residue vectors</li><li>generate floor curve from decoded floor data</li><li>compute dot product of floor and residue, producing audio spectrum vector</li><li>inverse monolithic transform of audio spectrum vector, always an MDCT in Vorbis I</li><li>overlap/add left-hand output of transform with right-hand output of previous frame</li><li>store right hand-data from transform of current frame for future lapping</li><li>if not first frame, return results of overlap/add as audio result of current frame</li></ol></div><p>
-</p></div><p>
-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 <span class="emphasis"><em>entirely mathematically equivalent</em></span> to the
-specification, it need not be a literal semantic implementation.</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2814788"></a>1.3.2.1. Packet type decode</h5></div></div><div></div></div><p>
-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 other packet types are reserved; packets
-marked with a reserved type should be ignored.</p><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; <span class="emphasis"><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></span>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2814817"></a>1.3.2.2. Mode decode</h5></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-window"></a>1.3.2.3. Window shape decode (long windows only)</h5></div></div><div></div></div><p>
-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><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><p>
-This is easy to visualize in the case of equal sized-windows:</p><div class="mediaobject"><img src="window1.png" alt="overlap of two equal-sized windows"></div><p>
-And slightly more complex in the case of overlapping unequal sized
-windows:</p><div class="mediaobject"><img src="window2.png" alt="overlap of a long and a short window"></div><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><p>
-A description of valid window functions for use with an inverse MDCT
-can be found in the paper 
-&#8220;<span class="citetitle">
-<a href="http://www.iocon.com/resource/docs/ps/eusipco_corrected.ps" target="_top">
-The use of multirate filter banks for coding of high quality digital
-audio</a></span>&#8221;, by T. Sporer, K. Brandenburg and B. Edler.  Vorbis windows
-all use the slope function 
-  <span class="inlinemediaobject"></span>.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2814965"></a>1.3.2.4. floor decode</h5></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2814979"></a>1.3.2.5. residue decode</h5></div></div><div></div></div><p>
-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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2815005"></a>1.3.2.6. inverse channel coupling</h5></div></div><div></div></div><p>
-A detailed discussion of stereo in the Vorbis codec can be found in
-the document <a href="stereo.html" target="_top"><i class="citetitle">Stereo Channel Coupling in the
-Vorbis CODEC</i></a>.  Vorbis is not limited to only stereo coupling, but
-the stereo document also gives a good overview of the generic coupling
-mechanism.</p><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><p>
-After decoupling, in order, each pair of vectors on the coupling list, 
-the resulting residue vectors represent the fine spectral detail
-of each output channel.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2815044"></a>1.3.2.7. generate floor curve</h5></div></div><div></div></div><p>
-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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2811320"></a>1.3.2.8. compute floor/residue dot product</h5></div></div><div></div></div><p>
-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><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2811365"></a>1.3.2.9. inverse monolithic transform (MDCT)</h5></div></div><div></div></div><p>
-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" target="_top">&#8220;<span class="citetitle">The use of multirate filter banks for coding of high quality digital
-audio</span>&#8221;</a>, by T. Sporer, K. Brandenburg and B. Edler.</p><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2811397"></a>1.3.2.10. overlap/add data</h5></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2811414"></a>1.3.2.11. cache right hand data</h5></div></div><div></div></div><p>
-The decoder must cache the right hand portion of the current frame to
-be lapped with the left hand portion of the next frame.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2811427"></a>1.3.2.12. return finished audio data</h5></div></div><div></div></div><p>
-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><pre class="programlisting">
-window_blocksize(previous_window)/4+window_blocksize(current_window)/4
-</pre><p>
-
-from the center of the previous window to the center of the current
-window.</p><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></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-bitpacking"></a>2. Bitpacking Convention</h2></div><div><p class="releaseinfo">
- $Id: 02-bitpacking.xml,v 1.6 2002/10/27 16:20:47 giles Exp $
- <span class="emphasis"><em>Last update to this document: July 14, 2002</em></span>
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2897686"></a>2.1. Overview</h3></div></div><div></div></div><p>
-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.
-</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2925642"></a>2.1.1. octets, bytes and words</h4></div></div><div></div></div><p>
-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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2894837"></a>2.1.2. bit order</h4></div></div><div></div></div><p>
-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
-<span class="emphasis"><em>n</em></span> (<span class="emphasis"><em>n</em></span>=7 in an octet) for the
-MSb.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2898062"></a>2.1.3. byte order</h4></div></div><div></div></div><p>
-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><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 <span class="emphasis"><em>n</em></span>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2953314"></a>2.1.4. coding bits into byte sequences</h4></div></div><div></div></div><p>
-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 at which the previous field ends.</p><p>
-The encoder logically packs integers by writing the LSb of a 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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2899597"></a>2.1.5. signedness</h4></div></div><div></div></div><p>
-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.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2912938"></a>2.1.6. coding example</h4></div></div><div></div></div><p>
-Code the 4 bit integer value '12' [b1100] into an empty bytestream.
-Bytestream result:
-
-</p><pre class="screen">  
-              |
-              V
-
-        7 6 5 4 3 2 1 0
-byte 0 [0 0 0 0 1 1 0 0]  &lt;-
-byte 1 [               ]
-byte 2 [               ]
-byte 3 [               ]
-             ...
-byte n [               ]  bytestream length == 1 byte
-
-</pre><p>
-</p><p>
-Continue by coding the 3 bit integer value '-1' [b111]:
-
-</p><pre class="screen">
-        |
-        V
-
-        7 6 5 4 3 2 1 0
-byte 0 [0 1 1 1 1 1 0 0]  &lt;-
-byte 1 [               ]
-byte 2 [               ]
-byte 3 [               ]
-             ... 
-byte n [               ]  bytestream length == 1 byte
-</pre><p>
-</p><p>
-Continue by coding the 7 bit integer value '17' [b0010001]:
-
-</p><pre class="screen">
-          |
-          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]  &lt;-
-byte 2 [               ]
-byte 3 [               ]
-             ...
-byte n [               ]  bytestream length == 2 bytes
-                          bit cursor == 6
-</pre><p>
-</p><p>
-Continue by coding the 13 bit integer value '6969' [b110 11001110 01]:
-
-</p><pre class="screen">
-                |
-                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]  &lt;-
-             ...
-byte n [               ]  bytestream length == 4 bytes
-
-</pre><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2912996"></a>2.1.7. decoding example</h4></div></div><div></div></div><p>
-Reading from the beginning of the bytestream encoded in the above example:
-
-</p><pre class="screen">
-                      |
-                      V
-                      
-        7 6 5 4 3 2 1 0
-byte 0 [1 1 1 1 1 1 0 0]  &lt;-
-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><p>
-</p><p>
-We read two, two-bit integer fields, resulting in the returned numbers
-'b00' and 'b11'.  Two things are worth noting here:
-
-</p><div class="itemizedlist"><ul type="disc"><li><p>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.</p></li><li><p>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.</p></li></ul></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2942492"></a>2.1.8. end-of-packet alignment</h4></div></div><div></div></div><p>
-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><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2939843"></a>2.1.9.  reading zero bits</h4></div></div><div></div></div><p>
-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></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-codebook"></a>3. Probability Model and Codebooks</h2></div><div><p class="releaseinfo">
- $Id: 03-codebook.xml,v 1.5 2002/10/27 16:20:47 giles Exp $
- <span class="emphasis"><em>Last update to this document: August 8, 2002</em></span>
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2906886"></a>3.1. Overview</h3></div></div><div></div></div><p>
-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.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2917847"></a>3.1.1. Bitwise operation</h4></div></div><div></div></div><p>
-The codebook mechanism is built on top of the vorbis bitpacker. 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 <a href="#vorbis-spec-bitpacking" title="2. Bitpacking Convention">Section 2, &#8220;Bitpacking Convention&#8221;</a>.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2944898"></a>3.2. Packed codebook format</h3></div></div><div></div></div><p>
-For purposes of the examples below, we assume that the storage
-system's native byte width is eight bits.  This is not universally
-true; see <a href="#vorbis-spec-bitpacking" title="2. Bitpacking Convention">Section 2, &#8220;Bitpacking Convention&#8221;</a> for discussion 
-relating to non-eight-bit bytes.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2900465"></a>3.2.1. codebook decode</h4></div></div><div></div></div><p>
-A codebook begins with a 24 bit sync pattern, 0x564342:
-
-</p><pre class="screen">
-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><p>
-16 bit <tt class="varname">[codebook_dimensions]</tt> and 24 bit <tt class="varname">[codebook_entries]</tt> fields:
-
-</p><pre class="screen">
-
-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><p>
-Next is the <tt class="varname">[ordered]</tt> bit flag:
-
-</p><pre class="screen">
-
-byte 8: [               X ] [ordered] (1 bit)
-
-</pre><p>
-Each entry, numbering a
-total of <tt class="varname">[codebook_entries]</tt>, is assigned a codeword length.
-We now read the list of codeword lengths and store these lengths in
-the array <tt class="varname">[codebook_codeword_lengths]</tt>. Decode of lengths is
-according to whether the <tt class="varname">[ordered]</tt> flag is set or unset.
-
-</p><div class="itemizedlist"><ul type="disc"><li><p>If the <tt class="varname">[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><p>The decoder first reads one additional bit flag, the
-  <tt class="varname">[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 class="screen">
-byte 8: [             X 1 ] [sparse] flag (1 bit)
-</pre><p>
-  The decoder now performs for each of the <tt class="varname">[codebook_entries]</tt>
-  codebook entries:
-
-</p><pre class="screen">
-  
-  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><li><p>If the <tt class="varname">[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:
-
-</p><pre class="screen">
-  1) [current_entry] = 0;
-  2) [current_length] = read a five bit unsigned integer and add 1;
-  3) [number] = read <a href="#vorbis-spec-ilog" title="9.2.1. 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></li></ul></div><p>
-
-After all codeword lengths have been decoded, the decoder reads the
-vector lookup table.  Vorbis I supports three lookup types:
-</p><div class="orderedlist"><ol type="1"><li>No lookup</li><li>Implicitly populated value mapping (lattice VQ)</li><li>Explicitly populated value mapping (tessellated or 'foam'
-VQ)</li></ol></div><p>
-</p><p>
-The lookup table type is read as a four bit unsigned integer:
-</p><pre class="screen">
-  1) [codebook_lookup_type] = read four bits as an unsigned integer
-</pre><p>
-Codebook decode precedes according to <tt class="varname">[codebook_lookup_type]</tt>:
-</p><div class="itemizedlist"><ul type="disc"><li><p>Lookup type zero indicates no lookup to be read.  Proceed past
-lookup decode.</p></li><li><p>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 class="varname">[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:
-
-</p><pre class="screen">
-  1) [codebook_minimum_value] = <a href="#vorbis-spec-float32_unpack" title="9.2.2. float32_unpack">float32_unpack</a>( read 32 bits as an unsigned integer) 
-  2) [codebook_delta_value] = <a href="#vorbis-spec-float32_unpack" title="9.2.2. 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="#vorbis-spec-lookup1_values" title="9.2.3. lookup1_values">lookup1_values</a>(<tt class="varname">[codebook_entries]</tt>, <tt class="varname">[codebook_dimensions]</tt> )
-
-  } else {
-
-     6) [codebook_lookup_values] = <tt class="varname">[codebook_entries]</tt> * <tt class="varname">[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><li><p>A <tt class="varname">[codebook_lookup_type]</tt> of greater than two is reserved
-and indicates a stream that is not decodable by the specification in this
-document.</p></li></ul></div><p>
-</p><p>
-An 'end of packet' during any read operation in the above steps is
-considered an error condition rendering the stream undecodable.</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2938450"></a>3.2.1.1. Huffman decision tree representation</h5></div></div><div></div></div><p>
-The <tt class="varname">[codebook_codeword_lengths]</tt> array and
-<tt class="varname">[codebook_entries]</tt> value uniquely define the Huffman decision
-tree used for entropy decoding.</p><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 class="screen">
-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><p>
-Assigning codewords in order (lowest possible value of the appropriate
-length to highest) results in the following codeword list:
-
-</p><pre class="screen">
-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><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
-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.</p></div><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><div class="mediaobject"><img src="hufftree.png" alt="[huffman tree illustration]"></div><p>
-</p><p>
-As we assign codewords in order, we see that each choice constructs a
-new leaf in the leftmost possible position.</p><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><div class="mediaobject"><img src="hufftree-under.png" alt="[underspecified huffman tree illustration]"></div><p>
-</p><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2901567"></a>3.2.1.2. VQ lookup table vector representation</h5></div></div><div></div></div><p>
-Unpacking the VQ lookup table vectors relies on the following values:
-</p><pre class="programlisting">
-the [codebook_multiplicands] array
-[codebook_minimum_value]
-[codebook_delta_value]
-[codebook_sequence_p]
-[codebook_lookup_type]
-[codebook_entries]
-[codebook_dimensions]
-[codebook_lookup_values]
-</pre><p>
-</p><p>
-Decoding (unpacking) a specific vector in the vector lookup table
-proceeds according to <tt class="varname">[codebook_lookup_type]</tt>.  The unpacked
-vector values are what a codebook would return during audio packet
-decode in a VQ context.</p><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="id2901596"></a>3.2.1.2.1. Vector value decode: Lookup type 1</h6></div></div><div></div></div><p>
-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 class="varname">[codebook_multiplicands]</tt> as follows (<tt class="varname">[value_vector]</tt>
-is the output vector representing the vector of values for entry number
-<tt class="varname">[lookup_offset]</tt> in this codebook):
-
-</p><pre class="screen">
-  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></div><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="id2901638"></a>3.2.1.2.2. Vector value decode: Lookup type 2</h6></div></div><div></div></div><p>
-Lookup type two specifies a VQ lookup table in which each scalar in
-each vector is explicitly set by the <tt class="varname">[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 class="varname">[codebook_multiplicands]</tt> as follows (<tt class="varname">[value_vector]</tt>
-is the output vector representing the vector of values for entry number
-<tt class="varname">[lookup_offset]</tt> in this codebook):
-
-</p><pre class="screen">
-  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></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2901687"></a>3.3. Use of the codebook abstraction</h3></div></div><div></div></div><p>
-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><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><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><p>
-When used in a scalar context, the resulting codeword entry is the
-desired return value.</p><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></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-codec"></a>4. Codec Setup and Packet Decode</h2></div><div><p class="releaseinfo">
- $Id: 04-codec.xml,v 1.8 2003/03/11 11:02:17 xiphmont Exp $
- <span class="emphasis"><em>Last update to this document: March 11, 2003</em></span>
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2901896"></a>4.1. Overview</h3></div></div><div></div></div><p>
-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 <a href="#vorbis-spec-intro" title="1. Introduction and Description">Section 1, &#8220;Introduction and Description&#8221;</a>.  <a href="#vorbis-spec-bitpacking" title="2. Bitpacking Convention">Section 2, &#8220;Bitpacking Convention&#8221;</a> covers reading and writing bit fields from
-and to bitstream packets.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2897591"></a>4.2. Header decode and decode setup</h3></div></div><div></div></div><p>
-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><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2904270"></a>4.2.1. Common header decode</h4></div></div><div></div></div><p>
-Each header packet begins with the same header fields.
-</p><pre class="screen">
-  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><p>
-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.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2812455"></a>4.2.2. Identification header</h4></div></div><div></div></div><p>
-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 class="screen">
- 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><p>
-<tt class="varname">[vorbis_version]</tt> is to read '0' in order to be compatible
-with this document.  Both <tt class="varname">[audio_channels]</tt> and
-<tt class="varname">[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 class="varname">[blocksize_0]</tt> must be less than or equal to
-<tt class="varname">[blocksize_1]</tt>.  The framing bit must be nonzero.  Failure to
-meet any of these conditions renders a stream undecodable.</p><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><div class="itemizedlist"><ul type="disc"><li>All three fields set to the same value implies a fixed rate, or tightly bounded, nearly fixed-rate bitstream</li><li>Only nominal set implies a VBR or ABR stream that averages the nominal bitrate</li><li>Maximum and or minimum set implies a VBR bitstream that obeys the bitrate limits</li><li>None set indicates the encoder does not care to speculate.</li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2951567"></a>4.2.3. Comment header</h4></div></div><div></div></div><p>
-Comment header decode and data specification is covered in
-<a href="#vorbis-spec-comment" title="5. comment field and header specification">Section 5, &#8220;comment field and header specification&#8221;</a>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2951582"></a>4.2.4. Setup header</h4></div></div><div></div></div><p>
-Vorbis codec setup is configurable to an extreme degree:
-
-</p><div class="mediaobject"><img src="components.png" alt="[decoder pipeline configuration]"></div><p>
-</p><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><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2948740"></a>4.2.4.1. Codebooks</h5></div></div><div></div></div><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_codebook_count]</tt> = read eight bits as unsigned integer and add one</li><li>Decode <tt class="varname">[vorbis_codebook_count]</tt> codebooks in order as defined
-in <a href="#vorbis-spec-codebook" title="3. Probability Model and Codebooks">Section 3, &#8220;Probability Model and Codebooks&#8221;</a>.  Save each configuration, in
-order, in an array of
-codebook configurations <tt class="varname">[vorbis_codebook_configurations]</tt>.</li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2948777"></a>4.2.4.2. Time domain transforms</h5></div></div><div></div></div><p>
-These hooks are placeholders in Vorbis I.  Nevertheless, the
-configuration placeholder values must be read to maintain bitstream
-sync.</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_time_count]</tt> = read 6 bits as unsigned integer and add one</li><li>read <tt class="varname">[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.</li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2948813"></a>4.2.4.3. Floors</h5></div></div><div></div></div><p>
-Vorbis uses two floor types; header decode is handed to the decode
-abstraction of the appropriate type.</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_floor_count]</tt> = read 6 bits as unsigned integer and add one</li><li><p>For each <tt class="varname">[i]</tt> of <tt class="varname">[vorbis_floor_count]</tt> floor numbers:
-  </p><div class="orderedlist"><ol type="a"><li>read the floor type: vector <tt class="varname">[vorbis_floor_types]</tt> element <tt class="varname">[i]</tt> =
-read 16 bits as unsigned integer</li><li>If the floor type is zero, decode the floor
-configuration as defined in <a href="#vorbis-spec-floor0" title="6. Floor type 0 setup and decode">Section 6, &#8220;Floor type 0 setup and decode&#8221;</a>; save
-this
-configuration in slot <tt class="varname">[i]</tt> of the floor configuration array <tt class="varname">[vorbis_floor_configurations]</tt>.</li><li>If the floor type is one,
-decode the floor configuration as defined in <a href="#vorbis-spec-floor1" title="7. Floor type 1 setup and decode">Section 7, &#8220;Floor type 1 setup and decode&#8221;</a>; save this configuration in slot <tt class="varname">[i]</tt> of the floor configuration array <tt class="varname">[vorbis_floor_configurations]</tt>.</li><li>If the the floor type is greater than one, this stream is undecodable; ERROR CONDITION</li></ol></div><p>
- </p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2890101"></a>4.2.4.4. Residues</h5></div></div><div></div></div><p>
-Vorbis uses three residue types; header decode of each type is identical.
-</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_residue_count]</tt> = read 6 bits as unsigned integer and add one
-</li><li><p>For each of <tt class="varname">[vorbis_residue_count]</tt> residue numbers:
- </p><div class="orderedlist"><ol type="a"><li>read the residue type; vector <tt class="varname">[vorbis_residue_types]</tt> element <tt class="varname">[i]</tt> = read 16 bits as unsigned integer</li><li>If the residue type is zero,
-one or two, decode the residue configuration as defined in <a href="#vorbis-spec-residue" title="8. Residue setup and decode">Section 8, &#8220;Residue setup and decode&#8221;</a>; save this configuration in slot <tt class="varname">[i]</tt> of the residue configuration array <tt class="varname">[vorbis_residue_configurations]</tt>.</li><li>If the the residue type is greater than two, this stream is undecodable; ERROR CONDITION</li></ol></div><p>
-</p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2890178"></a>4.2.4.5. Mappings</h5></div></div><div></div></div><p>
-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><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_mapping_count]</tt> = read 6 bits as unsigned integer and add one</li><li><p>For each <tt class="varname">[i]</tt> of <tt class="varname">[vorbis_mapping_count]</tt> mapping numbers:
-  </p><div class="orderedlist"><ol type="a"><li>read the mapping type: 16 bits as unsigned integer.  There's no reason to save the mapping type in Vorbis I.</li><li>If the mapping type is nonzero, the stream is undecodable</li><li><p>If the mapping type is zero:
-    </p><div class="orderedlist"><ol type="i"><li><p>read 1 bit as a boolean flag
-      </p><div class="orderedlist"><ol type="A"><li>if set, <tt class="varname">[vorbis_mapping_submaps]</tt> = read 4 bits as unsigned integer and add one</li><li>if unset, <tt class="varname">[vorbis_mapping_submaps]</tt> = 1</li></ol></div><p>
-      </p></li><li><p>read 1 bit as a boolean flag
-       </p><div class="orderedlist"><ol type="A"><li><p>if set, square polar channel mapping is in use:
-           </p><div class="orderedlist"><ol type="I"><li><tt class="varname">[vorbis_mapping_coupling_steps]</tt> = read 8 bits as unsigned integer and add one</li><li><p>for <tt class="varname">[j]</tt> each of <tt class="varname">[vorbis_mapping_coupling_steps]</tt> steps:
-               </p><div class="orderedlist"><ol type="1"><li>vector <tt class="varname">[vorbis_mapping_magnitude]</tt> element <tt class="varname">[j]</tt>= read <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>(<tt class="varname">[audio_channels]</tt> - 1) bits as unsigned integer</li><li>vector <tt class="varname">[vorbis_mapping_angle]</tt> element <tt class="varname">[j]</tt>= read <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>(<tt class="varname">[audio_channels]</tt> - 1) bits as unsigned integer</li><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 class="varname">[audio_channels]</tt>-1, or the angle channel is greater than <tt class="varname">[audio_channels]</tt>-1, the stream is undecodable.</li></ol></div><p>
-               </p></li></ol></div><p>
-           </p></li><li>if unset, <tt class="varname">[vorbis_mapping_coupling_steps]</tt> = 0</li></ol></div><p>
-       </p></li><li>read 2 bits (reserved field); if the value is nonzero, the stream is undecodable</li><li><p>if <tt class="varname">[vorbis_mapping_submaps]</tt> is greater than one, we read channel multiplex settings. For each <tt class="varname">[j]</tt> of <tt class="varname">[audio_channels]</tt> channels:</p><div class="orderedlist"><ol type="A"><li>vector <tt class="varname">[vorbis_mapping_mux]</tt> element <tt class="varname">[j]</tt> = read 4 bits as unsigned integer</li><li>if the value is greater than the highest numbered submap (<tt class="varname">[vorbis_mapping_submaps]</tt> - 1), this in an error condition rendering the stream undecodable</li></ol></div></li><li><p>for each submap <tt class="varname">[j]</tt> of <tt class="varname">[vorbis_mapping_submaps]</tt> submaps, read the floor and residue numbers for use in decoding that submap:</p><div class="orderedlist"><ol type="A"><li>read and discard 8 bits (the unused time configuration placeholder)</li><li>read 8 bits as unsigned integer for the floor number; save in vector <tt class="varname">[vorbis_mapping_submap_floor]</tt> element <tt class="varname">[j]</tt></li><li>verify the floor number is not greater than the highest number floor configured for the bitstream. If it is, the bitstream is undecodable</li><li>read 8 bits as unsigned integer for the residue number; save in vector <tt class="varname">[vorbis_mapping_submap_residue]</tt> element <tt class="varname">[j]</tt></li><li>verify the residue number is not greater than the highest number residue configured for the bitstream.  If it is, the bitstream is undecodable</li></ol></div></li><li>save this mapping configuration in slot <tt class="varname">[i]</tt> of the mapping configuration array <tt class="varname">[vorbis_mapping_configurations]</tt>.</li></ol></div></li></ol></div><p>
- </p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2900307"></a>4.2.4.6. Modes</h5></div></div><div></div></div><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_mode_count]</tt> = read 6 bits as unsigned integer and add one</li><li><p>For each of <tt class="varname">[vorbis_mode_count]</tt> mode numbers:</p><div class="orderedlist"><ol type="a"><li><tt class="varname">[vorbis_mode_blockflag]</tt> = read 1 bit</li><li><tt class="varname">[vorbis_mode_windowtype]</tt> = read 16 bits as unsigned integer</li><li><tt class="varname">[vorbis_mode_transformtype]</tt> = read 16 bits as unsigned integer</li><li><tt class="varname">[vorbis_mode_mapping]</tt> = read 8 bits as unsigned integer</li><li>verify ranges; zero is the only legal value in Vorbis I for
-<tt class="varname">[vorbis_mode_windowtype]</tt>
-and <tt class="varname">[vorbis_mode_transformtype]</tt>.  <tt class="varname">[vorbis_mode_mapping]</tt> must not be greater than the highest number mapping in use.  Any illegal values render the stream undecodable.</li><li>save this mode configuration in slot <tt class="varname">[i]</tt> of the mode configuration array
-<tt class="varname">[vorbis_mode_configurations]</tt>.</li></ol></div></li><li>read 1 bit as a framing flag.  If unset, a framing error occurred and the stream is not
-decodable.</li></ol></div><p>
-After reading mode descriptions, setup header decode is complete.
-</p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2900420"></a>4.3. Audio packet decode and synthesis</h3></div></div><div></div></div><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. <span class="emphasis"><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></span>.
-</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2900441"></a>4.3.1. packet type, mode and window decode</h4></div></div><div></div></div><div class="orderedlist"><ol type="1"><li>read 1 bit <tt class="varname">[packet_type]</tt>; check that packet type is 0 (audio)</li><li>read <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>([vorbis_mode_count]-1) bits
-<tt class="varname">[mode_number]</tt></li><li>decode blocksize <tt class="varname">[n]</tt> is equal to <tt class="varname">[blocksize_0]</tt> if 
-<tt class="varname">[vorbis_mode_blockflag]</tt> is 0, else <tt class="varname">[n]</tt> is equal to <tt class="varname">[blocksize_1]</tt>.</li><li><p>perform window selection and setup; this window is used later by the inverse MDCT:</p><div class="orderedlist"><ol type="a"><li><p>if this is a long window (the <tt class="varname">[vorbis_mode_blockflag]</tt> flag of this mode is
-set):</p><div class="orderedlist"><ol type="i"><li>read 1 bit for <tt class="varname">[previous_window_flag]</tt></li><li>read 1 bit for <tt class="varname">[next_window_flag]</tt></li><li>if <tt class="varname">[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-window" title="1.3.2.3. Window shape decode (long windows only)">Section 1.3.2.3, &#8220;Window shape decode (long windows only)&#8221;</a> for an illustration of overlapping
-dissimilar
-         windows. Else, the left half window will have normal long
-         shape.</li><li>if <tt class="varname">[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-window" title="1.3.2.3. Window shape decode (long windows only)">Section 1.3.2.3, &#8220;Window shape decode (long windows only)&#8221;</a> for an
-illustration of overlapping dissimilar
-         windows. Else, the left right window will have normal long
-         shape.</li></ol></div></li><li> if this is a short window, the window is always the same 
-       short-window shape.</li></ol></div></li></ol></div><p>
-Vorbis windows all use the slope function y=sin(0.5 *  * sin^2((x+.5)/n * )),
-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><div class="orderedlist"><ol type="1"><li> <tt class="varname">[window_center]</tt> = <tt class="varname">[n]</tt> / 2</li><li><p> if (<tt class="varname">[vorbis_mode_blockflag]</tt> is set and <tt class="varname">[previous_window_flag]</tt> is
-not set) then
-  </p><div class="orderedlist"><ol type="a"><li><tt class="varname">[left_window_start]</tt> = <tt class="varname">[n]</tt>/4 -
-<tt class="varname">[blocksize_0]</tt>/4</li><li><tt class="varname">[left_window_end]</tt> = <tt class="varname">[n]</tt>/4 + <tt class="varname">[blocksize_0]</tt>/4</li><li><tt class="varname">[left_n]</tt> = <tt class="varname">[blocksize_0]</tt>/2</li></ol></div><p>
- else
-  </p><div class="orderedlist"><ol type="a"><li><tt class="varname">[left_window_start]</tt> = 0</li><li><tt class="varname">[left_window_end]</tt> = <tt class="varname">[window_center]</tt></li><li><tt class="varname">[left_n]</tt> = <tt class="varname">[n]</tt>/2</li></ol></div></li><li><p> if (<tt class="varname">[vorbis_mode_blockflag]</tt> is set and <tt class="varname">[next_window_flag]</tt> is not
-set) then 
-  </p><div class="orderedlist"><ol type="a"><li><tt class="varname">[right_window_start]</tt> = <tt class="varname">[n]*3</tt>/4 -
-<tt class="varname">[blocksize_0]</tt>/4</li><li><tt class="varname">[right_window_end]</tt> = <tt class="varname">[n]*3</tt>/4 +
-<tt class="varname">[blocksize_0]</tt>/4</li><li><tt class="varname">[right_n]</tt> = <tt class="varname">[blocksize_0]</tt>/2</li></ol></div><p>
- else
-  </p><div class="orderedlist"><ol type="a"><li><tt class="varname">[right_window_start]</tt> = <tt class="varname">[window_center]</tt></li><li><tt class="varname">[right_window_end]</tt> = <tt class="varname">[n]</tt></li><li><tt class="varname">[right_n]</tt> = <tt class="varname">[n]</tt>/2</li></ol></div></li><li> window from range 0 ... <tt class="varname">[left_window_start]</tt>-1 inclusive is zero</li><li> for <tt class="varname">[i]</tt> in range <tt class="varname">[left_window_start]</tt> ...
-<tt class="varname">[left_window_end]</tt>-1, window(<tt class="varname">[i]</tt>) = sin(.5 *  * sin^2( (<tt class="varname">[i]</tt>-<tt class="varname">[left_window_start]</tt>+.5) / <tt class="varname">[left_n]</tt> * .5 * ) )</li><li> window from range <tt class="varname">[left_window_end]</tt> ... <tt class="varname">[right_window_start]</tt>-1
-inclusive is one</li><li> for <tt class="varname">[i]</tt> in range <tt class="varname">[right_window_start]</tt> ... <tt class="varname">[right_window_end]</tt>-1, window(<tt class="varname">[i]</tt>) = sin(.5 *  * sin^2( (<tt class="varname">[i]</tt>-<tt class="varname">[right_window_start]</tt>+.5) / <tt class="varname">[right_n]</tt> * .5 *  + .5 * ) )</li><li> window from range <tt class="varname">[rigth_window_start]</tt> ... <tt class="varname">[n]</tt>-1 is
-zero</li></ol></div><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886674"></a>4.3.2. floor curve decode</h4></div></div><div></div></div><p>
-From this point on, we assume out decode context is using mode number
-<tt class="varname">[mode_number]</tt> from configuration array
-<tt class="varname">[vorbis_mode_configurations]</tt> and the map number
-<tt class="varname">[vorbis_mode_mapping]</tt> (specified by the current mode) taken
-from the mapping configuration array
-<tt class="varname">[vorbis_mapping_configurations]</tt>.</p><p>
-Floor curves are decoded one-by-one in channel order.</p><p>
-For each floor <tt class="varname">[i]</tt> of <tt class="varname">[audio_channels]</tt>
- </p><div class="orderedlist"><ol type="1"><li><tt class="varname">[submap_number]</tt> = element <tt class="varname">[i]</tt> of vector [vorbis_mapping_mux]</li><li><tt class="varname">[floor_number]</tt> = element <tt class="varname">[submap_number]</tt> of vector
-[vorbis_submap_floor]</li><li>if the floor type of this
-floor (vector <tt class="varname">[vorbis_floor_types]</tt> element
-<tt class="varname">[floor_number]</tt>) is zero then decode the floor for
-channel <tt class="varname">[i]</tt> according to the
-<a href="#vorbis-spec-floor0-decode" title="6.2.2. packet decode">Section 6.2.2, &#8220;packet decode&#8221;</a></li><li>if the type of this floor
-is one then decode the floor for channel <tt class="varname">[i]</tt> according
-to the <a href="#vorbis-spec-floor1-decode" title="7.2.2.1. packet decode">Section 7.2.2.1, &#8220;packet decode&#8221;</a></li><li>save the needed decoded floor information for channel for later synthesis</li><li>if the decoded floor returned 'unused', set vector <tt class="varname">[no_residue]</tt> element
-<tt class="varname">[i]</tt> to true, else set vector <tt class="varname">[no_residue]</tt> element <tt class="varname">[i]</tt> to
-false</li></ol></div><p>
-</p><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886816"></a>4.3.3. nonzero vector propagate</h4></div></div><div></div></div><p>
-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><p>
-for each <tt class="varname">[i]</tt> from 0 ... <tt class="varname">[vorbis_mapping_coupling_steps]</tt>-1
-
-</p><div class="orderedlist"><ol type="1"><li>if either <tt class="varname">[no_residue]</tt> entry for channel
-(<tt class="varname">[vorbis_mapping_magnitude]</tt> element <tt class="varname">[i]</tt>) or (channel
-<tt class="varname">[vorbis_mapping_angle]</tt> element <tt class="varname">[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.</li></ol></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886876"></a>4.3.4. residue decode</h4></div></div><div></div></div><p>
-Unlike floors, which are decoded in channel order, the residue vectors
-are decoded in submap order.</p><p>
-for each submap <tt class="varname">[i]</tt> in order from 0 ... <tt class="varname">[vorbis_mapping_submaps]</tt>-1</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[ch]</tt> = 0</li><li><p>for each channel <tt class="varname">[j]</tt> in order from 0 ... <tt class="varname">[audio_channels]</tt> - 1</p><div class="orderedlist"><ol type="a"><li><p>if channel <tt class="varname">[j]</tt> in submap <tt class="varname">[i]</tt> (vector <tt class="varname">[vorbis_mapping_mux]</tt> element <tt class="varname">[j]</tt> is equal to <tt class="varname">[i]</tt>)</p><div class="orderedlist"><ol type="i"><li><p>if vector <tt class="varname">[no_residue]</tt> element <tt class="varname">[j]</tt> is true
-      </p><div class="orderedlist"><ol type="A"><li>vector <tt class="varname">[do_not_decode_flag]</tt> element <tt class="varname">[ch]</tt> is set</li></ol></div><p>
-     else
-      </p><div class="orderedlist"><ol type="A"><li>vector <tt class="varname">[do_not_decode_flag]</tt> element <tt class="varname">[ch]</tt> is unset</li></ol></div></li><li>increment <tt class="varname">[ch]</tt></li></ol></div></li></ol></div></li><li><tt class="varname">[residue_number]</tt> = vector <tt class="varname">[vorbis_mapping_submap_residue]</tt> element <tt class="varname">[i]</tt></li><li><tt class="varname">[residue_type]</tt> = vector <tt class="varname">[vorbis_residue_types]</tt> element <tt class="varname">[residue_number]</tt></li><li>decode <tt class="varname">[ch]</tt> vectors using residue <tt class="varname">[residue_number]</tt>, according to type <tt class="varname">[residue_type]</tt>, also passing vector <tt class="varname">[do_not_decode_flag]</tt> to indicate which vectors in the bundle should not be decoded. Correct per-vector decode length is <tt class="varname">[n]</tt>/2.</li><li><tt class="varname">[ch]</tt> = 0</li><li><p>for each channel <tt class="varname">[j]</tt> in order from 0 ... <tt class="varname">[audio_channels]</tt></p><div class="orderedlist"><ol type="a"><li><p>if channel <tt class="varname">[j]</tt> is in submap <tt class="varname">[i]</tt> (vector <tt class="varname">[vorbis_mapping_mux]</tt> element <tt class="varname">[j]</tt> is equal to <tt class="varname">[i]</tt>)</p><div class="orderedlist"><ol type="i"><li>residue vector for channel <tt class="varname">[j]</tt> is set to decoded residue vector <tt class="varname">[ch]</tt></li><li>increment <tt class="varname">[ch]</tt></li></ol></div></li></ol></div></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2887131"></a>4.3.5. inverse coupling</h4></div></div><div></div></div><p>
-for each <tt class="varname">[i]</tt> from <tt class="varname">[vorbis_mapping_coupling_steps]</tt>-1 descending to 0
-
-</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[magnitude_vector]</tt> = the residue vector for channel
-(vector <tt class="varname">[vorbis_mapping_magnitude]</tt> element <tt class="varname">[i]</tt>)</li><li><tt class="varname">[angle_vector]</tt> = the residue vector for channel (vector
-<tt class="varname">[vorbis_mapping_angle]</tt> element <tt class="varname">[i]</tt>)</li><li><p>for each scalar value <tt class="varname">[M]</tt> in vector <tt class="varname">[magnitude_vector]</tt> and the corresponding scalar value <tt class="varname">[A]</tt> in vector <tt class="varname">[angle_vector]</tt>:</p><div class="orderedlist"><ol type="a"><li><p>if (<tt class="varname">[M]</tt> is greater than zero)
-    </p><div class="orderedlist"><ol type="i"><li><p>if (<tt class="varname">[A]</tt> is greater than zero)
-      </p><div class="orderedlist"><ol type="A"><li><tt class="varname">[new_M]</tt> = <tt class="varname">[M]</tt></li><li><tt class="varname">[new_A]</tt> = <tt class="varname">[M]</tt>-<tt class="varname">[A]</tt></li></ol></div><p>
-     else
-      </p><div class="orderedlist"><ol type="A"><li><tt class="varname">[new_A]</tt> = <tt class="varname">[M]</tt></li><li><tt class="varname">[new_M]</tt> = <tt class="varname">[M]</tt>+<tt class="varname">[A]</tt></li></ol></div><p>
-     </p></li></ol></div><p>
-   else
-    </p><div class="orderedlist"><ol type="i"><li><p>if (<tt class="varname">[A]</tt> is greater than zero)
-      </p><div class="orderedlist"><ol type="A"><li><tt class="varname">[new_M]</tt> = <tt class="varname">[M]</tt></li><li><tt class="varname">[new_A]</tt> = <tt class="varname">[M]</tt>+<tt class="varname">[A]</tt></li></ol></div><p>
-     else
-      </p><div class="orderedlist"><ol type="A"><li><tt class="varname">[new_A]</tt> = <tt class="varname">[M]</tt></li><li><tt class="varname">[new_M]</tt> = <tt class="varname">[M]</tt>-<tt class="varname">[A]</tt></li></ol></div><p>
-     </p></li></ol></div><p>
-   </p></li><li>set scalar value <tt class="varname">[M]</tt> in vector <tt class="varname">[magnitude_vector]</tt> to <tt class="varname">[new_M]</tt></li><li>set scalar value <tt class="varname">[A]</tt> in vector <tt class="varname">[angle_vector]</tt> to <tt class="varname">[new_A]</tt></li></ol></div></li></ol></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2953524"></a>4.3.6. dot product</h4></div></div><div></div></div><p>
-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 class="varname">[n]</tt>/2.</p><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 of the floor and residue vectors for each channel; the produced
-vectors are the length <tt class="varname">[n]</tt>/2 audio spectrum for each
-channel.</p><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2951198"></a>4.3.7. inverse MDCT</h4></div></div><div></div></div><p>
-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" target="_top">&#8220;<span class="citetitle">The
-use of multirate filter banks for coding of high quality digital
-audio</span>&#8221;</a>, by T. Sporer, K. Brandenburg and B. Edler.  The window
-function used for the MDCT is the function described earlier.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2914921"></a>4.3.8. overlap_add</h4></div></div><div></div></div><p>
-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-window" title="1.3.2.3. Window shape decode (long windows only)">Section 1.3.2.3, &#8220;Window shape decode (long windows only)&#8221;</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 does 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><pre class="programlisting">
-window_blocksize(previous_window)/4+window_blocksize(current_window)/4
-</pre><p>
-
-from the center (element windowsize/2) of the previous window to the
-center (element windowsize/2-1, inclusive) of the current window.</p><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2953624"></a>4.3.9. output channel order</h4></div></div><div></div></div><p>
-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><div class="variablelist"><dl><dt><span class="term">one channel</span></dt><dd>the stream is monophonic</dd><dt><span class="term">two channels</span></dt><dd>the stream is stereo.  channel order: left, right</dd><dt><span class="term">three channels</span></dt><dd>the stream is a 1d-surround encoding.  channel order: left,
-center, right</dd><dt><span class="term">four channels</span></dt><dd>the stream is quadraphonic surround.  channel order: front left,
-front right, rear left, rear right</dd><dt><span class="term">five channels</span></dt><dd>the stream is five-channel surround.  channel order: front left,
-front center, front right, rear left, rear right</dd><dt><span class="term">six channels</span></dt><dd>the stream is 5.1 surround.  channel order: front left, front
-center, front right, rear left, rear right, LFE</dd><dt><span class="term">greater than six channels</span></dt><dd>channel use and order is defined by the application</dd></dl></div><p>
-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/" target="_top">Ambisonics</a>) will
-make use of channel mappings other than mapping 0.</p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-comment"></a>5. comment field and header specification</h2></div><div><p class="releaseinfo">
- $Id: 05-comment.xml,v 1.5 2002/10/31 19:37:57 giles Exp $
- <span class="emphasis"><em>Last update to this document: July 16, 2002</em></span>
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2940356"></a>5.1. Overview</h3></div></div><div></div></div><p>The Vorbis text comment header is the second (of three) header
-packets that begin a Vorbis bitstream. It is meant for short text
-comments, not arbitrary metadata; arbitrary metadata belongs in a
-separate logical bitstream (usually an XML stream type) that provides
-greater structure and machine parseability.</p><p>The comment field is meant to be used much like someone jotting a
-quick note on the bottom of a CDR. It should be a little information to
-remember the disc by and explain it to others; a short, to-the-point
-text note that need not only be a couple words, but isn't going to be
-more than a short paragraph.  The essentials, in other words, whatever
-they turn out to be, eg:
-
-</p><div class="blockquote"><blockquote class="blockquote"><p>Honest Bob and the Factory-to-Dealer-Incentives, <i class="citetitle">I'm Still
-Around</i>, opening for Moxy Frvous, 1997.</p></blockquote></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2940397"></a>5.2. Comment encoding</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2940402"></a>5.2.1. Structure</h4></div></div><div></div></div><p>
-The comment header is logically a list of eight-bit-clean vectors; the
-number of vectors is bounded to 2^32-1 and the length of each vector
-is limited to 2^32-1 bytes. The vector length is encoded; the vector
-contents themselves are not null terminated. In addition to the vector
-list, there is a single vector for vendor name (also 8 bit clean,
-length encoded in 32 bits). The 1.0 release of libvorbis sets the 
-vendor string to "Xiph.Org libVorbis I 20020717".</p><p>The comment header is decoded as follows:
-
-</p><pre class="programlisting">
-  1) [vendor_length] = read an unsigned integer of 32 bits
-  2) [vendor_string] = read a UTF-8 vector as [vendor_length] octets
-  3) [user_comment_list_length] = read an unsigned integer of 32 bits
-  4) iterate [user_comment_list_length] times {
-       5) [length] = read an unsigned integer of 32 bits
-       6) this iteration's user comment = read a UTF-8 vector as [length] octets
-     }
-  7) [framing_bit] = read a single bit as boolean
-  8) if ( [framing_bit] unset or end-of-packet ) then ERROR
-  9) done.
-</pre><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2897468"></a>5.2.2. Content vector format</h4></div></div><div></div></div><p>
-The comment vectors are structured similarly to a UNIX environment variable.
-That is, comment fields consist of a field name and a corresponding value and
-look like:</p><div class="blockquote"><blockquote class="blockquote"><pre class="programlisting">
-comment[0]="ARTIST=me"; 
-comment[1]="TITLE=the sound of Vorbis"; 
-</pre></blockquote></div><p>
-The field name is case-insensitive and may consist of ASCII 0x20
-through 0x7D, 0x3D ('=') excluded. ASCII 0x41 through 0x5A inclusive
-(characters A-Z) is to be considered equivalent to ASCII 0x61 through 
-0x7A inclusive (characters a-z).
-</p><p>
-The field name is immediately followed by ASCII 0x3D ('=');
-this equals sign is used to terminate the field name.
-</p><p>
-0x3D is followed by 8 bit clean UTF-8 encoded value of the
-field contents to the end of the field.
-</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2935965"></a>5.2.2.1. Field names</h5></div></div><div></div></div><p>Below is a proposed, minimal list of standard filed names with a
-description of intended use.  No single or group of field names is
-mandatory; a comment header may contain one, all or none of the names
-in this list.</p><div class="variablelist"><dl><dt><span class="term">TITLE</span></dt><dd>Track/Work name</dd><dt><span class="term">VERSION</span></dt><dd>The version field may be used to
-differentiate multiple
-versions of the same track title in a single collection. (e.g. remix
-info)
-</dd><dt><span class="term">ALBUM</span></dt><dd>The collection name to which this track belongs
-</dd><dt><span class="term">TRACKNUMBER</span></dt><dd>The track number of this piece if part of a specific larger collection or album
-</dd><dt><span class="term">ARTIST</span></dt><dd>The artist generally considered responsible for the work. In popular music this is usually the performing band or singer. For classical music it would be the composer. For an audio book it would be the author of the original text.
-</dd><dt><span class="term">PERFORMER</span></dt><dd>The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists. In an audio book it would be the actor who did the reading. In popular music this is typically the same as the ARTIST and is omitted.
-</dd><dt><span class="term">COPYRIGHT</span></dt><dd>Copyright attribution, e.g., '2001 Nobody's Band' or '1999 Jack Moffitt'
-</dd><dt><span class="term">LICENSE</span></dt><dd>License information, eg, 'All Rights Reserved', 'Any
-Use Permitted', a URL to a license such as a Creative Commons license
-("www.creativecommons.org/blahblah/license.html") or the EFF Open
-Audio License ('distributed under the terms of the Open Audio
-License. see http://www.eff.org/IP/Open_licenses/eff_oal.html for
-details'), etc.
-</dd><dt><span class="term">ORGANIZATION</span></dt><dd>Name of the organization producing the track (i.e.
-the 'record label')
-</dd><dt><span class="term">DESCRIPTION</span></dt><dd>A short text description of the contents
-</dd><dt><span class="term">GENRE</span></dt><dd>A short text indication of music genre
-</dd><dt><span class="term">DATE</span></dt><dd>Date the track was recorded
-</dd><dt><span class="term">LOCATION</span></dt><dd>Location where track was recorded
-</dd><dt><span class="term">CONTACT</span></dt><dd>Contact information for the creators or distributors of the track. This could be a URL, an email address, the physical address of the producing label.
-</dd><dt><span class="term">ISRC</span></dt><dd>International Standard Recording Code for the
-track; see <a href="http://www.ifpi.org/site-content/online/isrc_intro.html" target="_top">the ISRC
-intro page</a> for more information on ISRC numbers.
-</dd></dl></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2812122"></a>5.2.2.2. Implications</h5></div></div><div></div></div><p>Field names should not be 'internationalized'; this is a
-concession to simplicity not an attempt to exclude the majority of
-the world that doesn't speak English. Field <span class="emphasis"><em>contents</em></span>
-however, use the UTF-8 character encoding to allow easy representation of any
-language.</p><p>We have the length of the entirety of the field and restrictions on
-the field name so that the field name is bounded in a known way. Thus
-we also have the length of the field contents.</p><p>Individual 'vendors' may use non-standard field names within
-reason. The proper use of comment fields should be clear through
-context at this point.  Abuse will be discouraged.</p><p>There is no vendor-specific prefix to 'nonstandard' field names.
-Vendors should make some effort to avoid arbitrarily polluting the
-common namespace. We will generally collect the more useful tags
-here to help with standardization.</p><p>Field names are not required to be unique (occur once) within a
-comment header.  As an example, assume a track was recorded by three
-well know artists; the following is permissible, and encouraged:
-
-</p><div class="blockquote"><blockquote class="blockquote"><pre class="programlisting">
-ARTIST=Dizzy Gillespie 
-ARTIST=Sonny Rollins 
-ARTIST=Sonny Stitt 
-</pre></blockquote></div><p>
-
-</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2812179"></a>5.2.3. Encoding</h4></div></div><div></div></div><p>
-The comment header comprises the entirety of the second bitstream
-header packet.  Unlike the first bitstream header packet, it is not
-generally the only packet on the second page and may not be restricted
-to within the second bitstream page.  The length of the comment header
-packet is (practically) unbounded.  The comment header packet is not
-optional; it must be present in the bitstream even if it is
-effectively empty.</p><p>
-The comment header is encoded as follows (as per Ogg's standard
-bitstream mapping which renders least-significant-bit of the word to be
-coded into the least significant available bit of the current
-bitstream octet first):
-
-</p><div class="orderedlist"><ol type="1"><li>
-  Vendor string length (32 bit unsigned quantity specifying number of octets)
- </li><li>
-  Vendor string ([vendor string length] octets coded from beginning of string to end of string, not null terminated)
- </li><li>
-  Number of comment fields (32 bit unsigned quantity specifying number of fields)
- </li><li>
-  Comment field 0 length (if [Number of comment fields]&gt;0; 32 bit unsigned quantity specifying number of octets)
- </li><li>
-  Comment field 0 ([Comment field 0 length] octets coded from beginning of string to end of string, not null terminated)
- </li><li>
-  Comment field 1 length (if [Number of comment fields]&gt;1...)...
- </li></ol></div><p>
-</p><p>
-This is actually somewhat easier to describe in code; implementation of the above can be found in <tt class="filename">vorbis/lib/info.c</tt>, <tt class="function">_vorbis_pack_comment()</tt> and <tt class="function">_vorbis_unpack_comment()</tt>.
-</p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-floor0"></a>6. Floor type 0 setup and decode</h2></div><div><p class="releaseinfo">
-  $Id: 06-floor0.xml,v 1.7 2002/10/27 16:20:47 giles Exp $
-  <span class="emphasis"><em>Last update to this document: July 19, 2002</em></span>
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946983"></a>6.1. Overview</h3></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2944376"></a>6.2. Floor 0 format</h3></div></div><div></div></div><p>
-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><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2891951"></a>6.2.1. header decode</h4></div></div><div></div></div><p>
-Configuration information for instances of floor zero decodes from the
-codec setup header (third packet).  configuration decode proceeds as
-follows:</p><pre class="screen">
-  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><p>
-An end-of-packet condition during any of these bitstream reads renders
-this stream undecodable.  In addition, any element of the array
-<tt class="varname">[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.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-floor0-decode"></a>6.2.2. packet decode</h4></div></div><div></div></div><p>
-Extracting a floor0 curve from an audio packet consists of first
-decoding the curve amplitude and <tt class="varname">[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><p>
-Packet decode proceeds as follows:</p><pre class="screen">
-  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="#vorbis-spec-ilog" title="9.2.1. 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><p>
-Take note of the following properties of decode:
-</p><div class="itemizedlist"><ul type="disc"><li>An <tt class="varname">[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.</li><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 class="varname">[amplitude]</tt> value had read zero at the beginning of decode.</li><li>The book number used for decode
-can, in fact, be stored in the bitstream in <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>( <tt class="varname">[floor0_number_of_books]</tt> -
-1 ) bits.  Nevertheless, the above specification is correct and values
-greater than the maximum possible book value are reserved.</li><li>The number of scalars read into the vector <tt class="varname">[coefficients]</tt>
-may be greater than <tt class="varname">[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 class="varname">[codebook_dimensions]</tt> value of three and
-<tt class="varname">[floor0_order]</tt> is ten, the only way to fill all the needed
-scalars in <tt class="varname">[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.</li></ul></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-floor0-synth"></a>6.2.3. curve computation</h4></div></div><div></div></div><p>
-Given an <tt class="varname">[amplitude]</tt> integer and <tt class="varname">[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 class="varname">[n]</tt> specified by the decode process, we compute a
-floor output vector.</p><p>
-If the value <tt class="varname">[amplitude]</tt> is zero, the return value is a
-length <tt class="varname">[n]</tt> vector with all-zero scalars.  Otherwise, begin by
-assuming the following definitions for the given vector to be
-synthesized:</p><div class="informalequation"><div class="mediaobject"><img src="lspmap.png" alt="[lsp map equation]"></div></div><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 <tt class="varname">[output]</tt> on a log
-(dB) amplitude scale, mapping it to linear amplitude in the last step:</p><div class="orderedlist"><ol type="1"><li> <tt class="varname">[i]</tt> = 0 </li><li><p>if ( <tt class="varname">[floor0_order]</tt> is odd ) {
-  </p><div class="orderedlist"><ol type="a"><li><p>calculate <tt class="varname">[p]</tt> and <tt class="varname">[q]</tt> according to:
-        </p><div class="informalequation"><div class="mediaobject"><img src="oddlsp.png" alt="[equation for odd lsp]"></div></div><p>
-   </p></li></ol></div><p>
-  } else <tt class="varname">[floor0_order]</tt> is even {
-  </p><div class="orderedlist"><ol type="a"><li><p>calculate <tt class="varname">[p]</tt> and <tt class="varname">[q]</tt> according to:
-        </p><div class="informalequation"><div class="mediaobject"><img src="evenlsp.png" alt="[equation for even lsp]"></div></div><p>
-   </p></li></ol></div><p> 
-  }
- </p></li><li><p>calculate <tt class="varname">[linear_floor_value]</tt> according to:
-     </p><div class="informalequation"><div class="mediaobject"><img src="floorval.png" alt="[expression for floorval]"></div></div><p>
- </p></li><li><tt class="varname">[iteration_condition]</tt> = map element <tt class="varname">[i]</tt></li><li><tt class="varname">[output]</tt> element <tt class="varname">[i]</tt> = <tt class="varname">[linear_floor_value]</tt></li><li>increment <tt class="varname">[i]</tt></li><li>if ( map element <tt class="varname">[i]</tt> is equal to <tt class="varname">[iteration_condition]</tt> ) continue at step 7</li><li>if ( <tt class="varname">[i]</tt> is less than <tt class="varname">[n]</tt> ) continue at step 2</li><li>done</li></ol></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-floor1"></a>7. Floor type 1 setup and decode</h2></div><div><p class="releaseinfo">
- $Id: 07-floor1.xml,v 1.5 2003/03/11 11:02:17 xiphmont Exp $
- <span class="emphasis"><em>Last update to this document: March 11, 2003</em></span>
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2907016"></a>7.1. Overview</h3></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2923546"></a>7.2. Floor 1 format</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2937562"></a>7.2.1. model</h4></div></div><div></div></div><p>
-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><div class="itemizedlist"><ul type="disc"><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.</li><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.</li><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.</li><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.</li></ul></div><p>
-Consider the following example, with values chosen for ease of
-understanding rather than representing typical configuration:</p><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><div class="mediaobject"><img src="floor1-1.png" alt="[graph of example floor]"></div><p>
-We now draw new logical lines to reflect the correction to new_Y, and
-iterate for X positions 32 and 96:</p><div class="mediaobject"><img src="floor1-2.png" alt="[graph of example floor]"></div><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><div class="mediaobject"><img src="floor1-3.png" alt="[graph of example floor]"></div><div class="mediaobject"><img src="floor1-4.png" alt="[graph of example floor]"></div><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2812423"></a>7.2.2. header decode</h4></div></div><div></div></div><p>
-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><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 class="screen">
-
-  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) increment [floor1_values] by one
-           }
-     }
- 
- 23) done
-</pre><p>
-An end-of-packet condition while reading any aspect of a floor 1
-configuration during setup renders a stream undecodable.  In
-addition, a <tt class="varname">[floor1_class_masterbooks]</tt> or
-<tt class="varname">[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><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-floor1-decode"></a>7.2.2.1. packet decode</h5></div></div><div></div></div><p>
-Packet decode begins by checking the <tt class="varname">[nonzero]</tt> flag:</p><pre class="screen">
-  1) [nonzero] = read 1 bit as boolean
-</pre><p>
-If <tt class="varname">[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).
-</p><p>
-Assuming <tt class="varname">[nonzero]</tt> is set, decode proceeds as follows:</p><pre class="screen">
-  1) [range] = vector { 256, 128, 86, 64 } element ([floor1_multiplier]-1)
-  2) vector [floor1_Y] element [0] = read <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>([range]-1) bits as unsigned integer
-  3) vector [floor1_Y] element [1] = read <a href="#vorbis-spec-ilog" title="9.2.1. 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><p>
-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 class="varname">[nonzero]</tt> flag had been unset at the beginning of decode.
-</p><p>
-Vector <tt class="varname">[floor1_Y]</tt> contains the values from packet decode
-needed for floor 1 synthesis.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-floor1-synth"></a>7.2.2.2. curve computation</h5></div></div><div></div></div><p>
-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><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><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="id2950434"></a>7.2.2.2.1. step 1: amplitude value synthesis</h6></div></div><div></div></div><p>
-Unwrap the always-positive-or-zero values read from the packet into
-+/- difference values, then apply to line prediction.</p><pre class="screen">
-  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="#vorbis-spec-low_neighbor" title="9.2.4. low_neighbor">low_neighbor</a>([floor1_X_list],[i])
-       8) [high_neighbor_offset] = <a href="#vorbis-spec-high_neighbor" title="9.2.4.1. high_neighbor">high_neighbor</a>([floor1_X_list],[i])
-
-       9) [predicted] = <a href="#vorbis-spec-render_point" title="9.2.4.2. 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></div><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="id2898539"></a>7.2.2.2.2. step 2: curve synthesis</h6></div></div><div></div></div><p>
-Curve synthesis generates a return vector <tt class="varname">[floor]</tt> of length
-<tt class="varname">[n]</tt> (where <tt class="varname">[n]</tt> is provided by the decode process
-calling to floor decode).  Floor 1 curve synthesis makes use of the
-<tt class="varname">[floor1_X_list]</tt>, <tt class="varname">[floor1_final_Y]</tt> and
-<tt class="varname">[floor1_step2_flag]</tt> vectors, as well as [floor1_multiplier]
-and [floor1_values] values.</p><p>
-Decode begins by sorting the scalars from vectors
-<tt class="varname">[floor1_X_list]</tt>, <tt class="varname">[floor1_final_Y]</tt> and
-<tt class="varname">[floor1_step2_flag]</tt> together into new vectors
-<tt class="varname">[floor1_X_list]'</tt>, <tt class="varname">[floor1_final_Y]'</tt> and
-<tt class="varname">[floor1_step2_flag]'</tt> according to ascending sort order of the
-values in <tt class="varname">[floor1_X_list]</tt>.  That is, sort the values of
-<tt class="varname">[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><p>
-Then compute the final curve in one pass:</p><pre class="screen">
-  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="#vorbis-spec-render_line" title="9.2.4.3. 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="#vorbis-spec-render_line" title="9.2.4.3. 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="#vorbis-spec-floor1_inverse_dB_table" title="10.1. floor1_inverse_dB_table">[floor1_inverse_dB_static_table]</a>
-
- 16) done
-
-</pre></div></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-residue"></a>8. Residue setup and decode</h2></div><div><p class="releaseinfo">
-  $Id: 08-residue.xml,v 1.5 2003/03/11 11:02:17 xiphmont Exp $
-  <span class="emphasis"><em>Last update to this document: March 11, 2003</em></span>
- </p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2932325"></a>8.1. Overview</h3></div></div><div></div></div><p>
-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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2949726"></a>8.2. Residue format</h3></div></div><div></div></div><p>
-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><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><div class="itemizedlist"><ul type="disc"><li><p>Each vector is partitioned into multiple equal sized chunks
-according to configuration specified.  If we have a vector size of
-<span class="emphasis"><em>n</em></span>, a partition size <span class="emphasis"><em>residue_partition_size</em></span>, and a total
-of <span class="emphasis"><em>ch</em></span> residue vectors, the total number of partitioned chunks
-coded is <span class="emphasis"><em>n</em></span>/<span class="emphasis"><em>residue_partition_size</em></span>*<span class="emphasis"><em>ch</em></span>.  It is
-important to note that the integer division truncates.  In the below
-example, we assume an example <span class="emphasis"><em>residue_partition_size</em></span> of 8.</p></li><li><p>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><li><p>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></li></ul></div><div class="mediaobject"><img src="residue-pack.png" alt="[illustration of residue vector format]"></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2889077"></a>8.3. residue 0</h3></div></div><div></div></div><p>
-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><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><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 class="programlisting">
-
-            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><p>
-It is worth mentioning at this point that no configurable value in the
-residue coding setup is restricted to a power of two.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2901450"></a>8.4. residue 1</h3></div></div><div></div></div><p>
-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.</p><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 class="programlisting">
-
-            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></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2901481"></a>8.5. residue 2</h3></div></div><div></div></div><p>
-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 <span class="emphasis"><em>ch</em></span> passed in vectors of length <span class="emphasis"><em>n</em></span> are first
-interleaved and flattened into a single vector of length
-<span class="emphasis"><em>ch</em></span>*<span class="emphasis"><em>n</em></span>.  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><div class="mediaobject"><img src="residue2.png" alt="[illustration of residue type 2]"></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2903780"></a>8.6. Residue decode</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2903786"></a>8.6.1. header decode</h4></div></div><div></div></div><p>
-Header decode for all three residue types is identical.</p><pre class="programlisting">
-  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><p>
-<tt class="varname">[residue_begin]</tt> and <tt class="varname">[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 class="varname">[residue_begin]</tt> and ends at
-<tt class="varname">[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 class="varname">[residue_partition_size]</tt>apply to the interleaved
-vector, not the individual vectors before interleave.
-<tt class="varname">[residue_partition_size]</tt> is as explained above,
-<tt class="varname">[residue_classifications]</tt> is the number of possible
-classification to which a partition can belong and
-<tt class="varname">[residue_classbook]</tt> is the codebook number used to code
-classification codewords.  The number of dimensions in book
-<tt class="varname">[residue_classbook]</tt> determines how many classification values
-are grouped into a single classification codeword.</p><p>
-Next we read a bitmap pattern that specifies which partition classes
-code values in which passes.</p><pre class="programlisting">
-  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><p>
-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 class="programlisting">
-  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><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2903905"></a>8.6.2. packet decode</h4></div></div><div></div></div><p>
-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><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><p>
-The following convenience values are conceptually useful to clarifying
-the decode process:</p><pre class="programlisting">
-  1) [classwords_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><p>
-Packet decode proceeds as follows, matching the description offered earlier in the document.  We assume that the number of vectors being encoded, <tt class="varname">[ch]</tt> is provided by the higher level decoding process.</p><pre class="programlisting">
-  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 [i] descending over the range [classwords_per_codeword]-1 ... 0 {
-
-                           9) array [classifications] element [j],([i]+[partition_count]) =
-                              [temp] integer modulo [residue_classifications]
-                          10) [temp] = [temp] / [residue_classifications] using integer division
-
-                         }
-      
-                    }
-            
-               }
-        
-          }
-
-      11) iterate [i] over the range 0 .. ([classwords_per_codeword] - 1) while [partition_count] 
-          is also less than [partitions_to_read] {
-
-            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]
-                      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 [partition_count] by one
-
-          }
-     }
- 
- 19) done
-
-</pre><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2813062"></a>8.6.3. format 0 specifics</h4></div></div><div></div></div><p>
-Format zero decodes partitions exactly as described earlier in the
-'Residue Format: residue 0' section.  The following pseudocode
-presents the same algorithm. Assume:</p><div class="itemizedlist"><ul type="disc"><li> <tt class="varname">[n]</tt> is the value in <tt class="varname">[residue_partition_size]</tt></li><li><tt class="varname">[v]</tt> is the residue vector</li><li><tt class="varname">[offset]</tt> is the beginning read offset in [v]</li></ul></div><pre class="programlisting">
- 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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2813946"></a>8.6.4. format 1 specifics</h4></div></div><div></div></div><p>
-Format 1 decodes partitions exactly as described earlier in the
-'Residue Format: residue 1' section.  The following pseudocode
-presents the same algorithm. Assume:</p><div class="itemizedlist"><ul type="disc"><li> <tt class="varname">[n]</tt> is the value in
-<tt class="varname">[residue_partition_size]</tt></li><li><tt class="varname">[v]</tt> is the residue vector</li><li><tt class="varname">[offset]</tt> is the beginning read offset in [v]</li></ul></div><pre class="programlisting">
- 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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2814000"></a>8.6.5. format 2 specifics</h4></div></div><div></div></div><p>
-Format 2 is reducible to format 1.  It may be implemented as an additional stepprior to and an additional post-decode step after a normal format 1 decode.
-</p><p>
-Format 2 handles 'do not decode' vectors differently than 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.  We then request normal format 1 to decode a single vector
-representing all output channels, rather than a vector for each
-channel.  After decode, deinterleave the vector into independent vectors, one for each output channel.  That is:</p><div class="orderedlist"><ol type="1"><li>If all vectors 0 through <span class="emphasis"><em>ch</em></span>-1 are marked 'do not decode', allocate and clear a single vector <tt class="varname">[v]</tt>of length <span class="emphasis"><em>ch*n</em></span> and skip step 2 below; proceed directly to the post-decode step.</li><li>Rather than performing format 1 decode to produce <span class="emphasis"><em>ch</em></span> vectors of length <span class="emphasis"><em>n</em></span> each, call format 1 decode to produce a single vector <tt class="varname">[v]</tt> of length <span class="emphasis"><em>ch*n</em></span>. </li><li><p>Post decode: Deinterleave the single vector <tt class="varname">[v]</tt> returned by format 1 decode as described above into <span class="emphasis"><em>ch</em></span> independent vectors, one for each outputchannel, according to:
-  </p><pre class="programlisting">
-  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 [v] element ([i] * [ch] + [j])
-
-          }
-     }
-
-  4) done
-  </pre><p>
- </p></li></ol></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-helper"></a>9. Helper equations</h2></div><div><p class="releaseinfo">
- $Id: 09-helper.xml,v 1.5 2002/10/27 16:20:47 giles Exp $
- <span class="emphasis"><em>Last update to this document: October 15, 2002</em></span>
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2939423"></a>9.1. Overview</h3></div></div><div></div></div><p>
-The equations below are used in multiple places by the Vorbis codec
-specification.  Rather than cluttering up the main specification
-documents, they are defined here and referenced where appropriate.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892245"></a>9.2. Functions</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-ilog"></a>9.2.1. ilog</h4></div></div><div></div></div><p>
-The "ilog(x)" function returns the position number (1 through n) of the highest set bit in the two's complement integer value
-<tt class="varname">[x]</tt>.  Values of <tt class="varname">[x]</tt> less than zero are defined to return zero.</p><pre class="programlisting">
-  1) [return_value] = 0;
-  2) if ( [x] is greater than zero ){
-      
-       3) increment [return_value];
-       4) logical shift [x] one bit to the right, padding the MSb with zero
-       5) repeat at step 2)
-
-     }
-
-   6) done
-</pre><p>
-Examples:
-
-</p><div class="itemizedlist"><ul type="disc"><li>ilog(0) = 0;</li><li>ilog(1) = 1;</li><li>ilog(2) = 2;</li><li>ilog(3) = 2;</li><li>ilog(4) = 3;</li><li>ilog(7) = 3;</li><li>ilog(negative number) = 0;</li></ul></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-float32_unpack"></a>9.2.2. float32_unpack</h4></div></div><div></div></div><p>
-"float32_unpack(x)" is intended to translate the packed binary
-representation of a Vorbis codebook float value into the
-representation used by the decoder for floating point numbers.  For
-purposes of this example, we will unpack a Vorbis float32 into a
-host-native floating point number.</p><pre class="programlisting">
-  1) [mantissa] = [x] bitwise AND 0x1fffff (unsigned result)
-  2) [sign] = [x] bitwise AND 0x80000000 (unsigned result)
-  3) [exponent] = ( [x] bitwise AND 0x7fe00000) shifted right 21 bits (unsigned result)
-  4) if ( [sign] is nonzero ) then negate [mantissa]
-  5) return [mantissa] * ( 2 ^ ( [exponent] - 788 ) )
-</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-lookup1_values"></a>9.2.3. lookup1_values</h4></div></div><div></div></div><p>
-"lookup1_values(codebook_entries,codebook_dimensions)" is used to
-compute the correct length of the value index for a codebook VQ lookup
-table of lookup type 1.  The values on this list are permuted to
-construct the VQ vector lookup table of size
-<tt class="varname">[codebook_entries]</tt>.</p><p>
-The return value for this function is defined to be 'the greatest
-integer value for which <tt class="varname">[return_value] to the power of
-[codebook_dimensions] is less than or equal to
-[codebook_entries]</tt>'.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-low_neighbor"></a>9.2.4. low_neighbor</h4></div></div><div></div></div><p>
-"low_neighbor(v,x)" finds the position <tt class="varname">n</tt> in vector <tt class="varname">[v]</tt> of
-the greatest value scalar element for which <tt class="varname">n</tt> is less than
-<tt class="varname">[x]</tt> and vector <tt class="varname">[v]</tt> element <tt class="varname">n</tt> is less
-than vector <tt class="varname">[v]</tt> element <tt class="varname">[x]</tt>.</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-high_neighbor"></a>9.2.4.1. high_neighbor</h5></div></div><div></div></div><p>
-"high_neighbor(v,x)" finds the position <tt class="varname">n</tt> in vector [v] of
-the lowest value scalar element for which <tt class="varname">n</tt> is less than
-<tt class="varname">[x]</tt> and vector <tt class="varname">[v]</tt> element <tt class="varname">n</tt> is greater
-than vector <tt class="varname">[v]</tt> element <tt class="varname">[x]</tt>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-render_point"></a>9.2.4.2. render_point</h5></div></div><div></div></div><p>
-"render_point(x0,y0,x1,y1,X)" is used to find the Y value at point X
-along the line specified by x0, x1, y0 and y1.  This function uses an
-integer algorithm to solve for the point directly without calculating
-intervening values along the line.</p><pre class="programlisting">
-  1)  [dy] = [y1] - [y0]
-  2) [adx] = [x1] - [x0]
-  3) [ady] = absolute value of [dy]
-  4) [err] = [ady] * ([X] - [x0])
-  5) [off] = [err] / [adx] using integer division
-  6) if ( [dy] is less than zero ) {
-
-       7) [Y] = [y0] - [off]
-
-     } else {
-
-       8) [Y] = [y0] + [off]
-  
-     }
-
-  9) done
-</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-render_line"></a>9.2.4.3. render_line</h5></div></div><div></div></div><p>
-Floor decode type one uses the integer line drawing algorithm of
-"render_line(x0, y0, x1, y1, v)" to construct an integer floor
-curve for contiguous piecewise line segments. Note that it has not
-been relevant elsewhere, but here we must define integer division as
-rounding division of both positive and negative numbers toward zero.
-</p><pre class="programlisting">
-  1)   [dy] = [y1] - [y0]
-  2)  [adx] = [x1] - [x0]
-  3)  [ady] = absolute value of [dy]
-  4) [base] = [dy] / [adx] using integer division
-  5)    [x] = [x0]
-  6)    [y] = [y0]
-  7)  [err] = 0
-
-  8) if ( [dy] is less than 0 ) {
-
-        9) [sy] = [base] - 1
-
-     } else {
-
-       10) [sy] = [base] + 1
-
-     }
-
- 11) [ady] = [ady] - (absolute value of [base]) * [adx]
- 12) vector [v] element [x] = [y]
-
- 13) iterate [x] over the range [x0]+1 ... [x1]-1 {
-
-       14) [err] = [err] + [ady];
-       15) if ( [err] &gt;= [adx] ) {
-
-             15) [err] = [err] - [adx]
-             16)   [y] = [y] + [sy]
-
-           } else {
-
-             17) [y] = [y] + [base]
-   
-           }
-
-       18) vector [v] element [x] = [y]
-
-     }
-</pre></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-tables"></a>10. Tables</h2></div><div><p class="releaseinfo">
-  $Id: 10-tables.xml,v 1.2 2002/10/27 14:55:31 giles Exp $
-  <span class="emphasis"><em>Last update to this document: July 18, 2002</em></span>
- </p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="vorbis-spec-floor1_inverse_dB_table"></a>10.1. floor1_inverse_dB_table</h3></div></div><div></div></div><p>
-The vector <tt class="varname">[floor1_inverse_dB_table]</tt> is a 256 element static
-lookup table consiting of the following values (read left to right
-then top to bottom):</p><pre class="screen">
-  1.0649863e-07, 1.1341951e-07, 1.2079015e-07, 1.2863978e-07, 
-  1.3699951e-07, 1.4590251e-07, 1.5538408e-07, 1.6548181e-07, 
-  1.7623575e-07, 1.8768855e-07, 1.9988561e-07, 2.1287530e-07, 
-  2.2670913e-07, 2.4144197e-07, 2.5713223e-07, 2.7384213e-07, 
-  2.9163793e-07, 3.1059021e-07, 3.3077411e-07, 3.5226968e-07, 
-  3.7516214e-07, 3.9954229e-07, 4.2550680e-07, 4.5315863e-07, 
-  4.8260743e-07, 5.1396998e-07, 5.4737065e-07, 5.8294187e-07, 
-  6.2082472e-07, 6.6116941e-07, 7.0413592e-07, 7.4989464e-07, 
-  7.9862701e-07, 8.5052630e-07, 9.0579828e-07, 9.6466216e-07, 
-  1.0273513e-06, 1.0941144e-06, 1.1652161e-06, 1.2409384e-06, 
-  1.3215816e-06, 1.4074654e-06, 1.4989305e-06, 1.5963394e-06, 
-  1.7000785e-06, 1.8105592e-06, 1.9282195e-06, 2.0535261e-06, 
-  2.1869758e-06, 2.3290978e-06, 2.4804557e-06, 2.6416497e-06, 
-  2.8133190e-06, 2.9961443e-06, 3.1908506e-06, 3.3982101e-06, 
-  3.6190449e-06, 3.8542308e-06, 4.1047004e-06, 4.3714470e-06, 
-  4.6555282e-06, 4.9580707e-06, 5.2802740e-06, 5.6234160e-06, 
-  5.9888572e-06, 6.3780469e-06, 6.7925283e-06, 7.2339451e-06, 
-  7.7040476e-06, 8.2047000e-06, 8.7378876e-06, 9.3057248e-06, 
-  9.9104632e-06, 1.0554501e-05, 1.1240392e-05, 1.1970856e-05, 
-  1.2748789e-05, 1.3577278e-05, 1.4459606e-05, 1.5399272e-05, 
-  1.6400004e-05, 1.7465768e-05, 1.8600792e-05, 1.9809576e-05, 
-  2.1096914e-05, 2.2467911e-05, 2.3928002e-05, 2.5482978e-05, 
-  2.7139006e-05, 2.8902651e-05, 3.0780908e-05, 3.2781225e-05, 
-  3.4911534e-05, 3.7180282e-05, 3.9596466e-05, 4.2169667e-05, 
-  4.4910090e-05, 4.7828601e-05, 5.0936773e-05, 5.4246931e-05, 
-  5.7772202e-05, 6.1526565e-05, 6.5524908e-05, 6.9783085e-05, 
-  7.4317983e-05, 7.9147585e-05, 8.4291040e-05, 8.9768747e-05, 
-  9.5602426e-05, 0.00010181521, 0.00010843174, 0.00011547824, 
-  0.00012298267, 0.00013097477, 0.00013948625, 0.00014855085, 
-  0.00015820453, 0.00016848555, 0.00017943469, 0.00019109536, 
-  0.00020351382, 0.00021673929, 0.00023082423, 0.00024582449, 
-  0.00026179955, 0.00027881276, 0.00029693158, 0.00031622787, 
-  0.00033677814, 0.00035866388, 0.00038197188, 0.00040679456, 
-  0.00043323036, 0.00046138411, 0.00049136745, 0.00052329927, 
-  0.00055730621, 0.00059352311, 0.00063209358, 0.00067317058, 
-  0.00071691700, 0.00076350630, 0.00081312324, 0.00086596457, 
-  0.00092223983, 0.00098217216, 0.0010459992,  0.0011139742, 
-  0.0011863665,  0.0012634633,  0.0013455702,  0.0014330129, 
-  0.0015261382,  0.0016253153,  0.0017309374,  0.0018434235, 
-  0.0019632195,  0.0020908006,  0.0022266726,  0.0023713743, 
-  0.0025254795,  0.0026895994,  0.0028643847,  0.0030505286, 
-  0.0032487691,  0.0034598925,  0.0036847358,  0.0039241906, 
-  0.0041792066,  0.0044507950,  0.0047400328,  0.0050480668, 
-  0.0053761186,  0.0057254891,  0.0060975636,  0.0064938176, 
-  0.0069158225,  0.0073652516,  0.0078438871,  0.0083536271, 
-  0.0088964928,  0.009474637,   0.010090352,   0.010746080, 
-  0.011444421,   0.012188144,   0.012980198,   0.013823725, 
-  0.014722068,   0.015678791,   0.016697687,   0.017782797, 
-  0.018938423,   0.020169149,   0.021479854,   0.022875735, 
-  0.024362330,   0.025945531,   0.027631618,   0.029427276, 
-  0.031339626,   0.033376252,   0.035545228,   0.037855157, 
-  0.040315199,   0.042935108,   0.045725273,   0.048696758, 
-  0.051861348,   0.055231591,   0.058820850,   0.062643361, 
-  0.066714279,   0.071049749,   0.075666962,   0.080584227, 
-  0.085821044,   0.091398179,   0.097337747,   0.10366330, 
-  0.11039993,    0.11757434,    0.12521498,    0.13335215, 
-  0.14201813,    0.15124727,    0.16107617,    0.17154380, 
-  0.18269168,    0.19456402,    0.20720788,    0.22067342, 
-  0.23501402,    0.25028656,    0.26655159,    0.28387361, 
-  0.30232132,    0.32196786,    0.34289114,    0.36517414, 
-  0.38890521,    0.41417847,    0.44109412,    0.46975890, 
-  0.50028648,    0.53279791,    0.56742212,    0.60429640, 
-  0.64356699,    0.68538959,    0.72993007,    0.77736504, 
-  0.82788260,    0.88168307,    0.9389798,     1.
-</pre></div></div><div class="appendix" lang="en"><h2 class="title" style="clear: both"><a name="vorbis-over-ogg"></a>A. Embedding Vorbis into an Ogg stream</h2><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946040"></a>A.1. Overview</h3></div></div><div></div></div><p>
-This document describes using Ogg logical and physical transport
-streams to encapsulate Vorbis compressed audio packet data into file
-form.</p><p>
-The <a href="#vorbis-spec-intro" title="1. Introduction and Description">Section 1, &#8220;Introduction and Description&#8221;</a> provides an overview of the construction
-of Vorbis audio packets.</p><p>
-The <a href="oggstream.html" target="_top">Ogg
-bitstream overview</a> and <a href="framing.html" target="_top">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><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2915136"></a>A.1.1. Restrictions</h4></div></div><div></div></div><p>
-The Ogg/Vorbis I specification currently dictates that Ogg/Vorbis
-streams use Ogg transport streams in degenerate, unmultiplexed
-form only. That is:
-
-</p><div class="itemizedlist"><ul type="disc"><li>
-  A meta-headerless Ogg file encapsulates the Vorbis I packets
- </li><li>
-  The Ogg stream may be chained, i.e. contain multiple, contigous logical streams (links).
- </li><li>
-  The Ogg stream must be unmultiplexed (only one stream, a Vorbis audio stream, per link)
- </li></ul></div><p>
-</p><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2924373"></a>A.1.2. MIME type</h4></div></div><div></div></div><p>
-The correct MIME type of any Ogg file is <tt class="literal">application/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 class="literal">audio/x-vorbis</tt> is also allowed.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946406"></a>A.2. Encapsulation</h3></div></div><div></div></div><p>
-Ogg encapsulation of a Vorbis packet stream is straightforward.</p><div class="itemizedlist"><ul type="disc"><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.
-</li><li>
-  This first page is marked 'beginning of stream' in the page flags.
-</li><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.
-</li><li>
-  The granule position of these first pages containing only headers is zero.
-</li><li>
-  The first audio packet of the logical stream begins a fresh Ogg page.
-</li><li>
-  Packets are placed into ogg pages in order until the end of stream.
-</li><li>
-  The last page is marked 'end of stream' in the page flags.
-</li><li>
-  Vorbis packets may span page boundaries.
-</li><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).
-</li><li>
-  The granule position of a page represents the end PCM sample
-  position of the last packet <span class="emphasis"><em>completed</em></span> 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'.
-</li><li><p>
-    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><div class="itemizedlist"><ul type="circle"><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.
-    </li><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.
-    </li></ul></div><p>
-    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><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
-    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></div></li><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.
- </li></ul></div></div></div><div class="appendix" lang="en"><h2 class="title" style="clear: both"><a name="vorbis-over-rtp"></a>B. Vorbis encapsulation in RTP</h2><pre class="literallayout">
-
-
-<font color="red">&lt;xi:include&gt;
-  <font color="red">&lt;xi:fallback&gt;
-    <p>Please consult the internet draft <i class="citetitle">RTP Payload Format for Vorbis Encoded
-    Audio</i> for description of how to embed Vorbis audio in an RTP stream.</p>
-  &lt;/xi:fallback&gt;</font>
-&lt;/xi:include&gt;</font>
-</pre></div><div class="appendix" lang="en"><h2 class="title" style="clear: both"><a name="footer"></a>C. Colophon</h2><div class="mediaobject"><img src="white-xifish.png" alt="[Xiph.org logo]"></div><p>
-Ogg is a <a href="http://www.xiph.org/" target="_top">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" target="_top">About
-the Xiph.org Foundation</a> for details.
-</p><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><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><p>
-Ogg, Vorbis, Xiph.org Foundation and their logos are trademarks (tm)
-of the <a href="http://www.xiph.org/" target="_top">Xiph.org Foundation</a>.  These
-pages are copyright (C) 1994-2002 Xiph.org Foundation. All rights
-reserved.</p><p>
-This document is set in DocBook XML.
-</p></div></div></body></html>

Deleted: websites/xiph.org/vorbis/doc/Vorbis_I_spec-20040119.pdf
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/Vorbis_I_spec.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/Vorbis_I_spec.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/Vorbis_I_spec.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,3279 +0,0 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Vorbis I specification</title><meta name="generator" content="DocBook XSL Stylesheets V1.64.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id4625153"></a>Vorbis I specification</h1></div><div><h3 class="corpauthor">Xiph.org Foundation</h3></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#vorbis-spec-intro">1. Introduction and Description</a></span></dt><dd><dl><dt><span class="section"><a href="#id4755883">1.1. Overview</a></span></dt><dt><span class="section"><a href="#id4762720">1.2. Decoder Configuration</a></span></dt><dt><span class="section"><a href="#id4749032">1.3. High-level Decode Process</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-bitpacking">2. Bitpacking Convention</a></span></dt><dd><dl><dt><span class="section"><a href="#id4774875">2.1. Overview</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-codebook">3. Probability Model and Codebooks</a></span></dt><dd><dl><dt><span class="section"><a href="#id4724346">3.1. Overview</a></span></dt><dt><span class="section"><a href="#id4782063">3.2. Packed codebook format</a></span></dt><dt><span class="section"><a href="#id4663109">3.3. Use of the codebook abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-codec">4. Codec Setup and Packet Decode</a></span></dt><dd><dl><dt><span class="section"><a href="#id4735511">4.1. Overview</a></span></dt><dt><span class="section"><a href="#id4726648">4.2. Header decode and decode setup</a></span></dt><dt><span class="section"><a href="#id4775256">4.3. Audio packet decode and synthesis</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-comment">5. comment field and header specification</a></span></dt><dd><dl><dt><span class="section"><a href="#id4744840">5.1. Overview</a></span></dt><dt><span class="section"><a href="#id4744873">5.2. Comment encoding</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-floor0">6. Floor type 0 setup and decode</a></span></dt><dd><dl><dt><span class="section"><a href="#id4728756">6.1. Overview</a></span></dt><dt><span class="section"><a href="#id4759457">6.2. Floor 0 format</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-floor1">7. Floor type 1 setup and decode</a></span></dt><dd><dl><dt><span class="section"><a href="#id4730723">7.1. Overview</a></span></dt><dt><span class="section"><a href="#id4755904">7.2. Floor 1 format</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-residue">8. Residue setup and decode</a></span></dt><dd><dl><dt><span class="section"><a href="#id4764751">8.1. Overview</a></span></dt><dt><span class="section"><a href="#id4767416">8.2. Residue format</a></span></dt><dt><span class="section"><a href="#id4743000">8.3. residue 0</a></span></dt><dt><span class="section"><a href="#id4786178">8.4. residue 1</a></span></dt><dt><span class="section"><a href="#id4786205">8.5. residue 2</a></span></dt><dt><span class="section"><a href="#id4743118">8.6. Residue decode</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-helper">9. Helper equations</a></span></dt><dd><dl><dt><span class="section"><a href="#id4737644">9.1. Overview</a></span></dt><dt><span class="section"><a href="#id4743986">9.2. Functions</a></span></dt></dl></dd><dt><span class="section"><a href="#vorbis-spec-tables">10. Tables</a></span></dt><dd><dl><dt><span class="section"><a href="#vorbis-spec-floor1_inverse_dB_table">10.1. floor1_inverse_dB_table</a></span></dt></dl></dd><dt><span class="appendix"><a href="#vorbis-over-ogg">A. Embedding Vorbis into an Ogg stream</a></span></dt><dd><dl><dt><span class="section"><a href="#id4743952">A.1. Overview</a></span></dt><dd><dl><dt><span class="section"><a href="#id4733866">A.1.1. Restrictions</a></span></dt><dt><span class="section"><a href="#id4734494">A.1.2. MIME type</a></span></dt></dl></dd><dt><span class="section"><a href="#id4782005">A.2. Encapsulation</a></span></dt></dl></dd><dt><span class="appendix"><a href="#vorbis-over-rtp">B. Vorbis encapsulation in RTP</a></span></dt><dt><span class="appendix"><a href="#footer">C. Colophon</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-intro"></a>1. Introduction and Description</h2></div><div><p class="releaseinfo">
- $Id: 01-introduction.xml 6494 2004-04-06 21:18:53Z giles $
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4755883"></a>1.1. Overview</h3></div></div><div></div></div><p>
-This document provides a high level description of the Vorbis codec's
-construction.  A bit-by-bit specification appears beginning in 
-<a href="#vorbis-spec-codec" title="4. Codec Setup and Packet Decode">Section 4, &#8220;Codec Setup and Packet Decode&#8221;</a>.
-The later sections assume a high-level
-understanding of the Vorbis decode process, which is 
-provided here.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4766516"></a>1.1.1. Application</h4></div></div><div></div></div><p>
-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 48kbps
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4756062"></a>1.1.2. Classification</h4></div></div><div></div></div><p>
-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.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4775773"></a>1.1.3. Assumptions</h4></div></div><div></div></div><p>
-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><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 variable bit rate (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><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><p>
-The specification for embedding Vorbis into
-an Ogg transport stream is in <a href="#vorbis-over-ogg" title="A. Embedding Vorbis into an Ogg stream">Appendix A, <i>Embedding Vorbis into an Ogg stream</i></a>.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4744107"></a>1.1.4. Codec Setup and Probability Model</h4></div></div><div></div></div><p>
-Vorbis' 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 of codec setup intentionally
-lean toward the extreme of forward adaptive.</p><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.
-</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
-Vorbis <span class="emphasis"><em>can</em></span> initiate decode at any arbitrary packet within a
-bitstream so long as the codec has been initialized/setup with the
-setup headers.</p></div><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><p>
-Our own design work indicates 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' suitable application space.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4742389"></a>1.1.5. Format Specification</h4></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4745272"></a>1.1.6. Hardware Profile</h4></div></div><div></div></div><p>
-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></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4762720"></a>1.2. Decoder Configuration</h3></div></div><div></div></div><p>
-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><div class="mediaobject"><img src="components.png" alt="decoder pipeline configuration"></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4748901"></a>1.2.1. Global Config</h4></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4748914"></a>1.2.2. Mode</h4></div></div><div></div></div><p>
-Each Vorbis frame is coded according to a master 'mode'.  A bitstream
-may use one or many modes.</p><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4748940"></a>1.2.3. Mapping</h4></div></div><div></div></div><p>
-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><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><p>
-As an example:</p><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4744340"></a>1.2.4. Floor</h4></div></div><div></div></div><p>
-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><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><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4749006"></a>1.2.5. Residue</h4></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4756564"></a>1.2.6. Codebooks</h4></div></div><div></div></div><p>
-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><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><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></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4749032"></a>1.3. High-level Decode Process</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4749037"></a>1.3.1. Decode Setup</h4></div></div><div></div></div><p>
-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><p>
-The header packets are, in order, the identification
-header, the comments header, and the setup header.</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4749055"></a>1.3.1.1. Identification Header</h5></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4749066"></a>1.3.1.2. Comment Header</h5></div></div><div></div></div><p>
-The comment header includes user text comments ("tags") and a vendor
-string for the application/library that produced the bitstream.  The
-encoding and proper use of the comment header is described in 
-<a href="#vorbis-spec-comment" title="5. comment field and header specification">Section 5, &#8220;comment field and header specification&#8221;</a>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4683890"></a>1.3.1.3. Setup Header</h5></div></div><div></div></div><p>
-The setup header includes extensive CODEC setup information as well as
-the complete VQ and Huffman codebooks needed for decode.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4760598"></a>1.3.2. Decode Procedure</h4></div></div><div></div></div><div class="highlights"><p>
-The decoding and synthesis procedure for all audio packets is
-fundamentally the same.
-</p><div class="orderedlist"><ol type="1"><li>decode packet type flag</li><li>decode mode number</li><li>decode window shape (long windows only)</li><li>decode floor</li><li>decode residue into residue vectors</li><li>inverse channel coupling of residue vectors</li><li>generate floor curve from decoded floor data</li><li>compute dot product of floor and residue, producing audio spectrum vector</li><li>inverse monolithic transform of audio spectrum vector, always an MDCT in Vorbis I</li><li>overlap/add left-hand output of transform with right-hand output of previous frame</li><li>store right hand-data from transform of current frame for future lapping</li><li>if not first frame, return results of overlap/add as audio result of current frame</li></ol></div><p>
-</p></div><p>
-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 <span class="emphasis"><em>entirely mathematically equivalent</em></span> to the
-specification, it need not be a literal semantic implementation.</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4662171"></a>1.3.2.1. Packet type decode</h5></div></div><div></div></div><p>
-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 other packet types are reserved; packets
-marked with a reserved type should be ignored.</p><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; <span class="emphasis"><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></span>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4662196"></a>1.3.2.2. Mode decode</h5></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-window"></a>1.3.2.3. Window shape decode (long windows only)</h5></div></div><div></div></div><p>
-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><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><p>
-This is easy to visualize in the case of equal sized-windows:</p><div class="mediaobject"><img src="window1.png" alt="overlap of two equal-sized windows"></div><p>
-And slightly more complex in the case of overlapping unequal sized
-windows:</p><div class="mediaobject"><img src="window2.png" alt="overlap of a long and a short window"></div><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><p>
-A description of valid window functions for use with an inverse MDCT
-can be found in the paper 
-&#8220;<span class="citetitle">
-<a href="http://www.iocon.com/resource/docs/ps/eusipco_corrected.ps" target="_top">
-The use of multirate filter banks for coding of high quality digital
-audio</a></span>&#8221;, by T. Sporer, K. Brandenburg and B. Edler.  Vorbis windows
-all use the slope function 
-  <span class="inlinemediaobject"></span>.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4662324"></a>1.3.2.4. floor decode</h5></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4662336"></a>1.3.2.5. residue decode</h5></div></div><div></div></div><p>
-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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4662359"></a>1.3.2.6. inverse channel coupling</h5></div></div><div></div></div><p>
-A detailed discussion of stereo in the Vorbis codec can be found in
-the document <a href="stereo.html" target="_top"><i class="citetitle">Stereo Channel Coupling in the
-Vorbis CODEC</i></a>.  Vorbis is not limited to only stereo coupling, but
-the stereo document also gives a good overview of the generic coupling
-mechanism.</p><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><p>
-After decoupling, in order, each pair of vectors on the coupling list, 
-the resulting residue vectors represent the fine spectral detail
-of each output channel.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4661107"></a>1.3.2.7. generate floor curve</h5></div></div><div></div></div><p>
-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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4661127"></a>1.3.2.8. compute floor/residue dot product</h5></div></div><div></div></div><p>
-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><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4661167"></a>1.3.2.9. inverse monolithic transform (MDCT)</h5></div></div><div></div></div><p>
-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" target="_top">&#8220;<span class="citetitle">The use of multirate filter banks for coding of high quality digital
-audio</span>&#8221;</a>, by T. Sporer, K. Brandenburg and B. Edler.</p><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4661194"></a>1.3.2.10. overlap/add data</h5></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4661209"></a>1.3.2.11. cache right hand data</h5></div></div><div></div></div><p>
-The decoder must cache the right hand portion of the current frame to
-be lapped with the left hand portion of the next frame.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4661220"></a>1.3.2.12. return finished audio data</h5></div></div><div></div></div><p>
-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><pre class="programlisting">
-window_blocksize(previous_window)/4+window_blocksize(current_window)/4
-</pre><p>
-
-from the center of the previous window to the center of the current
-window.</p><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></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-bitpacking"></a>2. Bitpacking Convention</h2></div><div><p class="releaseinfo">
- $Id: 02-bitpacking.xml 6494 2004-04-06 21:18:53Z giles $
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4774875"></a>2.1. Overview</h3></div></div><div></div></div><p>
-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.
-</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4726490"></a>2.1.1. octets, bytes and words</h4></div></div><div></div></div><p>
-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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4759806"></a>2.1.2. bit order</h4></div></div><div></div></div><p>
-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
-<span class="emphasis"><em>n</em></span> (<span class="emphasis"><em>n</em></span>=7 in an octet) for the
-MSb.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4765588"></a>2.1.3. byte order</h4></div></div><div></div></div><p>
-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><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 <span class="emphasis"><em>n</em></span>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4734050"></a>2.1.4. coding bits into byte sequences</h4></div></div><div></div></div><p>
-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 at which the previous field ends.</p><p>
-The encoder logically packs integers by writing the LSb of a 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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4766447"></a>2.1.5. signedness</h4></div></div><div></div></div><p>
-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.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4741565"></a>2.1.6. coding example</h4></div></div><div></div></div><p>
-Code the 4 bit integer value '12' [b1100] into an empty bytestream.
-Bytestream result:
-
-</p><pre class="screen">  
-              |
-              V
-
-        7 6 5 4 3 2 1 0
-byte 0 [0 0 0 0 1 1 0 0]  &lt;-
-byte 1 [               ]
-byte 2 [               ]
-byte 3 [               ]
-             ...
-byte n [               ]  bytestream length == 1 byte
-
-</pre><p>
-</p><p>
-Continue by coding the 3 bit integer value '-1' [b111]:
-
-</p><pre class="screen">
-        |
-        V
-
-        7 6 5 4 3 2 1 0
-byte 0 [0 1 1 1 1 1 0 0]  &lt;-
-byte 1 [               ]
-byte 2 [               ]
-byte 3 [               ]
-             ... 
-byte n [               ]  bytestream length == 1 byte
-</pre><p>
-</p><p>
-Continue by coding the 7 bit integer value '17' [b0010001]:
-
-</p><pre class="screen">
-          |
-          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]  &lt;-
-byte 2 [               ]
-byte 3 [               ]
-             ...
-byte n [               ]  bytestream length == 2 bytes
-                          bit cursor == 6
-</pre><p>
-</p><p>
-Continue by coding the 13 bit integer value '6969' [b110 11001110 01]:
-
-</p><pre class="screen">
-                |
-                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]  &lt;-
-             ...
-byte n [               ]  bytestream length == 4 bytes
-
-</pre><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4763676"></a>2.1.7. decoding example</h4></div></div><div></div></div><p>
-Reading from the beginning of the bytestream encoded in the above example:
-
-</p><pre class="screen">
-                      |
-                      V
-                      
-        7 6 5 4 3 2 1 0
-byte 0 [1 1 1 1 1 1 0 0]  &lt;-
-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><p>
-</p><p>
-We read two, two-bit integer fields, resulting in the returned numbers
-'b00' and 'b11'.  Two things are worth noting here:
-
-</p><div class="itemizedlist"><ul type="disc"><li><p>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.</p></li><li><p>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.</p></li></ul></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4763718"></a>2.1.8. end-of-packet alignment</h4></div></div><div></div></div><p>
-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><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4776931"></a>2.1.9.  reading zero bits</h4></div></div><div></div></div><p>
-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></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-codebook"></a>3. Probability Model and Codebooks</h2></div><div><p class="releaseinfo">
- $Id: 03-codebook.xml 6494 2004-04-06 21:18:53Z giles $
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4724346"></a>3.1. Overview</h3></div></div><div></div></div><p>
-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.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4777229"></a>3.1.1. Bitwise operation</h4></div></div><div></div></div><p>
-The codebook mechanism is built on top of the vorbis bitpacker. 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 <a href="#vorbis-spec-bitpacking" title="2. Bitpacking Convention">Section 2, &#8220;Bitpacking Convention&#8221;</a>.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4782063"></a>3.2. Packed codebook format</h3></div></div><div></div></div><p>
-For purposes of the examples below, we assume that the storage
-system's native byte width is eight bits.  This is not universally
-true; see <a href="#vorbis-spec-bitpacking" title="2. Bitpacking Convention">Section 2, &#8220;Bitpacking Convention&#8221;</a> for discussion 
-relating to non-eight-bit bytes.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4782363"></a>3.2.1. codebook decode</h4></div></div><div></div></div><p>
-A codebook begins with a 24 bit sync pattern, 0x564342:
-
-</p><pre class="screen">
-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><p>
-16 bit <tt class="varname">[codebook_dimensions]</tt> and 24 bit <tt class="varname">[codebook_entries]</tt> fields:
-
-</p><pre class="screen">
-
-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><p>
-Next is the <tt class="varname">[ordered]</tt> bit flag:
-
-</p><pre class="screen">
-
-byte 8: [               X ] [ordered] (1 bit)
-
-</pre><p>
-Each entry, numbering a
-total of <tt class="varname">[codebook_entries]</tt>, is assigned a codeword length.
-We now read the list of codeword lengths and store these lengths in
-the array <tt class="varname">[codebook_codeword_lengths]</tt>. Decode of lengths is
-according to whether the <tt class="varname">[ordered]</tt> flag is set or unset.
-
-</p><div class="itemizedlist"><ul type="disc"><li><p>If the <tt class="varname">[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><p>The decoder first reads one additional bit flag, the
-  <tt class="varname">[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 class="screen">
-byte 8: [             X 1 ] [sparse] flag (1 bit)
-</pre><p>
-  The decoder now performs for each of the <tt class="varname">[codebook_entries]</tt>
-  codebook entries:
-
-</p><pre class="screen">
-  
-  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><li><p>If the <tt class="varname">[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:
-
-</p><pre class="screen">
-  1) [current_entry] = 0;
-  2) [current_length] = read a five bit unsigned integer and add 1;
-  3) [number] = read <a href="#vorbis-spec-ilog" title="9.2.1. 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></li></ul></div><p>
-
-After all codeword lengths have been decoded, the decoder reads the
-vector lookup table.  Vorbis I supports three lookup types:
-</p><div class="orderedlist"><ol type="1"><li>No lookup</li><li>Implicitly populated value mapping (lattice VQ)</li><li>Explicitly populated value mapping (tessellated or 'foam'
-VQ)</li></ol></div><p>
-</p><p>
-The lookup table type is read as a four bit unsigned integer:
-</p><pre class="screen">
-  1) [codebook_lookup_type] = read four bits as an unsigned integer
-</pre><p>
-Codebook decode precedes according to <tt class="varname">[codebook_lookup_type]</tt>:
-</p><div class="itemizedlist"><ul type="disc"><li><p>Lookup type zero indicates no lookup to be read.  Proceed past
-lookup decode.</p></li><li><p>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 class="varname">[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:
-
-</p><pre class="screen">
-  1) [codebook_minimum_value] = <a href="#vorbis-spec-float32_unpack" title="9.2.2. float32_unpack">float32_unpack</a>( read 32 bits as an unsigned integer) 
-  2) [codebook_delta_value] = <a href="#vorbis-spec-float32_unpack" title="9.2.2. 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="#vorbis-spec-lookup1_values" title="9.2.3. lookup1_values">lookup1_values</a>(<tt class="varname">[codebook_entries]</tt>, <tt class="varname">[codebook_dimensions]</tt> )
-
-  } else {
-
-     6) [codebook_lookup_values] = <tt class="varname">[codebook_entries]</tt> * <tt class="varname">[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><li><p>A <tt class="varname">[codebook_lookup_type]</tt> of greater than two is reserved
-and indicates a stream that is not decodable by the specification in this
-document.</p></li></ul></div><p>
-</p><p>
-An 'end of packet' during any read operation in the above steps is
-considered an error condition rendering the stream undecodable.</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4780064"></a>3.2.1.1. Huffman decision tree representation</h5></div></div><div></div></div><p>
-The <tt class="varname">[codebook_codeword_lengths]</tt> array and
-<tt class="varname">[codebook_entries]</tt> value uniquely define the Huffman decision
-tree used for entropy decoding.</p><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 class="screen">
-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><p>
-Assigning codewords in order (lowest possible value of the appropriate
-length to highest) results in the following codeword list:
-
-</p><pre class="screen">
-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><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
-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.</p></div><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><div class="mediaobject"><img src="hufftree.png" alt="[huffman tree illustration]"></div><p>
-</p><p>
-As we assign codewords in order, we see that each choice constructs a
-new leaf in the leftmost possible position.</p><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><div class="mediaobject"><img src="hufftree-under.png" alt="[underspecified huffman tree illustration]"></div><p>
-</p><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4663005"></a>3.2.1.2. VQ lookup table vector representation</h5></div></div><div></div></div><p>
-Unpacking the VQ lookup table vectors relies on the following values:
-</p><pre class="programlisting">
-the [codebook_multiplicands] array
-[codebook_minimum_value]
-[codebook_delta_value]
-[codebook_sequence_p]
-[codebook_lookup_type]
-[codebook_entries]
-[codebook_dimensions]
-[codebook_lookup_values]
-</pre><p>
-</p><p>
-Decoding (unpacking) a specific vector in the vector lookup table
-proceeds according to <tt class="varname">[codebook_lookup_type]</tt>.  The unpacked
-vector values are what a codebook would return during audio packet
-decode in a VQ context.</p><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="id4663030"></a>3.2.1.2.1. Vector value decode: Lookup type 1</h6></div></div><div></div></div><p>
-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 class="varname">[codebook_multiplicands]</tt> as follows (<tt class="varname">[value_vector]</tt>
-is the output vector representing the vector of values for entry number
-<tt class="varname">[lookup_offset]</tt> in this codebook):
-
-</p><pre class="screen">
-  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></div><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="id4663067"></a>3.2.1.2.2. Vector value decode: Lookup type 2</h6></div></div><div></div></div><p>
-Lookup type two specifies a VQ lookup table in which each scalar in
-each vector is explicitly set by the <tt class="varname">[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 class="varname">[codebook_multiplicands]</tt> as follows (<tt class="varname">[value_vector]</tt>
-is the output vector representing the vector of values for entry number
-<tt class="varname">[lookup_offset]</tt> in this codebook):
-
-</p><pre class="screen">
-  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></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4663109"></a>3.3. Use of the codebook abstraction</h3></div></div><div></div></div><p>
-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><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><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><p>
-When used in a scalar context, the resulting codeword entry is the
-desired return value.</p><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></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-codec"></a>4. Codec Setup and Packet Decode</h2></div><div><p class="releaseinfo">
- $Id: 04-codec.xml 6494 2004-04-06 21:18:53Z giles $
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4735511"></a>4.1. Overview</h3></div></div><div></div></div><p>
-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 <a href="#vorbis-spec-intro" title="1. Introduction and Description">Section 1, &#8220;Introduction and Description&#8221;</a>.  <a href="#vorbis-spec-bitpacking" title="2. Bitpacking Convention">Section 2, &#8220;Bitpacking Convention&#8221;</a> covers reading and writing bit fields from
-and to bitstream packets.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4726648"></a>4.2. Header decode and decode setup</h3></div></div><div></div></div><p>
-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><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4761087"></a>4.2.1. Common header decode</h4></div></div><div></div></div><p>
-Each header packet begins with the same header fields.
-</p><pre class="screen">
-  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><p>
-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.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4772216"></a>4.2.2. Identification header</h4></div></div><div></div></div><p>
-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 class="screen">
- 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><p>
-<tt class="varname">[vorbis_version]</tt> is to read '0' in order to be compatible
-with this document.  Both <tt class="varname">[audio_channels]</tt> and
-<tt class="varname">[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 class="varname">[blocksize_0]</tt> must be less than or equal to
-<tt class="varname">[blocksize_1]</tt>.  The framing bit must be nonzero.  Failure to
-meet any of these conditions renders a stream undecodable.</p><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><div class="itemizedlist"><ul type="disc"><li>All three fields set to the same value implies a fixed rate, or tightly bounded, nearly fixed-rate bitstream</li><li>Only nominal set implies a VBR or ABR stream that averages the nominal bitrate</li><li>Maximum and or minimum set implies a VBR bitstream that obeys the bitrate limits</li><li>None set indicates the encoder does not care to speculate.</li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4726773"></a>4.2.3. Comment header</h4></div></div><div></div></div><p>
-Comment header decode and data specification is covered in
-<a href="#vorbis-spec-comment" title="5. comment field and header specification">Section 5, &#8220;comment field and header specification&#8221;</a>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4726786"></a>4.2.4. Setup header</h4></div></div><div></div></div><p>
-Vorbis codec setup is configurable to an extreme degree:
-
-</p><div class="mediaobject"><img src="components.png" alt="[decoder pipeline configuration]"></div><p>
-</p><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><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4778336"></a>4.2.4.1. Codebooks</h5></div></div><div></div></div><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_codebook_count]</tt> = read eight bits as unsigned integer and add one</li><li>Decode <tt class="varname">[vorbis_codebook_count]</tt> codebooks in order as defined
-in <a href="#vorbis-spec-codebook" title="3. Probability Model and Codebooks">Section 3, &#8220;Probability Model and Codebooks&#8221;</a>.  Save each configuration, in
-order, in an array of
-codebook configurations <tt class="varname">[vorbis_codebook_configurations]</tt>.</li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4778369"></a>4.2.4.2. Time domain transforms</h5></div></div><div></div></div><p>
-These hooks are placeholders in Vorbis I.  Nevertheless, the
-configuration placeholder values must be read to maintain bitstream
-sync.</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_time_count]</tt> = read 6 bits as unsigned integer and add one</li><li>read <tt class="varname">[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.</li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4778400"></a>4.2.4.3. Floors</h5></div></div><div></div></div><p>
-Vorbis uses two floor types; header decode is handed to the decode
-abstraction of the appropriate type.</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_floor_count]</tt> = read 6 bits as unsigned integer and add one</li><li><p>For each <tt class="varname">[i]</tt> of <tt class="varname">[vorbis_floor_count]</tt> floor numbers:
-  </p><div class="orderedlist"><ol type="a"><li>read the floor type: vector <tt class="varname">[vorbis_floor_types]</tt> element <tt class="varname">[i]</tt> =
-read 16 bits as unsigned integer</li><li>If the floor type is zero, decode the floor
-configuration as defined in <a href="#vorbis-spec-floor0" title="6. Floor type 0 setup and decode">Section 6, &#8220;Floor type 0 setup and decode&#8221;</a>; save
-this
-configuration in slot <tt class="varname">[i]</tt> of the floor configuration array <tt class="varname">[vorbis_floor_configurations]</tt>.</li><li>If the floor type is one,
-decode the floor configuration as defined in <a href="#vorbis-spec-floor1" title="7. Floor type 1 setup and decode">Section 7, &#8220;Floor type 1 setup and decode&#8221;</a>; save this configuration in slot <tt class="varname">[i]</tt> of the floor configuration array <tt class="varname">[vorbis_floor_configurations]</tt>.</li><li>If the the floor type is greater than one, this stream is undecodable; ERROR CONDITION</li></ol></div><p>
- </p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4691108"></a>4.2.4.4. Residues</h5></div></div><div></div></div><p>
-Vorbis uses three residue types; header decode of each type is identical.
-</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_residue_count]</tt> = read 6 bits as unsigned integer and add one
-</li><li><p>For each of <tt class="varname">[vorbis_residue_count]</tt> residue numbers:
- </p><div class="orderedlist"><ol type="a"><li>read the residue type; vector <tt class="varname">[vorbis_residue_types]</tt> element <tt class="varname">[i]</tt> = read 16 bits as unsigned integer</li><li>If the residue type is zero,
-one or two, decode the residue configuration as defined in <a href="#vorbis-spec-residue" title="8. Residue setup and decode">Section 8, &#8220;Residue setup and decode&#8221;</a>; save this configuration in slot <tt class="varname">[i]</tt> of the residue configuration array <tt class="varname">[vorbis_residue_configurations]</tt>.</li><li>If the the residue type is greater than two, this stream is undecodable; ERROR CONDITION</li></ol></div><p>
-</p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4691174"></a>4.2.4.5. Mappings</h5></div></div><div></div></div><p>
-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><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_mapping_count]</tt> = read 6 bits as unsigned integer and add one</li><li><p>For each <tt class="varname">[i]</tt> of <tt class="varname">[vorbis_mapping_count]</tt> mapping numbers:
-  </p><div class="orderedlist"><ol type="a"><li>read the mapping type: 16 bits as unsigned integer.  There's no reason to save the mapping type in Vorbis I.</li><li>If the mapping type is nonzero, the stream is undecodable</li><li><p>If the mapping type is zero:
-    </p><div class="orderedlist"><ol type="i"><li><p>read 1 bit as a boolean flag
-      </p><div class="orderedlist"><ol type="A"><li>if set, <tt class="varname">[vorbis_mapping_submaps]</tt> = read 4 bits as unsigned integer and add one</li><li>if unset, <tt class="varname">[vorbis_mapping_submaps]</tt> = 1</li></ol></div><p>
-      </p></li><li><p>read 1 bit as a boolean flag
-       </p><div class="orderedlist"><ol type="A"><li><p>if set, square polar channel mapping is in use:
-           </p><div class="orderedlist"><ol type="I"><li><tt class="varname">[vorbis_mapping_coupling_steps]</tt> = read 8 bits as unsigned integer and add one</li><li><p>for <tt class="varname">[j]</tt> each of <tt class="varname">[vorbis_mapping_coupling_steps]</tt> steps:
-               </p><div class="orderedlist"><ol type="1"><li>vector <tt class="varname">[vorbis_mapping_magnitude]</tt> element <tt class="varname">[j]</tt>= read <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>(<tt class="varname">[audio_channels]</tt> - 1) bits as unsigned integer</li><li>vector <tt class="varname">[vorbis_mapping_angle]</tt> element <tt class="varname">[j]</tt>= read <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>(<tt class="varname">[audio_channels]</tt> - 1) bits as unsigned integer</li><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 class="varname">[audio_channels]</tt>-1, or the angle channel is greater than <tt class="varname">[audio_channels]</tt>-1, the stream is undecodable.</li></ol></div><p>
-               </p></li></ol></div><p>
-           </p></li><li>if unset, <tt class="varname">[vorbis_mapping_coupling_steps]</tt> = 0</li></ol></div><p>
-       </p></li><li>read 2 bits (reserved field); if the value is nonzero, the stream is undecodable</li><li><p>if <tt class="varname">[vorbis_mapping_submaps]</tt> is greater than one, we read channel multiplex settings. For each <tt class="varname">[j]</tt> of <tt class="varname">[audio_channels]</tt> channels:</p><div class="orderedlist"><ol type="A"><li>vector <tt class="varname">[vorbis_mapping_mux]</tt> element <tt class="varname">[j]</tt> = read 4 bits as unsigned integer</li><li>if the value is greater than the highest numbered submap (<tt class="varname">[vorbis_mapping_submaps]</tt> - 1), this in an error condition rendering the stream undecodable</li></ol></div></li><li><p>for each submap <tt class="varname">[j]</tt> of <tt class="varname">[vorbis_mapping_submaps]</tt> submaps, read the floor and residue numbers for use in decoding that submap:</p><div class="orderedlist"><ol type="A"><li>read and discard 8 bits (the unused time configuration placeholder)</li><li>read 8 bits as unsigned integer for the floor number; save in vector <tt class="varname">[vorbis_mapping_submap_floor]</tt> element <tt class="varname">[j]</tt></li><li>verify the floor number is not greater than the highest number floor configured for the bitstream. If it is, the bitstream is undecodable</li><li>read 8 bits as unsigned integer for the residue number; save in vector <tt class="varname">[vorbis_mapping_submap_residue]</tt> element <tt class="varname">[j]</tt></li><li>verify the residue number is not greater than the highest number residue configured for the bitstream.  If it is, the bitstream is undecodable</li></ol></div></li><li>save this mapping configuration in slot <tt class="varname">[i]</tt> of the mapping configuration array <tt class="varname">[vorbis_mapping_configurations]</tt>.</li></ol></div></li></ol></div><p>
- </p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4775159"></a>4.2.4.6. Modes</h5></div></div><div></div></div><div class="orderedlist"><ol type="1"><li><tt class="varname">[vorbis_mode_count]</tt> = read 6 bits as unsigned integer and add one</li><li><p>For each of <tt class="varname">[vorbis_mode_count]</tt> mode numbers:</p><div class="orderedlist"><ol type="a"><li><tt class="varname">[vorbis_mode_blockflag]</tt> = read 1 bit</li><li><tt class="varname">[vorbis_mode_windowtype]</tt> = read 16 bits as unsigned integer</li><li><tt class="varname">[vorbis_mode_transformtype]</tt> = read 16 bits as unsigned integer</li><li><tt class="varname">[vorbis_mode_mapping]</tt> = read 8 bits as unsigned integer</li><li>verify ranges; zero is the only legal value in Vorbis I for
-<tt class="varname">[vorbis_mode_windowtype]</tt>
-and <tt class="varname">[vorbis_mode_transformtype]</tt>.  <tt class="varname">[vorbis_mode_mapping]</tt> must not be greater than the highest number mapping in use.  Any illegal values render the stream undecodable.</li><li>save this mode configuration in slot <tt class="varname">[i]</tt> of the mode configuration array
-<tt class="varname">[vorbis_mode_configurations]</tt>.</li></ol></div></li><li>read 1 bit as a framing flag.  If unset, a framing error occurred and the stream is not
-decodable.</li></ol></div><p>
-After reading mode descriptions, setup header decode is complete.
-</p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4775256"></a>4.3. Audio packet decode and synthesis</h3></div></div><div></div></div><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. <span class="emphasis"><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></span>.
-</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4775274"></a>4.3.1. packet type, mode and window decode</h4></div></div><div></div></div><div class="orderedlist"><ol type="1"><li>read 1 bit <tt class="varname">[packet_type]</tt>; check that packet type is 0 (audio)</li><li>read <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>([vorbis_mode_count]-1) bits
-<tt class="varname">[mode_number]</tt></li><li>decode blocksize <tt class="varname">[n]</tt> is equal to <tt class="varname">[blocksize_0]</tt> if 
-<tt class="varname">[vorbis_mode_blockflag]</tt> is 0, else <tt class="varname">[n]</tt> is equal to <tt class="varname">[blocksize_1]</tt>.</li><li><p>perform window selection and setup; this window is used later by the inverse MDCT:</p><div class="orderedlist"><ol type="a"><li><p>if this is a long window (the <tt class="varname">[vorbis_mode_blockflag]</tt> flag of this mode is
-set):</p><div class="orderedlist"><ol type="i"><li>read 1 bit for <tt class="varname">[previous_window_flag]</tt></li><li>read 1 bit for <tt class="varname">[next_window_flag]</tt></li><li>if <tt class="varname">[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-window" title="1.3.2.3. Window shape decode (long windows only)">Section 1.3.2.3, &#8220;Window shape decode (long windows only)&#8221;</a> for an illustration of overlapping
-dissimilar
-         windows. Else, the left half window will have normal long
-         shape.</li><li>if <tt class="varname">[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-window" title="1.3.2.3. Window shape decode (long windows only)">Section 1.3.2.3, &#8220;Window shape decode (long windows only)&#8221;</a> for an
-illustration of overlapping dissimilar
-         windows. Else, the left right window will have normal long
-         shape.</li></ol></div></li><li> if this is a short window, the window is always the same 
-       short-window shape.</li></ol></div></li></ol></div><p>
-Vorbis windows all use the slope function y=sin(0.5 * &#960; * sin^2((x+.5)/n * &#960;)),
-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><div class="orderedlist"><ol type="1"><li> <tt class="varname">[window_center]</tt> = <tt class="varname">[n]</tt> / 2</li><li><p> if (<tt class="varname">[vorbis_mode_blockflag]</tt> is set and <tt class="varname">[previous_window_flag]</tt> is
-not set) then
-  </p><div class="orderedlist"><ol type="a"><li><tt class="varname">[left_window_start]</tt> = <tt class="varname">[n]</tt>/4 -
-<tt class="varname">[blocksize_0]</tt>/4</li><li><tt class="varname">[left_window_end]</tt> = <tt class="varname">[n]</tt>/4 + <tt class="varname">[blocksize_0]</tt>/4</li><li><tt class="varname">[left_n]</tt> = <tt class="varname">[blocksize_0]</tt>/2</li></ol></div><p>
- else
-  </p><div class="orderedlist"><ol type="a"><li><tt class="varname">[left_window_start]</tt> = 0</li><li><tt class="varname">[left_window_end]</tt> = <tt class="varname">[window_center]</tt></li><li><tt class="varname">[left_n]</tt> = <tt class="varname">[n]</tt>/2</li></ol></div></li><li><p> if (<tt class="varname">[vorbis_mode_blockflag]</tt> is set and <tt class="varname">[next_window_flag]</tt> is not
-set) then 
-  </p><div class="orderedlist"><ol type="a"><li><tt class="varname">[right_window_start]</tt> = <tt class="varname">[n]*3</tt>/4 -
-<tt class="varname">[blocksize_0]</tt>/4</li><li><tt class="varname">[right_window_end]</tt> = <tt class="varname">[n]*3</tt>/4 +
-<tt class="varname">[blocksize_0]</tt>/4</li><li><tt class="varname">[right_n]</tt> = <tt class="varname">[blocksize_0]</tt>/2</li></ol></div><p>
- else
-  </p><div class="orderedlist"><ol type="a"><li><tt class="varname">[right_window_start]</tt> = <tt class="varname">[window_center]</tt></li><li><tt class="varname">[right_window_end]</tt> = <tt class="varname">[n]</tt></li><li><tt class="varname">[right_n]</tt> = <tt class="varname">[n]</tt>/2</li></ol></div></li><li> window from range 0 ... <tt class="varname">[left_window_start]</tt>-1 inclusive is zero</li><li> for <tt class="varname">[i]</tt> in range <tt class="varname">[left_window_start]</tt> ...
-<tt class="varname">[left_window_end]</tt>-1, window(<tt class="varname">[i]</tt>) = sin(.5 * &#960; * sin^2( (<tt class="varname">[i]</tt>-<tt class="varname">[left_window_start]</tt>+.5) / <tt class="varname">[left_n]</tt> * .5 * &#960;) )</li><li> window from range <tt class="varname">[left_window_end]</tt> ... <tt class="varname">[right_window_start]</tt>-1
-inclusive is one</li><li> for <tt class="varname">[i]</tt> in range <tt class="varname">[right_window_start]</tt> ... <tt class="varname">[right_window_end]</tt>-1, window(<tt class="varname">[i]</tt>) = sin(.5 * &#960; * sin^2( (<tt class="varname">[i]</tt>-<tt class="varname">[right_window_start]</tt>+.5) / <tt class="varname">[right_n]</tt> * .5 * &#960; + .5 * &#960;) )</li><li> window from range <tt class="varname">[right_window_start]</tt> ... <tt class="varname">[n]</tt>-1 is
-zero</li></ol></div><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4785171"></a>4.3.2. floor curve decode</h4></div></div><div></div></div><p>
-From this point on, we assume out decode context is using mode number
-<tt class="varname">[mode_number]</tt> from configuration array
-<tt class="varname">[vorbis_mode_configurations]</tt> and the map number
-<tt class="varname">[vorbis_mode_mapping]</tt> (specified by the current mode) taken
-from the mapping configuration array
-<tt class="varname">[vorbis_mapping_configurations]</tt>.</p><p>
-Floor curves are decoded one-by-one in channel order.</p><p>
-For each floor <tt class="varname">[i]</tt> of <tt class="varname">[audio_channels]</tt>
- </p><div class="orderedlist"><ol type="1"><li><tt class="varname">[submap_number]</tt> = element <tt class="varname">[i]</tt> of vector [vorbis_mapping_mux]</li><li><tt class="varname">[floor_number]</tt> = element <tt class="varname">[submap_number]</tt> of vector
-[vorbis_submap_floor]</li><li>if the floor type of this
-floor (vector <tt class="varname">[vorbis_floor_types]</tt> element
-<tt class="varname">[floor_number]</tt>) is zero then decode the floor for
-channel <tt class="varname">[i]</tt> according to the
-<a href="#vorbis-spec-floor0-decode" title="6.2.2. packet decode">Section 6.2.2, &#8220;packet decode&#8221;</a></li><li>if the type of this floor
-is one then decode the floor for channel <tt class="varname">[i]</tt> according
-to the <a href="#vorbis-spec-floor1-decode" title="7.2.2.1. packet decode">Section 7.2.2.1, &#8220;packet decode&#8221;</a></li><li>save the needed decoded floor information for channel for later synthesis</li><li>if the decoded floor returned 'unused', set vector <tt class="varname">[no_residue]</tt> element
-<tt class="varname">[i]</tt> to true, else set vector <tt class="varname">[no_residue]</tt> element <tt class="varname">[i]</tt> to
-false</li></ol></div><p>
-</p><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4785294"></a>4.3.3. nonzero vector propagate</h4></div></div><div></div></div><p>
-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><p>
-for each <tt class="varname">[i]</tt> from 0 ... <tt class="varname">[vorbis_mapping_coupling_steps]</tt>-1
-
-</p><div class="orderedlist"><ol type="1"><li>if either <tt class="varname">[no_residue]</tt> entry for channel
-(<tt class="varname">[vorbis_mapping_magnitude]</tt> element <tt class="varname">[i]</tt>)
-or channel
-(<tt class="varname">[vorbis_mapping_angle]</tt> element <tt class="varname">[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.</li></ol></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4785346"></a>4.3.4. residue decode</h4></div></div><div></div></div><p>
-Unlike floors, which are decoded in channel order, the residue vectors
-are decoded in submap order.</p><p>
-for each submap <tt class="varname">[i]</tt> in order from 0 ... <tt class="varname">[vorbis_mapping_submaps]</tt>-1</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[ch]</tt> = 0</li><li><p>for each channel <tt class="varname">[j]</tt> in order from 0 ... <tt class="varname">[audio_channels]</tt> - 1</p><div class="orderedlist"><ol type="a"><li><p>if channel <tt class="varname">[j]</tt> in submap <tt class="varname">[i]</tt> (vector <tt class="varname">[vorbis_mapping_mux]</tt> element <tt class="varname">[j]</tt> is equal to <tt class="varname">[i]</tt>)</p><div class="orderedlist"><ol type="i"><li><p>if vector <tt class="varname">[no_residue]</tt> element <tt class="varname">[j]</tt> is true
-      </p><div class="orderedlist"><ol type="A"><li>vector <tt class="varname">[do_not_decode_flag]</tt> element <tt class="varname">[ch]</tt> is set</li></ol></div><p>
-     else
-      </p><div class="orderedlist"><ol type="A"><li>vector <tt class="varname">[do_not_decode_flag]</tt> element <tt class="varname">[ch]</tt> is unset</li></ol></div></li><li>increment <tt class="varname">[ch]</tt></li></ol></div></li></ol></div></li><li><tt class="varname">[residue_number]</tt> = vector <tt class="varname">[vorbis_mapping_submap_residue]</tt> element <tt class="varname">[i]</tt></li><li><tt class="varname">[residue_type]</tt> = vector <tt class="varname">[vorbis_residue_types]</tt> element <tt class="varname">[residue_number]</tt></li><li>decode <tt class="varname">[ch]</tt> vectors using residue <tt class="varname">[residue_number]</tt>, according to type <tt class="varname">[residue_type]</tt>, also passing vector <tt class="varname">[do_not_decode_flag]</tt> to indicate which vectors in the bundle should not be decoded. Correct per-vector decode length is <tt class="varname">[n]</tt>/2.</li><li><tt class="varname">[ch]</tt> = 0</li><li><p>for each channel <tt class="varname">[j]</tt> in order from 0 ... <tt class="varname">[audio_channels]</tt></p><div class="orderedlist"><ol type="a"><li><p>if channel <tt class="varname">[j]</tt> is in submap <tt class="varname">[i]</tt> (vector <tt class="varname">[vorbis_mapping_mux]</tt> element <tt class="varname">[j]</tt> is equal to <tt class="varname">[i]</tt>)</p><div class="orderedlist"><ol type="i"><li>residue vector for channel <tt class="varname">[j]</tt> is set to decoded residue vector <tt class="varname">[ch]</tt></li><li>increment <tt class="varname">[ch]</tt></li></ol></div></li></ol></div></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4785567"></a>4.3.5. inverse coupling</h4></div></div><div></div></div><p>
-for each <tt class="varname">[i]</tt> from <tt class="varname">[vorbis_mapping_coupling_steps]</tt>-1 descending to 0
-
-</p><div class="orderedlist"><ol type="1"><li><tt class="varname">[magnitude_vector]</tt> = the residue vector for channel
-(vector <tt class="varname">[vorbis_mapping_magnitude]</tt> element <tt class="varname">[i]</tt>)</li><li><tt class="varname">[angle_vector]</tt> = the residue vector for channel (vector
-<tt class="varname">[vorbis_mapping_angle]</tt> element <tt class="varname">[i]</tt>)</li><li><p>for each scalar value <tt class="varname">[M]</tt> in vector <tt class="varname">[magnitude_vector]</tt> and the corresponding scalar value <tt class="varname">[A]</tt> in vector <tt class="varname">[angle_vector]</tt>:</p><div class="orderedlist"><ol type="a"><li><p>if (<tt class="varname">[M]</tt> is greater than zero)
-    </p><div class="orderedlist"><ol type="i"><li><p>if (<tt class="varname">[A]</tt> is greater than zero)
-      </p><div class="orderedlist"><ol type="A"><li><tt class="varname">[new_M]</tt> = <tt class="varname">[M]</tt></li><li><tt class="varname">[new_A]</tt> = <tt class="varname">[M]</tt>-<tt class="varname">[A]</tt></li></ol></div><p>
-     else
-      </p><div class="orderedlist"><ol type="A"><li><tt class="varname">[new_A]</tt> = <tt class="varname">[M]</tt></li><li><tt class="varname">[new_M]</tt> = <tt class="varname">[M]</tt>+<tt class="varname">[A]</tt></li></ol></div><p>
-     </p></li></ol></div><p>
-   else
-    </p><div class="orderedlist"><ol type="i"><li><p>if (<tt class="varname">[A]</tt> is greater than zero)
-      </p><div class="orderedlist"><ol type="A"><li><tt class="varname">[new_M]</tt> = <tt class="varname">[M]</tt></li><li><tt class="varname">[new_A]</tt> = <tt class="varname">[M]</tt>+<tt class="varname">[A]</tt></li></ol></div><p>
-     else
-      </p><div class="orderedlist"><ol type="A"><li><tt class="varname">[new_A]</tt> = <tt class="varname">[M]</tt></li><li><tt class="varname">[new_M]</tt> = <tt class="varname">[M]</tt>-<tt class="varname">[A]</tt></li></ol></div><p>
-     </p></li></ol></div><p>
-   </p></li><li>set scalar value <tt class="varname">[M]</tt> in vector <tt class="varname">[magnitude_vector]</tt> to <tt class="varname">[new_M]</tt></li><li>set scalar value <tt class="varname">[A]</tt> in vector <tt class="varname">[angle_vector]</tt> to <tt class="varname">[new_A]</tt></li></ol></div></li></ol></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4785785"></a>4.3.6. dot product</h4></div></div><div></div></div><p>
-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 class="varname">[n]</tt>/2.</p><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 of the floor and residue vectors for each channel; the produced
-vectors are the length <tt class="varname">[n]</tt>/2 audio spectrum for each
-channel.</p><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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4741147"></a>4.3.7. inverse MDCT</h4></div></div><div></div></div><p>
-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" target="_top">&#8220;<span class="citetitle">The
-use of multirate filter banks for coding of high quality digital
-audio</span>&#8221;</a>, by T. Sporer, K. Brandenburg and B. Edler.  The window
-function used for the MDCT is the function described earlier.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4747516"></a>4.3.8. overlap_add</h4></div></div><div></div></div><p>
-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-window" title="1.3.2.3. Window shape decode (long windows only)">Section 1.3.2.3, &#8220;Window shape decode (long windows only)&#8221;</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 does 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><pre class="programlisting">
-window_blocksize(previous_window)/4+window_blocksize(current_window)/4
-</pre><p>
-
-from the center (element windowsize/2) of the previous window to the
-center (element windowsize/2-1, inclusive) of the current window.</p><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4785865"></a>4.3.9. output channel order</h4></div></div><div></div></div><p>
-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><div class="variablelist"><dl><dt><span class="term">one channel</span></dt><dd>the stream is monophonic</dd><dt><span class="term">two channels</span></dt><dd>the stream is stereo.  channel order: left, right</dd><dt><span class="term">three channels</span></dt><dd>the stream is a 1d-surround encoding.  channel order: left,
-center, right</dd><dt><span class="term">four channels</span></dt><dd>the stream is quadraphonic surround.  channel order: front left,
-front right, rear left, rear right</dd><dt><span class="term">five channels</span></dt><dd>the stream is five-channel surround.  channel order: front left,
-front center, front right, rear left, rear right</dd><dt><span class="term">six channels</span></dt><dd>the stream is 5.1 surround.  channel order: front left, front
-center, front right, rear left, rear right, LFE</dd><dt><span class="term">greater than six channels</span></dt><dd>channel use and order is defined by the application</dd></dl></div><p>
-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/" target="_top">Ambisonics</a>) will
-make use of channel mappings other than mapping 0.</p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-comment"></a>5. comment field and header specification</h2></div><div><p class="releaseinfo">
- $Id: 05-comment.xml 6494 2004-04-06 21:18:53Z giles $
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4744840"></a>5.1. Overview</h3></div></div><div></div></div><p>The Vorbis text comment header is the second (of three) header
-packets that begin a Vorbis bitstream. It is meant for short text
-comments, not arbitrary metadata; arbitrary metadata belongs in a
-separate logical bitstream (usually an XML stream type) that provides
-greater structure and machine parseability.</p><p>The comment field is meant to be used much like someone jotting a
-quick note on the bottom of a CDR. It should be a little information to
-remember the disc by and explain it to others; a short, to-the-point
-text note that need not only be a couple words, but isn't going to be
-more than a short paragraph.  The essentials, in other words, whatever
-they turn out to be, eg:
-
-</p><div class="blockquote"><blockquote class="blockquote"><p>Honest Bob and the Factory-to-Dealer-Incentives, <i class="citetitle">I'm Still
-Around</i>, opening for Moxy Früvous, 1997.</p></blockquote></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4744873"></a>5.2. Comment encoding</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4744877"></a>5.2.1. Structure</h4></div></div><div></div></div><p>
-The comment header is logically a list of eight-bit-clean vectors; the
-number of vectors is bounded to 2^32-1 and the length of each vector
-is limited to 2^32-1 bytes. The vector length is encoded; the vector
-contents themselves are not null terminated. In addition to the vector
-list, there is a single vector for vendor name (also 8 bit clean,
-length encoded in 32 bits). The 1.0 release of libvorbis sets the 
-vendor string to "Xiph.Org libVorbis I 20020717".</p><p>The comment header is decoded as follows:
-
-</p><pre class="programlisting">
-  1) [vendor_length] = read an unsigned integer of 32 bits
-  2) [vendor_string] = read a UTF-8 vector as [vendor_length] octets
-  3) [user_comment_list_length] = read an unsigned integer of 32 bits
-  4) iterate [user_comment_list_length] times {
-       5) [length] = read an unsigned integer of 32 bits
-       6) this iteration's user comment = read a UTF-8 vector as [length] octets
-     }
-  7) [framing_bit] = read a single bit as boolean
-  8) if ( [framing_bit] unset or end-of-packet ) then ERROR
-  9) done.
-</pre><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4778631"></a>5.2.2. Content vector format</h4></div></div><div></div></div><p>
-The comment vectors are structured similarly to a UNIX environment variable.
-That is, comment fields consist of a field name and a corresponding value and
-look like:</p><div class="blockquote"><blockquote class="blockquote"><pre class="programlisting">
-comment[0]="ARTIST=me"; 
-comment[1]="TITLE=the sound of Vorbis"; 
-</pre></blockquote></div><p>
-The field name is case-insensitive and may consist of ASCII 0x20
-through 0x7D, 0x3D ('=') excluded. ASCII 0x41 through 0x5A inclusive
-(characters A-Z) is to be considered equivalent to ASCII 0x61 through 
-0x7A inclusive (characters a-z).
-</p><p>
-The field name is immediately followed by ASCII 0x3D ('=');
-this equals sign is used to terminate the field name.
-</p><p>
-0x3D is followed by 8 bit clean UTF-8 encoded value of the
-field contents to the end of the field.
-</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4777217"></a>5.2.2.1. Field names</h5></div></div><div></div></div><p>Below is a proposed, minimal list of standard field names with a
-description of intended use.  No single or group of field names is
-mandatory; a comment header may contain one, all or none of the names
-in this list.</p><div class="variablelist"><dl><dt><span class="term">TITLE</span></dt><dd>Track/Work name</dd><dt><span class="term">VERSION</span></dt><dd>The version field may be used to
-differentiate multiple
-versions of the same track title in a single collection. (e.g. remix
-info)
-</dd><dt><span class="term">ALBUM</span></dt><dd>The collection name to which this track belongs
-</dd><dt><span class="term">TRACKNUMBER</span></dt><dd>The track number of this piece if part of a specific larger collection or album
-</dd><dt><span class="term">ARTIST</span></dt><dd>The artist generally considered responsible for the work. In popular music this is usually the performing band or singer. For classical music it would be the composer. For an audio book it would be the author of the original text.
-</dd><dt><span class="term">PERFORMER</span></dt><dd>The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists. In an audio book it would be the actor who did the reading. In popular music this is typically the same as the ARTIST and is omitted.
-</dd><dt><span class="term">COPYRIGHT</span></dt><dd>Copyright attribution, e.g., '2001 Nobody's Band' or '1999 Jack Moffitt'
-</dd><dt><span class="term">LICENSE</span></dt><dd>License information, eg, 'All Rights Reserved', 'Any
-Use Permitted', a URL to a license such as a Creative Commons license
-("www.creativecommons.org/blahblah/license.html") or the EFF Open
-Audio License ('distributed under the terms of the Open Audio
-License. see http://www.eff.org/IP/Open_licenses/eff_oal.html for
-details'), etc.
-</dd><dt><span class="term">ORGANIZATION</span></dt><dd>Name of the organization producing the track (i.e.
-the 'record label')
-</dd><dt><span class="term">DESCRIPTION</span></dt><dd>A short text description of the contents
-</dd><dt><span class="term">GENRE</span></dt><dd>A short text indication of music genre
-</dd><dt><span class="term">DATE</span></dt><dd>Date the track was recorded
-</dd><dt><span class="term">LOCATION</span></dt><dd>Location where track was recorded
-</dd><dt><span class="term">CONTACT</span></dt><dd>Contact information for the creators or distributors of the track. This could be a URL, an email address, the physical address of the producing label.
-</dd><dt><span class="term">ISRC</span></dt><dd>International Standard Recording Code for the
-track; see <a href="http://www.ifpi.org/site-content/online/isrc_intro.html" target="_top">the ISRC
-intro page</a> for more information on ISRC numbers.
-</dd></dl></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id4740104"></a>5.2.2.2. Implications</h5></div></div><div></div></div><p>Field names should not be 'internationalized'; this is a
-concession to simplicity not an attempt to exclude the majority of
-the world that doesn't speak English. Field <span class="emphasis"><em>contents</em></span>
-however, use the UTF-8 character encoding to allow easy representation of any
-language.</p><p>We have the length of the entirety of the field and restrictions on
-the field name so that the field name is bounded in a known way. Thus
-we also have the length of the field contents.</p><p>Individual 'vendors' may use non-standard field names within
-reason. The proper use of comment fields should be clear through
-context at this point.  Abuse will be discouraged.</p><p>There is no vendor-specific prefix to 'nonstandard' field names.
-Vendors should make some effort to avoid arbitrarily polluting the
-common namespace. We will generally collect the more useful tags
-here to help with standardization.</p><p>Field names are not required to be unique (occur once) within a
-comment header.  As an example, assume a track was recorded by three
-well know artists; the following is permissible, and encouraged:
-
-</p><div class="blockquote"><blockquote class="blockquote"><pre class="programlisting">
-ARTIST=Dizzy Gillespie 
-ARTIST=Sonny Rollins 
-ARTIST=Sonny Stitt 
-</pre></blockquote></div><p>
-
-</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4740153"></a>5.2.3. Encoding</h4></div></div><div></div></div><p>
-The comment header comprises the entirety of the second bitstream
-header packet.  Unlike the first bitstream header packet, it is not
-generally the only packet on the second page and may not be restricted
-to within the second bitstream page.  The length of the comment header
-packet is (practically) unbounded.  The comment header packet is not
-optional; it must be present in the bitstream even if it is
-effectively empty.</p><p>
-The comment header is encoded as follows (as per Ogg's standard
-bitstream mapping which renders least-significant-bit of the word to be
-coded into the least significant available bit of the current
-bitstream octet first):
-
-</p><div class="orderedlist"><ol type="1"><li>
-  Vendor string length (32 bit unsigned quantity specifying number of octets)
- </li><li>
-  Vendor string ([vendor string length] octets coded from beginning of string to end of string, not null terminated)
- </li><li>
-  Number of comment fields (32 bit unsigned quantity specifying number of fields)
- </li><li>
-  Comment field 0 length (if [Number of comment fields]&gt;0; 32 bit unsigned quantity specifying number of octets)
- </li><li>
-  Comment field 0 ([Comment field 0 length] octets coded from beginning of string to end of string, not null terminated)
- </li><li>
-  Comment field 1 length (if [Number of comment fields]&gt;1...)...
- </li></ol></div><p>
-</p><p>
-This is actually somewhat easier to describe in code; implementation of the above can be found in <tt class="filename">vorbis/lib/info.c</tt>, <tt class="function">_vorbis_pack_comment()</tt> and <tt class="function">_vorbis_unpack_comment()</tt>.
-</p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-floor0"></a>6. Floor type 0 setup and decode</h2></div><div><p class="releaseinfo">
-  $Id: 06-floor0.xml 6494 2004-04-06 21:18:53Z giles $
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4728756"></a>6.1. Overview</h3></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4759457"></a>6.2. Floor 0 format</h3></div></div><div></div></div><p>
-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><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4747605"></a>6.2.1. header decode</h4></div></div><div></div></div><p>
-Configuration information for instances of floor zero decodes from the
-codec setup header (third packet).  configuration decode proceeds as
-follows:</p><pre class="screen">
-  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><p>
-An end-of-packet condition during any of these bitstream reads renders
-this stream undecodable.  In addition, any element of the array
-<tt class="varname">[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.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-floor0-decode"></a>6.2.2. packet decode</h4></div></div><div></div></div><p>
-Extracting a floor0 curve from an audio packet consists of first
-decoding the curve amplitude and <tt class="varname">[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><p>
-Packet decode proceeds as follows:</p><pre class="screen">
-  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="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>( [floor0_number_of_books] ) bits
-       5) if ( [booknumber] is greater than the highest number decode codebook ) then packet is undecodable
-       6) [last] = 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><p>
-Take note of the following properties of decode:
-</p><div class="itemizedlist"><ul type="disc"><li>An <tt class="varname">[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.</li><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 class="varname">[amplitude]</tt> value had read zero at the beginning of decode.</li><li>The book number used for decode
-can, in fact, be stored in the bitstream in <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>( <tt class="varname">[floor0_number_of_books]</tt> -
-1 ) bits.  Nevertheless, the above specification is correct and values
-greater than the maximum possible book value are reserved.</li><li>The number of scalars read into the vector <tt class="varname">[coefficients]</tt>
-may be greater than <tt class="varname">[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 class="varname">[codebook_dimensions]</tt> value of three and
-<tt class="varname">[floor0_order]</tt> is ten, the only way to fill all the needed
-scalars in <tt class="varname">[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.</li></ul></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-floor0-synth"></a>6.2.3. curve computation</h4></div></div><div></div></div><p>
-Given an <tt class="varname">[amplitude]</tt> integer and <tt class="varname">[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 class="varname">[n]</tt> specified by the decode process, we compute a
-floor output vector.</p><p>
-If the value <tt class="varname">[amplitude]</tt> is zero, the return value is a
-length <tt class="varname">[n]</tt> vector with all-zero scalars.  Otherwise, begin by
-assuming the following definitions for the given vector to be
-synthesized:</p><div class="informalequation"><div class="mediaobject"><img src="lspmap.png" alt="[lsp map equation]"></div></div><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 <tt class="varname">[output]</tt> on a log
-(dB) amplitude scale, mapping it to linear amplitude in the last step:</p><div class="orderedlist"><ol type="1"><li> <tt class="varname">[i]</tt> = 0 </li><li><p>if ( <tt class="varname">[floor0_order]</tt> is odd ) {
-  </p><div class="orderedlist"><ol type="a"><li><p>calculate <tt class="varname">[p]</tt> and <tt class="varname">[q]</tt> according to:
-        </p><div class="informalequation"><div class="mediaobject"><img src="oddlsp.png" alt="[equation for odd lsp]"></div></div><p>
-   </p></li></ol></div><p>
-  } else <tt class="varname">[floor0_order]</tt> is even {
-  </p><div class="orderedlist"><ol type="a"><li><p>calculate <tt class="varname">[p]</tt> and <tt class="varname">[q]</tt> according to:
-        </p><div class="informalequation"><div class="mediaobject"><img src="evenlsp.png" alt="[equation for even lsp]"></div></div><p>
-   </p></li></ol></div><p> 
-  }
- </p></li><li><p>calculate <tt class="varname">[linear_floor_value]</tt> according to:
-     </p><div class="informalequation"><div class="mediaobject"><img src="floorval.png" alt="[expression for floorval]"></div></div><p>
- </p></li><li><tt class="varname">[iteration_condition]</tt> = map element <tt class="varname">[i]</tt></li><li><tt class="varname">[output]</tt> element <tt class="varname">[i]</tt> = <tt class="varname">[linear_floor_value]</tt></li><li>increment <tt class="varname">[i]</tt></li><li>if ( map element <tt class="varname">[i]</tt> is equal to <tt class="varname">[iteration_condition]</tt> ) continue at step 5</li><li>if ( <tt class="varname">[i]</tt> is less than <tt class="varname">[n]</tt> ) continue at step 2</li><li>done</li></ol></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-floor1"></a>7. Floor type 1 setup and decode</h2></div><div><p class="releaseinfo">
- $Id: 07-floor1.xml 6494 2004-04-06 21:18:53Z giles $
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4730723"></a>7.1. Overview</h3></div></div><div></div></div><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4755904"></a>7.2. Floor 1 format</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4771088"></a>7.2.1. model</h4></div></div><div></div></div><p>
-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><div class="itemizedlist"><ul type="disc"><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.</li><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.</li><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.</li><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.</li></ul></div><p>
-Consider the following example, with values chosen for ease of
-understanding rather than representing typical configuration:</p><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><div class="mediaobject"><img src="floor1-1.png" alt="[graph of example floor]"></div><p>
-We now draw new logical lines to reflect the correction to new_Y, and
-iterate for X positions 32 and 96:</p><div class="mediaobject"><img src="floor1-2.png" alt="[graph of example floor]"></div><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><div class="mediaobject"><img src="floor1-3.png" alt="[graph of example floor]"></div><div class="mediaobject"><img src="floor1-4.png" alt="[graph of example floor]"></div><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4769190"></a>7.2.2. header decode</h4></div></div><div></div></div><p>
-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><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 class="screen">
-
-  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) increment [floor1_values] by one
-           }
-     }
- 
- 23) done
-</pre><p>
-An end-of-packet condition while reading any aspect of a floor 1
-configuration during setup renders a stream undecodable.  In
-addition, a <tt class="varname">[floor1_class_masterbooks]</tt> or
-<tt class="varname">[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><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-floor1-decode"></a>7.2.2.1. packet decode</h5></div></div><div></div></div><p>
-Packet decode begins by checking the <tt class="varname">[nonzero]</tt> flag:</p><pre class="screen">
-  1) [nonzero] = read 1 bit as boolean
-</pre><p>
-If <tt class="varname">[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).
-</p><p>
-Assuming <tt class="varname">[nonzero]</tt> is set, decode proceeds as follows:</p><pre class="screen">
-  1) [range] = vector { 256, 128, 86, 64 } element ([floor1_multiplier]-1)
-  2) vector [floor1_Y] element [0] = read <a href="#vorbis-spec-ilog" title="9.2.1. ilog">ilog</a>([range]-1) bits as unsigned integer
-  3) vector [floor1_Y] element [1] = read <a href="#vorbis-spec-ilog" title="9.2.1. 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><p>
-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 class="varname">[nonzero]</tt> flag had been unset at the beginning of decode.
-</p><p>
-Vector <tt class="varname">[floor1_Y]</tt> contains the values from packet decode
-needed for floor 1 synthesis.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-floor1-synth"></a>7.2.2.2. curve computation</h5></div></div><div></div></div><p>
-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><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><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="id4786569"></a>7.2.2.2.1. step 1: amplitude value synthesis</h6></div></div><div></div></div><p>
-Unwrap the always-positive-or-zero values read from the packet into
-+/- difference values, then apply to line prediction.</p><pre class="screen">
-  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="#vorbis-spec-low_neighbor" title="9.2.4. low_neighbor">low_neighbor</a>([floor1_X_list],[i])
-       8) [high_neighbor_offset] = <a href="#vorbis-spec-high_neighbor" title="9.2.4.1. high_neighbor">high_neighbor</a>([floor1_X_list],[i])
-
-       9) [predicted] = <a href="#vorbis-spec-render_point" title="9.2.4.2. 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 ( [highroom] is greater than [lowroom] ) {
-
-                        22) vector [floor1_final_Y] element [i] = [val] - [lowroom] + [predicted]
-		     
-		      } else [highroom] is not greater than [lowroom] {
-              
-                        23) vector [floor1_final_Y] element [i] = [predicted] - [val] + [highroom] - 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></div><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="id4760406"></a>7.2.2.2.2. step 2: curve synthesis</h6></div></div><div></div></div><p>
-Curve synthesis generates a return vector <tt class="varname">[floor]</tt> of length
-<tt class="varname">[n]</tt> (where <tt class="varname">[n]</tt> is provided by the decode process
-calling to floor decode).  Floor 1 curve synthesis makes use of the
-<tt class="varname">[floor1_X_list]</tt>, <tt class="varname">[floor1_final_Y]</tt> and
-<tt class="varname">[floor1_step2_flag]</tt> vectors, as well as [floor1_multiplier]
-and [floor1_values] values.</p><p>
-Decode begins by sorting the scalars from vectors
-<tt class="varname">[floor1_X_list]</tt>, <tt class="varname">[floor1_final_Y]</tt> and
-<tt class="varname">[floor1_step2_flag]</tt> together into new vectors
-<tt class="varname">[floor1_X_list]'</tt>, <tt class="varname">[floor1_final_Y]'</tt> and
-<tt class="varname">[floor1_step2_flag]'</tt> according to ascending sort order of the
-values in <tt class="varname">[floor1_X_list]</tt>.  That is, sort the values of
-<tt class="varname">[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><p>
-Then compute the final curve in one pass:</p><pre class="screen">
-  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="#vorbis-spec-render_line" title="9.2.4.3. 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="#vorbis-spec-render_line" title="9.2.4.3. 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="#vorbis-spec-floor1_inverse_dB_table" title="10.1. floor1_inverse_dB_table">[floor1_inverse_dB_static_table]</a>
-
- 16) done
-
-</pre></div></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-residue"></a>8. Residue setup and decode</h2></div><div><p class="releaseinfo">
-  $Id: 08-residue.xml 6494 2004-04-06 21:18:53Z giles $
- </p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4764751"></a>8.1. Overview</h3></div></div><div></div></div><p>
-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><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></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4767416"></a>8.2. Residue format</h3></div></div><div></div></div><p>
-Residue 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 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><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><div class="itemizedlist"><ul type="disc"><li><p>Each vector is partitioned into multiple equal sized chunks
-according to configuration specified.  If we have a vector size of
-<span class="emphasis"><em>n</em></span>, a partition size <span class="emphasis"><em>residue_partition_size</em></span>, and a total
-of <span class="emphasis"><em>ch</em></span> residue vectors, the total number of partitioned chunks
-coded is <span class="emphasis"><em>n</em></span>/<span class="emphasis"><em>residue_partition_size</em></span>*<span class="emphasis"><em>ch</em></span>.  It is
-important to note that the integer division truncates.  In the below
-example, we assume an example <span class="emphasis"><em>residue_partition_size</em></span> of 8.</p></li><li><p>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><li><p>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></li></ul></div><div class="mediaobject"><img src="residue-pack.png" alt="[illustration of residue vector format]"></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4743000"></a>8.3. residue 0</h3></div></div><div></div></div><p>
-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><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><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 class="programlisting">
-
-            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><p>
-It is worth mentioning at this point that no configurable value in the
-residue coding setup is restricted to a power of two.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4786178"></a>8.4. residue 1</h3></div></div><div></div></div><p>
-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.</p><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 class="programlisting">
-
-            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></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4786205"></a>8.5. residue 2</h3></div></div><div></div></div><p>
-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 <span class="emphasis"><em>ch</em></span> passed in vectors of length <span class="emphasis"><em>n</em></span> are first
-interleaved and flattened into a single vector of length
-<span class="emphasis"><em>ch</em></span>*<span class="emphasis"><em>n</em></span>.  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><div class="mediaobject"><img src="residue2.png" alt="[illustration of residue type 2]"></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4743118"></a>8.6. Residue decode</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4782440"></a>8.6.1. header decode</h4></div></div><div></div></div><p>
-Header decode for all three residue types is identical.</p><pre class="programlisting">
-  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><p>
-<tt class="varname">[residue_begin]</tt> and <tt class="varname">[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 class="varname">[residue_begin]</tt> and ends at
-<tt class="varname">[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 class="varname">[residue_partition_size]</tt>apply to the interleaved
-vector, not the individual vectors before interleave.
-<tt class="varname">[residue_partition_size]</tt> is as explained above,
-<tt class="varname">[residue_classifications]</tt> is the number of possible
-classification to which a partition can belong and
-<tt class="varname">[residue_classbook]</tt> is the codebook number used to code
-classification codewords.  The number of dimensions in book
-<tt class="varname">[residue_classbook]</tt> determines how many classification values
-are grouped into a single classification codeword.</p><p>
-Next we read a bitmap pattern that specifies which partition classes
-code values in which passes.</p><pre class="programlisting">
-  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><p>
-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 class="programlisting">
-  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><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4782543"></a>8.6.2. packet decode</h4></div></div><div></div></div><p>
-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><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><p>
-The following convenience values are conceptually useful to clarifying
-the decode process:</p><pre class="programlisting">
-  1) [classwords_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><p>
-Packet decode proceeds as follows, matching the description offered earlier in the document.  We assume that the number of vectors being encoded, <tt class="varname">[ch]</tt> is provided by the higher level decoding process.</p><pre class="programlisting">
-  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 [i] descending over the range [classwords_per_codeword]-1 ... 0 {
-
-                           9) array [classifications] element [j],([i]+[partition_count]) =
-                              [temp] integer modulo [residue_classifications]
-                          10) [temp] = [temp] / [residue_classifications] using integer division
-
-                         }
-      
-                    }
-            
-               }
-        
-          }
-
-      11) iterate [i] over the range 0 .. ([classwords_per_codeword] - 1) while [partition_count] 
-          is also less than [partitions_to_read] {
-
-            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]
-                      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 [partition_count] by one
-
-          }
-     }
- 
- 19) done
-
-</pre><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4784514"></a>8.6.3. format 0 specifics</h4></div></div><div></div></div><p>
-Format zero decodes partitions exactly as described earlier in the
-'Residue Format: residue 0' section.  The following pseudocode
-presents the same algorithm. Assume:</p><div class="itemizedlist"><ul type="disc"><li> <tt class="varname">[n]</tt> is the value in <tt class="varname">[residue_partition_size]</tt></li><li><tt class="varname">[v]</tt> is the residue vector</li><li><tt class="varname">[offset]</tt> is the beginning read offset in [v]</li></ul></div><pre class="programlisting">
- 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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4784562"></a>8.6.4. format 1 specifics</h4></div></div><div></div></div><p>
-Format 1 decodes partitions exactly as described earlier in the
-'Residue Format: residue 1' section.  The following pseudocode
-presents the same algorithm. Assume:</p><div class="itemizedlist"><ul type="disc"><li> <tt class="varname">[n]</tt> is the value in
-<tt class="varname">[residue_partition_size]</tt></li><li><tt class="varname">[v]</tt> is the residue vector</li><li><tt class="varname">[offset]</tt> is the beginning read offset in [v]</li></ul></div><pre class="programlisting">
- 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 {
-
-      4) vector [v] element ([offset]+[i]) =
-	  vector [v] element ([offset]+[i]) +
-          vector [entry_temp] element [j]
-      5) increment [i]
-
-    }
- 
-  6) if ( [i] is less than [n] ) continue at step 2
-  7) done
-</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4784608"></a>8.6.5. format 2 specifics</h4></div></div><div></div></div><p>
-Format 2 is reducible to format 1.  It may be implemented as an additional step prior to and an additional post-decode step after a normal format 1 decode.
-</p><p>
-Format 2 handles 'do not decode' vectors differently than 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.  We then request normal format 1 to decode a single vector
-representing all output channels, rather than a vector for each
-channel.  After decode, deinterleave the vector into independent vectors, one for each output channel.  That is:</p><div class="orderedlist"><ol type="1"><li>If all vectors 0 through <span class="emphasis"><em>ch</em></span>-1 are marked 'do not decode', allocate and clear a single vector <tt class="varname">[v]</tt>of length <span class="emphasis"><em>ch*n</em></span> and skip step 2 below; proceed directly to the post-decode step.</li><li>Rather than performing format 1 decode to produce <span class="emphasis"><em>ch</em></span> vectors of length <span class="emphasis"><em>n</em></span> each, call format 1 decode to produce a single vector <tt class="varname">[v]</tt> of length <span class="emphasis"><em>ch*n</em></span>. </li><li><p>Post decode: Deinterleave the single vector <tt class="varname">[v]</tt> returned by format 1 decode as described above into <span class="emphasis"><em>ch</em></span> independent vectors, one for each outputchannel, according to:
-  </p><pre class="programlisting">
-  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 [v] element ([i] * [ch] + [j])
-
-          }
-     }
-
-  4) done
-  </pre><p>
- </p></li></ol></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-helper"></a>9. Helper equations</h2></div><div><p class="releaseinfo">
- $Id: 09-helper.xml 6494 2004-04-06 21:18:53Z giles $
-</p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4737644"></a>9.1. Overview</h3></div></div><div></div></div><p>
-The equations below are used in multiple places by the Vorbis codec
-specification.  Rather than cluttering up the main specification
-documents, they are defined here and referenced where appropriate.
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4743986"></a>9.2. Functions</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-ilog"></a>9.2.1. ilog</h4></div></div><div></div></div><p>
-The "ilog(x)" function returns the position number (1 through n) of the highest set bit in the two's complement integer value
-<tt class="varname">[x]</tt>.  Values of <tt class="varname">[x]</tt> less than zero are defined to return zero.</p><pre class="programlisting">
-  1) [return_value] = 0;
-  2) if ( [x] is greater than zero ){
-      
-       3) increment [return_value];
-       4) logical shift [x] one bit to the right, padding the MSb with zero
-       5) repeat at step 2)
-
-     }
-
-   6) done
-</pre><p>
-Examples:
-
-</p><div class="itemizedlist"><ul type="disc"><li>ilog(0) = 0;</li><li>ilog(1) = 1;</li><li>ilog(2) = 2;</li><li>ilog(3) = 2;</li><li>ilog(4) = 3;</li><li>ilog(7) = 3;</li><li>ilog(negative number) = 0;</li></ul></div><p>
-</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-float32_unpack"></a>9.2.2. float32_unpack</h4></div></div><div></div></div><p>
-"float32_unpack(x)" is intended to translate the packed binary
-representation of a Vorbis codebook float value into the
-representation used by the decoder for floating point numbers.  For
-purposes of this example, we will unpack a Vorbis float32 into a
-host-native floating point number.</p><pre class="programlisting">
-  1) [mantissa] = [x] bitwise AND 0x1fffff (unsigned result)
-  2) [sign] = [x] bitwise AND 0x80000000 (unsigned result)
-  3) [exponent] = ( [x] bitwise AND 0x7fe00000) shifted right 21 bits (unsigned result)
-  4) if ( [sign] is nonzero ) then negate [mantissa]
-  5) return [mantissa] * ( 2 ^ ( [exponent] - 788 ) )
-</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-lookup1_values"></a>9.2.3. lookup1_values</h4></div></div><div></div></div><p>
-"lookup1_values(codebook_entries,codebook_dimensions)" is used to
-compute the correct length of the value index for a codebook VQ lookup
-table of lookup type 1.  The values on this list are permuted to
-construct the VQ vector lookup table of size
-<tt class="varname">[codebook_entries]</tt>.</p><p>
-The return value for this function is defined to be 'the greatest
-integer value for which <tt class="varname">[return_value] to the power of
-[codebook_dimensions] is less than or equal to
-[codebook_entries]</tt>'.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="vorbis-spec-low_neighbor"></a>9.2.4. low_neighbor</h4></div></div><div></div></div><p>
-"low_neighbor(v,x)" finds the position <tt class="varname">n</tt> in vector <tt class="varname">[v]</tt> of
-the greatest value scalar element for which <tt class="varname">n</tt> is less than
-<tt class="varname">[x]</tt> and vector <tt class="varname">[v]</tt> element <tt class="varname">n</tt> is less
-than vector <tt class="varname">[v]</tt> element <tt class="varname">[x]</tt>.</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-high_neighbor"></a>9.2.4.1. high_neighbor</h5></div></div><div></div></div><p>
-"high_neighbor(v,x)" finds the position <tt class="varname">n</tt> in vector [v] of
-the lowest value scalar element for which <tt class="varname">n</tt> is less than
-<tt class="varname">[x]</tt> and vector <tt class="varname">[v]</tt> element <tt class="varname">n</tt> is greater
-than vector <tt class="varname">[v]</tt> element <tt class="varname">[x]</tt>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-render_point"></a>9.2.4.2. render_point</h5></div></div><div></div></div><p>
-"render_point(x0,y0,x1,y1,X)" is used to find the Y value at point X
-along the line specified by x0, x1, y0 and y1.  This function uses an
-integer algorithm to solve for the point directly without calculating
-intervening values along the line.</p><pre class="programlisting">
-  1)  [dy] = [y1] - [y0]
-  2) [adx] = [x1] - [x0]
-  3) [ady] = absolute value of [dy]
-  4) [err] = [ady] * ([X] - [x0])
-  5) [off] = [err] / [adx] using integer division
-  6) if ( [dy] is less than zero ) {
-
-       7) [Y] = [y0] - [off]
-
-     } else {
-
-       8) [Y] = [y0] + [off]
-  
-     }
-
-  9) done
-</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="vorbis-spec-render_line"></a>9.2.4.3. render_line</h5></div></div><div></div></div><p>
-Floor decode type one uses the integer line drawing algorithm of
-"render_line(x0, y0, x1, y1, v)" to construct an integer floor
-curve for contiguous piecewise line segments. Note that it has not
-been relevant elsewhere, but here we must define integer division as
-rounding division of both positive and negative numbers toward zero.
-</p><pre class="programlisting">
-  1)   [dy] = [y1] - [y0]
-  2)  [adx] = [x1] - [x0]
-  3)  [ady] = absolute value of [dy]
-  4) [base] = [dy] / [adx] using integer division
-  5)    [x] = [x0]
-  6)    [y] = [y0]
-  7)  [err] = 0
-
-  8) if ( [dy] is less than 0 ) {
-
-        9) [sy] = [base] - 1
-
-     } else {
-
-       10) [sy] = [base] + 1
-
-     }
-
- 11) [ady] = [ady] - (absolute value of [base]) * [adx]
- 12) vector [v] element [x] = [y]
-
- 13) iterate [x] over the range [x0]+1 ... [x1]-1 {
-
-       14) [err] = [err] + [ady];
-       15) if ( [err] &gt;= [adx] ) {
-
-             16) [err] = [err] - [adx]
-             17)   [y] = [y] + [sy]
-
-           } else {
-
-             18) [y] = [y] + [base]
-   
-           }
-
-       19) vector [v] element [x] = [y]
-
-     }
-</pre></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="vorbis-spec-tables"></a>10. Tables</h2></div><div><p class="releaseinfo">
-  $Id: 10-tables.xml 6494 2004-04-06 21:18:53Z giles $
- </p></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="vorbis-spec-floor1_inverse_dB_table"></a>10.1. floor1_inverse_dB_table</h3></div></div><div></div></div><p>
-The vector <tt class="varname">[floor1_inverse_dB_table]</tt> is a 256 element static
-lookup table consiting of the following values (read left to right
-then top to bottom):</p><pre class="screen">
-  1.0649863e-07, 1.1341951e-07, 1.2079015e-07, 1.2863978e-07, 
-  1.3699951e-07, 1.4590251e-07, 1.5538408e-07, 1.6548181e-07, 
-  1.7623575e-07, 1.8768855e-07, 1.9988561e-07, 2.1287530e-07, 
-  2.2670913e-07, 2.4144197e-07, 2.5713223e-07, 2.7384213e-07, 
-  2.9163793e-07, 3.1059021e-07, 3.3077411e-07, 3.5226968e-07, 
-  3.7516214e-07, 3.9954229e-07, 4.2550680e-07, 4.5315863e-07, 
-  4.8260743e-07, 5.1396998e-07, 5.4737065e-07, 5.8294187e-07, 
-  6.2082472e-07, 6.6116941e-07, 7.0413592e-07, 7.4989464e-07, 
-  7.9862701e-07, 8.5052630e-07, 9.0579828e-07, 9.6466216e-07, 
-  1.0273513e-06, 1.0941144e-06, 1.1652161e-06, 1.2409384e-06, 
-  1.3215816e-06, 1.4074654e-06, 1.4989305e-06, 1.5963394e-06, 
-  1.7000785e-06, 1.8105592e-06, 1.9282195e-06, 2.0535261e-06, 
-  2.1869758e-06, 2.3290978e-06, 2.4804557e-06, 2.6416497e-06, 
-  2.8133190e-06, 2.9961443e-06, 3.1908506e-06, 3.3982101e-06, 
-  3.6190449e-06, 3.8542308e-06, 4.1047004e-06, 4.3714470e-06, 
-  4.6555282e-06, 4.9580707e-06, 5.2802740e-06, 5.6234160e-06, 
-  5.9888572e-06, 6.3780469e-06, 6.7925283e-06, 7.2339451e-06, 
-  7.7040476e-06, 8.2047000e-06, 8.7378876e-06, 9.3057248e-06, 
-  9.9104632e-06, 1.0554501e-05, 1.1240392e-05, 1.1970856e-05, 
-  1.2748789e-05, 1.3577278e-05, 1.4459606e-05, 1.5399272e-05, 
-  1.6400004e-05, 1.7465768e-05, 1.8600792e-05, 1.9809576e-05, 
-  2.1096914e-05, 2.2467911e-05, 2.3928002e-05, 2.5482978e-05, 
-  2.7139006e-05, 2.8902651e-05, 3.0780908e-05, 3.2781225e-05, 
-  3.4911534e-05, 3.7180282e-05, 3.9596466e-05, 4.2169667e-05, 
-  4.4910090e-05, 4.7828601e-05, 5.0936773e-05, 5.4246931e-05, 
-  5.7772202e-05, 6.1526565e-05, 6.5524908e-05, 6.9783085e-05, 
-  7.4317983e-05, 7.9147585e-05, 8.4291040e-05, 8.9768747e-05, 
-  9.5602426e-05, 0.00010181521, 0.00010843174, 0.00011547824, 
-  0.00012298267, 0.00013097477, 0.00013948625, 0.00014855085, 
-  0.00015820453, 0.00016848555, 0.00017943469, 0.00019109536, 
-  0.00020351382, 0.00021673929, 0.00023082423, 0.00024582449, 
-  0.00026179955, 0.00027881276, 0.00029693158, 0.00031622787, 
-  0.00033677814, 0.00035866388, 0.00038197188, 0.00040679456, 
-  0.00043323036, 0.00046138411, 0.00049136745, 0.00052329927, 
-  0.00055730621, 0.00059352311, 0.00063209358, 0.00067317058, 
-  0.00071691700, 0.00076350630, 0.00081312324, 0.00086596457, 
-  0.00092223983, 0.00098217216, 0.0010459992,  0.0011139742, 
-  0.0011863665,  0.0012634633,  0.0013455702,  0.0014330129, 
-  0.0015261382,  0.0016253153,  0.0017309374,  0.0018434235, 
-  0.0019632195,  0.0020908006,  0.0022266726,  0.0023713743, 
-  0.0025254795,  0.0026895994,  0.0028643847,  0.0030505286, 
-  0.0032487691,  0.0034598925,  0.0036847358,  0.0039241906, 
-  0.0041792066,  0.0044507950,  0.0047400328,  0.0050480668, 
-  0.0053761186,  0.0057254891,  0.0060975636,  0.0064938176, 
-  0.0069158225,  0.0073652516,  0.0078438871,  0.0083536271, 
-  0.0088964928,  0.009474637,   0.010090352,   0.010746080, 
-  0.011444421,   0.012188144,   0.012980198,   0.013823725, 
-  0.014722068,   0.015678791,   0.016697687,   0.017782797, 
-  0.018938423,   0.020169149,   0.021479854,   0.022875735, 
-  0.024362330,   0.025945531,   0.027631618,   0.029427276, 
-  0.031339626,   0.033376252,   0.035545228,   0.037855157, 
-  0.040315199,   0.042935108,   0.045725273,   0.048696758, 
-  0.051861348,   0.055231591,   0.058820850,   0.062643361, 
-  0.066714279,   0.071049749,   0.075666962,   0.080584227, 
-  0.085821044,   0.091398179,   0.097337747,   0.10366330, 
-  0.11039993,    0.11757434,    0.12521498,    0.13335215, 
-  0.14201813,    0.15124727,    0.16107617,    0.17154380, 
-  0.18269168,    0.19456402,    0.20720788,    0.22067342, 
-  0.23501402,    0.25028656,    0.26655159,    0.28387361, 
-  0.30232132,    0.32196786,    0.34289114,    0.36517414, 
-  0.38890521,    0.41417847,    0.44109412,    0.46975890, 
-  0.50028648,    0.53279791,    0.56742212,    0.60429640, 
-  0.64356699,    0.68538959,    0.72993007,    0.77736504, 
-  0.82788260,    0.88168307,    0.9389798,     1.
-</pre></div></div><div class="appendix" lang="en"><h2 class="title" style="clear: both"><a name="vorbis-over-ogg"></a>A. Embedding Vorbis into an Ogg stream</h2><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4743952"></a>A.1. Overview</h3></div></div><div></div></div><p>
-This document describes using Ogg logical and physical transport
-streams to encapsulate Vorbis compressed audio packet data into file
-form.</p><p>
-The <a href="#vorbis-spec-intro" title="1. Introduction and Description">Section 1, &#8220;Introduction and Description&#8221;</a> provides an overview of the construction
-of Vorbis audio packets.</p><p>
-The <a href="oggstream.html" target="_top">Ogg
-bitstream overview</a> and <a href="framing.html" target="_top">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><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4733866"></a>A.1.1. Restrictions</h4></div></div><div></div></div><p>
-The Ogg/Vorbis I specification currently dictates that Ogg/Vorbis
-streams use Ogg transport streams in degenerate, unmultiplexed
-form only. That is:
-
-</p><div class="itemizedlist"><ul type="disc"><li>
-  A meta-headerless Ogg file encapsulates the Vorbis I packets
- </li><li>
-  The Ogg stream may be chained, i.e. contain multiple, contigous logical streams (links).
- </li><li>
-  The Ogg stream must be unmultiplexed (only one stream, a Vorbis audio stream, per link)
- </li></ul></div><p>
-</p><p>
-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></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id4734494"></a>A.1.2. MIME type</h4></div></div><div></div></div><p>
-The correct MIME type of any Ogg file is <tt class="literal">application/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 class="literal">audio/x-vorbis</tt> is also allowed.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4782005"></a>A.2. Encapsulation</h3></div></div><div></div></div><p>
-Ogg encapsulation of a Vorbis packet stream is straightforward.</p><div class="itemizedlist"><ul type="disc"><li>
-  The first Vorbis packet (the identification 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.
-</li><li>
-  This first page is marked 'beginning of stream' in the page flags.
-</li><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.
-</li><li>
-  The granule position of these first pages containing only headers is zero.
-</li><li>
-  The first audio packet of the logical stream begins a fresh Ogg page.
-</li><li>
-  Packets are placed into ogg pages in order until the end of stream.
-</li><li>
-  The last page is marked 'end of stream' in the page flags.
-</li><li>
-  Vorbis packets may span page boundaries.
-</li><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).
-</li><li>
-  The granule position of a page represents the end PCM sample
-  position of the last packet <span class="emphasis"><em>completed</em></span> 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'.
-</li><li><p>
-    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><div class="itemizedlist"><ul type="circle"><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.
-    </li><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.
-    </li></ul></div><p>
-    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><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
-    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></div></li><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.
- </li></ul></div></div></div><div class="appendix" lang="en"><h2 class="title" style="clear: both"><a name="vorbis-over-rtp"></a>B. Vorbis encapsulation in RTP</h2><pre class="literallayout">
-
-
-
-
-Network Working Group				               Phil Kerr
-Internet-Draft		 			    Ogg Vorbis Community
-June 10, 2003                                                  OpenDrama
-Expires: December 10, 2003      
-
-
-  	      RTP Payload Format for Vorbis Encoded Audio
-
-		   &lt;draft-kerr-avt-vorbis-rtp-02.txt&gt;
-
-Status of this Memo
-
-   This document is an Internet-Draft and is in full conformance
-   with all provisions of Section 10 of RFC2026.
-
-   Internet-Drafts are working documents of the Internet Engineering
-   Task Force (IETF), its areas, and its working groups.  Note that
-   other groups may also distribute working documents as
-   Internet-Drafts.
-
-   Internet-Drafts are draft documents valid for a maximum of six
-   months and may be updated, replaced, or obsoleted by other
-   documents at any time.  It is inappropriate to use Internet-
-   Drafts as reference material or to cite them other than as
-   "work in progress".
-
-   The list of current Internet-Drafts can be accessed at 
-   http://www.ietf.org/ietf/1id-abstracts.txt
-
-   The list of Internet-Draft Shadow Directories can be accessed at
-   http://www.ietf.org/shadow.html.
-
-Copyright Notice
-
-   Copyright (C) The Internet Society (2003).  All Rights Reserved.
-
-Abstract
-	
-   This document describes a RTP payload format for transporting 
-   Vorbis encoded audio.  It details the RTP encapsulation mechanism 
-   for raw Vorbis data and details the delivery mechanisms for the 
-   decoder probability model, referred to as a codebook, metadata 
-   and other setup information.
-
-
-
-
-
-
-
-
-
-
-
-
-Kerr                     Expires December 10, 2003              [Page 1]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-Table of Contents
-
-   1.         Introduction ........................................    2
-   1.1        Terminology .........................................    3
-   2.         Payload Format ......................................    3
-   2.1        RTP Header ..........................................    3
-   2.2        Payload Header ......................................    4
-   2.3        Payload Data ........................................    5
-   2.4        Example RTP Packet ..................................    5
-   3.         Frame Packetizing ...................................    6
-   3.1        Example Fragmented Vorbis Packet ....................    6
-   3.2        Packet Loss .........................................    8
-   4.         Configuration Headers ...............................    8
-   4.1        RTCP Based Config Header Transmission ...............    9
-   4.2        Codebook Caching ....................................   11
-   5.         Session Description .................................   11
-   5.1        SDP Based Config Header Transmission ................   12
-   6.         IANA Considerations .................................   13
-   7.         Congestion Control ..................................   13
-   8.         Security Considerations .............................   14
-   9.         Acknowledgements ....................................   14
-   10.        Normative References ................................   14
-   10.1       Informative References ................................ 14
-   11.        Full Copyright Statement ............................   15
-   12.        Authors Address .....................................   15
-
-
-1 Introduction
-
-   The Xiph.org Foundation creates and defines codecs for use in 
-   multimedia that are not encumbered by patents and thus may be freely 
-   implemented by any individual or organization.
-
-   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 48k bits/sec 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).
-
-   Vorbis encoded audio is generally encapsulated within an Ogg format 
-   bitstream [1], which provides framing and synchronization.  For the 
-   purposes of RTP transport, this layer is unnecessary, and so raw 
-   Vorbis packets are used in the payload.
-
-
-
-
-
-Kerr                     Expires December 10, 2003              [Page 2]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-1.1 Terminology
-
-   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
-   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
-   document are to be interpreted as described in RFC 2119 [2].
-
-2 Payload Format
-
-   For RTP based transportation of Vorbis encoded audio the standard 
-   RTP header is followed by an 8 bit payload header, then the payload 
-   data.
-
-
-2.1 RTP Header
-
-     0                   1                   2                   3
-   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |V=2|P|X|  CC   |M|     PT      |       sequence number         |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                           timestamp                           |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |           synchronization source (SSRC) identifier            |
-   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-   |            contributing source (CSRC) identifiers             |
-   |                              ...                              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-
-   The RTP header begins with an octet of fields (V, P, X, and CC) to   
-   support specialized RTP uses (see [4] and [5] for details). For 
-   Vorbis RTP, the following values are used.
-
-   Version (V): 2 bits
-      This field identifies the version of RTP. The version
-      used by this specification is two (2).
-
-   Padding (P): 1 bit
-      If the padding bit is set, the packet contains one or more
-      additional padding octets at the end which are not part of
-      the payload.  P is set if the total packet size is less than 
-      the MTU.  
-
-   Extension (X): 1 bit
-      If the extension, X,  bit is set, the fixed header MUST be 
-      followed by exactly one header extension, with a format defined 
-      in Section 5.3.1. of [4], 
-
-   CSRC count (CC): 4 bits
-      The CSRC count contains the number of CSRC identifiers.
-
-
-
-Kerr                     Expires December 10, 2003              [Page 3]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-   Marker (M): 1 bit
-      Set to zero.  Audio silence suppression not used.  This conforms
-      to section 4.1 of [6].
-
-   Payload Type (PT): 7 bits
-      An RTP profile for a class of applications is expected to assign 
-      a payload type for this format, or a dynamically allocated 
-      payload type SHOULD be chosen which designates the payload as 
-      Vorbis.
-
-   Sequence number: 16 bits
-      The sequence number increments by one for each RTP data packet
-      sent, and may be used by the receiver to detect packet loss and
-      to restore packet sequence. This field is detailed further in
-      [3].
-
-   Timestamp: 32 bits
-      A timestamp representing the sampling time of the first sample of
-      the first Vorbis packet in the RTP packet.  The clock frequency 
-      MUST be set to the sample rate of the encoded audio data and is 
-      conveyed out-of-band.
-
-   SSRC/CSRC identifiers: 
-      These two fields, 32 bits each with one SSRC field and a maximum 
-      of 16 CSRC fields, are as defined in [3].  
-
-
-2.2 Payload Header
-
-   After the RTP Header section the next octet is the Payload Header.  
-   This octet is split into a number of bitfields detailing the format
-   of the following Payload Data packets.
-
-     0   1   2   3   4   5   6   7
-   +---+---+---+---+---+---+---+---+
-   | C | F | R |  # of packets     |
-   +---+---+---+---+---+---+---+---+
-
-   Continuation (C): 1 bit
-      Set to one if this is a continuation of a fragmented packet.
-
-   Fragmented (F): 1 bit
-      Set to one if the payload contains complete packets or if it
-      contains the last fragment of a fragmented packet. 
-
-   Reserved (R): 1 bit
-      Reserved, MUST be set to zero by senders, and ignored by 
-      receivers.
-
-   The last 5 bits are the number of complete packets in this payload.  
-   This provides for a maximum number of 32 Vorbis packets in the 
-   payload.  If C is set to one, this number SHOULD be 0.
-
-Kerr                     Expires December 10, 2003              [Page 4]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-2.3 Payload Data
-
-   Vorbis packets are unbounded in length currently.  At some future
-   point there will likely be a practical limit placed on packet
-   length.  
-
-   Typical Vorbis packet sizes are from very small (2-3 bytes) to 
-   quite large (8-12 kilobytes).  The reference implementation [9] 
-   typically produces packets less than ~800 bytes, except for the
-   header packets which are ~4-12 kilobytes.
-
-   Within a RTP context the maximum Vorbis packet SHOULD be kept below
-   the MTU size, typically 1500 octets, including the RTP and payload 
-   headers, to avoid fragmentation.  For the delivery of Vorbis audio 
-   using RTP the maximum size of the header block is limited to 64K.
-
-   If the payload contains a single Vorbis packet or a Vorbis packet
-   fragment, the Vorbis packet data follows the payload header.
-
-   For payloads which consist of multiple Vorbis packets, payload data 
-   consists of one octet representing the packet length followed by 
-   the packet data for each of the Vorbis packets in the payload.
-
-   The Vorbis packet length octet is the length of the data block 
-   minus one.   
-
-   The payload packing of the Vorbis data packets SHOULD follow the
-   guidelines set-out in section 4.4 of [5] where the oldest packet
-   occurs immediately after the RTP packet header.
-
-   Channel mapping of the audio is in accordance with BS. 775-1 
-   ITU-R.
-
-
-2.4 Example RTP Packet
-
-   Here is an example RTP packet containing two Vorbis packets.
-
-   RTP Packet Header:
-
-    0                   1                   2                   3
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   | 2 |0|0|  0    |0|      PT     |       sequence number         |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                 timestamp (in sample rate units)              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |          synchronisation source (SSRC) identifier             |
-   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-   |            contributing source (CSRC) identifiers             |
-   |                              ...                              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-Kerr                     Expires December 10, 2003              [Page 5]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-   Payload Data:
-
-    0                   1                   2                   3
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |0|1|0| # pks: 2|      len      |         vorbis data ...       |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                      ...vorbis data...                        |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |      ...      |      len      |   next vorbis packet data...  |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-
-3 Frame Packetizing
-
-   Each RTP packet contains either one complete Vorbis packet, one 
-   Vorbis packet fragment, or an integer number of complete Vorbis 
-   packets (up to a max of 32 packets, since the number of packets 
-   is defined by a 5 bit value).
-
-   Any Vorbis packet that is larger than 256 octets and less than the
-   path-MTU MUST be placed in a RTP packet by itself.
-
-   Any Vorbis packet that is 256 bytes or less SHOULD be bundled in the
-   RTP packet with as many Vorbis packets as will fit, up to a maximum
-   of 32.
-
-   If a Vorbis packet will not fit within the network MTU, it SHOULD be
-   fragmented.  A fragmented packet has a zero in the last five bits 
-   of the payload header.  Each fragment after the first will also set 
-   the Continued (C) bit to one in the payload header.  The RTP packet 
-   containing the last fragment of the Vorbis packet will have the 
-   Final Fragment (F) bit set to one.  To maintain the correct sequence
-   for fragmented packet reception the timestamp field of fragmented 
-   packets MUST be the same as the first packet sent, with the sequence 
-   number incremented as normal for the subsequent RTP packets. 
-
-
-
-
-3.1 Example Fragmented Vorbis Packet
-
-   Here is an example fragmented Vorbis packet split over three RTP
-   packets.  
-
-
-
-
-
-
-
-
-
-Kerr                     Expires December 10, 2003              [Page 6]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-   Packet 1:
-    0                   1                   2                   3
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |V=2|P|X|  CC   |M|     PT      |           1000                |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                             xxxxx                             |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |           synchronization source (SSRC) identifier            |
-   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-   |            contributing source (CSRC) identifiers             |
-   |                              ...                              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |0|0|0|        0|      len      |         vorbis data ..        |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                       ..vorbis data..                         |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-   In this packet the initial sequence number is 1000 and the 
-   timestamp is xxxxx.  The number of packets field is set to 0.
-
-
-   Packet 2:
-    0                   1                   2                   3
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |V=2|P|X|  CC   |M|     PT      |           1001                |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                             xxxxx                             |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |           synchronization source (SSRC) identifier            |
-   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-   |            contributing source (CSRC) identifiers             |
-   |                              ...                              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |1|0|0|        0|      len      |         vorbis data ...       |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                       ..vorbis data..                         |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-   The C bit is set to 1 and the number of packets field is set to 0.
-   For large Vorbis fragments there can be several of these type of
-   payload packets.  The maximum packet size SHOULD be no greater
-   than the MTU of 1500 octets, including all RTP and payload headers.
-   The sequence number has been incremented by one but the timestamp 
-   field remains the same as the initial packet.
-
-
-
-
-
-Kerr                     Expires December 10, 2003              [Page 7]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-   Packet 3:
-
-    0                   1                   2                   3
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |V=2|P|X|  CC   |M|     PT      |           1002                |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                             xxxxx                             |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |           synchronization source (SSRC) identifier            |
-   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-   |            contributing source (CSRC) identifiers             |
-   |                              ...                              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |1|1|0|        0|      len      |         vorbis data ..        |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                       ..vorbis data..                         |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-   This is the last Vorbis fragment packet.  The C and F bits are 
-   set and the packet count remains set to 0.  As in the previous 
-   packets the timestamp remains set to the first packet in the 
-   sequence and the sequence number has been incremented.
-
-
-3.2 Packet Loss
-
-   As there is no error correction within the Vorbis stream, packet 
-   loss will result in a loss of signal.  Packet loss is more of an 
-   issue for fragmented Vorbis packets as the client will have to 
-   cope with the handling of the C and F flags.  If we use the 
-   fragmented Vorbis packet example above and the first packet is
-   lost the client SHOULD detect that the next packet has the packet
-   count field set to 0 and the C bit is set and MUST drop it.  The
-   next packet, which is the final fragmented packet, MUST be dropped
-   in the same manner.  Feedback reports on lost and dropped packets
-   MUST be sent back via RTCP.
-
-
-4 Configuration Headers
-
-   To decode a Vorbis stream three configuration header blocks are
-   needed.  The first header indicates the sample and bitrates, the 
-   number of channels and the version of the Vorbis encoder used.  
-   The second header contains the decoders probability model, or 
-   codebooks and the third header details stream metadata.
-
-
-
-
-
-
-Kerr                     Expires December 10, 2003              [Page 8]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-   As the RTP stream may change certain configuration data mid-session
-   there are two different methods for delivering this configuration
-   data to a client, RTCP which is detailed below and SDP which is 
-   detailed in section 5.  SDP delivery is used to set-up an initial
-   state for the client application and RTCP is used to change state
-   during the session.  The changes may be due to different metadata
-   or codebooks as well as different bitrates of the stream.
-
-   Unlike other mainstream audio codecs Vorbis has no statically 
-   configured probability model, instead it packs all entropy decoding
-   configuration, VQ and Huffman models into a self-contained codebook.
-   This codebook block also requires additional identification 
-   information detailing the number of audio channels, bit rates and
-   other information used to initialise the Vorbis stream.
-
-
-4.1 RTCP Based Header Transmission
-
-   The three header data blocks are sent out-of-band as an APP defined 
-   RTCP message with the 4 octet name field set to VORB. 
-
-   VORB RTCP packets MUST set the padding (P) flag and add the
-   appropriate padding octets needed to conform with section 6.6 
-   of [3].  Synchronizing the configuration headers to the RTP stream 
-   is  critical.  A 32 bit timestamp field is used to indicate the
-   timepoint when a VORB header MUST be applied to the RTP stream. 
-   VORB RTCP packets MUST be sent just ahead of the change in the RTP
-   stream.  As the reception loss of the RTCP header will mean the 
-   RTP stream will fail to decode properly the freqency of their 
-   periodic retransmission MUST be high enough to minimize the    
-   stream disturbance whilst remaining under the RTCP bandwidth
-   allocation.
-
-    0                   1                   2                   3
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |V=2|P| subtype |   PT=APP=204  |             Length            |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                           SSRC/CSRC                           |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                             VORB                              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                 Timestamp (in sample rate units)              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                        Vorbis Version                         |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                       Audio Sample Rate                       |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                        Bitrate Maximum                        |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                        Bitrate Nominal                        |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-Kerr                     Expires December 10, 2003              [Page 9]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-    0                   1                   2                   3
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                        Bitrate Minimum                        |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   | bsz 0 | bsz 1 |       Num Audio Channels      |c|m|o|x|x|x|x|x|
-   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-   |     Codebook length           |      Codebook checksum        |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   ..                          Codebook                            |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   ..                          URI string                          |
-   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-   |                      Vendor string length                     |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                         Vendor string                        ..
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                    User comments list length                  |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   ..               User comment length / User comment             |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-
-   The first Vorbis config header defines the Vorbis stream 
-   attributes.  The Vorbis version MUST be set to zero to comply with
-   this document.  The fields Sample Rate, Bitrate Maximum/Nominal/
-   Minimum and Num Audio Channels are set in accordance with [6] with 
-   the bsz fields above referring to the blocksize parameters.  The 
-   framing bit is not used for RTP transportation and so applications 
-   constructing Vorbis files MUST take care to set this if required.
-
-   The next 8 bits are used to indicate the presence of the two 
-   other Vorbis stream config headers and the size overflow header.
-
-   The c flag indicates the presence of a codebook header block, the
-   m flag indicates the presence of a comment metadata block.  The o
-   flag indicates if the size of either of the c and m headers would
-   make the VORB packet greater than that allowed for a RTCP message.
-
-   The remaining five bits, indicated with an x, are reserved/unused
-   and MUST be set to 0 for this version of the document.
-
-   If the c flag is set then the next header block will contain the 
-   codebook configuration data.  
-
-   This setup information MUST be completely intact, as a client can 
-   not decode a stream with an incomplete or corrupted codebook set.
-
-   A 16 bit codebook length field and a 16 bit 1's complement checksum
-   of the codebook precedes the codebook datablock.  The length field 
-   allows for codebooks to be up to 64K in size. The checksum is used 
-   to detect a corrupted codebook.  
-
-Kerr                     Expires December 10, 2003             [Page 10]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-   If a checksum failure is detected then a new config header file
-   SHOULD be obtained from SDP, if the codebook has not changed since
-   the session has started.  If no SDP value is set and no other method
-   for obtaining the config headers exists then this is considered to 
-   be a failure and SHOULD be reported to the client application.
-
-   If the m flag is set then the next header block will contain the 
-   comment metadata, such as artist name, track title and so on.  These
-   metadata messages are not intended to be fully descriptive but to 
-   offer basic track/song information.  This message MUST be sent at 
-   the start of the stream, together with the setup and codebook 
-   headers, even if it contains no information.  During a session the
-   metadata associated with the stream may change from that specified 
-   at the start, e.g. a live concert broadcast changing acts/scenes, so
-   clients MUST have the ability to receive m header blocks.  Details
-   on the format of the comments can be found in the Vorbis 
-   documentation [7].
-
-   The format for the data takes the form of a 32 bit codec vendors
-   name length field followed by the name encoded in UTF-8.  The next
-   field denotes the number of user comments and then the user comments
-   length and text field pairs, up to the number indicated by the user 
-   comment list length.   
-
-   If the o, overflow, bit is set then the URI of a whole header block
-   is specified in an overflow URI field, which is a null terminated 
-   UTF-8 string.  The header file specified at the URI MUST NOT have 
-   the overflow flag set, otherwise a loop condition will occur. 
-
-
-4.2 Codebook Caching
-
-   Codebook caching allows clients that have previously connected to a 
-   stream to re-use the codebooks and thus begin the playback of the 
-   session faster.  When a client receives a codebook it may store
-   it, together with the MD5 key, locally and can compare the MD5 key
-   of locally cached codebooks with the key it receives via SDP, which
-   is detailed in section 5.1.   
-   
-
-5 Session Description for Vorbis RTP Streams
-
-   Session description information concerning the Vorbis stream 
-   SHOULD be provided if possible and MUST be in accordance with [8].  
-   The SDP information is split into two sections, a mandatory 
-   section detailing the RTP stream and an optional section used to 
-   convey information needed for codebook caching.
-
-
-
-
-
-
-Kerr                     Expires December 10, 2003             [Page 11]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-   Below is an outline of the mandatory SDP attributes.
-
-   u=&lt;URI of Vorbis header file&gt;
-   m=audio &lt;port&gt; RTP/AVP 98
-   c=IN IP4/6 &lt;URI of Vorbis stream&gt;
-   a=rtpmap:98 vorbis/&lt;sample rate&gt;
-
-   The contents of the Vorbis Header file referred to in the 
-   u attribute MUST contain all three of the config header blocks 
-   as specified in section 4.  The overflow bit of the header packet
-   MUST not be set.
-
-   The port value is specified by the server application bound to 
-   the URI specified in the c attribute.  The bitrate value specified 
-   in the a attribute MUST match the Vorbis sample rate value.
-
-5.1 SDP Based Config Header Transmission
-
-   The optional SDP attributes are used to convey details of the 
-   Vorbis stream which are required for codebook caching.  If the 
-   following attributes are set they take precedent over values 
-   specified in the u attribute detailed above.  The maximum size
-   of the mandatory and optional SDP attributes MUST be less than
-   1K in size to conform to section 4.1 of [8].
-
-   a=md5key:&lt;MD5 key of codebook&gt;
-   a=bitrate_min:&lt;Bitrate Minimum&gt;
-   a=bitrate_norm:&lt;Bitrate Normal&gt;
-   a=bitrate_max:&lt;Bitrate Maximum&gt;
-   a=bsz0:&lt;Block Size 0&gt;
-   a=bsz1:&lt;Block Size 1&gt;
-   a=channels:&lt;Num Audio Channels&gt;
-   a=meta_vendor:&lt;Vendor Name&gt;
-
-   If the codebook MD5 attribute, md5key, is set the key is compared 
-   to a locally held cache and if found the associated local codebook 
-   is used, if not the client MUST use the configuration headers
-   specified in the u attribute.  
-
-   The md5key requires other attributes which detail bitrates, channels
-   and metadata associated with the RTP stream.  The attributes
-   following the md5key example above MUST all be present.
-
-   The metadata attribute, meta_vendor, provides the bare minimum 
-   information required for decoding but does not convey any 
-   meaningfull stream metadata information.  As outlined in the Vorbis 
-   comment field and header specification documentation, [7], a number 
-   of predefined field names are available which SHOULD be used.  An 
-   example would be:
-
-
-
-
-Kerr                     Expires December 10, 2003             [Page 12]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-   a=meta_vendor:Xiph.Org libVorbis I 20020717
-   a=meta_artist:Honest Bob and the Factory-to-Dealer-Incentives
-   a=meta_title:I'm Still Around
-   a=meta_tracknumber:5
-
-
-6 IANA Considerations
-
-   MIME media type name: audio
-
-   MIME subtype: vorbis
-
-   Required Parameters: none
-
-   Optional Parameters: none
-
-   Encoding considerations:
-         This type is only defined for transfer via RTP as specified in
-         a Work in Progress.
-
-   Security Considerations:
-         See Section 6 of RFC 3047.
-
-   Interoperability considerations: none
-
-   Published specification:
-         See the Vorbis documentation [2] for details.
-
-   Applications which use this media type:
-         Audio streaming and conferencing tools
-
-   Additional information: none
-
-   Person &amp; email address to contact for further information:
-         Phil Kerr
-         philkerr at elec.gla.ac.uk
-
-   Intended usage: COMMON
-
-   Author/Change controller:
-         Author: Phil Kerr
-         Change controller: Phil Kerr
-
-
-7 Congestion Control    
-
-   Vorbis clients SHOULD send regular receiver reports detailing 
-   congestion.  A mechanism for dynamically downgrading the stream, 
-   known as bitrate peeling, will allow for a graceful backing off
-   of the stream bitrate.  This feature is not available at present
-   so an alternative would be to redirect the client to a lower 
-   bitrate stream if one is available.  
- 
-Kerr                     Expires December 10, 2003             [Page 13]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-
-8 Security Considerations
-
-   RTP packets using this payload format are subject to the security 
-   considerations discussed in the RTP specification [3].  This implies 
-   that the confidentiality of the media stream is achieved by using
-   encryption.  Because the data compression used with this payload
-   format is applied end-to-end, encryption may be performed on the 
-   compressed data.  Where the size of a data block is set care MUST 
-   be taken to prevent buffer overflows in the client applications.
-
-
-9 Acknowledgments
-
-   This document is a continuation of draft-moffitt-vorbis-rtp-00.txt.
-   The MIME type section is a continuation of draft-short-avt-rtp-
-   vorbis-mime-00.txt
-
-   Thanks to the AVT, Ogg Vorbis Communities / Xiph.org including 
-   Steve Casner, Ramon Garcia, Pascal Hennequin, Ralph Jiles, 
-   Tor-Einar Jarnbjo, Colin Law, John Lazzaro, Jack Moffitt, 
-   Colin Perkins, Barry Short, Mike Smith.
-
-
-10 Normative References
-
-   1. The Ogg Encapsulation Format Version 0 (RFC 3533), S. Pfeiffer.
-
-   2. Key words for use in RFCs to Indicate Requirement Levels 
-      (RFC 2119), S. Bradner.
-
-   3. RTP: A Transport Protocol for Real-Time Applications (RFC 1889),
-      Schulzrinne, et al.
-  
-   4. RTP: A transport protocol for real-time applications. Work   
-      in progress, draft-ietf-avt-rtp-new-11.txt.
-
-   5. RTP Profile for Audio and Video Conferences with Minimal Control. 
-      Work in progress, draft-ietf-avt-profile-new-12.txt.
-
-   6. Ogg Vorbis I spec:  Codec setup and packet decode.
-      http://www.xiph.org/ogg/vorbis/doc/vorbis-spec-ref.html
-
-   7. Ogg Vorbis I spec:  Comment field and header specification. 
-      http://www.xiph.org/ogg/vorbis/doc/v-comment.html
-
-   8. SDP: Session Description Protocol (RFC 2327), Handley, M. and 
-      V. Jacobson.
-
-
-10.1 Informative References
-
-   9. libvorbis: Available from the Xiph website, http://www.xiph.org  
-
-Kerr                     Expires December 10, 2003             [Page 14]
-
-Internet Draft      draft-kerr-avt-vorbis-rtp-02.txt       June 10, 2003
-
-11 Full Copyright Statement
-
-   Copyright (C) The Internet Society (2003). All Rights Reserved.
-
-   This document and translations of it may be copied and furnished to
-   others, and derivative works that comment on or otherwise explain it
-   or assist in its implementation may be prepared, copied, published
-   and distributed, in whole or in part, without restriction of any
-   kind, provided that the above copyright notice and this paragraph are
-   included on all such copies and derivative works. However, this
-   document itself may not be modified in any way, such as by removing
-   the copyright notice or references to the Internet Society or other
-   Internet organizations, except as needed for the purpose of
-   developing Internet standards in which case the procedures for
-   copyrights defined in the Internet Standards process must be
-   followed, or as required to translate it into languages other than
-   English.
-
-   The limited permissions granted above are perpetual and will not be
-   revoked by the Internet Society or its successors or assigns.
-
-   This document and the information contained herein is provided on an
-   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
-   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
-   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
-   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
-   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-
-12 Authors Address
-
-   Phil Kerr
-   Centre for Music Technology
-   University of Glasgow
-   Glasgow, Scotland
-   UK, G12 8LT
-   Phone: +44 141 330 5740
-   Email: philkerr at elec.gla.ac.uk
-          phil at plus24.com
-
-   WWW: http://www.xiph.org/
-
-
-
-
-
-
-
-
-
-Kerr                     Expires December 10, 2003             [Page 15]
-
-
-
-From: Colin Perkins &lt;csp at csperkins.org&gt;
-Date: Tue May 6, 2003  23:29:25 Europe/London
-To: philkerr at elec.gla.ac.uk
-Cc: avt at ietf.org
-Subject: [AVT] Re: Status of draft-kerr-avt-vorbis-rtp-01
-
-Hi Phil,
-
---&gt; philkerr at elec.gla.ac.uk writes:
-I'm checking on the status of draft-kerr-avt-vorbis-rtp-01 and how things can be
-moved forward with it.  The update was submitted just before the cutoff for the
-last AVT meeting and there seems to have been no action on it since.
-
-I took the liberty of cc'ing the AVT mailing list, to encourage feedback.
-
-There are a few small changes I may wish to make to the draft, which will be
-discussed at a Vorbis meeting tomorrow, but I wanted to check with you first on
-if the 01 draft is good enough to move forward.
-
-I think it's in good shape, although I have a couple of issues:
-
- - Section 2.1 notes that the P, X and CC fields of the RTP header are set
-   to 0. I'm not sure it's appropriate for a payload format to specify this: 
-   I can imagine valid scenarios where each of these can be used with Vorbis. *
-
- - The discussion in section 3 can make use of normative language to be
-   clear on how frames are packetized. I suggest the following changes:
-
-       Any Vorbis packet that is larger than 256 octets and less than the
-       path-MTU should be placed in a RTP packet by itself.
-                ^^^^^^ MUST
-*
-       Any Vorbis packet that is 256 bytes or less should be bundled in the
-                                                   ^^^^^^ SHOULD
-       RTP packet with as many Vorbis packets as will fit, up to a maximum
-       of 32.
-*
-       If a Vorbis packet will not fit into the RTP packet, it must be 
-                within the network MTU ^^^^^^^^^^^^^^^^^^^     ^^^^ SHOULD
-       fragmented.  A fragmented packet has a zero in the last five bits 
-       of the payload header.  Each fragment after the first will also set 
-       the Continued (C) bit to one in the payload header.  The RTP packet 
-       containing the last fragment of the Vorbis packet will have the 
-       Marker (F) bit set to one.
-       ^^^^^^ Final Fragment 
-                  (to avoid confusion with the RTP Marker bit)
-*
-
- - The IANA considerations section needs to be expanded. Section 4 of RFC
-   3047 is a good example, to illustrate the format. *
-
- - Regarding the configuration headers, is there a need to send updates
-   during a session? If not, it might be appropriate to define some SDP
-   parameters to convey the configuration data at session initiation time,
-   rather than relying on RTCP. If RTCP is to be used, it's necessary to
-   discuss reliability, and how a receiver reacts if the information is
-   lost.
-
-I also have a few editorial comments:
-
- - The interpretation of key words and reference to RFC 2119 should be
-   moved into the Introduction rather than being in the Status of this
-   Memo section. *
-
- - I suggest moving the last three paragraphs of the Introduction into
-   section 2.3, where the packing of the payload data is discussed. It
-   may also be appropriate to include a slightly longer description of
-   the Vorbis codec and when it might be useful in the Introduction. *
-
- - In section 3.1, it might be useful to include the RTP packet header 
-   details, to show how the RTP sequence number and timestamp are used
-   (sequence number increases by one for each packet, timestamp stays 
-   the same for each fragment). *
-
- - Section 7 might reference the discussion of congestion control in 
-   the RTP spec and/or profile
-
- - References should be split into Normative and Informative sections. *
-
-
-Cheers,
-Colin
-_______________________________________________
-Audio/Video Transport Working Group
-avt at ietf.org
-https://www1.ietf.org/mailman/listinfo/avt
-
-
-
-
-
-Hi All,
-
-Please find below an updated Vorbis-RTP Internet Draft document for review and discussion at the Xiph IRC meeting on Saturday.
-
-The changes in this version have been:
-
-Codebook caching mechanism
-Expanded SDP parameters
-Expanded MIME section
-Expanded introduction
-Packet loss section
-Minor tweaks and clarity changes to text
-
-There are probably some minor tweaks to the formatting needed which will be done before the final submission.
-
-Open issues concern:
-
-Bitrate peeling for congestion control needs to be firmed up
-A clearer definition of the path MTU is probably needed
-
-Feedback and comments welcomed of course.
-
-All being well I will submit this to the IETF early next week with a request to move the document to AVT WG status (a step closer to RFC).
-
-Regards
-
-Phil
-
-
-Annexe) some comments on  draft-kerr-avt-vorbis-rtp-01 :
-    - Section 3, p5.  "path-MTU" is not a clear concept in IP multicast.
-      (path-mtu discover algorithm not operationnal here)
-      Open issue : optimal value for a "RTP-MTU" with vorbis ?
-          (IP fragmentation/reassembling vs RTP framentation/reassembling ?) 
-          (size and frequency of "big" vorbis packet ?)
-          (optimistic MTU=1500, pessimistic MTU=500, Neutral MTU=1000 ?) *?
-
-    - Section 5, p.9 last paragraph. "the URI value set there" is in SDP *
-      information or in VORB RTCP overflow field ? 
- 
-    - Section 5 sentence "The framing bit is not used for RTP ..." appears *
-      2 times.
-
-    - Section 6, c=IN IP4 .. ; no reason to restrict to IPv4 *
-
-    - Section 6, needs clarification for "all three of the config header *
-      blocks". starting of the first block ?
-
-    - Section 2.2,  figure, numbering from 0 to 7 is better *
-
-    - Need rules for reassembling process (Section 3.2 ?).
-       Normal process
-       misordering ?
-       process with loss of fragment ? temporisation ?? *
-
-    - More generally what is the consequence of vorbis packet loss,
-      and vorbis packet misordeing ?
-    -  ...
-
-
-
-
-</pre></div><div class="appendix" lang="en"><h2 class="title" style="clear: both"><a name="footer"></a>C. Colophon</h2><div class="mediaobject"><img src="white-xifish.png" alt="[Xiph.org logo]"></div><p>
-Ogg is a <a href="http://www.xiph.org/" target="_top">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" target="_top">About
-the Xiph.org Foundation</a> for details.
-</p><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><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><p>
-Ogg, Vorbis, Xiph.org Foundation and their logos are trademarks (tm)
-of the <a href="http://www.xiph.org/" target="_top">Xiph.org Foundation</a>.  These
-pages are copyright (C) 1994-2004 Xiph.org Foundation. All rights
-reserved.</p><p>
-This document is set in DocBook XML.
-</p></div></div></body></html>

Deleted: websites/xiph.org/vorbis/doc/Vorbis_I_spec.pdf
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/components.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/draft-moffitt-vorbis-rtp-00.txt
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/draft-moffitt-vorbis-rtp-00.txt	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/draft-moffitt-vorbis-rtp-00.txt	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,230 +0,0 @@
-Network Working Group				Jack Moffitt
-Internet-Draft					Xiph.org Foundation
-Expire in six months				February 2001
-
-
-	    RTP Payload Format for Vorbis Encoded Audio
-
-		   <draft-moffitt-vorbis-rtp-00.txt>
-
-Status of this Memo
-
-   This document is an Internet-Draft and is in full conformance
-   with all provisions of Section 10 of RFC2026.
-
-   Internet-Drafts are working documents of the Internet Engineering
-   Task Force (IETF), its areas, and its working groups.  Note that
-   other groups may also distribute working documents as
-   Internet-Drafts.
-
-   Internet-Drafts are draft documents valid for a maximum of six
-   months and may be updated, replaced, or obsoleted by other
-   documents at any time.  It is inappropriate to use Internet-
-   Drafts as reference material or to cite them other than as
-   "work in progress".
-
-   The list of current Internet-Drafts can be accessed at 
-   http://www.ietf.org/ietf/1id-abstracts.txt
-
-   The list of Internet-Draft Shadow Directories can be accessed at
-   http://www.ietf.org/shadow.html.
-
-Abstract
-	
-   This document describes a RTP payload format for transporting Vorbis
-   encoded audio.
-
-1 Introduction
-
-   This document describes how Vorbis encoded audio may be formatted for
-   use as an RTP payload type. 
-
-   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
-   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
-   document are to be interpreted as described in RFC 2119 [1].
-
-2 Background
-
-   The Xiph.org Foundation creates and defines codecs for use in 
-   multimedia that are not encumbered by patents and thus may be freely 
-   implemented by any individual or organization.
-
-   Vorbis is the general purpose multi-channel audio codec created by 
-   the Xiph.org Foundation.
-
-   Vorbis encoded audio is generally found within an Ogg format 
-   bitstream, which provides framing and synchronization.  For the 
-   purposes of RTP transport, this layer is unnecessary, and so raw 
-   Vorbis packets are used in the payload.
-
-   Vorbis packets are unbounded in length currently.  At some future
-   point there will likely be a practical limit placed on packet
-   length.
-
-   Typical Vorbis packet sizes are from very small (2-3 bytes) to 
-   quite large (8-12 kilobytes).  The reference implementation seems to
-   make every packet less than ~800 bytes, except for the codebooks
-   packet which is ~8-12 kilobytes.
-
-3 Payload Format
-
-   The standard RTP header is followed by an 8 bit payload header, and 
-   the payload data.
-
-3.1 RTP Header
-
-   The following fields of the RTP header are used for Vorbis payloads:
-
-   Payload Type (PT): 7 bits
-      An RTP profile for a class of applications is expected to assign a 
-      payload type for this format, or a dynamically allocated payload 
-      type should be chosen which designates the payload as Vorbis.
-
-   Timestamp: 32 bits
-      A timestamp representing the sampling time of the first sample of
-      the first Vorbis packet in the RTP packet.  The clock frequency 
-      MUST be set to the sample rate of the encoded audio data and is 
-      conveyed out-of-band.
-
-   Marker (M): 1 bit
-      Set to one if the payload contains complete packets or if it
-      contains the last fragment of a fragmented packet.
-
-3.2 Payload Header
-
-   The first byte of the payload data is the payload header:
-
-           +---+---+---+---+---+---+---+---+
-           | C | R | R |  # of packets     |
-           +---+---+---+---+---+---+---+---+
-
-   C: 1 bit
-      Set to one if this is a continuation of a fragmented packet.
-
-   R: 1 bit x 2
-      Reserved, must be set to zero by senders, and ignored by 
-      receivers.
-
-   The last 5 bits are the number of complete packets in this payload.  
-   If C is set to one, this number should be 0.
-
-3.3 Payload Data
-
-   If the payload contains a single Vorbis packet or a Vorbis packet
-   fragment, the Vorbis packet data follows the payload header.
-
-   For payloads which consist of multiple Vorbis packets, payload data 
-   consists of one byte representing the packet length followed by the 
-   packet data for each of the Vorbis packets in the payload.
-
-   The Vorbis packet length byte is the length minus one.  A value of 
-   0 means a length of 1.
-
-3.4 Example RTP Packet
-
-   Here is an example RTP packet containing two Vorbis packets.
-
-   RTP Packet Header:
-
-    0                   1                   2                   3
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 8 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |V=2|P|X|  CC   |M|      PT     |      sequence number          |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                 timestamp (in sample rate units)              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |         sychronization source (SSRC) identifier               |
-   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-   |         contributing source (CSRC) identifiers                |
-   |                      ...                                      |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-   Payload Data:
-
-    0                   1                   2                   3
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |0|0|0| # pks: 2|      len      |  vorbis data ...              |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |                  ...vorbis data...                            |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |     ...       |      len      | next vorbis packet data...    |
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-4 Frame Packetizing
-
-   Each RTP packet contains either one complete Vorbis packet, one 
-   Vorbis packet fragment, or an integer number of complete Vorbis 
-   packets (a max of 32 packets, since the number of packets is 
-   defined by a 5 bit value).
-
-   Any Vorbis packet that is larger than 256 bytes and less than the
-   path-MTU should be placed in a RTP packet by itself.
-
-   Any Vorbis packet that is 256 bytes or less should be bundled in the
-   RTP packet with as many Vorbis packets as will fit, up to a maximum
-   of 32.
-
-   If a packet will not fit into the RTP packet, it must be fragmented.
-   A fragmented packet has a zero in the last five bits of the payload 
-   header.  Each fragment after the first will also set the Continued 
-   (C) bit to one in the payload header.  The RTP packet containing the
-   last fragment of the Vorbis packet will have the Marker (M) bit set
-   to one.
-
-5 Open Issues
-
-   To decode a Vorbis stream, a set of codebooks is required.  These
-   codebooks are allowed to change for each logical bitstream (for
-   example, for each song encoded in a radio stream).
-
-   The codebooks must be completely intact and a client can not decode
-   a stream with an incomplete or corrupted set.
-
-   A client connecting to a multicast RTP Vorbis session needs to get the
-   first set of codebooks in some manner.  These codebooks are typically
-   between 4 kilobytes and 8 kilobytes in size.
-
-   A final solution to how best to deliver the codebooks has not yet been
-   realized.  Here are the current proposals:
-
-   - Including the first set of codebooks in the SDP description
-   
-   - Broadcasting a codebook only stream as a second multicast Vorbis
-     stream
-
-   - Create some method of requesting the codebooks via RTCP
-
-   - Periodically retransmit the headers inline
-
-6 Security Considerations
-
-   RTP packets using this payload format are subject to the security 
-   considerations discussed in the RTP specification [1].  This implies 
-   that the confidentiality of the media stream is achieved by using
-   encryption.  Becase the data compression used with this payload
-   format is applied end-to-end, encryption may be performed on the 
-   compressed data.
-
-7 Acknowledgements
-
-   Thanks to the rest of the Xiph.org team, especially Monty 
-   <monty at xiph.org>. Thanks also to Rob Lanphier <robla at real.com> for 
-   his guidance.
-
-8 References
-
-   1. RTP: A Transport Protocol for Real-Time Applications (RFC 1889)
-  
-   2. Xiph.org's Ogg Vorbis pages http://www.xiph.org/ogg/vorbis/
-      Vorbis documentation only currently exists as API documenation,
-      or as source code.  The source can be obtained at
-      http://www.xiph.org/ogg/vorbis/download.html
-
-9 Author's Address
-
-   Jack Moffitt
-   Executive Director
-   Xiph.org Foundation
-   email: jack at xiph.org
-   WWW: http://www.xiph.org/

Deleted: websites/xiph.org/vorbis/doc/eightphase.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/evenlsp.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/floor1-1.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/floor1-2.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/floor1-3.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/floor1-4.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/floor1_inverse_dB_table.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/floor1_inverse_dB_table.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/floor1_inverse_dB_table.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,112 +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: floor1_inverse_dB_table
-</font></h1>
-
-<em>Last update to this document: July 18, 2002</em><p>
-
-The vector <tt>[floor1_inverse_dB_table]</tt> is a 256 element static
-lookup table consiting of the following values (read left to right
-then top to bottom):
-
-<pre>
-  1.0649863e-07, 1.1341951e-07, 1.2079015e-07, 1.2863978e-07, 
-  1.3699951e-07, 1.4590251e-07, 1.5538408e-07, 1.6548181e-07, 
-  1.7623575e-07, 1.8768855e-07, 1.9988561e-07, 2.1287530e-07, 
-  2.2670913e-07, 2.4144197e-07, 2.5713223e-07, 2.7384213e-07, 
-  2.9163793e-07, 3.1059021e-07, 3.3077411e-07, 3.5226968e-07, 
-  3.7516214e-07, 3.9954229e-07, 4.2550680e-07, 4.5315863e-07, 
-  4.8260743e-07, 5.1396998e-07, 5.4737065e-07, 5.8294187e-07, 
-  6.2082472e-07, 6.6116941e-07, 7.0413592e-07, 7.4989464e-07, 
-  7.9862701e-07, 8.5052630e-07, 9.0579828e-07, 9.6466216e-07, 
-  1.0273513e-06, 1.0941144e-06, 1.1652161e-06, 1.2409384e-06, 
-  1.3215816e-06, 1.4074654e-06, 1.4989305e-06, 1.5963394e-06, 
-  1.7000785e-06, 1.8105592e-06, 1.9282195e-06, 2.0535261e-06, 
-  2.1869758e-06, 2.3290978e-06, 2.4804557e-06, 2.6416497e-06, 
-  2.8133190e-06, 2.9961443e-06, 3.1908506e-06, 3.3982101e-06, 
-  3.6190449e-06, 3.8542308e-06, 4.1047004e-06, 4.3714470e-06, 
-  4.6555282e-06, 4.9580707e-06, 5.2802740e-06, 5.6234160e-06, 
-  5.9888572e-06, 6.3780469e-06, 6.7925283e-06, 7.2339451e-06, 
-  7.7040476e-06, 8.2047000e-06, 8.7378876e-06, 9.3057248e-06, 
-  9.9104632e-06, 1.0554501e-05, 1.1240392e-05, 1.1970856e-05, 
-  1.2748789e-05, 1.3577278e-05, 1.4459606e-05, 1.5399272e-05, 
-  1.6400004e-05, 1.7465768e-05, 1.8600792e-05, 1.9809576e-05, 
-  2.1096914e-05, 2.2467911e-05, 2.3928002e-05, 2.5482978e-05, 
-  2.7139006e-05, 2.8902651e-05, 3.0780908e-05, 3.2781225e-05, 
-  3.4911534e-05, 3.7180282e-05, 3.9596466e-05, 4.2169667e-05, 
-  4.4910090e-05, 4.7828601e-05, 5.0936773e-05, 5.4246931e-05, 
-  5.7772202e-05, 6.1526565e-05, 6.5524908e-05, 6.9783085e-05, 
-  7.4317983e-05, 7.9147585e-05, 8.4291040e-05, 8.9768747e-05, 
-  9.5602426e-05, 0.00010181521, 0.00010843174, 0.00011547824, 
-  0.00012298267, 0.00013097477, 0.00013948625, 0.00014855085, 
-  0.00015820453, 0.00016848555, 0.00017943469, 0.00019109536, 
-  0.00020351382, 0.00021673929, 0.00023082423, 0.00024582449, 
-  0.00026179955, 0.00027881276, 0.00029693158, 0.00031622787, 
-  0.00033677814, 0.00035866388, 0.00038197188, 0.00040679456, 
-  0.00043323036, 0.00046138411, 0.00049136745, 0.00052329927, 
-  0.00055730621, 0.00059352311, 0.00063209358, 0.00067317058, 
-  0.00071691700, 0.00076350630, 0.00081312324, 0.00086596457, 
-  0.00092223983, 0.00098217216, 0.0010459992,  0.0011139742, 
-  0.0011863665,  0.0012634633,  0.0013455702,  0.0014330129, 
-  0.0015261382,  0.0016253153,  0.0017309374,  0.0018434235, 
-  0.0019632195,  0.0020908006,  0.0022266726,  0.0023713743, 
-  0.0025254795,  0.0026895994,  0.0028643847,  0.0030505286, 
-  0.0032487691,  0.0034598925,  0.0036847358,  0.0039241906, 
-  0.0041792066,  0.0044507950,  0.0047400328,  0.0050480668, 
-  0.0053761186,  0.0057254891,  0.0060975636,  0.0064938176, 
-  0.0069158225,  0.0073652516,  0.0078438871,  0.0083536271, 
-  0.0088964928,  0.009474637,   0.010090352,   0.010746080, 
-  0.011444421,   0.012188144,   0.012980198,   0.013823725, 
-  0.014722068,   0.015678791,   0.016697687,   0.017782797, 
-  0.018938423,   0.020169149,   0.021479854,   0.022875735, 
-  0.024362330,   0.025945531,   0.027631618,   0.029427276, 
-  0.031339626,   0.033376252,   0.035545228,   0.037855157, 
-  0.040315199,   0.042935108,   0.045725273,   0.048696758, 
-  0.051861348,   0.055231591,   0.058820850,   0.062643361, 
-  0.066714279,   0.071049749,   0.075666962,   0.080584227, 
-  0.085821044,   0.091398179,   0.097337747,   0.10366330, 
-  0.11039993,    0.11757434,    0.12521498,    0.13335215, 
-  0.14201813,    0.15124727,    0.16107617,    0.17154380, 
-  0.18269168,    0.19456402,    0.20720788,    0.22067342, 
-  0.23501402,    0.25028656,    0.26655159,    0.28387361, 
-  0.30232132,    0.32196786,    0.34289114,    0.36517414, 
-  0.38890521,    0.41417847,    0.44109412,    0.46975890, 
-  0.50028648,    0.53279791,    0.56742212,    0.60429640, 
-  0.64356699,    0.68538959,    0.72993007,    0.77736504, 
-  0.82788260,    0.88168307,    0.9389798,     1.
-<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>
-

Deleted: websites/xiph.org/vorbis/doc/floorval.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/fourphase.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/framing.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/framing.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/framing.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,395 +0,0 @@
-<HTML><HEAD><TITLE>xiph.org: Ogg Vorbis documentation</TITLE>
-<BODY bgcolor="#ffffff" text="#202020" link="#006666" vlink="#000000">
-<nobr><a href="http://www.xiph.org/ogg/index.html"><img src="white-ogg.png" border=0><img 
-src="vorbisword2.png" border=0></a></nobr><p>
-
-<h1><font color=#000070>
-Ogg logical bitstream framing
-</font></h1>
-
-<em>Last update to this document: July 14, 2002</em><br> 
-
-<h2>Ogg bitstreams</h2>
-
-The Ogg transport bitstream is designed to provide framing, error
-protection and seeking structure for higher-level codec streams that
-consist of raw, unencapsulated data packets, such as the Vorbis audio
-codec or Tarkin video codec.
-
-<h2>Application example: Vorbis</h2>
-Vorbis encodes short-time blocks of PCM data into raw packets of
-bit-packed data.  These raw packets may be used directly by transport
-mechanisms that provide their own framing and packet-separation
-mechanisms (such as UDP datagrams).  For stream based storage (such as
-files) and transport (such as TCP streams or pipes), Vorbis uses the
-Ogg bitstream format to provide framing/sync, sync recapture
-after error, landmarks during seeking, and enough information to
-properly separate data back into packets at the original packet
-boundaries without relying on decoding to find packet boundaries.<p>
-
-<h2>Design constraints for Ogg bitstreams</h2>
-
-<ol><li>True streaming; we must not need to seek to build a 100%
-   complete bitstream.
-
-<li> Use no more than approximately 1-2% of bitstream bandwidth for
-   packet boundary marking, high-level framing, sync and seeking.
-
-<li> Specification of absolute position within the original sample
-   stream.
-
-<li> Simple mechanism to ease limited editing, such as a simplified
-   concatenation mechanism.
-
-<li> Detection of corruption, recapture after error and direct, random
-   access to data at arbitrary positions in the bitstream.
-</ol>
-
-<h2>Logical and Physical Bitstreams</h2>
-
-A <em>logical</em> Ogg bitstream is a contiguous stream of
-sequential pages belonging only to the logical bitstream.  A
-<em>physical</em> Ogg bitstream is constructed from one or more
-than one logical Ogg bitstream (the simplest physical bitstream
-is simply a single logical bitstream).  We describe below the exact
-formatting of an Ogg logical bitstream.  Combining logical
-bitstreams into more complex physical bitstreams is described in the
-<a href="oggstream.html">Ogg bitstream overview</a>.  The exact
-mapping of raw Vorbis packets into a valid Ogg Vorbis physical
-bitstream is described in <a href="vorbis-stream.html">Vorbis
-bitstream mapping</a>.
-
-<h2>Bitstream structure</h2>
-
-An Ogg stream is structured by dividing incoming packets into
-segments of up to 255 bytes and then wrapping a group of contiguous
-packet segments into a variable length page preceded by a page
-header.  Both the header size and page size are variable; the page
-header contains sizing information and checksum data to determine
-header/page size and data integrity.<p>
-
-The bitstream is captured (or recaptured) by looking for the beginning
-of a page, specifically the capture pattern.  Once the capture pattern
-is found, the decoder verifies page sync and integrity by computing
-and comparing the checksum. At that point, the decoder can extract the
-packets themselves.<p>
-
-<h3>Packet segmentation</h3>
-
-Packets are logically divided into multiple segments before encoding
-into a page. Note that the segmentation and fragmentation process is a
-logical one; it's used to compute page header values and the original
-page data need not be disturbed, even when a packet spans page
-boundaries.<p>
-
-The raw packet is logically divided into [n] 255 byte segments and a
-last fractional segment of < 255 bytes.  A packet size may well
-consist only of the trailing fractional segment, and a fractional
-segment may be zero length.  These values, called "lacing values" are
-then saved and placed into the header segment table.<p>
-
-An example should make the basic concept clear:<p>
-
-<pre>
-<tt>
-raw packet:
-  ___________________________________________
- |______________packet data__________________| 753 bytes
-
-lacing values for page header segment table: 255,255,243
-</tt>
-</pre>
-
-We simply add the lacing values for the total size; the last lacing
-value for a packet is always the value that is less than 255. Note
-that this encoding both avoids imposing a maximum packet size as well
-as imposing minimum overhead on small packets (as opposed to, eg,
-simply using two bytes at the head of every packet and having a max
-packet size of 32k.  Small packets (<255, the typical case) are
-penalized with twice the segmentation overhead). Using the lacing
-values as suggested, small packets see the minimum possible
-byte-aligned overheade (1 byte) and large packets, over 512 bytes or
-so, see a fairly constant ~.5% overhead on encoding space.<p>
-
-Note that a lacing value of 255 implies that a second lacing value
-follows in the packet, and a value of < 255 marks the end of the
-packet after that many additional bytes.  A packet of 255 bytes (or a
-multiple of 255 bytes) is terminated by a lacing value of 0:<p>
-
-<pre><tt>
-raw packet:
-  _______________________________
- |________packet data____________|          255 bytes
-
-lacing values: 255, 0
-</tt></pre>
-
-Note also that a 'nil' (zero length) packet is not an error; it
-consists of nothing more than a lacing value of zero in the header.<p>
-
-<h3>Packets spanning pages</h3>
-
-Packets are not restricted to beginning and ending within a page,
-although individual segments are, by definition, required to do so.
-Packets are not restricted to a maximum size, although excessively
-large packets in the data stream are discouraged; the Ogg
-bitstream specification strongly recommends nominal page size of
-approximately 4-8kB (large packets are foreseen as being useful for
-initialization data at the beginning of a logical bitstream).<p>
-
-After segmenting a packet, the encoder may decide not to place all the
-resulting segments into the current page; to do so, the encoder places
-the lacing values of the segments it wishes to belong to the current
-page into the current segment table, then finishes the page.  The next
-page is begun with the first value in the segment table belonging to
-the next packet segment, thus continuing the packet (data in the
-packet body must also correspond properly to the lacing values in the
-spanned pages. The segment data in the first packet corresponding to
-the lacing values of the first page belong in that page; packet
-segments listed in the segment table of the following page must begin
-the page body of the subsequent page).<p>
-
-The last mechanic to spanning a page boundary is to set the header
-flag in the new page to indicate that the first lacing value in the
-segment table continues rather than begins a packet; a header flag of
-0x01 is set to indicate a continued packet.  Although mandatory, it
-is not actually algorithmically necessary; one could inspect the
-preceding segment table to determine if the packet is new or
-continued.  Adding the information to the packet_header flag allows a
-simpler design (with no overhead) that needs only inspect the current
-page header after frame capture.  This also allows faster error
-recovery in the event that the packet originates in a corrupt
-preceding page, implying that the previous page's segment table
-cannot be trusted.<p>
-
-Note that a packet can span an arbitrary number of pages; the above
-spanning process is repeated for each spanned page boundary.  Also a
-'zero termination' on a packet size that is an even multiple of 255
-must appear even if the lacing value appears in the next page as a
-zero-length continuation of the current packet.  The header flag
-should be set to 0x01 to indicate that the packet spanned, even though
-the span is a nil case as far as data is concerned.<p>
-
-The encoding looks odd, but is properly optimized for speed and the
-expected case of the majority of packets being between 50 and 200
-bytes (note that it is designed such that packets of wildly different
-sizes can be handled within the model; placing packet size
-restrictions on the encoder would have only slightly simplified design
-in page generation and increased overall encoder complexity).<p>
-
-The main point behind tracking individual packets (and packet
-segments) is to allow more flexible encoding tricks that requiring
-explicit knowledge of packet size. An example is simple bandwidth
-limiting, implemented by simply truncating packets in the nominal case
-if the packet is arranged so that the least sensitive portion of the
-data comes last.<p>
-
-<h3>Page header</h3>
-
-The headering mechanism is designed to avoid copying and re-assembly
-of the packet data (ie, making the packet segmentation process a
-logical one); the header can be generated directly from incoming
-packet data.  The encoder buffers packet data until it finishes a
-complete page at which point it writes the header followed by the
-buffered packet segments.<p>
-
-<h4>capture_pattern</h4>
-
- A header begins with a capture pattern that simplifies identifying
- pages; once the decoder has found the capture pattern it can do a more
- intensive job of verifying that it has in fact found a page boundary
- (as opposed to an inadvertent coincidence in the byte stream).<p>
-
-<pre><tt>
- byte value
-
-  0  0x4f 'O'
-  1  0x67 'g'
-  2  0x67 'g'
-  3  0x53 'S'  
-</tt></pre>
-
-<h4>stream_structure_version</h4>
-
- The capture pattern is followed by the stream structure revision:
-
-<pre><tt>
- byte value
-
-  4  0x00
-</tt></pre>
- 
-<h4>header_type_flag</h4>
-  
- The header type flag identifies this page's context in the bitstream:
-
-<pre><tt>
- byte value
-
-  5  bitflags: 0x01: unset = fresh packet
-	               set = continued packet
-	       0x02: unset = not first page of logical bitstream
-                       set = first page of logical bitstream (bos)
-	       0x04: unset = not last page of logical bitstream
-                       set = last page of logical bitstream (eos)
-</tt></pre>
-
-<h4>absolute granule position</h4>
-
- (This is packed in the same way the rest of Ogg data is packed; LSb
- of LSB first.  Note that the 'position' data specifies a 'sample'
- number (eg, in a CD quality sample is four octets, 16 bits for left
- and 16 bits for right; in video it would likely be the frame number.
- It is up to the specific codec in use to define the semantic meaning
- of the granule position value).  The position specified is the total
- samples encoded after including all packets finished on this page
- (packets begun on this page but continuing on to the next page do not
- count).  The rationale here is that the position specified in the
- frame header of the last page tells how long the data coded by the
- bitstream is.  A truncated stream will still return the proper number
- of samples that can be decoded fully.
-<p>
- A special value of '-1' (in two's complement) indicates that no packets
- finish on this page.
-
-<pre><tt>
- byte value
-
-  6  0xXX LSB
-  7  0xXX
-  8  0xXX
-  9  0xXX
- 10  0xXX
- 11  0xXX
- 12  0xXX
- 13  0xXX MSB
-</tt></pre>
-
-<h4>stream serial number</h4>
- 
- Ogg allows for separate logical bitstreams to be mixed at page
- granularity in a physical bitstream.  The most common case would be
- sequential arrangement, but it is possible to interleave pages for
- two separate bitstreams to be decoded concurrently.  The serial
- number is the means by which pages physical pages are associated with
- a particular logical stream.  Each logical stream must have a unique
- serial number within a physical stream:
-
-<pre><tt>
- byte value
-
- 14  0xXX LSB
- 15  0xXX
- 16  0xXX
- 17  0xXX MSB
-</tt></pre>
-
-<h4>page sequence no</h4>
-
- Page counter; lets us know if a page is lost (useful where packets
- span page boundaries).
-
-<pre><tt>
- byte value
-
- 18  0xXX LSB
- 19  0xXX
- 20  0xXX
- 21  0xXX MSB
-</tt></pre>
-
-<h4>page checksum</h4>
-     
- 32 bit CRC value (direct algorithm, initial val and final XOR = 0,
- generator polynomial=0x04c11db7).  The value is computed over the
- entire header (with the CRC field in the header set to zero) and then
- continued over the page.  The CRC field is then filled with the
- computed value.<p>
-
- (A thorough discussion of CRC algorithms can be found in <a
- href="ftp://ftp.rocksoft.com/papers/crc_v3.txt">"A
- Painless Guide to CRC Error Detection Algorithms"</a> by Ross
- Williams <a
- href="mailto:ross at guest.adelaide.edu.au">ross at guest.adelaide.edu.au</a>.)
-
-<pre><tt>
- byte value
-
- 22  0xXX LSB
- 23  0xXX
- 24  0xXX
- 25  0xXX MSB
-</tt></pre>
-
-<h4>page_segments</h4>
-
- The number of segment entries to appear in the segment table. The
- maximum number of 255 segments (255 bytes each) sets the maximum
- possible physical page size at 65307 bytes or just under 64kB (thus
- we know that a header corrupted so as destroy sizing/alignment
- information will not cause a runaway bitstream.  We'll read in the
- page according to the corrupted size information that's guaranteed to
- be a reasonable size regardless, notice the checksum mismatch, drop
- sync and then look for recapture).<p>
-
-<pre><tt>
- byte value
-
- 26 0x00-0xff (0-255)
-</tt></pre>
-
-<h4>segment_table (containing packet lacing values)</h4>
-
- The lacing values for each packet segment physically appearing in
- this page are listed in contiguous order.
-
-<pre><tt>
- byte value
-
- 27 0x00-0xff (0-255)
- [...]
- n  0x00-0xff (0-255, n=page_segments+26)
-</tt></pre>
-
-Total page size is calculated directly from the known header size and
-lacing values in the segment table. Packet data segments follow
-immediately after the header.<p>
-
-Page headers typically impose a flat .25-.5% space overhead assuming
-nominal ~8k page sizes.  The segmentation table needed for exact
-packet recovery in the streaming layer adds approximately .5-1%
-nominal assuming expected encoder behavior in the 44.1kHz, 128kbps
-stereo encodings.<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>
-
-

Deleted: websites/xiph.org/vorbis/doc/helper.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/helper.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/helper.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,196 +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: helper equations
-</font></h1>
-
-<em>Last update to this document: October 15, 2002</em><p>
-
-<h1>Overview</h1>
-
-The equations below are used in multiple places by the Vorbis codec
-specification.  Rather than cluttering up the main specification
-documents, they are defined here and linked in the main documents
-where appropriate.<p>
-
-<a name=log><h2>ilog</h2></a>
-
-
-The "ilog(x)" function returns the position number (1 through n) of the highest set bit in the two's complement integer value
-<tt>[x]</tt>.  Values of <tt>[x]</tt> less than zero are defined to return zero.
-
-<pre>
-  1) [return_value] = 0;
-  2) if ( [x] is greater than zero ){
-      
-       3) increment [return_value];
-       4) logical shift [x] one bit to the right, padding the MSb with zero
-       5) repeat at step 2)
-
-     }
-
-   6) done
-</pre>
-
-Examples:
-
-<ul><li> ilog(0) = 0;
-    <li> ilog(1) = 1;
-    <li> ilog(2) = 2;
-    <li> ilog(3) = 2;
-    <li> ilog(4) = 3;
-    <li> ilog(7) = 3;
-    <li> ilog(negative number) = 0;
-</uL>
-
-<a name=float32_unpack><h2>float32_unpack</h2></a>
-
-"float32_unpack(x)" is intended to translate the packed binary
-representation of a Vorbis codebook float value into the
-representation used by the decoder for floating point numbers.  For
-purposes of this example, we will unpack a Vorbis float32 into a
-host-native floating point number.<p>
-
-<pre>
-  1) [mantissa] = [x] bitwise AND 0x1fffff (unsigned result)
-  2) [sign] = [x] bitwise AND 0x80000000 (unsigned result)
-  3) [exponent] = ( [x] bitwise AND 0x7fe00000) shifted right 21 bits (unsigned result)
-  4) if ( [sign] is nonzero ) then negate [mantissa]
-  5) return [mantissa] * ( 2 ^ ( [exponent] - 788 ) )
-</pre>
-
-<a name=lookup1_values><h2>lookup1_values</h2></a>
-
-"lookup1_values(codebook_entries,codebook_dimensions)" is used to
-compute the correct length of the value index for a codebook VQ lookup
-table of lookup type 1.  The values on this list are permuted to
-construct the VQ vector lookup table of size
-<tt>[codebook_entries]</tt>.<p>
-
-The return value for this function is defined to be 'the greatest
-integer value for which <tt>[return_value] to the power of
-[codebook_dimensions] is less than or equal to
-[codebook_entries]</tt>'.
-
-<a name=low_neighbor><h2>low_neighbor</h2></a>
-
-"low_neighbor(v,x)" finds the position <i>n</i> in vector [v] of
-the greatest value scalar element for which <i>n</i> is less than
-<tt>[x]</tt> and <tt>vector [v] element <i>n</i> is less
-than vector [v] element [x]</tt>.
-
-<a name=high_neighbor><h2>high_neighbor</h2></a>
-
-"high_neighbor(v,x)" finds the position <i>n</i> in vector [v] of
-the lowest value scalar element for which <i>n</i> is less than
-<tt>[x]</tt> and <tt>vector [v] element <i>n</i> is greater
-than vector [v] element [x]</tt>.
-
-<a name=render_point><h2>render_point</h2></a>
-
-"render_point(x0,y0,x1,y1,X)" is used to find the Y value at point X
-along the line specified by x0, x1, y0 and y1.  This function uses an
-integer algorithm to solve for the point directly without calculating
-intervening values along the line.<p>
-
-<pre>
-  1)  [dy] = [y1] - [y0]
-  2) [adx] = [x1] - [x0]
-  3) [ady] = absolute value of [dy]
-  4) [err] = [ady] * ([X] - [x0])
-  5) [off] = [err] / [adx] using integer division
-  6) if ( [dy] is less than zero ) {
-
-       7) [Y] = [y0] - [off]
-
-     } else {
-
-       8) [Y] = [y0] + [off]
-  
-     }
-
-  9) done
-</pre>
-
-<a name=render_line><h2>render_line</h2></a>
-
-Floor decode type one uses the integer line drawing algorithm of
-"render_line(x0, y0, x1, y1, v)" to construct an integer floor
-curve for contiguous piecewise line segments. Note that it has not
-been relevant elsewhere, but here we must define integer division as
-rounding division of both positive and negative numbers toward zero.
-
-<pre>
-  1)   [dy] = [y1] - [y0]
-  2)  [adx] = [x1] - [x0]
-  3)  [ady] = absolute value of [dy]
-  4) [base] = [dy] / [adx] using integer division
-  5)    [x] = [x0]
-  6)    [y] = [y0]
-  7)  [err] = 0
-
-  8) if ( [dy] is less than 0 ) {
-
-        9) [sy] = [base] - 1
-
-     } else {
-
-       10) [sy] = [base] + 1
-
-     }
-
- 11) [ady] = [ady] - (absolute value of [base]) * [adx]
- 12) vector [v] element [x] = [y]
-
- 13) iterate [x] over the range [x0]+1 ... [x1]-1 {
-
-       14) [err] = [err] + [ady];
-       15) if ( [err] >= [adx] ) {
-
-             15) [err] = [err] - [adx]
-             16)   [y] = [y] + [sy]
-
-           } else {
-
-             17) [y] = [y] + [base]
-   
-           }
-
-       18) vector [v] element [x] = [y]
-
-     }
-</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>
-

Deleted: websites/xiph.org/vorbis/doc/hufftree-under.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/hufftree.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/index.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/index.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/index.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,72 +0,0 @@
-<title>  xiph.org: Ogg Vorbis documentation </title>
-
-<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 Documentation
-</font></h1>
-
-<em>Last documentation revision: March 11, 2003</em><p> 
-
-<h2>Vorbis technical discussion documents</h2>
-<ul>
-<li><a href="vorbis-fidelity.html">Fidelity measurement terminology</a>
-<li><a href="stereo.html">Vorbis channel coupling and stereo-specific application</a>
-</ul>
-
-<h2>Ogg Vorbis I specification documents</h2>
-<ul>
-<li> <a href="Vorbis_I_spec.html">Vorbis I spec: HTML </a>
-<li> <a href="Vorbis_I_spec.pdf">Vorbis I spec: PDF </a>
-<li> <a href="v-comment.html">Vorbis metadata format
-  and standard tag set</a>
-</ul>
-
-<h2>Ogg Vorbis programming documents</h2>
-<ul>
-<li>Programming with libvorbis
-<li><a href="vorbisfile/index.html">Programming with vorbisfile</a>
-<li><a href="vorbisenc/index.html">Programming with vorbisenc</a><P>
-
-
-</ul>
-
-<h2>Ogg bitstream documentation</h2>
-<ul>
-<li><a href="oggstream.html">Ogg bitstream overview</a>
-<li><a href="framing.html">Ogg logical bitstream and framing spec</a>
-</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>
-

Deleted: websites/xiph.org/vorbis/doc/lspmap.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/oddlsp.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/oggstream.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/oggstream.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/oggstream.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,196 +0,0 @@
-<HTML><HEAD><TITLE>xiph.org: Ogg Vorbis documentation</TITLE>
-<BODY bgcolor="#ffffff" text="#202020" link="#006666" vlink="#000000">
-<nobr><a href="http://www.xiph.org/ogg/index.html"><img src="white-ogg.png" border=0><img 
-src="vorbisword2.png" border=0></a></nobr><p>
-
-
-<h1><font color=#000070>
-Ogg logical and physical bitstream overview
-</font></h1>
-
-<em>Last update to this document: July 14, 2002</em><br> 
-
-<h2>Ogg bitstreams</h2>
-
-Ogg codecs use octet vectors of raw, compressed data
-(<em>packets</em>). These compressed packets do not have any
-high-level structure or boundary information; strung together, they
-appear to be streams of random bytes with no landmarks.<p>
-
-Raw packets may be used directly by transport mechanisms that provide
-their own framing and packet-separation mechanisms (such as UDP
-datagrams).  For stream based storage (such as files) and transport
-(such as TCP streams or pipes), Vorbis and other future Ogg codecs use
-the Ogg bitstream format to provide framing/sync, sync recapture
-after error, landmarks during seeking, and enough information to
-properly separate data back into packets at the original packet
-boundaries without relying on decoding to find packet boundaries.<p>
-
-<h2>Logical and physical bitstreams</h2>
-
-Raw packets are grouped and encoded into contiguous pages of
-structured bitstream data called <em>logical bitstreams</em>.  A
-logical bitstream consists of pages, in order, belonging to a single
-codec instance.  Each page is a self contained entity (although it is
-possible that a packet may be split and encoded across one or more
-pages); that is, the page decode mechanism is designed to recognize,
-verify and handle single pages at a time from the overall bitstream.<p>
-
-Multiple logical bitstreams can be combined (with restrictions) into a
-single <em>physical bitstream</em>.  A physical bitstream consists of
-multiple logical bitstreams multiplexed at the page level and may
-include a 'meta-header' at the beginning of the multiplexed logical
-stream that serves as identification magic. Whole pages are taken in
-order from multiple logical bitstreams and combined into a single
-physical stream of pages. The decoder reconstructs the original
-logical bitstreams from the physical bitstream by taking the pages in
-order from the physical bitstream and redirecting them into the
-appropriate logical decoding entity. The simplest physical bitstream
-is a single, unmultiplexed logical bitstream with no meta-header; this
-is referred to as a 'degenerate stream'.  <p>
-
-<a href=framing.html>Ogg Logical Bitstream Framing</a> discusses
-the page format of an Ogg bitstream, the packet coding process
-and logical bitstreams in detail.  The remainder of this document
-specifies requirements for constructing finished, physical Ogg
-bitstreams.<p>
-
-<h2>Mapping Restrictions</h2>
-
-Logical bitstreams may not be mapped/multiplexed into physical
-bitstreams without restriction.  Here we discuss design restrictions
-on Ogg physical bitstreams in general, mostly to introduce
-design rationale. Each 'media' format defines its own (generally more
-restrictive) mapping.  An '<a href="vorbis-ogg.html">Ogg Vorbis
-Audio Bitstream</a>', for example, has a <a
-href="vorbis-ogg.html">specific physical bitstream structure</a>.
-An 'Ogg A/V' bitstream (not currently specified) will also mandate a
-specific, restricted physical bitstream format.<p>
-
-<h3>additional end-to-end structure</h3>
-
-The <a href="framing.html">framing specification</a> defines
-'beginning of stream' and 'end of stream' page markers via a header
-flag (it is possible for a stream to consist of a single page).  A
-stream always consists of an integer number of pages, an easy
-requirement given the variable size nature of pages.<p>
-
-In addition to the header flag marking the first and last pages of a
-logical bitstream, the first page of an Ogg bitstream obeys
-additional restrictions.  Each individual media mapping specifies its
-own implementation details regarding these restrictions.<p>
-
-The first page of a logical Ogg bitstream consists of a single,
-small 'initial header' packet that includes sufficient information to
-identify the exact CODEC type and media requirements of the logical
-bitstream.  The intent of this restriction is to simplify identifying
-the bitstream type and content; for a given media type (or across all
-Ogg media types) we can know that we only need a small, fixed
-amount of data to uniquely identify the bitstream type.<p>
-
-As an example, Ogg Vorbis places the name and revision of the Vorbis
-CODEC, the audio rate and the audio quality into this initial header,
-thus simplifying vastly the certain identification of an Ogg Vorbis
-audio bitstream.<p>
-
-<h3>sequential multiplexing (chaining)</h3>
-
-The simplest form of logical bitstream multiplexing is concatenation
-(<em>chaining</em>).  Complete logical bitstreams are strung
-one-after-another in order.  The bitstreams do not overlap; the final
-page of a given logical bitstream is immediately followed by the
-initial page of the next.  Chaining is the only logical->physical
-mapping allowed by Ogg Vorbis.<p>
-
-Each chained logical bitstream must have a unique serial number within
-the scope of the physical bitstream.<p>
-
-<h3>concurrent multiplexing (grouping)</h3>
-
-Logical bitstreams may also be multiplexed 'in parallel'
-(<em>grouped</em>).  An example of grouping would be to allow
-streaming of separate audio and video streams, using different codecs
-and different logical bitstreams, in the same physical bitstream.
-Whole pages from multiple logical bitstreams are mixed together.<p>
-
-The initial pages of each logical bitstream must appear first; the
-media mapping specifies the order of the initial pages.  For example,
-Ogg A/V will eventually specify an Ogg video bitstream with
-audio.  The mapping may specify that the physical bitstream must begin
-with the initial page of a logical video bitstream, followed by the
-initial page of an audio stream.  Unlike initial pages, terminal pages
-for the logical bitstreams need not all occur contiguously (although a
-specific media mapping may require this; it is not mandated by the
-generic Ogg stream spec).  Terminal pages may be 'nil' pages,
-that is, pages containing no content but simply a page header with
-position information and the 'last page of bitstream' flag set in the
-page header.<p>
-
-Each grouped bitstream must have a unique serial number within the
-scope of the physical bitstream.<p>
-
-<h3>sequential and concurrent multiplexing</h3>
-
-Groups of concurrently multiplexed bitstreams may be chained
-consecutively.  Such a physical bitstream obeys all the rules of both
-grouped and chained multiplexed streams; the groups, when unchained ,
-must stand on their own as a valid concurrently multiplexed
-bitstream.<p>
-
-<h3>multiplexing example</h3>
-
-Below, we present an example of a grouped and chained bitstream:<p>
-
-<img src=stream.png><p>
-
-In this example, we see pages from five total logical bitstreams
-multiplexed into a physical bitstream.  Note the following
-characteristics:
-
-<ol><li>Grouped bitstreams begin together; all of the initial pages
-must appear before any data pages.  When concurrently multiplexed
-groups are chained, the new group does not begin until all the
-bitstreams in the previous group have terminated.<p>
-
-<li>The pages of concurrently multiplexed bitstreams need not conform
-to a regular order; the only requirement is that page <tt>n</tt> of a
-logical bitstream follow page <tt>n-1</tt> in the physical bitstream.
-There are no restrictions on intervening pages belonging to other
-logical bitstreams.  (Tying page appearance to bitrate demands is one
-logical strategy, ie, the page appears at the chronological point
-where decode requires more information).
-
-</ol>
-
-<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>
-
-

Deleted: websites/xiph.org/vorbis/doc/programming.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/programming.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/programming.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,502 +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>
-Programming with Xiph.org <tt>libvorbis</tt>
-</font></h1>
-
-<em>Last update to this document: July 22, 1999</em><br> 
-
-<h2>Description</h2> 
-
-Libvorbis is the Xiph.org Foundation's portable Ogg Vorbis CODEC
-implemented as a programmatic library.  Libvorbis provides primitives
-to handle framing and manipulation of Ogg bitstreams (used by the
-Vorbis for streaming), a full analysis (encoding) interface as well as
-packet decoding and synthesis for playback. <p>
-
-The libvorbis library does not provide any system interface; a
-full-featured demonstration player included with the library
-distribtion provides example code for a variety of system interfaces
-as well as a working example of using libvorbis in production code.
-
-<h2>Encoding Overview</h2>
-
-
-
-<h2>Decoding Overview</h2>
-
-Decoding a bitstream with libvorbis follows roughly the following
-steps:
-
-<ol>
-<li>Frame the incoming bitstream into pages
-<li>Sort the pages by logical bitstream and buffer then into logical streams
-<li>Decompose the logical streams into raw packets
-<li>Reconstruct segments of the original data from each packet
-<li>Glue the reconstructed segments back into a decoded stream
-</ol>
-
-<h3>Framing</h3>
-
-An Ogg bitstream is logically arranged into pages, but to decode
-the pages, we have to find them first.  The raw bitstream is first fed
-into an <tt>ogg_sync_state</tt> buffer using <tt>ogg_sync_buffer()</tt>
-and <tt>ogg_sync_wrote()</tt>.  After each block we submit to the sync
-buffer, we should check to see if we can frame and extract a complete
-page or pages using <tt>ogg_sync_pageout()</tt>.  Extra pages are
-buffered; allowing them to build up in the <tt>ogg_sync_state</tt>
-buffer will eventually exhaust memory.<p>
-
-The Ogg pages returned from <tt>ogg_sync_pageout</tt> need not be
-decoded further to be used as landmarks in seeking; seeking can be
-either a rough process of simply jumping to approximately intuited
-portions of the bitstream, or it can be a precise bisection process
-that captures pages and inspects data position.  When seeking,
-however, sequential multiplexing (chaining) must be accounted for;
-beginning play in a new logical bitstream requires initializing a
-synthesis engine with the headers from that bitstream.  Vorbis
-bitstreams do not make use of concurent multiplexing (grouping).<p>
-
-<h3>Sorting</h3>
-
-The pages produced by <tt>ogg_sync_pageout</tt> are then sorted by
-serial number to seperate logical bitstreams.  Initialize logical
-bitstream buffers (<tt>og_stream_state</tt>) using
-<tt>ogg_stream_init()</tt>. Pages are submitted to the matching
-logical bitstream buffer using <tt>ogg_stream_pagein</tt>; the serial
-number of the page and the stream buffer must match, or the page will
-be rejected.  A page submitted out of sequence will simply be noted,
-and in the course of outputting packets, the hole will be flagged
-(<tt>ogg_sync_pageout</tt> and <tt>ogg_stream_packetout</tt> will
-return a negative value at positions where they had to recapture the
-stream).
-
-<h3>Extracting packets</h3>
-
-After submitting page[s] to a logical stream, read available packets
-using <tt>ogg_stream_packetout</tt>.
-
-<h3>Decoding packets</h3>
-
-<h3>Reassembling data segments</h3>
-
-
-<h2>Ogg Bitstream Manipulation Structures</h3>
-
-Two of the Ogg bitstream data structures are intended to be
-transparent to the developer; the fields should be used directly.<p>
-
-<h3>ogg_packet</h3>
-
-<pre>
-typedef struct {
-  unsigned char *packet;
-  long  bytes;
-  long  b_o_s;
-  long  e_o_s;
-
-  size64 granulepos;
-
-} ogg_packet;
-</pre>
-
-<dl>
-<dt>packet: <dd>a pointer to the byte data of the raw packet
-<dt>bytes: <dd>the size of the packet' raw data
-<dt>b_o_s: <dd>beginning of stream; nonzero if this is the first packet of 
-              the logical bitstream
-<dt>e_o_s: <dd>end of stream; nonzero if this is the last packet of the 
-              logical bitstream
-<dt>granulepos: <dd>the absolute position of this packet in the original 
-             uncompressed data stream.
-</dl>
-
-<h4>encoding notes</h4> The encoder is responsible for setting all of
-the fields of the packet to appropriate values before submission to
-<tt>ogg_stream_packetin()</tt>; however, it is noted that the value in
-<tt>b_o_s</tt> is ignored; the first page produced from a given
-<tt>ogg_stream_state</tt> structure will be stamped as the initial
-page.  <tt>e_o_s</tt>, however, must be set; this is the means by
-which the stream encoding primitives handle end of stream and cleanup.
-
-<h4>decoding notes</h4><tt>ogg_stream_packetout()</tt> sets the fields
-to appropriate values.  Note that granulepos will be >= 0 only in the
-case that the given packet actually represents that position (ie, only
-the last packet completed on any page will have a meaningful
-<tt>granulepos</tt>).  Intervening frames will see <tt>granulepos</tt> set
-to -1.
-
-<h3>ogg_page</h3>
-
-<pre>
-typedef struct {
-  unsigned char *header;
-  long header_len;
-  unsigned char *body;
-  long body_len;
-} ogg_page;
-</pre>
-
-<dl>
-<dt>header: <dd>pointer to the page header data
-<dt>header_len: <dd>length of the page header in bytes
-<dt>body: <dd>pointer to the page body
-<dt>body_len: <dd>length of the page body
-</dl>
-
-Note that although the <tt>header</tt> and <tt>body</tt> pointers do
-not necessarily point into a single contiguous page vector, the page
-body must immediately follow the header in the bitstream.<p>
-
-<h2>Ogg Bitstream Manipulation Functions</h3>
-
-<h3>
-int    ogg_page_bos(ogg_page *og);
-</h3>
-
-Returns the 'beginning of stream' flag for the given Ogg page.  The
-beginning of stream flag is set on the initial page of a logical
-bitstream.<P>
-
-Zero indicates the flag is cleared (this is not the initial page of a
-logical bitstream).  Nonzero indicates the flag is set (this is the
-initial page of a logical bitstream).<p>
-
-<h3>
-int    ogg_page_continued(ogg_page *og);
-</h3>
-
-Returns the 'packet continued' flag for the given Ogg page. The packet
-continued flag indicates whether or not the body data of this page
-begins with packet continued from a preceeding page.<p>
-Zero (unset) indicates that the body data begins with a new packet.
-Nonzero (set) indicates that the first packet data on the page is a
-continuation from the preceeding page.
-
-<h3>
-int    ogg_page_eos(ogg_page *og);
-</h3>
-
-Returns the 'end of stream' flag for a give Ogg page.  The end of page
-flag is set on the last (terminal) page of a logical bitstream.<p>
-
-Zero (unset) indicates that this is not the last page of a logical
-bitstream.  Nonzero (set) indicates that this is the last page of a
-logical bitstream and that no addiitonal pages belonging to this
-bitstream may follow.<p>
-
-<h3>
-size64 ogg_page_granulepos(ogg_page *og);
-</h3>
-
-Returns the position of this page as an absolute position within the
-original uncompressed data.  The position, as returned, is 'frames
-encoded to date up to and including the last whole packet on this
-page'.  Partial packets begun on this page but continued to the
-following page are not included.  If no packet ends on this page, the
-frame position value will be equal to the frame position value of the
-preceeding page.  If none of the original uncompressed data is yet
-represented in the logical bitstream (for example, the first page of a
-bitstream consists only of a header packet; this packet encodes only
-metadata), the value shall be zero.<p>
-
-The units of the framenumber are determined by media mapping.  A
-vorbis audio bitstream, for example, defines one frame to be the
-channel values from a single sampling period (eg, a 16 bit stereo
-bitstream consists of two samples of two bytes for a total of four
-bytes, thus a frame would be four bytes).  A video stream defines one
-frame to be a single frame of video.<p>
-
-<h3>
-int    ogg_page_pageno(ogg_page *og);
-</h3>
-
-Returns the sequential page number of the given Ogg page.  The first
-page in a logical bitstream is numbered zero; following pages are
-numbered in increasing monotonic order.<p>
-
-<h3>
-int    ogg_page_serialno(ogg_page *og);
-</h3>
-
-Returns the serial number of the given Ogg page.  The serial number is
-used as a handle to distinguish various logical bitstreams in a
-physical Ogg bitstresm. Every logical bitstream within a
-physical bitstream must use a unique (within the scope of the physical
-bitstream) serial number, which is stamped on all bitstream pages.<p>
-
-<h3>
-int    ogg_page_version(ogg_page *og);
-</h3>
-
-Returns the revision of the Ogg bitstream structure of the given page.
-Currently, the only permitted number is zero.  Later revisions of the
-bitstream spec will increment this version should any changes be
-incompatable.</p>
-
-<h3>
-int    ogg_stream_clear(ogg_stream_state *os);
-</h3>
-
-Clears and deallocates the internal storage of the given Ogg stream.
-After clearing, the stream structure is not initialized for use;
-<tt>ogg_stream_init</tt> must be called to reinitialize for use.
-Use <tt>ogg_stream_reset</tt> to reset the stream state
-to a fresh, intiialized state.<p>
-
-<tt>ogg_stream_clear</tt> does not call <tt>free()</tt> on the pointer
-<tt>os</tt>, allowing use of this call on stream structures in static
-or automatic storage.  <tt>ogg_stream_destroy</tt>is a complimentary
-function that frees the pointer as well.<p>
-
-Returns zero on success and non-zero on failure. This function always
-succeeds.<p>
-
-<h3>
-int    ogg_stream_destroy(ogg_stream_state *os);
-</h3>
-
-Clears and deallocates the internal storage of the given Ogg stream,
-then frees the storage associated with the pointer <tt>os</tt>.<p>
-
-<tt>ogg_stream_clear</tt> does not call <tt>free()</tt> on the pointer
-<tt>os</tt>, allowing use of that call on stream structures in static
-or automatic storage.<p>
-
-Returns zero on success and non-zero on failure. This function always
-succeeds.<p>
-
-<h3>
-int    ogg_stream_init(ogg_stream_state *os,int serialno);
-</h3>
-
-Initialize the storage associated with <tt>os</tt> for use as an Ogg
-stream.  This call is used to initialize a stream for both encode and
-decode.  The given serial number is the serial number that will be
-stamped on pages of the produced bitstream (during encode), or used as
-a check that pages match (during decode).<p>
-
-Returns zero on success, nonzero on failure.<p>
-
-<h3>
-int    ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
-</h3>
-
-Used during encoding to add the given raw packet to the given Ogg
-bitstream.  The contents of <tt>op</tt> are copied;
-<tt>ogg_stream_packetin</tt> does not retain any pointers into
-<tt>op</tt>'s storage. The encoding proccess buffers incoming packets
-until enough packets have been assembled to form an entire page;
-<tt>ogg_stream_pageout</tt> is used to read complete pages.<p>
-
-Returns zero on success, nonzero on failure.<p>
-
-<h3>
-int    ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
-</h3>
-
-Used during decoding to read raw packets from the given logical
-bitstream.  <tt>ogg_stream_packetout</tt> will only return complete
-packets for which checksumming indicates no corruption.  The size and
-contents of the packet exactly match those given in the encoding
-process.  <p>
-
-Returns zero if the next packet is not ready to be read (not buffered
-or incomplete), positive if it returned a complete packet in
-<tt>op</tt> and negative if there is a gap, extra bytes or corruption
-at this position in the bitstream (essentially that the bitstream had
-to be recaptured).  A negative value is not necessarily an error.  It
-would be a common occurence when seeking, for example, which requires
-recapture of the bitstream at the position decoding continued.<p>
-
-Iff the return value is positive, <tt>ogg_stream_packetout</tt> placed
-a packet in <tt>op</tt>.  The data in <t>op</tt> points to static
-storage that is valid until the next call to
-<tt>ogg_stream_pagein</tt>, <tt>ogg_stream_clear</tt>,
-<tt>ogg_stream_reset</tt>, or <tt>ogg_stream_destroy</tt>.  The
-pointers are not invalidated by more calls to
-<tt>ogg_stream_packetout</tt>.<p>
-
-<h3>
-int    ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
-</h3>
-
-Used during decoding to buffer the given complete, pre-verified page
-for decoding into raw Ogg packets. The given page must be framed,
-normally produced by <tt>ogg_sync_pageout</tt>, and from the logical
-bitstream associated with <tt>os</tt> (the serial numbers must match).
-The contents of the given page are copied; <tt>ogg_stream_pagein</tt>
-retains no pointers into <tt>og</tt> storage.<p>
-
-Returns zero on success and non-zero on failure.<p>
-
-<h3>
-int    ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
-</h3>
-
-Used during encode to read complete pages from the stream buffer.  The
-returned page is ready for sending out to the real world.<p>
-
-Returns zero if there is no complete page ready for reading.  Returns
-nonzero when it has placed data for a complete page into
-<tt>og</tt>. Note that the storage returned in og points into internal
-storage; the pointers in <tt>og</tt> are valid until the next call to
-<tt>ogg_stream_pageout</tt>, <tt>ogg_stream_packetin</tt>,
-<tt>ogg_stream_reset</tt>, <tt>ogg_stream_clear</tt> or
-<tt>ogg_stream_destroy</tt>.
-
-<h3>
-int    ogg_stream_reset(ogg_stream_state *os);
-</h3>
-
-Resets the given stream's state to that of a blank, unused stream;
-this may be used during encode or decode. <p>
-
-Note that if used during encode, it does not alter the stream's serial
-number.  In addition, the next page produced during encoding will be
-marked as the 'initial' page of the logical bitstream.<p>
-
-When used during decode, this simply clears the data buffer of any
-pending pages.  Beginning and end of stream cues are read from the
-bitstream and are unaffected by reset.<p>
-
-Returns zero on success and non-zero on failure. This function always
-succeeds.<p>
-
-<h3>
-char  *ogg_sync_buffer(ogg_sync_state *oy, long size);
-</h3>
-
-This call is used to buffer a raw bitstream for framing and
-verification. <tt>ogg_sync_buffer</tt> handles stream capture and
-recapture, checksumming, and division into Ogg pages (as required by
-<tt>ogg_stream_pagein</tt>).<p>
-
-<tt>ogg_sync_buffer</tt> exposes a buffer area into which the decoder
-copies the next (up to) <tt>size</tt> bytes.  We expose the buffer
-(rather than taking a buffer) in order to avoid an extra copy many
-uses; this way, for example, <tt>read()</tt> can transfer data
-directly into the stream buffer without first needing to place it in
-temporary storage.<p>
-
-Returns a pointer into <tt>oy</tt>'s internal bitstream sync buffer;
-the remaining space in the sync buffer is at least <tt>size</tt>
-bytes.  The decoder need not write all of <tt>size</tt> bytes;
-<tt>ogg_sync_wrote</tt> is used to inform the engine how many bytes
-were actually written. Use of <tt>ogg_sync_wrote</tt> after writing
-into the exposed buffer is mandantory.<p>
-
-<h3>
-int    ogg_sync_clear(ogg_sync_state *oy);
-</h3>
-
-<tt>ogg_sync_clear</tt>
-
-Clears and deallocates the internal storage of the given Ogg sync
-buffer.  After clearing, the sync structure is not initialized for
-use; <tt>ogg_sync_init</tt> must be called to reinitialize for use.
-Use <tt>ogg_sync_reset</tt> to reset the sync state and buffer to a
-fresh, intiialized state.<p>
-
-<tt>ogg_sync_clear</tt> does not call <tt>free()</tt> on the pointer
-<tt>oy</tt>, allowing use of this call on sync structures in static
-or automatic storage.  <tt>ogg_sync_destroy</tt>is a complimentary
-function that frees the pointer as well.<p>
-
-Returns zero on success and non-zero on failure. This function always
-succeeds.<p>
-
-<h3>
-int    ogg_sync_destroy(ogg_sync_state *oy);
-</h3>
-
-Clears and deallocates the internal storage of the given Ogg sync
-buffer, then frees the storage associated with the pointer
-<tt>oy</tt>.<p>
-
-<tt>ogg_sync_clear</tt> does not call <tt>free()</tt> on the pointer
-<tt>oy</tt>, allowing use of that call on stream structures in static
-or automatic storage.<p>
-
-Returns zero on success and non-zero on failure. This function always
-succeeds.<p>
-
-<h3>
-int    ogg_sync_init(ogg_sync_state *oy);
-</h3>
-
-Initializes the sync buffer <tt>oy</tt> for use.<p>
-Returns zero on success and non-zero on failure. This function always
-succeeds.<p>
-
-<h3>
-int    ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
-</h3>
-
-Reads complete, framed, verified Ogg pages from the sync buffer,
-placing the page data in <tt>og</tt>.<p>
-
-Returns zero when there's no complete pages buffered for
-retrieval. Returns negative when a loss of sync or recapture occurred
-(this is not necessarily an error; recapture would be required after
-seeking, for example).  Returns positive when a page is returned in
-<tt>og</tt>. Note that the data in <tt>og</tt> points into the sync
-buffer storage; the pointers are valid until the next call to
-<tt>ogg_sync_buffer</tt>, <tt>ogg_sync_clear</tt>,
-<tt>ogg_sync_destroy</tt> or <tt>ogg_sync_reset</tt>.
-
-
-<h3>
-int    ogg_sync_reset(ogg_sync_state *oy);
-</h3>
-
-<tt>ogg_sync_reset</tt> resets the sync state in <tt>oy</tt> to a
-clean, empty state.  This is useful, for example, when seeking to a
-new location in a bitstream.<p>
-
-Returns zero on success, nonzero on failure.<p>
-
-<h3>
-int    ogg_sync_wrote(ogg_sync_state *oy, long bytes);
-</h3>
-
-Used to inform the sync state as to how many bytes were actually
-written into the exposed sync buffer.  It must be equal to or less
-than the size of the buffer requested.<p>
-
-Returns zero on success and non-zero on failure; failure occurs only
-when the number of bytes written were larger than the buffer.<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"></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
-</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>

Deleted: websites/xiph.org/vorbis/doc/residue-pack.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/residue2.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/squarepolar.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/stereo.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/stereo.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/stereo.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,371 +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 stereo-specific channel coupling discussion
-</font></h1>
-
-<em>Last update to this document: July 16, 2002</em><br> 
-
-<h2>Abstract</h2> The Vorbis audio CODEC provides a channel coupling
-mechanisms designed to reduce effective bitrate by both eliminating
-interchannel redundancy and eliminating stereo image information
-labeled inaudible or undesirable according to spatial psychoacoustic
-models.  This document describes both the mechanical coupling
-mechanisms available within the Vorbis specification, as well as the
-specific stereo coupling models used by the reference
-<tt>libvorbis</tt> codec provided by xiph.org.
-
-<h2>Mechanisms</h2>
-
-In encoder release beta 4 and earlier, Vorbis supported multiple
-channel encoding, but the channels were encoded entirely separately
-with no cross-analysis or redundancy elimination between channels.
-This multichannel strategy is very similar to the mp3's <em>dual
-stereo</em> mode and Vorbis uses the same name for its analogous
-uncoupled multichannel modes.<p>
-
-However, the Vorbis spec provides for, and Vorbis release 1.0 rc1 and
-later implement a coupled channel strategy.  Vorbis has two specific
-mechanisms that may be used alone or in conjunction to implement
-channel coupling.  The first is <em>channel interleaving</em> via
-residue backend type 2, and the second is <em>square polar
-mapping</em>.  These two general mechanisms are particularly well
-suited to coupling due to the structure of Vorbis encoding, as we'll
-explore below, and using both we can implement both totally
-<em>lossless stereo image coupling</em> [bit-for-bit decode-identical
-to uncoupled modes], as well as various lossy models that seek to
-eliminate inaudible or unimportant aspects of the stereo image in
-order to enhance bitrate. The exact coupling implementation is
-generalized to allow the encoder a great deal of flexibility in
-implementation of a stereo or surround model without requiring any
-significant complexity increase over the combinatorially simpler
-mid/side joint stereo of mp3 and other current audio codecs.<p>
-
-A particular Vorbis bitstream may apply channel coupling directly to
-more than a pair of channels; polar mapping is hierarchical such that
-polar coupling may be extrapolated to an arbitrary number of channels
-and is not restricted to only stereo, quadraphonics, ambisonics or 5.1
-surround.  However, the scope of this document restricts itself to the
-stereo coupling case.<p>
-
-<h3>Square Polar Mapping</h3>
-
-<h4>maximal correlation</h4>
- 
-Recall that the basic structure of a a Vorbis I stream first generates
-from input audio a spectral 'floor' function that serves as an
-MDCT-domain whitening filter.  This floor is meant to represent the
-rough envelope of the frequency spectrum, using whatever metric the
-encoder cares to define.  This floor is subtracted from the log
-frequency spectrum, effectively normalizing the spectrum by frequency.
-Each input channel is associated with a unique floor function.<p>
-
-The basic idea behind any stereo coupling is that the left and right
-channels usually correlate.  This correlation is even stronger if one
-first accounts for energy differences in any given frequency band
-across left and right; think for example of individual instruments
-mixed into different portions of the stereo image, or a stereo
-recording with a dominant feature not perfectly in the center.  The
-floor functions, each specific to a channel, provide the perfect means
-of normalizing left and right energies across the spectrum to maximize
-correlation before coupling. This feature of the Vorbis format is not
-a convenient accident.<p>
-
-Because we strive to maximally correlate the left and right channels
-and generally succeed in doing so, left and right residue is typically
-nearly identical.  We could use channel interleaving (discussed below)
-alone to efficiently remove the redundancy between the left and right
-channels as a side effect of entropy encoding, but a polar
-representation gives benefits when left/right correlation is
-strong. <p>
-
-<h4>point and diffuse imaging</h4>
-
-The first advantage of a polar representation is that it effectively
-separates the spatial audio information into a 'point image'
-(magnitude) at a given frequency and located somewhere in the sound
-field, and a 'diffuse image' (angle) that fills a large amount of
-space simultaneously.  Even if we preserve only the magnitude (point)
-data, a detailed and carefully chosen floor function in each channel
-provides us with a free, fine-grained, frequency relative intensity
-stereo*.  Angle information represents diffuse sound fields, such as
-reverberation that fills the entire space simultaneously.<p>
-
-*<em>Because the Vorbis model supports a number of different possible
-stereo models and these models may be mixed, we do not use the term
-'intensity stereo' talking about Vorbis; instead we use the terms
-'point stereo', 'phase stereo' and subcategories of each.</em><p>
-
-The majority of a stereo image is representable by polar magnitude
-alone, as strong sounds tend to be produced at near-point sources;
-even non-diffuse, fast, sharp echoes track very accurately using
-magnitude representation almost alone (for those experimenting with
-Vorbis tuning, this strategy works much better with the precise,
-piecewise control of floor 1; the continuous approximation of floor 0
-results in unstable imaging).  Reverberation and diffuse sounds tend
-to contain less energy and be psychoacoustically dominated by the
-point sources embedded in them.  Thus, we again tend to concentrate
-more represented energy into a predictably smaller number of numbers.
-Separating representation of point and diffuse imaging also allows us
-to model and manipulate point and diffuse qualities separately.<p>
-
-<h4>controlling bit leakage and symbol crosstalk</h4> Because polar
-representation concentrates represented energy into fewer large
-values, we reduce bit 'leakage' during cascading (multistage VQ
-encoding) as a secondary benefit.  A single large, monolithic VQ
-codebook is more efficient than a cascaded book due to entropy
-'crosstalk' among symbols between different stages of a multistage cascade.
-Polar representation is a way of further concentrating entropy into
-predictable locations so that codebook design can take steps to
-improve multistage codebook efficiency.  It also allows us to cascade
-various elements of the stereo image independently.<p>
-
-<h4>eliminating trigonometry and rounding</h4>
-
-Rounding and computational complexity are potential problems with a
-polar representation. As our encoding process involves quantization,
-mixing a polar representation and quantization makes it potentially
-impossible, depending on implementation, to construct a coupled stereo
-mechanism that results in bit-identical decompressed output compared
-to an uncoupled encoding should the encoder desire it.<p>
-
-Vorbis uses a mapping that preserves the most useful qualities of
-polar representation, relies only on addition/subtraction (during
-decode; high quality encoding still requires some trig), and makes it
-trivial before or after quantization to represent an angle/magnitude
-through a one-to-one mapping from possible left/right value
-permutations.  We do this by basing our polar representation on the
-unit square rather than the unit-circle.<p>
-
-Given a magnitude and angle, we recover left and right using the
-following function (note that A/B may be left/right or right/left
-depending on the coupling definition used by the encoder):<p>
-
-<pre>
-      if(magnitude>0)
-        if(angle>0){
-          A=magnitude;
-          B=magnitude-angle;
-        }else{
-          B=magnitude;
-          A=magnitude+angle;
-        }
-      else
-        if(angle>0){
-          A=magnitude;
-          B=magnitude+angle;
-        }else{
-          B=magnitude;
-          A=magnitude-angle;
-        }
-    }
-</pre>
-
-The function is antisymmetric for positive and negative magnitudes in
-order to eliminate a redundant value when quantizing.  For example, if
-we're quantizing to integer values, we can visualize a magnitude of 5
-and an angle of -2 as follows:<p>
-
-<img src="squarepolar.png">
-
-<p>
-This representation loses or replicates no values; if the range of A
-and B are integral -5 through 5, the number of possible Cartesian
-permutations is 121.  Represented in square polar notation, the
-possible values are:
-
-<pre>
- 0, 0
-
--1,-2  -1,-1  -1, 0  -1, 1
-
- 1,-2   1,-1   1, 0   1, 1
-
--2,-4  -2,-3  -2,-2  -2,-1  -2, 0  -2, 1  -2, 2  -2, 3  
-
- 2,-4   2,-3   ... following the pattern ...
-
- ...    5, 1   5, 2   5, 3   5, 4   5, 5   5, 6   5, 7   5, 8   5, 9
-
-</pre>
-
-...for a grand total of 121 possible values, the same number as in
-Cartesian representation (note that, for example, <tt>5,-10</tt> is
-the same as <tt>-5,10</tt>, so there's no reason to represent
-both. 2,10 cannot happen, and there's no reason to account for it.)
-It's also obvious that this mapping is exactly reversible.<p>
-
-<h3>Channel interleaving</h3>
-
-We can remap and A/B vector using polar mapping into a magnitude/angle
-vector, and it's clear that, in general, this concentrates energy in
-the magnitude vector and reduces the amount of information to encode
-in the angle vector.  Encoding these vectors independently with
-residue backend #0 or residue backend #1 will result in bitrate
-savings.  However, there are still implicit correlations between the
-magnitude and angle vectors.  The most obvious is that the amplitude
-of the angle is bounded by its corresponding magnitude value.<p>
-
-Entropy coding the results, then, further benefits from the entropy
-model being able to compress magnitude and angle simultaneously.  For
-this reason, Vorbis implements residue backend #2 which pre-interleaves
-a number of input vectors (in the stereo case, two, A and B) into a
-single output vector (with the elements in the order of
-A_0, B_0, A_1, B_1, A_2 ... A_n-1, B_n-1) before entropy encoding.  Thus
-each vector to be coded by the vector quantization backend consists of
-matching magnitude and angle values.<p>
-
-The astute reader, at this point, will notice that in the theoretical
-case in which we can use monolithic codebooks of arbitrarily large
-size, we can directly interleave and encode left and right without
-polar mapping; in fact, the polar mapping does not appear to lend any
-benefit whatsoever to the efficiency of the entropy coding.  In fact,
-it is perfectly possible and reasonable to build a Vorbis encoder that
-dispenses with polar mapping entirely and merely interleaves the
-channel.  Libvorbis based encoders may configure such an encoding and
-it will work as intended.<p>
-
-However, when we leave the ideal/theoretical domain, we notice that
-polar mapping does give additional practical benefits, as discussed in
-the above section on polar mapping and summarized again here:<p>
-<ul>
-<li>Polar mapping aids in controlling entropy 'leakage' between stages
-of a cascaded codebook.  <li>Polar mapping separates the stereo image
-into point and diffuse components which may be analyzed and handled
-differently.
-</ul>
-
-<h2>Stereo Models</h2>
-
-<h3>Dual Stereo</h3>
-
-Dual stereo refers to stereo encoding where the channels are entirely
-separate; they are analyzed and encoded as entirely distinct entities.
-This terminology is familiar from mp3.<p>
-
-<h3>Lossless Stereo</h3>
-
-Using polar mapping and/or channel interleaving, it's possible to
-couple Vorbis channels losslessly, that is, construct a stereo
-coupling encoding that both saves space but also decodes
-bit-identically to dual stereo.  OggEnc 1.0 and later uses this
-mode in all high-bitrate encoding.<p>
-
-Overall, this stereo mode is overkill; however, it offers a safe
-alternative to users concerned about the slightest possible
-degradation to the stereo image or archival quality audio.<p>
-
-<h3>Phase Stereo</h3>
-
-Phase stereo is the least aggressive means of gracefully dropping
-resolution from the stereo image; it affects only diffuse imaging.<p>
-
-It's often quoted that the human ear is deaf to signal phase above
-about 4kHz; this is nearly true and a passable rule of thumb, but it
-can be demonstrated that even an average user can tell the difference
-between high frequency in-phase and out-of-phase noise.  Obviously
-then, the statement is not entirely true.  However, it's also the case
-that one must resort to nearly such an extreme demonstration before
-finding the counterexample.<p>
-
-'Phase stereo' is simply a more aggressive quantization of the polar
-angle vector; above 4kHz it's generally quite safe to quantize noise
-and noisy elements to only a handful of allowed phases, or to thin the
-phase with respect to the magnitude.  The phases of high amplitude
-pure tones may or may not be preserved more carefully (they are
-relatively rare and L/R tend to be in phase, so there is generally
-little reason not to spend a few more bits on them) <p>
-
-<h4>example: eight phase stereo</h4>
-
-Vorbis may implement phase stereo coupling by preserving the entirety
-of the magnitude vector (essential to fine amplitude and energy
-resolution overall) and quantizing the angle vector to one of only
-four possible values. Given that the magnitude vector may be positive
-or negative, this results in left and right phase having eight
-possible permutation, thus 'eight phase stereo':<p>
-
-<img src="eightphase.png"><p>
-
-Left and right may be in phase (positive or negative), the most common
-case by far, or out of phase by 90 or 180 degrees.<p>
-
-<h4>example: four phase stereo</h4>
-
-Similarly, four phase stereo takes the quantization one step further;
-it allows only in-phase and 180 degree out-out-phase signals:<p>
-
-<img src="fourphase.png"><p>
-
-<h3>example: point stereo</h3>
-
-Point stereo eliminates the possibility of out-of-phase signal
-entirely.  Any diffuse quality to a sound source tends to collapse
-inward to a point somewhere within the stereo image.  A practical
-example would be balanced reverberations within a large, live space;
-normally the sound is diffuse and soft, giving a sonic impression of
-volume.  In point-stereo, the reverberations would still exist, but
-sound fairly firmly centered within the image (assuming the
-reverberation was centered overall; if the reverberation is stronger
-to the left, then the point of localization in point stereo would be
-to the left).  This effect is most noticeable at low and mid
-frequencies and using headphones (which grant perfect stereo
-separation). Point stereo is is a graceful but generally easy to
-detect degradation to the sound quality and is thus used in frequency
-ranges where it is least noticeable.<p>
-
-<h3>Mixed Stereo</h3>
-
-Mixed stereo is the simultaneous use of more than one of the above
-stereo encoding models, generally using more aggressive modes in
-higher frequencies, lower amplitudes or 'nearly' in-phase sound.<p>
-
-It is also the case that near-DC frequencies should be encoded using
-lossless coupling to avoid frame blocking artifacts.<p>
-
-<h3>Vorbis Stereo Modes</h3>
-
-Vorbis, as of 1.0, uses lossless stereo and a number of mixed modes
-constructed out of lossless and point stereo.  Phase stereo was used
-in the rc2 encoder, but is not currently used for simplicity's sake.  It
-will likely be re-added to the stereo model in the future.
-
-<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>
-
-
-
-
-
-

Deleted: websites/xiph.org/vorbis/doc/stream.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/v-comment.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/v-comment.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/v-comment.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,231 +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: comment field and header specification
-</font></h1>
-
-<em>Last update to this document: July 16, 2002</em><p>
-
-<h1>Overview</h1>
-
-<p>The Vorbis text comment header is the second (of three) header
-packets that begin a Vorbis bitstream. It is meant for short, text
-comments, not arbitrary metadata; arbitrary metadata belongs in a
-separate logical bitstream (usually an XML stream type) that provides
-greater structure and machine parseability.
-
-<p>The comment field is meant to be used much like someone jotting a
-quick note on the bottom of a CDR. It should be a little information to
-remember the disc by and explain it to others; a short, to-the-point
-text note that need not only be a couple words, but isn't going to be
-more than a short paragraph.  The essentials, in other words, whatever
-they turn out to be, eg:
-
-<blockquote>
-"Honest Bob and the Factory-to-Dealer-Incentives, _I'm Still Around_,
-opening for Moxy Fruvous, 1997"
-</blockquote>
-
-<h1>Comment encoding</h1>
-
-
-<h2>Structure</h2>
-
-The comment header logically is a list of eight-bit-clean vectors; the
-number of vectors is bounded to 2^32-1 and the length of each vector
-is limited to 2^32-1 bytes. The vector length is encoded; the vector
-contents themselves are not null terminated. In addition to the vector
-list, there is a single vector for vendor name (also 8 bit clean,
-length encoded in 32 bits). Libvorbis currently sets the vendor string
-to "Xiph.Org libVorbis I 20020717".<p>
-
-The comment header is decoded as follows:<p>
-
-<pre>
-  1) [vendor_length] = read an unsigned integer of 32 bits
-  2) [vendor_string] = read a UTF-8 vector as [vendor_length] octets
-  3) [user_comment_list_length] = read an unsigned integer of 32 bits
-  4) iterate [user_comment_list_length] times {
-
-       5) [length] = read an unsigned integer of 32 bits
-       6) this iteration's user comment = read a UTF-8 vector as [length] octets
-
-     }
-
-  7) [framing_bit] = read a single bit as boolean
-  8) if ( [framing_bit]  unset or end of packet ) then ERROR
-  9) done.
-</pre>
-
-
-<h2>Content vector format</h2>
-
-The comment vectors are structured similarly to a UNIX environment variable.
-That is, comment fields consist of a field name and a field value and
-look like:
-
-<pre>
-comment[0]="ARTIST=me"; 
-comment[1]="TITLE=the sound of Vorbis"; 
-</pre>
-
-<ul>
-<li>A case-insensitive field name that may consist of ASCII 0x20 through
-0x7D, 0x3D ('=') excluded. ASCII 0x41 through 0x5A inclusive (A-Z) is
-to be considered equivalent to ASCII 0x61 through 0x7A inclusive
-(a-z).
-
-<li>The field name is immediately followed by ASCII 0x3D ('='); this
-equals sign is used to terminate the field name.
-
-<li>0x3D is followed by 8 bit clean UTF-8 encoded field contents
-to the end of the field.
-</ul>
-
-<h3>Field names</h3>
-
-Below is a proposed, minimal list of standard field names with a
-description of intended use.  No single or group of field names is
-mandatory; a comment header may contain one, all or none of the names
-in this list.<p>
-
-<dl>
-<dt>TITLE<dd>Track/Work name
-
-<dt>VERSION<dd>The version field may be used to differentiate multiple
-versions of the same track title in a single collection. (e.g. remix info)
-
-<dt>ALBUM<dd>The collection name to which this track belongs
-
-<dt>TRACKNUMBER<dd>The track number of this piece if part of a specific larger collection or album
-
-<dt>ARTIST<dd>The artist generally considered responsible for the work. In popular music this is usually the performing band or singer. For classical music it would be the composer. For an audio book it would be the author of the original text.
-
-<dt>PERFORMER<dd>The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists. In an audio book it would be the actor who did the reading. In popular music this is typically the same as the ARTIST and is omitted.
-
-<dt>COPYRIGHT<dd>Copyright attribution, e.g., '2001 Nobody's Band' or '1999 Jack Moffitt'
-
-<dt>LICENSE<dd>License information, eg, 'All Rights Reserved', 'Any
-Use Permitted', a URL to a license such as a Creative Commons license
-("www.creativecommons.org/blahblah/license.html") or the EFF Open
-Audio License ('distributed under the terms of the Open Audio
-License. see http://www.eff.org/IP/Open_licenses/eff_oal.html for
-details'), etc.
-
-<dt>ORGANIZATION<dd>Name of the organization producing the track (i.e.
-the 'record label')
-
-<dt>DESCRIPTION<dd>A short text description of the contents
-
-<dt>GENRE<dd>A short text indication of music genre
-
-<dt>DATE<dd>Date the track was recorded
-
-<dt>LOCATION<dd>Location where track was recorded
-
-<dt>CONTACT<dd>Contact information for the creators or distributors of the track. This could be a URL, an email address, the physical address of the producing label.
-
-<dt>ISRC<dd>ISRC number for the track; see <a href="http://www.ifpi.org/site-content/online/isrc_intro.html">the ISRC intro page</a> for more information on ISRC numbers.
-
-</dl>
-
-<h3>Implications</h3>
-<ul>
-<li>
-Field names should not be 'internationalized'; this is a
-concession to simplicity not an attempt to exclude the majority of
-the world that doesn't speak English. Field *contents*, however,
-are represented in UTF-8 to allow easy representation of any language.
-<li>
-We have the length of the entirety of the field and restrictions on
-the field name so that the field name is bounded in a known way. Thus
-we also have the length of the field contents.
-<li>
-Individual 'vendors' may use non-standard field names within
-reason. The proper use of comment fields should be clear through
-context at this point.  Abuse will be discouraged.
-<li>
-There is no vendor-specific prefix to 'nonstandard' field names.
-Vendors should make some effort to avoid arbitrarily polluting the
-common namespace. We will generally collect the more useful tags
-here to help with standardization.
-<li>
-Field names are not required to be unique (occur once) within a
-comment header.  As an example, assume a track was recorded by three
-well know artists; the following is permissible, and encouraged:
-<pre>
-              ARTIST=Dizzy Gillespie 
-              ARTIST=Sonny Rollins 
-              ARTIST=Sonny Stitt 
-</pre>
-
-</ul>
-
-<h2>Encoding</h2> 
-
-The comment header comprises the entirety of the second bitstream
-header packet.  Unlike the first bitstream header packet, it is not
-generally the only packet on the second page and may not be restricted
-to within the second bitstream page.  The length of the comment header
-packet is [practically] unbounded.  The comment header packet is not
-optional; it must be present in the bitstream even if it is
-effectively empty.<p>
-
-The comment header is encoded as follows (as per Ogg's standard
-bitstream mapping which renders least-significant-bit of the word to be
-coded into the least significant available bit of the current
-bitstream octet first):
-
-<ol>
-<li>
-Vendor string length (32 bit unsigned quantity specifying number of octets)
-
-<li>
-Vendor string ([vendor string length] octets coded from beginning of string to end of string, not null terminated)
-
-<li>Number of comment fields (32 bit unsigned quantity specifying number of fields)
-
-<li>Comment field 0 length (if [Number of comment fields]>0; 32 bit unsigned quantity specifying number of octets)
-
-<li>
-Comment field 0 ([Comment field 0 length] octets coded from beginning of string to end of string, not null terminated)
- 
-<li>Comment field 1 length (if [Number of comment fields]>1...)...
-</ol>
-
-This is actually somewhat easier to describe in code; implementation of the above can be found in vorbis/lib/info.c:_vorbis_pack_comment(),_vorbis_unpack_comment()
-
-<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>
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-clip.txt
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-clip.txt	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-clip.txt	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,139 +0,0 @@
-Topic:
-
-Sample granularity editing of a Vorbis file; inferred arbitrary sample
-length starting offsets / PCM stream lengths
-
-Overview:
-
-Vorbis, like mp3, is a frame-based* audio compression where audio is
-broken up into discrete short time segments.  These segments are
-'atomic' that is, one must recover the entire short time segment from
-the frame packet; there's no way to recover only a part of the PCM time
-segment from part of the coded packet without expanding the entire
-packet and then discarding a portion of the resulting PCM audio.
-
-* In mp3, the data segment representing a given time period is called
-  a 'frame'; the roughly equivalent Vorbis construct is a 'packet'.
-
-Thus, when we edit a Vorbis stream, the finest physical editing
-granularity is on these packet boundaries (the mp3 case is
-actually somewhat more complex and mp3 editing is more complicated
-than just snipping on a frame boundary because time data can be spread
-backward or forward over frames.  In Vorbis, packets are all
-stand-alone).  Thus, at the physical packet level, Vorbis is still
-limited to streams that contain an integral number of packets.
-
-However, Vorbis streams may still exactly represent and be edited to a
-PCM stream of arbitrary length and starting offset without padding the
-beginning or end of the decoded stream or requiring that the desired
-edit points be packet aligned.  Vorbis makes use of Ogg stream
-framing, and this framing provides time-stamping data, called a
-'granule position'; our starting offset and finished stream length may
-be inferred from correct usage of the granule position data.
-
-Time stamping mechanism:
-
-Vorbis packets are bundled into into Ogg pages (note that pages do not
-necessarily contain integral numbers of packets, but that isn't
-inportant in this discussion.  More about Ogg framing can be found in
-ogg/doc/framing.html).  Each page that contains a packet boundary is
-stamped with the absolute sample-granularity offset of the data, that
-is, 'complete samples-to-date' up to the last completed packet of that
-page. (The same mechanism is used for eg, video, where the number
-represents complete 2-D frames, and so on).
-
-(It's possible but rare for a packet to span more than two pages such
-that page[s] in the middle have no packet boundary; these packets have
-a granule position of '-1'.)
-
-This granule position mechaism in Ogg is used by Vorbis to indicate when the
-PCM data intended to be represented in a Vorbis segment begins a
-number of samples into the data represented by the first packet[s]
-and/or ends before the physical PCM data represented in the last
-packet[s].
-
-File length a non-integral number of frames:
-
-A file to be encoded in Vorbis will probably not encode into an
-integral number of packets; such a file is encoded with the last
-packet containing 'extra'* samples. These samples are not padding; they
-will be discarded in decode. 
-
-*(For best results, the encoder should use extra samples that preserve
-the character of the last frame.  Simply setting them to zero will
-introduce a 'cliff' that's hard to encode, resulting in spread-frame
-noise.  Libvorbis extrapolates the last frame past the end of data to
-produce the extra samples.  Even simply duplicating the last value is
-better than clamping the signal to zero).
-
-The encoder indicates to the decoder that the file is actually shorter
-than all of the samples ('original' + 'extra') by setting the granule
-position in the last page to a short value, that is, the last
-timestamp is the original length of the file discarding extra samples.
-The decoder will see that the number of samples it has decoded in the
-last page is too many; it is 'original' + 'extra', where the
-granulepos says that through the last packet we only have 'original'
-number of samples.  The decoder then ignores the 'extra' samples.
-This behavior is to occur only when the end-of-stream bit is set in
-the page (indicating last page of the logical stream).
- 
-Note that it not legal for the granule position of the last page to
-indicate that there are more samples in the file than actually exist,
-however, implementations should handle such an illegal file gracefully
-in the interests of robust programming.
-
-Beginning point not on integral packet boundary:
-
-It is possible that we will the PCM data represented by a Vorbis
-stream to begin at a position later than where the decoded PCM data
-really begins after an integral packet boundary, a situation analagous
-to the above description where the PCM data does not end at an
-integral packet boundary.  The easiest example is taking a clip out of
-a larger Vorbis stream, and choosing a beginning point of the clip
-that is not on a packet boundary; we need to ignore a few samples to
-get the desired beginning point.
-
-The process of marking the desired beginning point is similar to
-marking an arbitrary ending point. If the encoder wishes sample zero
-to be some location past the actual beginning of data, it associates a
-'short' granule position value with the completion of the second*
-audio packet.  The granule position is associated with the second
-packet simply by making sure the second packet completes its page.
-
-*(We associate the short value with the second packet for two reasons.
- a) The first packet only primes the overlap/add buffer.  No data is
- returned before decoding the second packet; this places the decision
- information at the point of decision.  b) Placing the short value on
- the first packet would make the value negative (as the first packet
- normally represents position zero); a negative value would break the
- requirement that granule positions increase; the headers have
- position values of zero)
-
-The decoder sees that on the first page that will return
-data from the overlap/add queue, we have more samples than the granule
-position accounts for, and discards the 'surplus' from the beginning
-of the queue.
-
-Note that short granule values (indicating less than the actually
-returned about of data) are not legal in the Vorbis spec outside of
-indicating beginning and ending sample positions.  However, decoders
-should, at minimum, tolerate inadvertant short values elsewhere in the
-stream (just as they should tolerate out-of-order/non-increasing
-granulepos values, although this too is illegal).
-
-Beginning point at arbitrary positive timestamp (no 'zero' sample):
-
-It's also possible that the granule position of the first page of an
-audio stream is a 'long value', that is, a value larger than the
-amount of PCM audio decoded.  This implies only that we are starting
-playback at some point into the logical stream, a potentially common
-occurence in streaming applications where the decoder may be
-connecting into a live stream.  The decoder should not treat the long
-value specially.
-
-A long value elsewhere in the stream would normally occur only when a
-page is lost or out of sequence, as indicated by the page's sequence
-number.  A long value under any other situation is not legal, however
-a decoder should tolerate both possibilities.
-
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-errors.txt
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-errors.txt	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-errors.txt	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,103 +0,0 @@
-Error return codes possible from libvorbis and libvorbisfile:
-
-All 'failure' style returns are <0; this either indicates a generic
-'false' value (eg, ready?  T or F) or an error condition.  Code can
-safely just test for < 0, or look at the specific return code for more
-detail.
-
-*** Return codes:
-
-OV_FALSE        The call returned a 'false' status (eg, ov_bitrate_instant 
-		can return OV_FALSE if playback is not in progress, and thus 
-		there is no instantaneous bitrate information to report.
-
-OV_HOLE		libvorbis/libvorbisfile is alerting the application that 
-		there was an interruption in the data (one of: garbage 
-		between pages, loss of sync followed by recapture, or a 
-		corrupt page)
-
-OV_EREAD        A read from media returned an error.
-
-OV_EFAULT       Internal logic fault; indicates a bug or heap/stack 
-		corruption.
-
-OV_EIMPL        The bitstream makes use of a feature not implemented in this 
-		library version.
-
-OV_EINVAL       Invalid argument value.
-
-OV_ENOTVORBIS	Bitstream/page/packet is not Vorbis data.
-
-OV_EBADHEADER   Invalid Vorbis bitstream header.
-
-OV_EVERSION	Vorbis version mismatch.
-
-OV_ENOTAUDIO	Packet data submitted to vorbis_synthesis is not audio data.
-
-OV_EBADPACKET	Invalid packet submitted to vorbis_synthesis.
-
-OV_EBADLINK	Invalid stream section supplied to libvorbis/libvorbisfile, 
-		or the requested link is corrupt. 
-
-OV_ENOSEEK	Bitstream is not seekable.
-
-
-****************************************************************
-*** Libvorbis functions that can return failure/error codes:
-
-int vorbis_analysis_headerout()
-    OV_EIMPL
-
-int vorbis_analysis_wrote()
-    OV_EINVAL
-
-int vorbis_synthesis_headerin()
-    OV_ENOTVORBIS, OV_EVERSION, OV_EBADHEADER
-
-int vorbis_synthesis()
-    OV_ENOTAUDIO, OV_EBADPACKET
-
-int vorbis_synthesis_read()
-    OV_EINVAL
-
-****************************************************************
-*** Libvorbisfile functions that can return failure/error codes:
-
-int ov_open_callbacks()   
-    OV_EREAD, OV_ENOTVORBIS, OV_EVERSION, OV_EBADHEADER, OV_FAULT
-
-int ov_open()
-    OV_EREAD, OV_ENOTVORBIS, OV_EVERSION, OV_EBADHEADER, OV_FAULT
-
-long ov_bitrate()
-    OV_EINVAL, OV_FALSE
-
-long ov_bitrate_instant()
-    OV_FALSE
-
-ogg_int64_t ov_raw_total()
-    OV_EINVAL
-
-ogg_int64_t ov_pcm_total()
-    OV_EINVAL
-
-double ov_time_total()
-    OV_EINVAL
-
-int ov_raw_seek()
-    OV_ENOSEEK, OV_EINVAL, OV_BADLINK
-
-int ov_pcm_seek_page()
-    OV_ENOSEEK, OV_EINVAL, OV_EREAD, OV_BADLINK, OV_FAULT
-
-int ov_pcm_seek()
-    OV_ENOSEEK, OV_EINVAL, OV_EREAD, OV_BADLINK, OV_FAULT
-
-int ov_time_seek()
-    OV_ENOSEEK, OV_EINVAL, OV_EREAD, OV_BADLINK, OV_FAULT
-
-int ov_time_seek_page()
-    OV_ENOSEEK, OV_EINVAL, OV_EREAD, OV_BADLINK, OV_FAULT
-
-long ov_read()
-    OV_HOLE, OV_EBADLINK

Deleted: websites/xiph.org/vorbis/doc/vorbis-fidelity.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-fidelity.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-fidelity.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,142 +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: Fidelity measurement and terminology discussion
-</font></h1>
-
-<em>Last update to this document: July 16, 2002</em><p> 
-
-Terminology discussed in this document is based on common terminology
-associated with contemporary codecs such as MPEG I audio layer 3
-(mp3).  However, some differences in terminology are useful in the
-context of Vorbis as Vorbis functions somewhat differently than most
-current formats.  For clarity, then, we describe a common terminology
-for discussion of Vorbis's and other formats' audio quality.<p>
-
-<h2>Subjective and Objective</h2>
-
-<em>Objective</em> fidelity is a measure, based on a computable,
-mechanical metric, of how carefully an output matches an input.  For
-example, a stereo amplifier may claim to introduce less that .01%
-total harmonic distortion when amplifying an input signal; this claim
-is easy to verify given proper equipment, and any number of testers are
-likely to arrive at the same, exact results.  One need not listen to
-the equipment to make this measurement.<p>
-
-However, given two amplifiers with identical, verifiable objective
-specifications, listeners may strongly prefer the sound quality of one
-over the other.  This is actually the case in the decades old debate
-[some would say jihad] among audiophiles involving vacuum tube versus
-solid state amplifiers.  There are people who can tell the difference,
-and strongly prefer one over the other despite seemingly identical,
-measurable quality.  This preference is <em>subjective</em> and
-difficult to measure but nonetheless real.
-
-Individual elements of subjective differences often can be qualified,
-but overall subjective quality generally is not measurable.  Different
-observers are likely to disagree on the exact results of a subjective
-test as each observer's perspective differs.  When measuring
-subjective qualities, the best one can hope for is average, empirical
-results that show statistical significance across a group.<p>
-
-Perceptual codecs are most concerned with subjective, not objective,
-quality.  This is why evaluating a perceptual codec via distortion
-measures and sonograms alone is useless; these objective measures may
-provide insight into the quality or functioning of a codec, but cannot
-answer the much squishier subjective question, "Does it sound
-good?". The tube amplifier example is perhaps not the best as very few
-people can hear, or care to hear, the minute differences between tubes
-and transistors, whereas the subjective differences in perceptual
-codecs tend to be quite large even when objective differences are
-not.<p>
-
-<h2>Fidelity, Artifacts and Differences</h2> Audio <em>artifacts</em>
-and loss of fidelity or more simply put, audio <em>differences</em>
-are not the same thing.<p>
-
-A loss of fidelity implies differences between the perceived input and
-output signal; it does not necessarily imply that the differences in
-output are displeasing or that the output sounds poor (although this
-is often the case).  Tube amplifiers are <em>not</em> higher fidelity
-than modern solid state and digital systems.  They simply produce a
-form of distortion and coloring that is either unnoticeable or actually
-pleasing to many ears.<p>
-
-As compared to an original signal using hard metrics, all perceptual
-codecs [ASPEC, ATRAC, MP3, WMA, AAC, TwinVQ, AC3 and Vorbis included]
-lose objective fidelity in order to reduce bitrate.  This is fact. The
-idea is to lose fidelity in ways that cannot be perceived.  However,
-most current streaming applications demand bitrates lower than what
-can be achieved by sacrificing only objective fidelity; this is also
-fact, despite whatever various company press releases might claim.
-Subjective fidelity eventually must suffer in one way or another.<p>
-
-The goal is to choose the best possible tradeoff such that the
-fidelity loss is graceful and not obviously noticeable.  Most listeners
-of FM radio do not realize how much lower fidelity that medium is as
-compared to compact discs or DAT.  However, when compared directly to
-source material, the difference is obvious.  A cassette tape is lower
-fidelity still, and yet the degradation, relatively speaking, is
-graceful and generally easy not to notice.  Compare this graceful loss
-of quality to an average 44.1kHz stereo mp3 encoded at 80 or 96kbps.
-The mp3 might actually be higher objective fidelity but subjectively
-sounds much worse.<p>
-
-Thus, when a CODEC <em>must</em> sacrifice subjective quality in order
-to satisfy a user's requirements, the result should be a
-<em>difference</em> that is generally either difficult to notice
-without comparison, or easy to ignore.  An <em>artifact</em>, on the
-other hand, is an element introduced into the output that is
-immediately noticeable, obviously foreign, and undesired.  The famous
-'underwater' or 'twinkling' effect synonymous with low bitrate (or
-poorly encoded) mp3 is an example of an <em>artifact</em>.  This
-working definition differs slightly from common usage, but the coined
-distinction between differences and artifacts is useful for our
-discussion.<p>
-
-The goal, when it is absolutely necessary to sacrifice subjective
-fidelity, is obviously to strive for differences and not artifacts.
-The vast majority of codecs today fail at this task miserably,
-predictably, and regularly in one way or another.  Avoiding such
-failures when it is necessary to sacrifice subjective quality is a
-fundamental design objective of Vorbis and that objective is reflected
-in Vorbis's design and tuning.<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>
-
-
-
-
-
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-ogg.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-ogg.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-ogg.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -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/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>
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-spec-bitpack.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-spec-bitpack.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-spec-bitpack.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -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>
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-spec-codebook.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-spec-codebook.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-spec-codebook.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -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>
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-spec-floor0.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-spec-floor0.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-spec-floor0.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -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>
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-spec-floor1.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-spec-floor1.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-spec-floor1.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -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>
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-spec-intro.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-spec-intro.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-spec-intro.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -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>
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-spec-ref.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-spec-ref.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-spec-ref.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -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>
-

Deleted: websites/xiph.org/vorbis/doc/vorbis-spec-res.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis-spec-res.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis-spec-res.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -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>
-

Deleted: websites/xiph.org/vorbis/doc/vorbis.html
===================================================================
--- websites/xiph.org/ogg/vorbis/doc/vorbis.html	2005-09-04 05:06:42 UTC (rev 9943)
+++ websites/xiph.org/vorbis/doc/vorbis.html	2005-09-04 17:25:32 UTC (rev 9945)
@@ -1,197 +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 encoding format documentation
-</font></h1>
-
-<em>Last update to this document: July 2, 2002</em><br> 
-<em>Last update to Vorbis documentation: July 2, 2002</em><p> 
-
-<table><tr><td>
-<img src=wait.png>
-</td><td valign=center>
-As of writing, not all the below document
-links are live.  They will be populated as we complete the
-documents.
-</td></tr></table>
-
-<p>
-<h2>Documents</h2>
-<ul>
-<li><a href="packet.html">Vorbis packet structure</a>
-<li><a href="envelope.html">Temporal envelope shaping and blocksize</a>
-<li><a href="mdct.html">Time domain segmentation and MDCT transform</a>
-<li><a href="resolution.html">The resolution floor</a>
-<li><a href="residuals.html">MDCT-domain fine structure</a><p>
-
-<li><a href="probmodel.html">The Vorbis probability model</a>
-
-<li><a href="bitpack.html">The Vorbis bitpacker</a><p>
-
-<li><a href="oggstream.html">Ogg bitstream overview</a>
-<li><a href="framing.html">Ogg logical bitstream and framing spec</a>
-<li><a href="vorbis-stream.html">Vorbis packet->Ogg bitstream 
-       mapping</a><p>
-
-<li><a href="programming.html">Programming with libvorbis</a><p>
-</ul>
-
-<h2>Description</h2>
-Ogg Vorbis is a general purpose compressed audio format
-for high quality (44.1-48.0kHz, 16+ bit, polyphonic) audio and music
-at moderate fixed and variable bitrates (40-80 kb/s/channel).  This
-places Vorbis in the same class as audio representations including
-MPEG-1 audio layer 3, MPEG-4 audio (AAC and TwinVQ), and PAC.<p>
-
-Vorbis is the first of a planned family of Ogg multimedia coding
-formats being developed as part of the Xiph.org Foundation's Ogg multimedia
-project.  See <a href="http://www.xiph.org/">http://www.xiph.org/</a>
-for more information.
-
-<h2>Vorbis technical documents</h2>
-
-A Vorbis encoder takes in overlapping (but contiguous) short-time
-segments of audio data. The encoder analyzes the content of the audio
-to determine an optimal compact representation; this phase of encoding
-is known as <em>analysis</em>.  For each short-time block of sound,
-the encoder then packs an efficient representation of the signal, as
-determined by analysis, into a raw packet much smaller than the size
-required by the original signal; this phase is <em>coding</em>.
-Lastly, in a streaming environment, the raw packets are then
-structured into a continuous stream of octets; this last phase is
-<em>streaming</em>. Note that the stream of octets is referred to both
-as a 'byte-' and 'bit-'stream; the latter usage is acceptible as the
-stream of octets is a physical representation of a true logical
-bit-by-bit stream.<p>
-
-A Vorbis decoder performs a mirror image process of extracting the
-original sequence of raw packets from an Ogg stream (<em>stream
-decomposition</em>), reconstructing the signal representation from the
-raw data in the packet (<em>decoding</em>) and them reconstituting an
-audio signal from the decoded representation (<em>synthesis</em>).<p>
-
-The <a href="programming.html">Programming with libvorbis</a>
-documents discuss use of the reference Vorbis codec library
-(libvorbis) produced by the Xiph.org Foundation.<p>
-
-The data representations and algorithms necessary at each step to
-encode and decode Ogg Vorbis bitstreams are described by the below
-documents in sufficient detail to construct a complete Vorbis codec.
-Note that at the time of writing, Vorbis is still in a 'Request For
-Comments' stage of development; despite being in advanced stages of
-development, input from the multimedia community is welcome.<p>
-
-<h3>Vorbis analysis and synthesis</h3>
-
-Analysis begins by seperating an input audio stream into individual,
-overlapping short-time segments of audio data.  These segments are
-then transformed into an alternate representation, seeking to
-represent the original signal in a more efficient form that codes into
-a smaller number of bytes.  The analysis and transformation stage is
-the most complex element of producing a Vorbis bitstream.<p>
-
-The corresponding synthesis step in the decoder is simpler; there is
-no analysis to perform, merely a mechanical, deterministic
-reconstruction of the original audio data from the transform-domain
-representation.<p>
-
-<ul>
-<li><a href="packet.html">Vorbis packet structure</a>: Describes the basic analysis components necessary to produce Vorbis packets and the structure of the packet itself.
-<li><a href="envelope.html">Temporal envelope shaping and blocksize</a>: Use of temporal envelope shaping and variable blocksize to minimize time-domain energy leakage during wide dynamic range and spectral energy swings.  Also discusses time-related principles of psychoacoustics.
-<li><a href="mdct.html">Time domain segmentation and MDCT transform</a>: Division of time domain data into individual overlapped, windowed short-time vectors and transformation using the MDCT
-<li><a href="resolution.html">The resolution floor</a>: Use of frequency doamin psychoacoustics, and the MDCT-domain noise, masking and resolution floors
-<li><a href="residuals.html">MDCT-domain fine structure</a>: Production, quantization and massaging of MDCT-spectrum fine structure
-</ul>
-
-<h3>Vorbis coding and decoding</h3>
-
-Coding and decoding converts the transform-domain representation of
-the original audio produced by analysis to and from a bitwise packed
-raw data packet.  Coding and decoding consist of two logically
-orthogonal concepts, <em>back-end coding</em> and <em>bitpacking</em>.<p>
-
-<em>Back-end coding</em> uses a probability model to represent the raw numbers
-of the audio representation in as few physical bits as possible;
-familiar examples of back-end coding include Huffman coding and Vector
-Quantization.<p>
-
-<em>Bitpacking</em> arranges the variable sized words of the back-end
-coding into a vector of octets without wasting space.  The octets
-produced by coding a single short-time audio segment is one raw Vorbis
-packet.<p>
-
-<ul>
-
-<li><a href="probmodel.html">The Vorbis probability model</a>
-
-<li><a href="bitpack.html">The Vorbis bitpacker</a>: Arrangement of 
-variable bit-length words into an octet-aligned packet.
-
-</ul>
-
-<h3>Vorbis streaming and stream decomposition</h3>
-
-Vorbis packets contain the raw, bitwise-compressed representation of a
-snippet of audio.  These packets contain no structure and cannot be
-strung together directly into a stream; for streamed transmission and
-storage, Vorbis packets are encoded into an Ogg bitstream.<p>
-
-<ul>
-
-<li><a href="oggstream.html">Ogg bitstream overview</a>: High-level
-description of Ogg logical bitstreams, how logical bitstreams
-(of mixed media types) can be combined into physical bitstreams, and
-restrictions on logical-to-physical mapping.  Note that this document is
-not specific only to Ogg Vorbis.
-
-<li><a href="framing.html">Ogg logical bitstream and framing
-spec</a>: Low level, complete specification of Ogg logical
-bitstream pages.  Note that this document is not specific only to Ogg
-Vorbis.
-
-<li><a href="vorbis-stream.html">Vorbis bitstream mapping</a>:
-Specifically describes mapping Vorbis data into an
-Ogg physical bitstream.  
-
-</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>
-
-
-
-
-
-

Deleted: websites/xiph.org/vorbis/doc/vorbisword2.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/wait.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/white-ogg.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/white-xifish.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/window1.png
===================================================================
(Binary files differ)

Deleted: websites/xiph.org/vorbis/doc/window2.png
===================================================================
(Binary files differ)

Copied: websites/xiph.org/vorbis/docs.html (from rev 9943, websites/xiph.org/ogg/vorbis/docs.html)

Copied: websites/xiph.org/vorbis/donate.html (from rev 9943, websites/xiph.org/ogg/vorbis/donate.html)

Copied: websites/xiph.org/vorbis/download (from rev 9943, websites/xiph.org/ogg/vorbis/download)

Copied: websites/xiph.org/vorbis/download.html (from rev 9943, websites/xiph.org/ogg/vorbis/download.html)

Copied: websites/xiph.org/vorbis/download_old.html (from rev 9943, websites/xiph.org/ogg/vorbis/download_old.html)

Copied: websites/xiph.org/vorbis/faq.html (from rev 9943, websites/xiph.org/ogg/vorbis/faq.html)

Copied: websites/xiph.org/vorbis/flac.html (from rev 9943, websites/xiph.org/ogg/vorbis/flac.html)

Copied: websites/xiph.org/vorbis/hardware (from rev 9943, websites/xiph.org/ogg/vorbis/hardware)

Copied: websites/xiph.org/vorbis/hardware.html (from rev 9943, websites/xiph.org/ogg/vorbis/hardware.html)

Copied: websites/xiph.org/vorbis/hardware.jpg (from rev 9943, websites/xiph.org/ogg/vorbis/hardware.jpg)

Copied: websites/xiph.org/vorbis/index.html (from rev 9943, websites/xiph.org/ogg/vorbis/index.html)

Copied: websites/xiph.org/vorbis/index_old.html (from rev 9943, websites/xiph.org/ogg/vorbis/index_old.html)

Copied: websites/xiph.org/vorbis/letter.html (from rev 9943, websites/xiph.org/ogg/vorbis/letter.html)

Copied: websites/xiph.org/vorbis/listen.html (from rev 9943, websites/xiph.org/ogg/vorbis/listen.html)

Copied: websites/xiph.org/vorbis/mail.html (from rev 9943, websites/xiph.org/ogg/vorbis/mail.html)

Copied: websites/xiph.org/vorbis/neuros.html (from rev 9943, websites/xiph.org/ogg/vorbis/neuros.html)

Copied: websites/xiph.org/vorbis/october.html (from rev 9943, websites/xiph.org/ogg/vorbis/october.html)

Copied: websites/xiph.org/vorbis/oggtop.include (from rev 9943, websites/xiph.org/ogg/vorbis/oggtop.include)

Copied: websites/xiph.org/vorbis/ogm.html (from rev 9943, websites/xiph.org/ogg/vorbis/ogm.html)

Copied: websites/xiph.org/vorbis/openletter.html (from rev 9943, websites/xiph.org/ogg/vorbis/openletter.html)

Copied: websites/xiph.org/vorbis/portables.html (from rev 9943, websites/xiph.org/ogg/vorbis/portables.html)

Copied: websites/xiph.org/vorbis/update.html (from rev 9943, websites/xiph.org/ogg/vorbis/update.html)

Copied: websites/xiph.org/vorbis/vorbis-1.0-spec.tgz (from rev 9943, websites/xiph.org/ogg/vorbis/vorbis-1.0-spec.tgz)



More information about the commits mailing list