[xiph-cvs] cvs commit: vorbis/vq bookutil.c bookutil.h build.c cascade.c genericdata.c huffbuild.c latticebuild.c latticehint.c latticepare.c latticetune.c lspdata.c metrics.c residuedata.c residuesplit.c run.c train.c vqext.h vqgen.c vqgen.h vqsplit.c vqsplit.h

Monty xiphmont at xiph.org
Wed Oct 11 20:21:58 PDT 2000



xiphmont    00/10/11 20:13:05

  Modified:    .        README configure configure.in
               doc      .cvsignore Makefile.am
               examples chaining_example.c decoder_example.c
                        encoder_example.c vorbisfile_example.c
               include/vorbis backends.h codebook.h codec.h mode_D.h
                        mode_E.h vorbisfile.h
               include/vorbis/book res0_1024a_128_1.vqh
                        res0_1024a_128_2.vqh res0_1024a_128_3.vqh
                        res0_1024a_128_4.vqh res0_1024a_128_5.vqh
                        res0_1024a_128_6.vqh res0_1024a_128_7.vqh
                        res0_1024a_128_8.vqh res0_1024a_128_9.vqh
                        res0_1024a_160_1.vqh res0_1024a_160_2.vqh
                        res0_1024a_160_3.vqh res0_1024a_160_4.vqh
                        res0_1024a_160_5.vqh res0_1024a_160_6.vqh
                        res0_1024a_160_7.vqh res0_1024a_160_8.vqh
                        res0_1024a_160_9.vqh res0_1024a_192_1.vqh
                        res0_1024a_192_2.vqh res0_1024a_192_3.vqh
                        res0_1024a_192_4.vqh res0_1024a_192_5.vqh
                        res0_1024a_256_1.vqh res0_1024a_256_2.vqh
                        res0_1024a_256_3.vqh res0_1024a_256_4.vqh
                        res0_1024a_256_5.vqh res0_1024a_350_1.vqh
                        res0_1024a_350_2.vqh res0_1024a_350_3.vqh
                        res0_1024a_350_4.vqh res0_1024a_350_5.vqh
                        res0_128a_128_1.vqh res0_128a_128_2.vqh
                        res0_128a_128_3.vqh res0_128a_128_4.vqh
                        res0_128a_128_5.vqh res0_128a_160_1.vqh
                        res0_128a_160_2.vqh res0_128a_160_3.vqh
                        res0_128a_160_4.vqh res0_128a_160_5.vqh
                        res0_128a_192_1.vqh res0_128a_192_2.vqh
                        res0_128a_192_3.vqh res0_128a_192_4.vqh
                        res0_128a_192_5.vqh res0_128a_256_1.vqh
                        res0_128a_256_2.vqh res0_128a_256_3.vqh
                        res0_128a_256_4.vqh res0_128a_256_5.vqh
                        res0_128a_350_1.vqh res0_128a_350_2.vqh
                        res0_128a_350_3.vqh res0_128a_350_4.vqh
                        res0_128a_350_5.vqh
               lib      Makefile.in analysis.c block.c bookinternal.h
                        codebook.c envelope.c envelope.h floor0.c iir.c
                        iir.h info.c lpc.c lpc.h lsp.c lsp.h mapping0.c
                        masking.h mdct.c mdct.h misc.h os.h psy.c psy.h
                        psytune.c res0.c scales.h sharedbook.c sharedbook.h
                        smallft.c smallft.h synthesis.c time0.c
                        vorbisfile.c window.c window.h
               vq       bookutil.c bookutil.h build.c cascade.c
                        genericdata.c huffbuild.c latticebuild.c
                        latticehint.c latticepare.c latticetune.c lspdata.c
                        metrics.c residuedata.c residuesplit.c run.c
                        train.c vqext.h vqgen.c vqgen.h vqsplit.c vqsplit.h
  Added:       .        .cvsignore Makefile.am autogen.sh libvorbis.spec
               examples .cvsignore Makefile.am
               include  .cvsignore Makefile.am
               include/vorbis .cvsignore Makefile.am
               include/vorbis/book .cvsignore Makefile.am
               lib      .cvsignore Makefile.am lookup.c lookup.h
                        lookup_data.h lookups.pl tone.c
  Removed:     .        COPYING.LIB Makefile.in configure.guess
                        configure.sub install.sh vorbis.spec
               examples Makefile.in seeking_test.c
               include/vorbis internal.h os_types.h.in
               lib      bitwise.c bitwise.h spectrum.h
  Log:
  Merging the postbeta2 branch onto the mainline.
  
  Monty

Revision  Changes    Path
1.5       +50 -16    vorbis/README

Index: README
===================================================================
RCS file: /usr/local/cvsroot/vorbis/README,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
- --- README	2000/05/12 21:42:04	1.4
+++ README	2000/10/12 03:12:36	1.5
@@ -2,8 +2,8 @@
 *                                                                  *
 * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE.  *
 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
- -* THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE.    *
- -* PLEASE READ THESE TERMS DISTRIBUTING.                            *
+* THE GNU LESSER/LIBRARY PUBLIC LICENSE 2, WHICH IS INCLUDED WITH  *
+* THIS SOURCE.  PLEASE READ THESE TERMS DISTRIBUTING.              *
 *                                                                  *
 * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-2000             *
 * by Monty <monty at xiph.org> and The XIPHOPHORUS Company            *
@@ -11,9 +11,24 @@
 *                                                                  *
 ********************************************************************
 
+NEW AND IMPORTANT:
+
+If you're used to the source distribution from the first two beta
+relaeases, things are now rearranged a bit.  Specifically, the
+'vorbis' CVS module contains only the libvorbis and libvorbisfile
+libraries.  Because Ogg bitstreams are to be used by other Ogg codecs,
+Ogg framing and streaming functionality is now in libogg (the 'ogg'
+CVS module).  Vorbis utilities are in 'vorbis-tools' and various
+player plugins are in 'vorbis-plugins'.  For now, you'll need to check
+out these other modules seperately.
+
+Secondly, the Ogg/Vorbis build systems now use automake.  Instead of
+'./configure;make', the proper build sequence (in each module) is
+'./autogen.sh;make'.
+
 WHAT'S HERE:
 
- -This source distribution includes libvorbis, a full-featured example
+This source distribution includes libvorbis and an example
 encoder/player to demonstrate use of libvorbis and documentation on
 the Ogg Vorbis audio coding format.
 
@@ -22,13 +37,22 @@
 ./lib  		The source for libvorbis, an LGPLed inplementation of 
                 the public domain OggSquish Vorbis audio encoding
                 format.
+
+./include       Library API headers and codebooks
+
+./debian        Rules/spec files for building Debian .deb packages
+
+./doc           Vorbis specification documents
+
+./examples	Example code illustrating programmatic use of libogg, 
+		libvorbis, libvorbisfile and libvorbisenc
 
- -./cmdline	A full-featured command line encoder/decoder/player
- -		utility ('vorbis') that demonstrates programmatic use
- -		of libvorbis.
+./mac 		Codewarrior project files and build tweaks for MacOS.
 
- -./docs          Vorbis specification documents
 
+./vq 		Internal utilities for training/building new LSP/residue 
+		and auxiliary codebooks.
+
 WHAT IS VORBIS:
 
 Vorbis is a general purpose audio and music encoding format
@@ -39,12 +63,22 @@
 All the technical details are published and documented, and any
 software entity may make full use of the format without royalty or
 patent concerns.
+
+This package contains:
 
- -This package contains libvorbis, an LGPLed software implementation of
+.) libvorbis, an LGPLed software implementation of
 the Vorbis specification by the Xiphophorus company
- -(http://www.xiph.org/), vorbisfile, an LGPLed convenience library
+(http://www.xiph.org/) 
+
+.) libvorbisfile, an LGPLed convenience library
 built on Vorbis designed to simplify common uses and a number of GPL
- -example programs, utilities and player plugins.
+example programs
+
+.) libvorbisenc, an LGPL library that provides a simple, programmatic
+encoding setup interface 
+
+.) example code making use of libogg, libvorbis, libvorbisfile and
+libvorbisenc
 
 CONTACT:
 
@@ -57,17 +91,17 @@
 
 A standard build should consist of nothing more than:
 
- -./configure
+./autogen.sh
 make 
 
 and as root if desired :
 
 make install
 
- -This will install the ogg vorbis commandline encoder/player ('ogg')
- -into /usr/local/bin, the ogg player and libvorbis manpages into
- -/usr/local/man/ and libvorbis.a into /usr/local/lib.
+This will install the vorbis libraries (static and shared) into
+/usr/local/lib, includes into /usr/local/include and API manpages
+(once we write some) into /usr/local/man.
 
- -Monty <monty at xiph.org>, <xiphmont at mit.edu>
+Monty <monty at xiph.org>
 
- -$Id: README,v 1.4 2000/05/12 21:42:04 xiphmont Exp $
+$Id: README,v 1.5 2000/10/12 03:12:36 xiphmont Exp $

1.23      +1169 -712 vorbis/configure

Index: configure
===================================================================
RCS file: /usr/local/cvsroot/vorbis/configure,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
- --- configure	2000/08/31 03:28:43	1.22
+++ configure	2000/10/12 03:12:37	1.23
@@ -11,6 +11,18 @@
 ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
+ac_help="$ac_help
+  --enable-shared[=PKGS]  build shared libraries [default=yes]"
+ac_help="$ac_help
+  --enable-static[=PKGS]  build static libraries [default=yes]"
+ac_help="$ac_help
+  --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
+ac_help="$ac_help
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
+ac_help="$ac_help
+  --disable-libtool-lock  avoid locking (might break parallel builds)"
+ac_help="$ac_help
+  --with-ogg=DIR          Set where the Ogg library is located"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -521,11 +533,6 @@
 fi
 
 
- -#AC_CONFIG_HEADER(config.h)
- -
- -cp configure.guess config.guess
- -cp configure.sub config.sub
- -
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
@@ -545,100 +552,260 @@
 ac_config_sub=$ac_aux_dir/config.sub
 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:568: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*
) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
 
- -# Make sure we can run config.sub.
- -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
- -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
 
- -echo $ac_n "checking host system type""... $ac_c" 1>&6
- -echo "configure:556: checking host system type" >&5
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:621: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { echo "configure: error: ls -t appears to fail.  Make sure there is 
not a broken
+alias in your environment" 1>&2; exit 1; }
+   fi
 
- -host_alias=$host
- -case "$host_alias" in
- -NONE)
- -  case $nonopt in
- -  NONE)
- -    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- -    else { echo "configure: error: can not guess host type; you must 
specify one" 1>&2; exit 1; }
- -    fi ;;
- -  *) host_alias=$nonopt ;;
- -  esac ;;
- -esac
- -
- -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
- -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
- -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
- -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
- -echo "$ac_t""$host" 1>&6
+   test "$2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   { echo "configure: error: newly created file is older than distributed 
files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
 
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
- -case $host in 
- -	*-*-irix*)
- -		if test -z "$CC"; then
- -			CC=cc
- -		fi
- -		echo $ac_n "checking for ALwritesamps in -laudio""... $ac_c" 1>&6
- -echo "configure:583: checking for ALwritesamps in -laudio" >&5
- -ac_lib_var=`echo audio'_'ALwritesamps | sed 'y%./+-%__p_%'`
- -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:678: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; 
then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
- -  ac_save_LIBS="$LIBS"
- -LIBS="-laudio  $LIBS"
- -cat > conftest.$ac_ext <<EOF
- -#line 591 "configure"
- -#include "confdefs.h"
- -/* Override any gcc2 internal prototype to avoid an error.  */
- -/* We use char because int might match the return type of a gcc2
- -    builtin and then its argument prototype would still apply.  */
- -char ALwritesamps();
- -
- -int main() {
- -ALwritesamps()
- -; return 0; }
+  cat > conftestmake <<\EOF
+all:
+	@echo 'ac_maketemp="${MAKE}"'
 EOF
- -if { (eval echo configure:602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
- -  rm -rf conftest*
- -  eval "ac_cv_lib_$ac_lib_var=yes"
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
 else
- -  echo "configure: failed program was:" >&5
- -  cat conftest.$ac_ext >&5
- -  rm -rf conftest*
- -  eval "ac_cv_lib_$ac_lib_var=no"
+  eval ac_cv_prog_make_${ac_make}_set=no
 fi
- -rm -f conftest*
- -LIBS="$ac_save_LIBS"
- -
+rm -f conftestmake
 fi
- -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
   echo "$ac_t""yes" 1>&6
- -    ac_tr_lib=HAVE_LIB`echo audio | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- -  cat >> confdefs.h <<EOF
- -#define $ac_tr_lib 1
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=libvorbis
+
+VERSION=1.0.0
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; 
then
+  { echo "configure: error: source directory already configured; run "make 
distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
 EOF
+
 
- -  LIBS="-laudio $LIBS"
 
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:724: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+   ACLOCAL=aclocal
+   echo "$ac_t""found" 1>&6
 else
- -  echo "$ac_t""no" 1>&6
+   ACLOCAL="$missing_dir/missing aclocal"
+   echo "$ac_t""missing" 1>&6
 fi
 
- -	;;
- -# BeOS does not use -lm
- -#	*-*-beos)
- -#		LIBS=""
- -#	;;
- -# added better check below
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:737: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+   AUTOCONF=autoconf
+   echo "$ac_t""found" 1>&6
+else
+   AUTOCONF="$missing_dir/missing autoconf"
+   echo "$ac_t""missing" 1>&6
+fi
 
- -esac
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:750: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+   AUTOMAKE=automake
+   echo "$ac_t""found" 1>&6
+else
+   AUTOMAKE="$missing_dir/missing automake"
+   echo "$ac_t""missing" 1>&6
+fi
 
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:763: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+   AUTOHEADER=autoheader
+   echo "$ac_t""found" 1>&6
+else
+   AUTOHEADER="$missing_dir/missing autoheader"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:776: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+   MAKEINFO=makeinfo
+   echo "$ac_t""found" 1>&6
+else
+   MAKEINFO="$missing_dir/missing makeinfo"
+   echo "$ac_t""missing" 1>&6
+fi
+
+
+
+
+V_LIB_CURRENT=0
+V_LIB_REVISION=0
+V_LIB_AGE=0
+VF_LIB_CURRENT=0
+VF_LIB_REVISION=0
+VF_LIB_AGE=0
+
+
+
+
+
+
+
+
 cflags_save="$CFLAGS"
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
- -echo "configure:642: checking for $ac_word" >&5
+echo "configure:809: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -668,7 +835,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
- -echo "configure:672: checking for $ac_word" >&5
+echo "configure:839: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -719,7 +886,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
- -echo "configure:723: checking for $ac_word" >&5
+echo "configure:890: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -751,7 +918,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... 
$ac_c" 1>&6
- -echo "configure:755: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) 
works" >&5
+echo "configure:922: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) 
works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -762,12 +929,12 @@
 
 cat > conftest.$ac_ext << EOF
 
- -#line 766 "configure"
+#line 933 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
- -if { (eval echo configure:771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
+if { (eval echo configure:938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && 
test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -793,12 +960,12 @@
   { echo "configure: error: installation or configuration problem: C compiler 
cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a 
cross-compiler""... $ac_c" 1>&6
- -echo "configure:797: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) 
is a cross-compiler" >&5
+echo "configure:964: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) 
is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
- -echo "configure:802: checking whether we are using GNU C" >&5
+echo "configure:969: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -807,7 +974,7 @@
   yes;
 #endif
 EOF
- -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:811: 
\"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:978: 
\"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -826,7 +993,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
- -echo "configure:830: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:997: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -835,33 +1002,556 @@
   ac_cv_prog_cc_g=yes
 else
   ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+
+CFLAGS="$cflags_save"
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+  p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+  enable_shared=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_shared=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_shared=yes
+fi
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+  p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+  enable_static=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_static=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_static=yes
+fi
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+  enable_fast_install=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_fast_install=yes
+fi
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:1106: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify 
one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:1127: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+  case $nonopt in
+  NONE) build_alias=$host_alias ;;
+  *) build_alias=$nonopt ;;
+  esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1147: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:1186: checking for ld used by GCC" >&5
+  ac_prog=`($CC -print-prog-name=ld) 2>&5`
+  case "$ac_prog" in
+    # Accept absolute paths.
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:1210: checking for GNU ld" >&5
+else
+  echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:1213: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -z "$LD"; then
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; 
then
+      ac_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > 
/dev/null; then
+	test "$with_gnu_ld" != no && break
+      else
+	test "$with_gnu_ld" != yes && break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+  echo "$ac_t""$LD" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 
1>&2; exit 1; }
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:1248: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept 
-v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  ac_cv_prog_gnu_ld=yes
+else
+  ac_cv_prog_gnu_ld=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
+
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:1264: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  ac_cv_path_NM="$NM"
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >
/dev/null; then
+	ac_cv_path_NM="$ac_dir/nm -B"
+	break
+      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep 
/dev/null >/dev/null; then
+	ac_cv_path_NM="$ac_dir/nm -p"
+	break
+      else
+	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+	continue # so that we can try to find one that supports BSD flags
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+fi
+fi
+
+NM="$ac_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1300: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+  rm -f conftestdata
+  ac_cv_prog_LN_S="ln -s"
+else
+  ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+case "$target" in
+NONE) lt_target="$host" ;;
+*) lt_target="$target" ;;
+esac
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags 
--disable-fast-install"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags 
--with-gnu-ld"
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+  :
+fi
+
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags 
--disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$lt_target" in
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 1349 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>
&5; }; then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:1371: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1376 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+
+
+esac
+
+
+# Save cache, so that ltconfig can load it
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p
"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+
+# Actually configure libtool.  ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+
+# Check whether --with-ogg or --without-ogg was given.
+if test "${with_ogg+set}" = set; then
+  withval="$with_ogg"
+  :
 fi
- -rm -f conftest*
+ 
+
 
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
- -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- -if test "$ac_test_CFLAGS" = set; then
- -  CFLAGS="$ac_save_CFLAGS"
- -elif test $ac_cv_prog_cc_g = yes; then
- -  if test "$GCC" = yes; then
- -    CFLAGS="-g -O2"
- -  else
- -    CFLAGS="-g"
- -  fi
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:1501: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify 
one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+
+if test -z "$GCC"; then
+	case $host in 
+	*-*-irix*)
+						if test -z "$CC"; then
+			CC=cc
+		fi
+		DEBUG="-g -signed" 
+		CFLAGS="-O2 -w -signed"
+		PROFILE="-p -g3 -O2 -signed" ;;
+	sparc-sun-solaris*)
+		DEBUG="-v -g"
+		CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
+		PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
+	*)
+		DEBUG="-g"
+		CFLAGS="-O"
+		PROFILE="-g -p" ;;
+        esac
 else
- -  if test "$GCC" = yes; then
- -    CFLAGS="-O2"
- -  else
- -    CFLAGS=
- -  fi
- -fi
 
- -# because AC_PROG_CC likes to set -g 
- -CFLAGS="$cflags_save"
+	case $host in 
+	*86-*-linux*)
+		DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
+		CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
+#              	PROFILE="-Wall -W -pg -O20 -ffast-math -D_REENTRANT 
-fsigned-char -fno-inline -static"
+		PROFILE="-Wall -W -pg -O20 -ffast-math -mno-ieee-fp -D_REENTRANT 
-fsigned-char -fno-inline -static"
+
+		# glibc < 2.1.3 has a serious FP bug in the math inline header
+		# that will cripple Vorbis.  Look to see if the magic FP stack
+		# clobber is missing in the mathinline header, thus indicating
+		# the buggy version
 
- -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
- -echo "configure:865: checking how to run the C preprocessor" >&5
+		echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1555: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -876,13 +1566,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
- -#line 880 "configure"
+#line 1570 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
- -{ (eval echo configure:886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -893,13 +1583,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
- -#line 897 "configure"
+#line 1587 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
- -{ (eval echo configure:903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -910,13 +1600,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
- -#line 914 "configure"
+#line 1604 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
- -{ (eval echo configure:920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -940,170 +1630,8 @@
 fi
 echo "$ac_t""$CPP" 1>&6
 
- -# Extract the first word of "ranlib", so it can be a program name with args.
- -set dummy ranlib; ac_word=$2
- -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
- -echo "configure:947: checking for $ac_word" >&5
- -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- -  echo $ac_n "(cached) $ac_c" 1>&6
- -else
- -  if test -n "$RANLIB"; then
- -  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
- -else
- -  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
- -  ac_dummy="$PATH"
- -  for ac_dir in $ac_dummy; do
- -    test -z "$ac_dir" && ac_dir=.
- -    if test -f $ac_dir/$ac_word; then
- -      ac_cv_prog_RANLIB="ranlib"
- -      break
- -    fi
- -  done
- -  IFS="$ac_save_ifs"
- -  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
- -fi
- -fi
- -RANLIB="$ac_cv_prog_RANLIB"
- -if test -n "$RANLIB"; then
- -  echo "$ac_t""$RANLIB" 1>&6
- -else
- -  echo "$ac_t""no" 1>&6
- -fi
- -
- -# Extract the first word of "ar", so it can be a program name with args.
- -set dummy ar; ac_word=$2
- -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
- -echo "configure:977: checking for $ac_word" >&5
- -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
- -  echo $ac_n "(cached) $ac_c" 1>&6
- -else
- -  if test -n "$AR"; then
- -  ac_cv_prog_AR="$AR" # Let the user override the test.
- -else
- -  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
- -  ac_dummy="$PATH"
- -  for ac_dir in $ac_dummy; do
- -    test -z "$ac_dir" && ac_dir=.
- -    if test -f $ac_dir/$ac_word; then
- -      ac_cv_prog_AR="ar"
- -      break
- -    fi
- -  done
- -  IFS="$ac_save_ifs"
- -fi
- -fi
- -AR="$ac_cv_prog_AR"
- -if test -n "$AR"; then
- -  echo "$ac_t""$AR" 1>&6
- -else
- -  echo "$ac_t""no" 1>&6
- -fi
- -
- -# Extract the first word of "install", so it can be a program name with 
args.
- -set dummy install; ac_word=$2
- -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
- -echo "configure:1006: checking for $ac_word" >&5
- -if eval "test \"`echo '$''{'ac_cv_prog_INSTALL'+set}'`\" = set"; then
- -  echo $ac_n "(cached) $ac_c" 1>&6
- -else
- -  if test -n "$INSTALL"; then
- -  ac_cv_prog_INSTALL="$INSTALL" # Let the user override the test.
- -else
- -  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
- -  ac_dummy="$PATH"
- -  for ac_dir in $ac_dummy; do
- -    test -z "$ac_dir" && ac_dir=.
- -    if test -f $ac_dir/$ac_word; then
- -      ac_cv_prog_INSTALL="install"
- -      break
- -    fi
- -  done
- -  IFS="$ac_save_ifs"
- -fi
- -fi
- -INSTALL="$ac_cv_prog_INSTALL"
- -if test -n "$INSTALL"; then
- -  echo "$ac_t""$INSTALL" 1>&6
- -else
- -  echo "$ac_t""no" 1>&6
- -fi
- -
- -
- -#not everyone uses libm (eg, BeOS)
- -#AC_CHECK_LIB(m, cos, LIBS="-lm"; AC_DEFINE(HAVE_LIBM), LIBS="")
- -# We no longer use config.h
- -echo $ac_n "checking for cos in -lm""... $ac_c" 1>&6
- -echo "configure:1037: checking for cos in -lm" >&5
- -ac_lib_var=`echo m'_'cos | sed 'y%./+-%__p_%'`
- -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- -  echo $ac_n "(cached) $ac_c" 1>&6
- -else
- -  ac_save_LIBS="$LIBS"
- -LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
- -#line 1045 "configure"
- -#include "confdefs.h"
- -/* Override any gcc2 internal prototype to avoid an error.  */
- -/* We use char because int might match the return type of a gcc2
- -    builtin and then its argument prototype would still apply.  */
- -char cos();
- -
- -int main() {
- -cos()
- -; return 0; }
- -EOF
- -if { (eval echo configure:1056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
- -  rm -rf conftest*
- -  eval "ac_cv_lib_$ac_lib_var=yes"
- -else
- -  echo "configure: failed program was:" >&5
- -  cat conftest.$ac_ext >&5
- -  rm -rf conftest*
- -  eval "ac_cv_lib_$ac_lib_var=no"
- -fi
- -rm -f conftest*
- -LIBS="$ac_save_LIBS"
- -
- -fi
- -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- -  echo "$ac_t""yes" 1>&6
- -  LIBS="-lm"
- -else
- -  echo "$ac_t""no" 1>&6
- -LIBS=""
- -fi
- -
- -
- -if test -z "$GCC"; then
- -	case $host in 
- -	*-*-irix*)
- -		DEBUG="-g -signed" 
- -		OPT="-O2 -w -signed"
- -		PROFILE="-p -g3 -O2 -signed" ;;
- -	sparc-sun-solaris*)
- -		DEBUG="-v -g"
- -		OPT="-xO4 -fast -w -fsimple -native -xcg92"
- -		PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
- -	*)
- -		DEBUG="-g"
- -		OPT="-O"
- -		PROFILE="-g -p" ;;
- -        esac
- -else
- -
- -	case $host in 
- -	*86-*-linux*)
- -		DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
- -		OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
- -		PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char"
- -		
- -		# glibc < 2.1.3 has a serious FP bug in the math inline header
- -		# that will cripple Vorbis.  Look to see if the magic FP stack
- -		# clobber is missing in the mathinline header, thus indicating
- -		# the buggy version
- -
- -		cat > conftest.$ac_ext <<EOF
- -#line 1107 "configure"
+#line 1635 "configure"
 #include "confdefs.h"
 
                                 #define __LIBC_INTERNAL_MATH_INLINES 1
@@ -1123,7 +1651,7 @@
 
                 if test ${bad} = "maybe" ;then
                       cat > conftest.$ac_ext <<EOF
- -#line 1127 "configure"
+#line 1655 "configure"
 #include "confdefs.h"
 
                                         #define __LIBC_INTERNAL_MATH_INLINES 1
@@ -1160,31 +1688,31 @@
  echo "configure: warning: ***************************************************
*****" 1>&2
  echo "configure: warning:                                                    
     " 1>&2
 
- -  		OPT=${OPT}" -D__NO_MATH_INLINES"
+  		CFLAGS=${OPT}" -D__NO_MATH_INLINES"
                   PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
                   fi;;
         *-*-linux*)
                 DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
- -		OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
+		CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char"
                 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
         sparc-sun-*)
                 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
- -		OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
+		CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
                 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
         *)
                 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
- -		OPT="-O20 -D__NO_MATH_INLINES -fsigned-char"
+		CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
                 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
         esac
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
- -echo "configure:1183: checking for ANSI C header files" >&5
+echo "configure:1711: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1188 "configure"
+#line 1716 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1192,7 +1720,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
- -{ (eval echo configure:1196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1209,7 +1737,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
- -#line 1213 "configure"
+#line 1741 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1227,7 +1755,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
- -#line 1231 "configure"
+#line 1759 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1248,7 +1776,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1252 "configure"
+#line 1780 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1259,7 +1787,7 @@
 exit (0); }
 
 EOF
- -if { (eval echo configure:1263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1288,7 +1816,7 @@
 #	pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
 # We no longer use config.h
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
- -echo "configure:1292: checking for pthread_create in -lpthread" >&5
+echo "configure:1820: checking for pthread_create in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1296,7 +1824,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
- -#line 1300 "configure"
+#line 1828 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1307,7 +1835,7 @@
 pthread_create()
 ; return 0; }
 EOF
- -if { (eval echo configure:1311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
+if { (eval echo configure:1839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1376,7 +1904,7 @@
 # behind the times on type madness
 
 echo $ac_n "checking for int16_t""... $ac_c" 1>&6
- -echo "configure:1380: checking for int16_t" >&5
+echo "configure:1908: checking for int16_t" >&5
 if eval "test \"`echo '$''{'has_int16_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1385,7 +1913,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1389 "configure"
+#line 1917 "configure"
 #include "confdefs.h"
 
 #ifdef __BEOS__
@@ -1396,7 +1924,7 @@
 int main() {return 0;}
 
 EOF
- -if { (eval echo configure:1400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   has_int16_t=yes
 else
@@ -1413,7 +1941,7 @@
 echo "$ac_t""$has_int16_t" 1>&6
 
 echo $ac_n "checking for int32_t""... $ac_c" 1>&6
- -echo "configure:1417: checking for int32_t" >&5
+echo "configure:1945: checking for int32_t" >&5
 if eval "test \"`echo '$''{'has_int32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1422,7 +1950,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1426 "configure"
+#line 1954 "configure"
 #include "confdefs.h"
 
 #ifdef __BEOS__
@@ -1433,7 +1961,7 @@
 int main() {return 0;}
 
 EOF
- -if { (eval echo configure:1437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   has_int32_t=yes
 else
@@ -1450,7 +1978,7 @@
 echo "$ac_t""$has_int32_t" 1>&6
 
 echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
- -echo "configure:1454: checking for uint32_t" >&5
+echo "configure:1982: checking for uint32_t" >&5
 if eval "test \"`echo '$''{'has_uint32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1459,7 +1987,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1463 "configure"
+#line 1991 "configure"
 #include "confdefs.h"
 
 #ifdef __BEOS__
@@ -1470,7 +1998,7 @@
 int main() {return 0;}
 
 EOF
- -if { (eval echo configure:1474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   has_uint32_t=yes
 else
@@ -1487,7 +2015,7 @@
 echo "$ac_t""$has_uint32_t" 1>&6
 
 echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
- -echo "configure:1491: checking for u_int32_t" >&5
+echo "configure:2019: checking for u_int32_t" >&5
 if eval "test \"`echo '$''{'has_u_int32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1496,7 +2024,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1500 "configure"
+#line 2028 "configure"
 #include "confdefs.h"
 
 #ifdef __BEOS__
@@ -1507,7 +2035,7 @@
 int main() {return 0;}
 
 EOF
- -if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   has_u_int32_t=yes
 else
@@ -1524,7 +2052,7 @@
 echo "$ac_t""$has_u_int32_t" 1>&6
 
 echo $ac_n "checking for int64_t""... $ac_c" 1>&6
- -echo "configure:1528: checking for int64_t" >&5
+echo "configure:2056: checking for int64_t" >&5
 if eval "test \"`echo '$''{'has_int64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1533,7 +2061,7 @@
 
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1537 "configure"
+#line 2065 "configure"
 #include "confdefs.h"
 
 #ifdef __BEOS__
@@ -1544,7 +2072,7 @@
 int main() {return 0;}
 
 EOF
- -if { (eval echo configure:1548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   has_int64_t=yes
 else
@@ -1561,7 +2089,7 @@
 echo "$ac_t""$has_int64_t" 1>&6
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
- -echo "configure:1565: checking size of short" >&5
+echo "configure:2093: checking size of short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1569,7 +2097,7 @@
     { echo "configure: error: can not run test program while cross compiling" 
1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1573 "configure"
+#line 2101 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1580,7 +2108,7 @@
   exit(0);
 }
 EOF
- -if { (eval echo configure:1584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -1600,7 +2128,7 @@
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
- -echo "configure:1604: checking size of int" >&5
+echo "configure:2132: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1608,7 +2136,7 @@
     { echo "configure: error: can not run test program while cross compiling" 
1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1612 "configure"
+#line 2140 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1619,7 +2147,7 @@
   exit(0);
 }
 EOF
- -if { (eval echo configure:1623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -1639,7 +2167,7 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
- -echo "configure:1643: checking size of long" >&5
+echo "configure:2171: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1647,7 +2175,7 @@
     { echo "configure: error: can not run test program while cross compiling" 
1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1651 "configure"
+#line 2179 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1658,7 +2186,7 @@
   exit(0);
 }
 EOF
- -if { (eval echo configure:1662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -1678,7 +2206,7 @@
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
- -echo "configure:1682: checking size of long long" >&5
+echo "configure:2210: checking size of long long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1686,7 +2214,7 @@
     { echo "configure: error: can not run test program while cross compiling" 
1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1690 "configure"
+#line 2218 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1697,7 +2225,7 @@
   exit(0);
 }
 EOF
- -if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -1727,383 +2255,311 @@
         esac
 fi
 
- -if test x$has_int32_t = "xyes" ; then
- -	SIZE32="int32_t"
- -else
- -	case 4 in
- -		$ac_cv_sizeof_short) SIZE32="short";;
- -		$ac_cv_sizeof_int) SIZE32="int";;
- -		$ac_cv_sizeof_long) SIZE32="long";;
- -	esac
- -fi
 
- -if test x$has_uint32_t = "xyes" ; then
- -	USIZE32="uint32_t"
+ac_safe=`echo "memory.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for memory.h""... $ac_c" 1>&6
+echo "configure:2262: checking for memory.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
- -	if test x$has_u_int32_t = "xyes" ; then
- -		USIZE32="u_int32_t"
- -	else
- -		case 4 in
- -			$ac_cv_sizeof_short) USIZE32="unsigned short";;
- -			$ac_cv_sizeof_int) USIZE32="unsigned int";;
- -			$ac_cv_sizeof_long) USIZE32="unsigned long";;
- -		esac
- -	fi
- -fi
- -
- -if test x$has_int64_t = "xyes" ; then
- -	SIZE64="int64_t"
+  cat > conftest.$ac_ext <<EOF
+#line 2267 "configure"
+#include "confdefs.h"
+#include <memory.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
 else
- -case 8 in
- -	$ac_cv_sizeof_int) SIZE64="int";;
- -	$ac_cv_sizeof_long) SIZE64="long";;
- -	$ac_cv_sizeof_long_long) SIZE64="long long";;
- -esac
- -fi
- -
- -if test -z "$SIZE16"; then
- -	{ echo "configure: error: No 16 bit type found on this platform!" 1>&2; 
exit 1; }
- -fi
- -if test -z "$SIZE32"; then
- -	{ echo "configure: error: No 32 bit type found on this platform!" 1>&2; 
exit 1; }
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
 fi
- -if test -z "$USIZE32"; then
- -	{ echo "configure: error: No unsigned 32 bit type found on this platform!" 
1>&2; exit 1; }
+rm -f conftest*
 fi
- -if test -z "$SIZE64"; then
- -	echo "configure: warning: No 64 bit type found on this platform!" 1>&2
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  CFLAGS="$CFLAGS -DUSE_MEMORY_H"
+else
+  echo "$ac_t""no" 1>&6
+:
 fi
- -	
- -#AC_CHECK_HEADER(alloca.h,AC_DEFINE(USE_ALLOCA_H),:)
- -#AC_CHECK_HEADER(memory.h,AC_DEFINE(USE_MEMORY_H),:)
- -# We no longer use config.h
- -ac_safe=`echo "alloca.h" | sed 'y%./+-%__p_%'`
- -echo $ac_n "checking for alloca.h""... $ac_c" 1>&6
- -echo "configure:1783: checking for alloca.h" >&5
- -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+
+
+
+
+
+echo $ac_n "checking for cos in -lm""... $ac_c" 1>&6
+echo "configure:2299: checking for cos in -lm" >&5
+ac_lib_var=`echo m'_'cos | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
- -  cat > conftest.$ac_ext <<EOF
- -#line 1788 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lm  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2307 "configure"
 #include "confdefs.h"
- -#include <alloca.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char cos();
+
+int main() {
+cos()
+; return 0; }
 EOF
- -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
- -{ (eval echo configure:1793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
- -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
- -if test -z "$ac_err"; then
+if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
   rm -rf conftest*
- -  eval "ac_cv_header_$ac_safe=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
- -  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
- -  eval "ac_cv_header_$ac_safe=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
 fi
- -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
- -  CFLAGS="$CFLAGS -DUSE_ALLOCA_H"
+  LIBS="-lm"
 else
   echo "$ac_t""no" 1>&6
- -:
+LIBS=""
 fi
 
- -ac_safe=`echo "memory.h" | sed 'y%./+-%__p_%'`
- -echo $ac_n "checking for memory.h""... $ac_c" 1>&6
- -echo "configure:1817: checking for memory.h" >&5
- -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
+echo "configure:2340: checking for pthread_create in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
- -  cat > conftest.$ac_ext <<EOF
- -#line 1822 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lpthread  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2348 "configure"
 #include "confdefs.h"
- -#include <memory.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char pthread_create();
+
+int main() {
+pthread_create()
+; return 0; }
 EOF
- -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
- -{ (eval echo configure:1827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
- -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
- -if test -z "$ac_err"; then
+if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
   rm -rf conftest*
- -  eval "ac_cv_header_$ac_safe=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
- -  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
- -  eval "ac_cv_header_$ac_safe=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
 fi
- -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
- -  CFLAGS="$CFLAGS -DUSE_MEMORY_H"
+  pthread_lib="-lpthread"
 else
   echo "$ac_t""no" 1>&6
 :
 fi
 
 
- -echo $ac_n "checking for working const""... $ac_c" 1>&6
- -echo "configure:1851: checking for working const" >&5
- -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+if test -n $with_ogg; then
+	CFLAGS="$CFLAGS -I$with_ogg/include -L$with_ogg/lib"
+fi 
+echo $ac_n "checking for oggpack_read in -logg""... $ac_c" 1>&6
+echo "configure:2385: checking for oggpack_read in -logg" >&5
+ac_lib_var=`echo ogg'_'oggpack_read | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
- -  cat > conftest.$ac_ext <<EOF
- -#line 1856 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-logg  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2393 "configure"
 #include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char oggpack_read();
 
 int main() {
- -
- -/* Ultrix mips cc rejects this.  */
- -typedef int charset[2]; const charset x;
- -/* SunOS 4.1.1 cc rejects this.  */
- -char const *const *ccp;
- -char **p;
- -/* NEC SVR4.0.2 mips cc rejects this.  */
- -struct point {int x, y;};
- -static struct point const zero = {0,0};
- -/* AIX XL C 1.02.0.0 rejects this.
- -   It does not let you subtract one const X* pointer from another in an arm
- -   of an if-expression whose if-part is not a constant expression */
- -const char *g = "string";
- -ccp = &g + (g ? g-g : 0);
- -/* HPUX 7.0 cc rejects these. */
- -++ccp;
- -p = (char**) ccp;
- -ccp = (char const *const *) p;
- -{ /* SCO 3.2v4 cc rejects this.  */
- -  char *t;
- -  char const *s = 0 ? (char *) 0 : (char const *) 0;
- -
- -  *t++ = 0;
- -}
- -{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
- -  int x[] = {25, 17};
- -  const int *foo = &x[0];
- -  ++foo;
- -}
- -{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- -  typedef const int *iptr;
- -  iptr p = 0;
- -  ++p;
- -}
- -{ /* AIX XL C 1.02.0.0 rejects this saying
- -     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- -  struct s { int j; const int *ap[3]; };
- -  struct s *b; b->j = 5;
- -}
- -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- -  const int foo = 10;
- -}
- -
+oggpack_read()
 ; return 0; }
 EOF
- -if { (eval echo configure:1905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>
&5; }; then
+if { (eval echo configure:2404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
   rm -rf conftest*
- -  ac_cv_c_const=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
- -  ac_cv_c_const=no
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$LIBS -logg"
+else
+  echo "$ac_t""no" 1>&6
+{ echo "configure: error: You must have libogg to compile vorbis!!!" 1>&2; 
exit 1; }
 fi
 
- -echo "$ac_t""$ac_cv_c_const" 1>&6
- -if test $ac_cv_c_const = no; then
- -  cat >> confdefs.h <<\EOF
- -#define const 
- -EOF
 
- -fi
 
- -echo $ac_n "checking whether time.h and sys/time.h may both be 
included""... $ac_c" 1>&6
- -echo "configure:1926: checking whether time.h and sys/time.h may both be 
included" >&5
- -if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments.  Useless!
+echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
+echo "configure:2430: checking for working alloca.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1931 "configure"
+#line 2435 "configure"
 #include "confdefs.h"
- -#include <sys/types.h>
- -#include <sys/time.h>
- -#include <time.h>
+#include <alloca.h>
 int main() {
- -struct tm *tp;
+void *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
- -if { (eval echo configure:1940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>
&5; }; then
+if { (eval echo configure:2442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
   rm -rf conftest*
- -  ac_cv_header_time=yes
+  ac_cv_header_alloca_h=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
- -  ac_cv_header_time=no
+  ac_cv_header_alloca_h=no
 fi
 rm -f conftest*
 fi
 
- -echo "$ac_t""$ac_cv_header_time" 1>&6
- -if test $ac_cv_header_time = yes; then
+echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
+if test $ac_cv_header_alloca_h = yes; then
   cat >> confdefs.h <<\EOF
- -#define TIME_WITH_SYS_TIME 1
+#define HAVE_ALLOCA_H 1
 EOF
 
 fi
 
- -echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... 
$ac_c" 1>&6
- -echo "configure:1961: checking whether struct tm is in sys/time.h or 
time.h" >&5
- -if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
+echo $ac_n "checking for alloca""... $ac_c" 1>&6
+echo "configure:2463: checking for alloca" >&5
+if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
- -#line 1966 "configure"
+#line 2468 "configure"
 #include "confdefs.h"
- -#include <sys/types.h>
- -#include <time.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# else
+#  if HAVE_ALLOCA_H
+#   include <alloca.h>
+#  else
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+#    endif
+#   endif
+#  endif
+# endif
+#endif
+
 int main() {
- -struct tm *tp; tp->tm_sec;
+char *p = (char *) alloca(1);
 ; return 0; }
 EOF
- -if { (eval echo configure:1974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>
&5; }; then
+if { (eval echo configure:2496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
   rm -rf conftest*
- -  ac_cv_struct_tm=time.h
+  ac_cv_func_alloca_works=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
- -  ac_cv_struct_tm=sys/time.h
+  ac_cv_func_alloca_works=no
 fi
 rm -f conftest*
 fi
 
- -echo "$ac_t""$ac_cv_struct_tm" 1>&6
- -if test $ac_cv_struct_tm = sys/time.h; then
+echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
+if test $ac_cv_func_alloca_works = yes; then
   cat >> confdefs.h <<\EOF
- -#define TM_IN_SYS_TIME 1
+#define HAVE_ALLOCA 1
 EOF
 
 fi
- -
- -
- -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
- -echo "configure:1996: checking whether ${MAKE-make} sets \${MAKE}" >&5
- -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
- -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = 
set"; then
- -  echo $ac_n "(cached) $ac_c" 1>&6
- -else
- -  cat > conftestmake <<\EOF
- -all:
- -	@echo 'ac_maketemp="${MAKE}"'
- -EOF
- -# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
- -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
- -if test -n "$ac_maketemp"; then
- -  eval ac_cv_prog_make_${ac_make}_set=yes
- -else
- -  eval ac_cv_prog_make_${ac_make}_set=no
- -fi
- -rm -f conftestmake
- -fi
- -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- -  echo "$ac_t""yes" 1>&6
- -  SET_MAKE=
- -else
- -  echo "$ac_t""no" 1>&6
- -  SET_MAKE="MAKE=${MAKE-make}"
- -fi
- -
- -echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
- -echo "configure:2023: checking for 8-bit clean memcmp" >&5
- -if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
- -  echo $ac_n "(cached) $ac_c" 1>&6
- -else
- -  if test "$cross_compiling" = yes; then
- -  ac_cv_func_memcmp_clean=no
- -else
- -  cat > conftest.$ac_ext <<EOF
- -#line 2031 "configure"
- -#include "confdefs.h"
- -
- -main()
- -{
- -  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
- -  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
- -}
 
+if test $ac_cv_func_alloca_works = no; then
+  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+  # that cause trouble.  Some versions do not even contain alloca or
+  # contain a buggy version.  If you still want to use their alloca,
+  # use ar to extract alloca.o from them instead of compiling alloca.c.
+  ALLOCA=alloca.${ac_objext}
+  cat >> confdefs.h <<\EOF
+#define C_ALLOCA 1
 EOF
- -if { (eval echo configure:2041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
- -then
- -  ac_cv_func_memcmp_clean=yes
- -else
- -  echo "configure: failed program was:" >&5
- -  cat conftest.$ac_ext >&5
- -  rm -fr conftest*
- -  ac_cv_func_memcmp_clean=no
- -fi
- -rm -fr conftest*
- -fi
- -
- -fi
 
- -echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
- -test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
- -echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
- -echo "configure:2059: checking return type of signal handlers" >&5
- -if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
+echo "configure:2528: checking whether alloca needs Cray hooks" >&5
+if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
- -#line 2064 "configure"
+#line 2533 "configure"
 #include "confdefs.h"
- -#include <sys/types.h>
- -#include <signal.h>
- -#ifdef signal
- -#undef signal
- -#endif
- -#ifdef __cplusplus
- -extern "C" void (*signal (int, void (*)(int)))(int);
+#if defined(CRAY) && ! defined(CRAY2)
+webecray
 #else
- -void (*signal ()) ();
+wenotbecray
 #endif
 
- -int main() {
- -int i;
- -; return 0; }
 EOF
- -if { (eval echo configure:2081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>
&5; }; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "webecray" >/dev/null 2>&1; then
   rm -rf conftest*
- -  ac_cv_type_signal=void
+  ac_cv_os_cray=yes
 else
- -  echo "configure: failed program was:" >&5
- -  cat conftest.$ac_ext >&5
   rm -rf conftest*
- -  ac_cv_type_signal=int
+  ac_cv_os_cray=no
 fi
 rm -f conftest*
- -fi
- -
- -echo "$ac_t""$ac_cv_type_signal" 1>&6
- -cat >> confdefs.h <<EOF
- -#define RETSIGTYPE $ac_cv_type_signal
- -EOF
 
+fi
 
- -for ac_func in gettimeofday select strcspn strerror strspn sigaction
- -do
- -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
- -echo "configure:2102: checking for $ac_func" >&5
+echo "$ac_t""$ac_cv_os_cray" 1>&6
+if test $ac_cv_os_cray = yes; then
+for ac_func in _getb67 GETB67 getb67; do
+  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2558: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
- -#line 2107 "configure"
+#line 2563 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2126,7 +2582,7 @@
 
 ; return 0; }
 EOF
- -if { (eval echo configure:2130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
+if { (eval echo configure:2586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2140,32 +2596,109 @@
 
 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
- -    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
   cat >> confdefs.h <<EOF
- -#define $ac_tr_func 1
+#define CRAY_STACKSEG_END $ac_func
 EOF
- - 
+
+  break
 else
   echo "$ac_t""no" 1>&6
 fi
+
 done
+fi
 
+echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
+echo "configure:2613: checking stack direction for C alloca" >&5
+if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_c_stack_direction=0
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2621 "configure"
+#include "confdefs.h"
+find_stack_direction ()
+{
+  static char *addr = 0;
+  auto char dummy;
+  if (addr == 0)
+    {
+      addr = &dummy;
+      return find_stack_direction ();
+    }
+  else
+    return (&dummy > addr) ? 1 : -1;
+}
+main ()
+{
+  exit (find_stack_direction() < 0);
+}
+EOF
+if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_c_stack_direction=1
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_c_stack_direction=-1
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
+cat >> confdefs.h <<EOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+EOF
 
+fi
 
+echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
+echo "configure:2662: checking for 8-bit clean memcmp" >&5
+if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_memcmp_clean=no
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2670 "configure"
+#include "confdefs.h"
 
+main()
+{
+  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
+}
 
+EOF
+if { (eval echo configure:2680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_func_memcmp_clean=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_func_memcmp_clean=no
+fi
+rm -fr conftest*
+fi
 
+fi
 
+echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
 
 
 
 
- -#AC_SUBST(XOGG)
- -#AC_SUBST(LIBGTKDIR)
 
 
- -subdirs="vorbis-tools/libao"
 
 
 trap '' 1 2 15
@@ -2279,10 +2812,9 @@
 done
 
 ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
 
- -trap 'rm -fr `echo "Makefile lib/Makefile examples/Makefile 
include/vorbis/os_types.h\
- -	vorbis-tools/Makefile\
- -	vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile" | 
sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile lib/Makefile doc/Makefile include/Makefile 
include/vorbis/Makefile include/vorbis/book/Makefile examples/Makefile" | sed 
"s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -2314,27 +2846,43 @@
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@V_LIB_CURRENT@%$V_LIB_CURRENT%g
+s%@V_LIB_REVISION@%$V_LIB_REVISION%g
+s%@V_LIB_AGE@%$V_LIB_AGE%g
+s%@VF_LIB_CURRENT@%$VF_LIB_CURRENT%g
+s%@VF_LIB_REVISION@%$VF_LIB_REVISION%g
+s%@VF_LIB_AGE@%$VF_LIB_AGE%g
+s%@CC@%$CC%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
 s%@host_cpu@%$host_cpu%g
 s%@host_vendor@%$host_vendor%g
 s%@host_os@%$host_os%g
- -s%@CC@%$CC%g
- -s%@CPP@%$CPP%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
 s%@RANLIB@%$RANLIB%g
- -s%@AR@%$AR%g
- -s%@INSTALL@%$INSTALL%g
- -s%@SET_MAKE@%$SET_MAKE%g
+s%@LN_S@%$LN_S%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@CPP@%$CPP%g
+s%@ALLOCA@%$ALLOCA%g
 s%@LIBOBJS@%$LIBOBJS%g
- -s%@SIZE16@%$SIZE16%g
- -s%@SIZE32@%$SIZE32%g
- -s%@USIZE32@%$USIZE32%g
- -s%@SIZE64@%$SIZE64%g
- -s%@OPT@%$OPT%g
 s%@DEBUG@%$DEBUG%g
 s%@PROFILE@%$PROFILE%g
 s%@pthread_lib@%$pthread_lib%g
- -s%@subdirs@%$subdirs%g
 
 CEOF
 EOF
@@ -2376,9 +2924,7 @@
 
 cat >> $CONFIG_STATUS <<EOF
 
- -CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile examples/Makefile 
include/vorbis/os_types.h\
- -	vorbis-tools/Makefile\
- -	vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile doc/Makefile 
include/Makefile include/vorbis/Makefile include/vorbis/book/Makefile 
examples/Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -2413,6 +2959,10 @@
     top_srcdir="$ac_dots$ac_given_srcdir" ;;
   esac
 
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
 
   echo creating "$ac_file"
   rm -f "$ac_file"
@@ -2428,6 +2978,7 @@
 s%@configure_input@%$configure_input%g
 s%@srcdir@%$srcdir%g
 s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
 fi; done
 rm -f conftest.s*
@@ -2443,98 +2994,4 @@
 chmod +x $CONFIG_STATUS
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
- -
- -if test "$no_recursion" != yes; then
- -
- -  # Remove --cache-file and --srcdir arguments so they do not pile up.
- -  ac_sub_configure_args=
- -  ac_prev=
- -  for ac_arg in $ac_configure_args; do
- -    if test -n "$ac_prev"; then
- -      ac_prev=
- -      continue
- -    fi
- -    case "$ac_arg" in
- -    -cache-file | --cache-file | --cache-fil | --cache-fi \
- -    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- -      ac_prev=cache_file ;;
- -    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- -    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | 
--c=*)
- -      ;;
- -    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- -      ac_prev=srcdir ;;
- -    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- -      ;;
- -    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
- -    esac
- -  done
- -
- -  for ac_config_dir in vorbis-tools/libao; do
- -
- -    # Do not complain, so a configure script can configure whichever
- -    # parts of a large source tree are present.
- -    if test ! -d $srcdir/$ac_config_dir; then
- -      continue
- -    fi
- -
- -    echo configuring in $ac_config_dir
- -
- -    case "$srcdir" in
- -    .) ;;
- -    *)
- -      if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
- -      else
- -        { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>
&2; exit 1; }
- -      fi
- -      ;;
- -    esac
- -
- -    ac_popdir=`pwd`
- -    cd $ac_config_dir
- -
- -      # A "../" for each directory in /$ac_config_dir.
- -      ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 
's%[^/]*/%../%g'`
- -
- -    case "$srcdir" in
- -    .) # No --srcdir option.  We are building in place.
- -      ac_sub_srcdir=$srcdir ;;
- -    /*) # Absolute path.
- -      ac_sub_srcdir=$srcdir/$ac_config_dir ;;
- -    *) # Relative path.
- -      ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
- -    esac
- -
- -    # Check for guested configure; otherwise get Cygnus style configure.
- -    if test -f $ac_sub_srcdir/configure; then
- -      ac_sub_configure=$ac_sub_srcdir/configure
- -    elif test -f $ac_sub_srcdir/configure.in; then
- -      ac_sub_configure=$ac_configure
- -    else
- -      echo "configure: warning: no configuration information is in 
$ac_config_dir" 1>&2
- -      ac_sub_configure=
- -    fi
- -
- -    # The recursion is here.
- -    if test -n "$ac_sub_configure"; then
- -
- -      # Make the cache file name correct relative to the subdirectory.
- -      case "$cache_file" in
- -      /*) ac_sub_cache_file=$cache_file ;;
- -      *) # Relative path.
- -        ac_sub_cache_file="$ac_dots$cache_file" ;;
- -      esac
- -
- -      echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure 
$ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
- -      # The eval makes quoting arguments work.
- -      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure 
$ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
- -      then :
- -      else
- -        { echo "configure: error: $ac_sub_configure failed for 
$ac_config_dir" 1>&2; exit 1; }
- -      fi
- -    fi
- -
- -    cd $ac_popdir
- -  done
- -fi
- -
 

1.24      +83 -110   vorbis/configure.in

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis/configure.in,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
- --- configure.in	2000/08/31 03:28:43	1.23
+++ configure.in	2000/10/12 03:12:37	1.24
@@ -1,59 +1,70 @@
- -# $Id: configure.in,v 1.23 2000/08/31 03:28:43 xiphmont Exp $
+dnl Process this file with autoconf to produce a configure script
 
- -AC_INIT(lib/mdct.c)
- -#AC_CONFIG_HEADER(config.h)
- -
- -cp configure.guess config.guess
- -cp configure.sub config.sub
+dnl ------------------------------------------------
+dnl Initialization and Versioning
+dnl ------------------------------------------------
 
- -AC_CANONICAL_HOST
+AC_INIT(lib/mdct.c)
+AM_INIT_AUTOMAKE(libvorbis,1.0.0)
 
- -dnl If we're on IRIX, we wanna use cc even if gcc is there (unless the user
- -dnl has overriden us)...
- -case $host in 
- -	*-*-irix*)
- -		if test -z "$CC"; then
- -			CC=cc
- -		fi
- -		AC_CHECK_LIB(audio, ALwritesamps)
- -	;;
- -# BeOS does not use -lm
- -#	*-*-beos)
- -#		LIBS=""
- -#	;;
- -# added better check below
+dnl Library versioning
 
- -esac
+V_LIB_CURRENT=0
+V_LIB_REVISION=0
+V_LIB_AGE=0
+VF_LIB_CURRENT=0
+VF_LIB_REVISION=0
+VF_LIB_AGE=0
+AC_SUBST(V_LIB_CURRENT)
+AC_SUBST(V_LIB_REVISION)
+AC_SUBST(V_LIB_AGE)
+AC_SUBST(VF_LIB_CURRENT)
+AC_SUBST(VF_LIB_REVISION)
+AC_SUBST(VF_LIB_AGE)
+
+dnl --------------------------------------------------  
+dnl Check for programs
+dnl --------------------------------------------------  
 
+dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
+dnl if $CFLAGS is blank
 cflags_save="$CFLAGS"
 AC_PROG_CC
- -# because AC_PROG_CC likes to set -g 
 CFLAGS="$cflags_save"
 
- -AC_PROG_CPP
- -AC_PROG_RANLIB
- -AC_CHECK_PROG(AR,ar,ar)
- -AC_CHECK_PROG(INSTALL,install,install)
+AM_PROG_LIBTOOL
 
- -#not everyone uses libm (eg, BeOS)
- -#AC_CHECK_LIB(m, cos, LIBS="-lm"; AC_DEFINE(HAVE_LIBM), LIBS="")
- -# We no longer use config.h
- -AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
+dnl --------------------------------------------------  
+dnl Additional arguments
+dnl --------------------------------------------------  
 
+AC_ARG_WITH(ogg, [  --with-ogg=DIR          Set where the Ogg library is 
located])
+
+dnl --------------------------------------------------
+dnl Set build flags based on environment
+dnl --------------------------------------------------
+
+AC_CANONICAL_HOST
+
 dnl Set some target options
 if test -z "$GCC"; then
         case $host in 
         *-*-irix*)
+		dnl If we're on IRIX, we wanna use cc even if gcc 
+		dnl is there (unless the user has overriden us)...
+		if test -z "$CC"; then
+			CC=cc
+		fi
                 DEBUG="-g -signed" 
- -		OPT="-O2 -w -signed"
+		CFLAGS="-O2 -w -signed"
                 PROFILE="-p -g3 -O2 -signed" ;;
         sparc-sun-solaris*)
                 DEBUG="-v -g"
- -		OPT="-xO4 -fast -w -fsimple -native -xcg92"
+		CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
                 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
         *)
                 DEBUG="-g"
- -		OPT="-O"
+		CFLAGS="-O"
                 PROFILE="-g -p" ;;
         esac
 else
@@ -61,9 +72,10 @@
         case $host in 
         *86-*-linux*)
                 DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
- -		OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
- -		PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char"
- -		
+		CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
+#              	PROFILE="-Wall -W -pg -O20 -ffast-math -D_REENTRANT 
-fsigned-char -fno-inline -static"
+		PROFILE="-Wall -W -pg -O20 -ffast-math -mno-ieee-fp -D_REENTRANT 
-fsigned-char -fno-inline -static"
+
                 # glibc < 2.1.3 has a serious FP bug in the math inline header
                 # that will cripple Vorbis.  Look to see if the magic FP stack
                 # clobber is missing in the mathinline header, thus indicating
@@ -100,20 +112,20 @@
  AC_MSG_WARN([********************************************************])
  AC_MSG_WARN([                                                        ])
 
- -  		OPT=${OPT}" -D__NO_MATH_INLINES"
+  		CFLAGS=${OPT}" -D__NO_MATH_INLINES"
                   PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
                   fi;;
         *-*-linux*)
                 DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
- -		OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
+		CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char"
                 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
         sparc-sun-*)
                 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
- -		OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
+		CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
                 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
         *)
                 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
- -		OPT="-O20 -D__NO_MATH_INLINES -fsigned-char"
+		CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
                 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
         esac
 fi
@@ -274,85 +286,46 @@
         esac
 fi
 
- -if test x$has_int32_t = "xyes" ; then
- -	SIZE32="int32_t"
- -else
- -	case 4 in
- -		$ac_cv_sizeof_short) SIZE32="short";;
- -		$ac_cv_sizeof_int) SIZE32="int";;
- -		$ac_cv_sizeof_long) SIZE32="long";;
- -	esac
- -fi
+dnl --------------------------------------------------
+dnl Check for headers
+dnl --------------------------------------------------
 
- -if test x$has_uint32_t = "xyes" ; then
- -	USIZE32="uint32_t"
- -else
- -	if test x$has_u_int32_t = "xyes" ; then
- -		USIZE32="u_int32_t"
- -	else
- -		case 4 in
- -			$ac_cv_sizeof_short) USIZE32="unsigned short";;
- -			$ac_cv_sizeof_int) USIZE32="unsigned int";;
- -			$ac_cv_sizeof_long) USIZE32="unsigned long";;
- -		esac
- -	fi
- -fi
+AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
 
- -if test x$has_int64_t = "xyes" ; then
- -	SIZE64="int64_t"
- -else
- -case 8 in
- -	$ac_cv_sizeof_int) SIZE64="int";;
- -	$ac_cv_sizeof_long) SIZE64="long";;
- -	$ac_cv_sizeof_long_long) SIZE64="long long";;
- -esac
- -fi
+dnl --------------------------------------------------
+dnl Check for typedefs, structures, etc
+dnl --------------------------------------------------
+
+dnl none
+
+dnl --------------------------------------------------
+dnl Check for libraries
+dnl --------------------------------------------------
 
- -if test -z "$SIZE16"; then
- -	AC_MSG_ERROR(No 16 bit type found on this platform!)
- -fi
- -if test -z "$SIZE32"; then
- -	AC_MSG_ERROR(No 32 bit type found on this platform!)
- -fi
- -if test -z "$USIZE32"; then
- -	AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
- -fi
- -if test -z "$SIZE64"; then
- -	AC_MSG_WARN(No 64 bit type found on this platform!)
- -fi
- -	
- -#AC_CHECK_HEADER(alloca.h,AC_DEFINE(USE_ALLOCA_H),:)
- -#AC_CHECK_HEADER(memory.h,AC_DEFINE(USE_MEMORY_H),:)
- -# We no longer use config.h
- -AC_CHECK_HEADER(alloca.h,CFLAGS="$CFLAGS -DUSE_ALLOCA_H",:)
- -AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
+AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
+AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
 
- -AC_C_CONST
- -AC_HEADER_TIME
- -AC_STRUCT_TM
+dnl Check for libogg
+if test -n $with_ogg; then
+	CFLAGS="$CFLAGS -I$with_ogg/include -L$with_ogg/lib"
+fi 
+AC_CHECK_LIB(ogg, oggpack_read, LIBS="$LIBS -logg", AC_MSG_ERROR([You must 
have libogg to compile vorbis!!!]))
+
+dnl --------------------------------------------------
+dnl Check for library functions
+dnl --------------------------------------------------
 
- -AC_PROG_MAKE_SET
+AC_FUNC_ALLOCA
 AC_FUNC_MEMCMP
- -AC_TYPE_SIGNAL
- -AC_CHECK_FUNCS(gettimeofday select strcspn strerror strspn sigaction)
+
+dnl --------------------------------------------------
+dnl Do substitutions
+dnl --------------------------------------------------
 
- -AC_SUBST(SIZE16)
- -AC_SUBST(SIZE32)
- -AC_SUBST(USIZE32)
- -AC_SUBST(SIZE64)
- -AC_SUBST(OPT)
 AC_SUBST(LIBS)
 AC_SUBST(DEBUG)
 AC_SUBST(PROFILE)
 AC_SUBST(CC)
- -AC_SUBST(RANLIB)
- -#AC_SUBST(XOGG)
- -#AC_SUBST(LIBGTKDIR)
 AC_SUBST(pthread_lib)
- -
- -AC_CONFIG_SUBDIRS(vorbis-tools/libao)
- -
- -AC_OUTPUT(Makefile lib/Makefile examples/Makefile include/vorbis/os_types.h\
- -	vorbis-tools/Makefile\
- -	vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile)
 
+AC_OUTPUT(Makefile lib/Makefile doc/Makefile include/Makefile 
include/vorbis/Makefile include/vorbis/book/Makefile examples/Makefile)

1.2       +13 -0     vorbis/.cvsignore

1.2       +13 -0     vorbis/Makefile.am

1.2       +47 -0     vorbis/autogen.sh

1.2       +73 -0     vorbis/libvorbis.spec

1.2       +2 -0      vorbis/doc/Attic/.cvsignore

Index: .cvsignore
===================================================================
RCS file: /usr/local/cvsroot/vorbis/doc/Attic/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- .cvsignore	2000/09/07 07:47:36	1.1
+++ .cvsignore	2000/10/12 03:12:38	1.2
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

1.2       +10 -0     vorbis/doc/Attic/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis/doc/Attic/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- Makefile.am	2000/09/07 06:32:38	1.1
+++ Makefile.am	2000/10/12 03:12:38	1.2
@@ -0,0 +1,10 @@
+## Process this with automake to create Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
+
+doc_DATA = v-comment.html vorbisword2.png white-ogg.png programming.html\
+	 vorbis.html wait.png white-xifish.png
+
+EXTRA_DIST = $(doc_DATA)

1.6       +3 -4      vorbis/examples/chaining_example.c

Index: chaining_example.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/examples/chaining_example.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
- --- chaining_example.c	2000/06/14 10:13:35	1.5
+++ chaining_example.c	2000/10/12 03:12:39	1.6
@@ -12,13 +12,12 @@
  ********************************************************************
 
  function: illustrate simple use of chained bitstream and vorbisfile.a
- - last mod: $Id: chaining_example.c,v 1.5 2000/06/14 10:13:35 xiphmont Exp $
+ last mod: $Id: chaining_example.c,v 1.6 2000/10/12 03:12:39 xiphmont Exp $
 
  ********************************************************************/
 
- -#include "vorbis/codec.h"
- -#include "vorbis/vorbisfile.h"
- -#include "../lib/misc.h"
+#include <vorbis/codec.h>
+#include <vorbis/vorbisfile.h>
 
 int main(){
   OggVorbis_File ov;

1.13      +10 -6     vorbis/examples/decoder_example.c

Index: decoder_example.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/examples/decoder_example.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
- --- decoder_example.c	2000/08/30 06:09:21	1.12
+++ decoder_example.c	2000/10/12 03:12:39	1.13
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: simple example decoder
- - last mod: $Id: decoder_example.c,v 1.12 2000/08/30 06:09:21 xiphmont Exp $
+ last mod: $Id: decoder_example.c,v 1.13 2000/10/12 03:12:39 xiphmont Exp $
 
  ********************************************************************/
 
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
- -#include "vorbis/codec.h"
+#include <vorbis/codec.h>
 
 #ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
 #include <io.h>
@@ -216,14 +216,14 @@
               /* no reason to complain; already complained above */
             }else{
               /* we have a packet.  Decode it */
- -	      double **pcm;
+	      float **pcm;
               int samples;
               
               if(vorbis_synthesis(&vb,&op)==0) /* test for success! */
                 vorbis_synthesis_blockin(&vd,&vb);
               /* 
                  
- -	      **pcm is a multichannel double vector.  In stereo, for
+	      **pcm is a multichannel float vector.  In stereo, for
               example, pcm[0] is left, and pcm[1] is right.  samples is
               the size of each channel.  Convert the float values
               (-1.<=range<=1.) to whatever PCM format and write it out */
@@ -233,13 +233,17 @@
                 int clipflag=0;
                 int bout=(samples<convsize?samples:convsize);
                 
- -		/* convert doubles to 16 bit signed ints (host order) and
+		/* convert floats to 16 bit signed ints (host order) and
                    interleave */
                 for(i=0;i<vi.channels;i++){
                   ogg_int16_t *ptr=convbuffer+i;
- -		  double  *mono=pcm[i];
+		  float  *mono=pcm[i];
                   for(j=0;j<bout;j++){
+#if 1
                     int val=mono[j]*32767.;
+#else /* optional dither */
+		    int val=mono[j]*32767.+drand48()-0.5;
+#endif
                     /* might as well guard against clipping */
                     if(val>32767){
                       val=32767;

1.14      +14 -4     vorbis/examples/encoder_example.c

Index: encoder_example.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/examples/encoder_example.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
- --- encoder_example.c	2000/08/15 14:01:02	1.13
+++ encoder_example.c	2000/10/12 03:12:39	1.14
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: simple example encoder
- - last mod: $Id: encoder_example.c,v 1.13 2000/08/15 14:01:02 xiphmont Exp $
+ last mod: $Id: encoder_example.c,v 1.14 2000/10/12 03:12:39 xiphmont Exp $
 
  ********************************************************************/
 
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 #include <time.h>
 #include <math.h>
- -#include "vorbis/mode_C.h"
+#include <vorbis/mode_C.h>
 
 #ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
 #include <io.h>
@@ -113,7 +113,17 @@
     ogg_stream_packetin(&os,&header_comm);
     ogg_stream_packetin(&os,&header_code);
 
- -    /* no need to write out here.  We'll get to that in the main loop */
+	/* We don't have to write out here, but doing so makes streaming 
+	 * much easier, so we do, flushing ALL pages. This ensures the actual
+	 * audio data will start on a new page
+	 */
+	while(!eos){
+		int result=ogg_stream_flush(&os,&og);
+		if(result==0)break;
+		fwrite(og.header,1,og.header_len,stdout);
+		fwrite(og.body,1,og.body_len,stdout);
+	}
+
   }
   
   while(!eos){
@@ -131,7 +141,7 @@
       /* data to encode */
 
       /* expose the buffer to submit data */
- -      double **buffer=vorbis_analysis_buffer(&vd,READ);
+      float **buffer=vorbis_analysis_buffer(&vd,READ);
       
       /* uninterleave samples */
       for(i=0;i<bytes/4;i++){

1.2       +3 -3      vorbis/examples/vorbisfile_example.c

Index: vorbisfile_example.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/examples/vorbisfile_example.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- vorbisfile_example.c	2000/06/19 10:05:57	1.1
+++ vorbisfile_example.c	2000/10/12 03:12:39	1.2
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: simple example decoder using vorbisfile
- - last mod: $Id: vorbisfile_example.c,v 1.1 2000/06/19 10:05:57 xiphmont Exp 
$
+ last mod: $Id: vorbisfile_example.c,v 1.2 2000/10/12 03:12:39 xiphmont Exp $
 
  ********************************************************************/
 
@@ -23,8 +23,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
- -#include "vorbis/codec.h"
- -#include "vorbis/vorbisfile.h"
+#include <vorbis/codec.h>
+#include <vorbis/vorbisfile.h>
 
 #ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
 #include <io.h>

1.2       +8 -0      vorbis/examples/.cvsignore

1.2       +23 -0     vorbis/examples/Makefile.am

1.2       +2 -0      vorbis/include/.cvsignore

1.2       +5 -0      vorbis/include/Makefile.am

1.12      +9 -9      vorbis/include/vorbis/backends.h

Index: backends.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/backends.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
- --- backends.h	2000/07/12 09:36:17	1.11
+++ backends.h	2000/10/12 03:12:40	1.12
@@ -13,7 +13,7 @@
 
  function: libvorbis backend and mapping structures; needed for 
            static mode headers
- - last mod: $Id: backends.h,v 1.11 2000/07/12 09:36:17 xiphmont Exp $
+ last mod: $Id: backends.h,v 1.12 2000/10/12 03:12:40 xiphmont Exp $
 
  ********************************************************************/
 
@@ -39,9 +39,9 @@
   void (*free_info) (vorbis_info_time *);
   void (*free_look) (vorbis_look_time *);
   int  (*forward)   (struct vorbis_block *,vorbis_look_time *,
- -		     double *,double *);
+		     float *,float *);
   int  (*inverse)   (struct vorbis_block *,vorbis_look_time *,
- -		     double *,double *);
+		     float *,float *);
 } vorbis_func_time;
 
 typedef struct{
@@ -57,9 +57,9 @@
   void (*free_info) (vorbis_info_floor *);
   void (*free_look) (vorbis_look_floor *);
   int  (*forward)   (struct vorbis_block *,vorbis_look_floor *,
- -		     double *,double *);
+		     float *,float *);
   int  (*inverse)   (struct vorbis_block *,vorbis_look_floor *,
- -		     double *);
+		     float *);
 } vorbis_func_floor;
 
 typedef struct{
@@ -83,9 +83,9 @@
   void (*free_info)    (vorbis_info_residue *);
   void (*free_look)    (vorbis_look_residue *);
   int  (*forward)      (struct vorbis_block *,vorbis_look_residue *,
- -			double **,int);
+			float **,int);
   int  (*inverse)      (struct vorbis_block *,vorbis_look_residue *,
- -			double **,int);
+			float **,int);
 } vorbis_func_residue;
 
 typedef struct vorbis_info_residue0{
@@ -101,8 +101,8 @@
   int    booklist[256];    /* list of second stage books */
 
   /* encode-only heuristic settings */
- -  double entmax[64];       /* book entropy threshholds*/
- -  double ampmax[64];       /* book amp threshholds*/
+  float  entmax[64];       /* book entropy threshholds*/
+  float  ampmax[64];       /* book amp threshholds*/
   int    subgrp[64];       /* book heuristic subgroup size */
   int    blimit[64];       /* subgroup position limits */
 

1.7       +9 -5      vorbis/include/vorbis/codebook.h

Index: codebook.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/codebook.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
- --- codebook.h	2000/07/17 12:55:35	1.6
+++ codebook.h	2000/10/12 03:12:41	1.7
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: codebook types
- - last mod: $Id: codebook.h,v 1.6 2000/07/17 12:55:35 xiphmont Exp $
+ last mod: $Id: codebook.h,v 1.7 2000/10/12 03:12:41 xiphmont Exp $
 
  ********************************************************************/
 
@@ -73,15 +73,15 @@
 
 /* assumes a maptype of 1; encode side only, so that's OK */
 typedef struct encode_aux_threshmatch{
- -  double *quantthresh;
+  float *quantthresh;
   long   *quantmap;
   int     quantvals; 
   int     threshvals; 
 } encode_aux_threshmatch;
 
 typedef struct encode_aux_pigeonhole{
- -  double min;
- -  double del;
+  float min;
+  float del;
 
   int  mapentries;
   int  quantvals;
@@ -94,6 +94,10 @@
 } encode_aux_pigeonhole;
 
 typedef struct decode_aux{
+  long   *tab;
+  int    *tabl;
+  int    tabn;
+
   long   *ptr0;
   long   *ptr1;
   long   aux;        /* number of tree entries */
@@ -104,7 +108,7 @@
   long entries;       /* codebook entries */
   const static_codebook *c;
 
- -  double *valuelist;  /* list of dim*entries actual entry values */
+  float  *valuelist;  /* list of dim*entries actual entry values */
   long   *codelist;   /* list of bitstream codewords for each entry */
   struct decode_aux *decode_tree;
 

1.30      +22 -134   vorbis/include/vorbis/codec.h

Index: codec.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/codec.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
- --- codec.h	2000/08/30 07:09:46	1.29
+++ codec.h	2000/10/12 03:12:41	1.30
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: libvorbis codec headers
- - last mod: $Id: codec.h,v 1.29 2000/08/30 07:09:46 xiphmont Exp $
+ last mod: $Id: codec.h,v 1.30 2000/10/12 03:12:41 xiphmont Exp $
 
  ********************************************************************/
 
@@ -26,9 +26,8 @@
 
 #define MAX_BARK 27
 
- -#include "os_types.h"
+#include <ogg/ogg.h>
 #include "vorbis/codebook.h"
- -#include "vorbis/internal.h"
 
 typedef void vorbis_look_transform;
 typedef void vorbis_info_time;
@@ -58,29 +57,29 @@
   int    smoothp;
 
   int    noisecullp;
- -  double noisecull_barkwidth;
+  float noisecull_barkwidth;
 
- -  double ath_adjatt;
- -  double ath_maxatt;
+  float ath_adjatt;
+  float ath_maxatt;
 
   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz 
*/
   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
 
   int tonemaskp;
- -  double toneatt[P_BANDS][P_LEVELS];
+  float toneatt[P_BANDS][P_LEVELS];
 
   int peakattp;
- -  double peakatt[P_BANDS][P_LEVELS];
+  float peakatt[P_BANDS][P_LEVELS];
 
   int noisemaskp;
- -  double noiseatt[P_BANDS][P_LEVELS];
+  float noiseatt[P_BANDS][P_LEVELS];
 
- -  double max_curve_dB;
+  float max_curve_dB;
 
   /* decay setup */
- -  double attack_coeff;
- -  double decay_coeff;
+  float attack_coeff;
+  float decay_coeff;
 } vorbis_info_psy;
 
 /* vorbis_info contains all the setup information specific to the
@@ -145,86 +144,11 @@
   
   /* for block long/sort tuning; encode only */
   int        envelopesa;
- -  double     preecho_thresh;
- -  double     preecho_clamp;
- -  double     preecho_minenergy;
+  float     preecho_thresh;
+  float     preecho_clamp;
+  float     preecho_minenergy;
 } vorbis_info;
  
- -/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
- -
- -typedef struct {
- -  unsigned char *header;
- -  long header_len;
- -  unsigned char *body;
- -  long body_len;
- -} ogg_page;
- -
- -/* ogg_stream_state contains the current encode/decode state of a logical
- -   Ogg bitstream **********************************************************/
- -
- -typedef struct {
- -  unsigned char   *body_data;    /* bytes from packet bodies */
- -  long    body_storage;          /* storage elements allocated */
- -  long    body_fill;             /* elements stored; fill mark */
- -  long    body_returned;         /* elements of fill returned */
- -
- -
- -  int     *lacing_vals;    /* The values that will go to the segment table 
*/
- -  ogg_int64_t *pcm_vals;      /* pcm_pos values for headers. Not compact
- -			     this way, but it is simple coupled to the
- -			     lacing fifo */
- -  long    lacing_storage;
- -  long    lacing_fill;
- -  long    lacing_packet;
- -  long    lacing_returned;
- -
- -  unsigned char    header[282];      /* working space for header encode */
- -  int              header_fill;
- -
- -  int     e_o_s;          /* set when we have buffered the last packet in 
the
- -			     logical bitstream */
- -  int     b_o_s;          /* set after we've written the initial page
- -			     of a logical bitstream */
- -  long     serialno;
- -  int      pageno;
- -  ogg_int64_t  packetno;      /* sequence number for decode; the framing
- -                             knows where there's a hole in the data,
- -                             but we need coupling so that the codec
- -                             (which is in a seperate abstraction
- -                             layer) also knows about the gap */
- -  ogg_int64_t   pcmpos;
- -
- -} ogg_stream_state;
- -
- -/* ogg_packet is used to encapsulate the data and metadata belonging
- -   to a single raw Ogg/Vorbis packet *************************************/
- -
- -typedef struct {
- -  unsigned char *packet;
- -  long  bytes;
- -  long  b_o_s;
- -  long  e_o_s;
- -
- -  ogg_int64_t  frameno;
- -  ogg_int64_t  packetno;       /* sequence number for decode; the framing
- -                             knows where there's a hole in the data,
- -                             but we need coupling so that the codec
- -                             (which is in a seperate abstraction
- -                             layer) also knows about the gap */
- -
- -} ogg_packet;
- -
- -typedef struct {
- -  unsigned char *data;
- -  int storage;
- -  int fill;
- -  int returned;
- -
- -  int unsynced;
- -  int headerbytes;
- -  int bodybytes;
- -} ogg_sync_state;
- -
 /* vorbis_dsp_state buffers the current vorbis audio
    analysis/synthesis state.  The DSP state belongs to a specific
    logical bitstream ****************************************************/
@@ -233,8 +157,8 @@
   vorbis_info *vi;
   int    modebits;
 
- -  double **pcm;
- -  double **pcmret;
+  float **pcm;
+  float **pcmret;
   int      pcm_storage;
   int      pcm_current;
   int      pcm_returned;
@@ -247,7 +171,7 @@
   long nW;
   long centerW;
 
- -  ogg_int64_t frameno;
+  ogg_int64_t granulepos;
   ogg_int64_t sequence;
 
   ogg_int64_t glue_bits;
@@ -257,7 +181,7 @@
 
   /* local lookup storage */
   void                   *ve; /* envelope lookup */    
- -  double                **window[2][2][2]; /* block, leadin, leadout, type 
*/
+  float                **window[2][2][2]; /* block, leadin, leadout, type */
   vorbis_look_transform **transform[2];    /* block, type */
   codebook               *fullbooks;
   /* backend lookups are tied to the mode, not the backend or naked mapping */
@@ -285,7 +209,7 @@
 
 typedef struct vorbis_block{
   /* necessary stream state for linking to the framing abstraction */
- -  double  **pcm;       /* this is a pointer into local storage */ 
+  float  **pcm;       /* this is a pointer into local storage */ 
   oggpack_buffer opb;
   
   long  lW;
@@ -295,7 +219,7 @@
   int   mode;
 
   int eofflag;
- -  ogg_int64_t frameno;
+  ogg_int64_t granulepos;
   ogg_int64_t sequence;
   vorbis_dsp_state *vd; /* For read-only access of configuration */
 
@@ -348,42 +272,6 @@
    packetization aren't necessary as they're provided by the transport
    and the streaming layer is not used */
 
- -/* OggSquish BITSREAM PRIMITIVES: encoding **************************/
- -
- -extern int      ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
- -extern int      ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
- -extern int      ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
- -
- -/* OggSquish BITSREAM PRIMITIVES: decoding **************************/
- -
- -extern int      ogg_sync_init(ogg_sync_state *oy);
- -extern int      ogg_sync_clear(ogg_sync_state *oy);
- -extern int      ogg_sync_destroy(ogg_sync_state *oy);
- -extern int      ogg_sync_reset(ogg_sync_state *oy);
- -
- -extern char    *ogg_sync_buffer(ogg_sync_state *oy, long size);
- -extern int      ogg_sync_wrote(ogg_sync_state *oy, long bytes);
- -extern long     ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
- -extern int      ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
- -extern int      ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
- -extern int      ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
- -
- -/* OggSquish BITSREAM PRIMITIVES: general ***************************/
- -
- -extern int      ogg_stream_init(ogg_stream_state *os,int serialno);
- -extern int      ogg_stream_clear(ogg_stream_state *os);
- -extern int      ogg_stream_reset(ogg_stream_state *os);
- -extern int      ogg_stream_destroy(ogg_stream_state *os);
- -extern int      ogg_stream_eof(ogg_stream_state *os);
- -
- -extern int      ogg_page_version(ogg_page *og);
- -extern int      ogg_page_continued(ogg_page *og);
- -extern int      ogg_page_bos(ogg_page *og);
- -extern int      ogg_page_eos(ogg_page *og);
- -extern ogg_int64_t  ogg_page_frameno(ogg_page *og);
- -extern int      ogg_page_serialno(ogg_page *og);
- -extern int      ogg_page_pageno(ogg_page *og);
- -
 /* Vorbis PRIMITIVES: general ***************************************/
 
 extern void     vorbis_info_init(vorbis_info *vi);
@@ -408,7 +296,7 @@
                                           ogg_packet *op,
                                           ogg_packet *op_comm,
                                           ogg_packet *op_code);
- -extern double **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
+extern float  **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
 extern int      vorbis_analysis_wrote(vorbis_dsp_state *v,int vals);
 extern int      vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block 
*vb);
 extern int      vorbis_analysis(vorbis_block *vb,ogg_packet *op);
@@ -420,7 +308,7 @@
 extern int      vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
 extern int      vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
 extern int      vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block 
*vb);
- -extern int      vorbis_synthesis_pcmout(vorbis_dsp_state *v,double ***pcm);
+extern int      vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm);
 extern int      vorbis_synthesis_read(vorbis_dsp_state *v,int samples);
 
 #ifdef __cplusplus

1.5       +1 -1      vorbis/include/vorbis/mode_D.h

Index: mode_D.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/mode_D.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
- --- mode_D.h	2000/09/01 07:49:52	1.4
+++ mode_D.h	2000/10/12 03:12:41	1.5
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: predefined encoding modes
- - last mod: $Id: mode_D.h,v 1.4 2000/09/01 07:49:52 msmith Exp $
+ last mod: $Id: mode_D.h,v 1.5 2000/10/12 03:12:41 xiphmont Exp $
 
  ********************************************************************/
 

1.3       +1 -1      vorbis/include/vorbis/mode_E.h

Index: mode_E.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/mode_E.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- mode_E.h	2000/09/01 07:49:53	1.2
+++ mode_E.h	2000/10/12 03:12:41	1.3
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: predefined encoding modes
- - last mod: $Id: mode_E.h,v 1.2 2000/09/01 07:49:53 msmith Exp $
+ last mod: $Id: mode_E.h,v 1.3 2000/10/12 03:12:41 xiphmont Exp $
 
  ********************************************************************/
 

1.8       +1 -1      vorbis/include/vorbis/vorbisfile.h

Index: vorbisfile.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/vorbisfile.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
- --- vorbisfile.h	2000/08/30 06:09:21	1.7
+++ vorbisfile.h	2000/10/12 03:12:41	1.8
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: stdio-based convenience library for opening/seeking/decoding
- - last mod: $Id: vorbisfile.h,v 1.7 2000/08/30 06:09:21 xiphmont Exp $
+ last mod: $Id: vorbisfile.h,v 1.8 2000/10/12 03:12:41 xiphmont Exp $
 
  ********************************************************************/
 

1.2       +2 -0      vorbis/include/vorbis/.cvsignore

1.2       +11 -0     vorbis/include/vorbis/Makefile.am

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_128_1.vqh

Index: res0_1024a_128_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_128_1.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_128_1.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_128_1.vqh	2000/10/12 03:12:42	1.3
@@ -34,7 +34,7 @@
         14,
 };
 
- -static double _vq_quantthresh_res0_1024a_128_1[] = {
+static float _vq_quantthresh_res0_1024a_128_1[] = {
         -0.5, 0.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_128_2.vqh

Index: res0_1024a_128_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_128_2.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_128_2.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_128_2.vqh	2000/10/12 03:12:42	1.3
@@ -34,7 +34,7 @@
          9,
 };
 
- -static double _vq_quantthresh_res0_1024a_128_2[] = {
+static float _vq_quantthresh_res0_1024a_128_2[] = {
         -0.5, 0.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_128_3.vqh

Index: res0_1024a_128_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_128_3.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_128_3.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_128_3.vqh	2000/10/12 03:12:42	1.3
@@ -70,7 +70,7 @@
         21,
 };
 
- -static double _vq_quantthresh_res0_1024a_128_3[] = {
+static float _vq_quantthresh_res0_1024a_128_3[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_128_4.vqh

Index: res0_1024a_128_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_128_4.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_128_4.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_128_4.vqh	2000/10/12 03:12:42	1.3
@@ -70,7 +70,7 @@
         17,
 };
 
- -static double _vq_quantthresh_res0_1024a_128_4[] = {
+static float _vq_quantthresh_res0_1024a_128_4[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_128_5.vqh

Index: res0_1024a_128_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_128_5.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_128_5.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_128_5.vqh	2000/10/12 03:12:42	1.3
@@ -183,7 +183,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_1024a_128_5[] = {
+static float _vq_quantthresh_res0_1024a_128_5[] = {
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_128_6.vqh

Index: res0_1024a_128_6.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_128_6.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_128_6.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_128_6.vqh	2000/10/12 03:12:42	1.3
@@ -183,7 +183,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_1024a_128_6[] = {
+static float _vq_quantthresh_res0_1024a_128_6[] = {
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_128_7.vqh

Index: res0_1024a_128_7.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_128_7.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_128_7.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_128_7.vqh	2000/10/12 03:12:42	1.3
@@ -44,7 +44,7 @@
         13,14,14,15,11,13,14,14,15,
 };
 
- -static double _vq_quantthresh_res0_1024a_128_7[] = {
+static float _vq_quantthresh_res0_1024a_128_7[] = {
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 
 };

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_128_8.vqh

Index: res0_1024a_128_8.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_128_8.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_128_8.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_128_8.vqh	2000/10/12 03:12:42	1.3
@@ -55,7 +55,7 @@
         12,
 };
 
- -static double _vq_quantthresh_res0_1024a_128_8[] = {
+static float _vq_quantthresh_res0_1024a_128_8[] = {
         -9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5, 
         1.5, 2.5, 3.5, 5, 7, 9.5, 
 };

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_128_9.vqh

Index: res0_1024a_128_9.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_128_9.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_128_9.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_128_9.vqh	2000/10/12 03:12:42	1.3
@@ -82,7 +82,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_1024a_128_9[] = {
+static float _vq_quantthresh_res0_1024a_128_9[] = {
         -38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5, 
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5, 
         7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_160_1.vqh

Index: res0_1024a_160_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_160_1.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_160_1.vqh	2000/08/15 11:53:18	1.1
+++ res0_1024a_160_1.vqh	2000/10/12 03:12:42	1.2
@@ -34,7 +34,7 @@
         15,
 };
 
- -static double _vq_quantthresh_res0_1024a_160_1[] = {
+static float _vq_quantthresh_res0_1024a_160_1[] = {
         -0.5, 0.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_160_2.vqh

Index: res0_1024a_160_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_160_2.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_160_2.vqh	2000/08/15 11:53:18	1.1
+++ res0_1024a_160_2.vqh	2000/10/12 03:12:42	1.2
@@ -34,7 +34,7 @@
          9,
 };
 
- -static double _vq_quantthresh_res0_1024a_160_2[] = {
+static float _vq_quantthresh_res0_1024a_160_2[] = {
         -0.5, 0.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_160_3.vqh

Index: res0_1024a_160_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_160_3.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_160_3.vqh	2000/08/15 11:53:18	1.1
+++ res0_1024a_160_3.vqh	2000/10/12 03:12:42	1.2
@@ -70,7 +70,7 @@
         20,
 };
 
- -static double _vq_quantthresh_res0_1024a_160_3[] = {
+static float _vq_quantthresh_res0_1024a_160_3[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_160_4.vqh

Index: res0_1024a_160_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_160_4.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_160_4.vqh	2000/08/15 11:53:18	1.1
+++ res0_1024a_160_4.vqh	2000/10/12 03:12:42	1.2
@@ -70,7 +70,7 @@
         16,
 };
 
- -static double _vq_quantthresh_res0_1024a_160_4[] = {
+static float _vq_quantthresh_res0_1024a_160_4[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_160_5.vqh

Index: res0_1024a_160_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_160_5.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_160_5.vqh	2000/08/15 11:53:18	1.1
+++ res0_1024a_160_5.vqh	2000/10/12 03:12:42	1.2
@@ -183,7 +183,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_1024a_160_5[] = {
+static float _vq_quantthresh_res0_1024a_160_5[] = {
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_160_6.vqh

Index: res0_1024a_160_6.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_160_6.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_160_6.vqh	2000/08/15 11:53:18	1.1
+++ res0_1024a_160_6.vqh	2000/10/12 03:12:42	1.2
@@ -183,7 +183,7 @@
         18,
 };
 
- -static double _vq_quantthresh_res0_1024a_160_6[] = {
+static float _vq_quantthresh_res0_1024a_160_6[] = {
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_160_7.vqh

Index: res0_1024a_160_7.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_160_7.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_160_7.vqh	2000/08/15 11:53:18	1.1
+++ res0_1024a_160_7.vqh	2000/10/12 03:12:42	1.2
@@ -44,7 +44,7 @@
         11,13,13,14,10,11,12,13,14,
 };
 
- -static double _vq_quantthresh_res0_1024a_160_7[] = {
+static float _vq_quantthresh_res0_1024a_160_7[] = {
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 
 };

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_160_8.vqh

Index: res0_1024a_160_8.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_160_8.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_160_8.vqh	2000/08/15 11:53:18	1.1
+++ res0_1024a_160_8.vqh	2000/10/12 03:12:42	1.2
@@ -55,7 +55,7 @@
         13,
 };
 
- -static double _vq_quantthresh_res0_1024a_160_8[] = {
+static float _vq_quantthresh_res0_1024a_160_8[] = {
         -9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5, 
         1.5, 2.5, 3.5, 5, 7, 9.5, 
 };

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_160_9.vqh

Index: res0_1024a_160_9.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_160_9.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_160_9.vqh	2000/08/15 11:53:18	1.1
+++ res0_1024a_160_9.vqh	2000/10/12 03:12:42	1.2
@@ -82,7 +82,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_1024a_160_9[] = {
+static float _vq_quantthresh_res0_1024a_160_9[] = {
         -38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5, 
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5, 
         7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_192_1.vqh

Index: res0_1024a_192_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_192_1.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_192_1.vqh	2000/08/15 14:01:03	1.1
+++ res0_1024a_192_1.vqh	2000/10/12 03:12:42	1.2
@@ -34,7 +34,7 @@
         11,
 };
 
- -static double _vq_quantthresh_res0_1024a_192_1[] = {
+static float _vq_quantthresh_res0_1024a_192_1[] = {
         -0.5, 0.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_192_2.vqh

Index: res0_1024a_192_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_192_2.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_192_2.vqh	2000/08/15 14:01:03	1.1
+++ res0_1024a_192_2.vqh	2000/10/12 03:12:42	1.2
@@ -70,7 +70,7 @@
         14,
 };
 
- -static double _vq_quantthresh_res0_1024a_192_2[] = {
+static float _vq_quantthresh_res0_1024a_192_2[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_192_3.vqh

Index: res0_1024a_192_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_192_3.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_192_3.vqh	2000/08/15 14:01:03	1.1
+++ res0_1024a_192_3.vqh	2000/10/12 03:12:42	1.2
@@ -183,7 +183,7 @@
         19,
 };
 
- -static double _vq_quantthresh_res0_1024a_192_3[] = {
+static float _vq_quantthresh_res0_1024a_192_3[] = {
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_192_4.vqh

Index: res0_1024a_192_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_192_4.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_192_4.vqh	2000/08/15 14:01:03	1.1
+++ res0_1024a_192_4.vqh	2000/10/12 03:12:42	1.2
@@ -40,7 +40,7 @@
         11,
 };
 
- -static double _vq_quantthresh_res0_1024a_192_4[] = {
+static float _vq_quantthresh_res0_1024a_192_4[] = {
         -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_192_5.vqh

Index: res0_1024a_192_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_192_5.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_192_5.vqh	2000/08/15 14:01:03	1.1
+++ res0_1024a_192_5.vqh	2000/10/12 03:12:42	1.2
@@ -82,7 +82,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_1024a_192_5[] = {
+static float _vq_quantthresh_res0_1024a_192_5[] = {
         -38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5, 
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5, 
         7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_256_1.vqh

Index: res0_1024a_256_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_256_1.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_256_1.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_256_1.vqh	2000/10/12 03:12:42	1.3
@@ -70,7 +70,7 @@
         16,
 };
 
- -static double _vq_quantthresh_res0_1024a_256_1[] = {
+static float _vq_quantthresh_res0_1024a_256_1[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_256_2.vqh

Index: res0_1024a_256_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_256_2.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_256_2.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_256_2.vqh	2000/10/12 03:12:42	1.3
@@ -44,7 +44,7 @@
         10,10,11,11, 9,10,10,11,11,
 };
 
- -static double _vq_quantthresh_res0_1024a_256_2[] = {
+static float _vq_quantthresh_res0_1024a_256_2[] = {
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 
 };

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_256_3.vqh

Index: res0_1024a_256_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_256_3.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_256_3.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_256_3.vqh	2000/10/12 03:12:42	1.3
@@ -55,7 +55,7 @@
         12,
 };
 
- -static double _vq_quantthresh_res0_1024a_256_3[] = {
+static float _vq_quantthresh_res0_1024a_256_3[] = {
         -9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5, 
         1.5, 2.5, 3.5, 5, 7, 9.5, 
 };

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_256_4.vqh

Index: res0_1024a_256_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_256_4.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_256_4.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_256_4.vqh	2000/10/12 03:12:42	1.3
@@ -67,7 +67,7 @@
         12,13,14,14,14,14,14,15,17,
 };
 
- -static double _vq_quantthresh_res0_1024a_256_4[] = {
+static float _vq_quantthresh_res0_1024a_256_4[] = {
         -19.5, -13.5, -9.5, -7, -5, -3.5, -2.5, -1.5, 
         -0.5, 0.5, 1.5, 2.5, 3.5, 5, 7, 9.5, 
         13.5, 19.5, 

1.3       +1 -1      vorbis/include/vorbis/book/res0_1024a_256_5.vqh

Index: res0_1024a_256_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_256_5.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_1024a_256_5.vqh	2000/08/15 09:09:39	1.2
+++ res0_1024a_256_5.vqh	2000/10/12 03:12:42	1.3
@@ -98,7 +98,7 @@
         15, 0, 0, 0,16,16, 0,16,16,
 };
 
- -static double _vq_quantthresh_res0_1024a_256_5[] = {
+static float _vq_quantthresh_res0_1024a_256_5[] = {
         -75.5, -54, -38.5, -27.5, -19.5, -13.5, -9.5, -7, 
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_350_1.vqh

Index: res0_1024a_350_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_350_1.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_350_1.vqh	2000/08/15 09:45:48	1.1
+++ res0_1024a_350_1.vqh	2000/10/12 03:12:42	1.2
@@ -70,7 +70,7 @@
         14,
 };
 
- -static double _vq_quantthresh_res0_1024a_350_1[] = {
+static float _vq_quantthresh_res0_1024a_350_1[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_350_2.vqh

Index: res0_1024a_350_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_350_2.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_350_2.vqh	2000/08/15 09:45:48	1.1
+++ res0_1024a_350_2.vqh	2000/10/12 03:12:42	1.2
@@ -44,7 +44,7 @@
          9, 9, 9,10, 8, 9, 9, 9,10,
 };
 
- -static double _vq_quantthresh_res0_1024a_350_2[] = {
+static float _vq_quantthresh_res0_1024a_350_2[] = {
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 
 };

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_350_3.vqh

Index: res0_1024a_350_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_350_3.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_350_3.vqh	2000/08/15 09:45:48	1.1
+++ res0_1024a_350_3.vqh	2000/10/12 03:12:42	1.2
@@ -55,7 +55,7 @@
         12,
 };
 
- -static double _vq_quantthresh_res0_1024a_350_3[] = {
+static float _vq_quantthresh_res0_1024a_350_3[] = {
         -9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5, 
         1.5, 2.5, 3.5, 5, 7, 9.5, 
 };

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_350_4.vqh

Index: res0_1024a_350_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_350_4.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_350_4.vqh	2000/08/15 09:45:48	1.1
+++ res0_1024a_350_4.vqh	2000/10/12 03:12:42	1.2
@@ -67,7 +67,7 @@
         11,12,12,12,12,13,13,13,15,
 };
 
- -static double _vq_quantthresh_res0_1024a_350_4[] = {
+static float _vq_quantthresh_res0_1024a_350_4[] = {
         -19.5, -13.5, -9.5, -7, -5, -3.5, -2.5, -1.5, 
         -0.5, 0.5, 1.5, 2.5, 3.5, 5, 7, 9.5, 
         13.5, 19.5, 

1.2       +1 -1      vorbis/include/vorbis/book/res0_1024a_350_5.vqh

Index: res0_1024a_350_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_1024a_350_5.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_1024a_350_5.vqh	2000/08/15 09:45:48	1.1
+++ res0_1024a_350_5.vqh	2000/10/12 03:12:42	1.2
@@ -98,7 +98,7 @@
         13,13,14,14,15,15,16,16,12,
 };
 
- -static double _vq_quantthresh_res0_1024a_350_5[] = {
+static float _vq_quantthresh_res0_1024a_350_5[] = {
         -75.5, -54, -38.5, -27.5, -19.5, -13.5, -9.5, -7, 
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_128_1.vqh

Index: res0_128a_128_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_128_1.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_128_1.vqh	2000/08/15 09:09:39	1.2
+++ res0_128a_128_1.vqh	2000/10/12 03:12:42	1.3
@@ -34,7 +34,7 @@
         12,
 };
 
- -static double _vq_quantthresh_res0_128a_128_1[] = {
+static float _vq_quantthresh_res0_128a_128_1[] = {
         -0.5, 0.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_128_2.vqh

Index: res0_128a_128_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_128_2.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_128_2.vqh	2000/08/15 09:09:39	1.2
+++ res0_128a_128_2.vqh	2000/10/12 03:12:42	1.3
@@ -70,7 +70,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_128a_128_2[] = {
+static float _vq_quantthresh_res0_128a_128_2[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_128_3.vqh

Index: res0_128a_128_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_128_3.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_128_3.vqh	2000/08/15 09:09:39	1.2
+++ res0_128a_128_3.vqh	2000/10/12 03:12:42	1.3
@@ -183,7 +183,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_128a_128_3[] = {
+static float _vq_quantthresh_res0_128a_128_3[] = {
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_128_4.vqh

Index: res0_128a_128_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_128_4.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_128_4.vqh	2000/08/15 09:09:39	1.2
+++ res0_128a_128_4.vqh	2000/10/12 03:12:42	1.3
@@ -40,7 +40,7 @@
         14,
 };
 
- -static double _vq_quantthresh_res0_128a_128_4[] = {
+static float _vq_quantthresh_res0_128a_128_4[] = {
         -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_128_5.vqh

Index: res0_128a_128_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_128_5.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_128_5.vqh	2000/08/15 09:09:39	1.2
+++ res0_128a_128_5.vqh	2000/10/12 03:12:42	1.3
@@ -82,7 +82,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_128a_128_5[] = {
+static float _vq_quantthresh_res0_128a_128_5[] = {
         -38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5, 
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5, 
         7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_160_1.vqh

Index: res0_128a_160_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_160_1.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_160_1.vqh	2000/08/15 11:53:18	1.1
+++ res0_128a_160_1.vqh	2000/10/12 03:12:42	1.2
@@ -34,7 +34,7 @@
          9,
 };
 
- -static double _vq_quantthresh_res0_128a_160_1[] = {
+static float _vq_quantthresh_res0_128a_160_1[] = {
         -0.5, 0.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_160_2.vqh

Index: res0_128a_160_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_160_2.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_160_2.vqh	2000/08/15 11:53:18	1.1
+++ res0_128a_160_2.vqh	2000/10/12 03:12:42	1.2
@@ -70,7 +70,7 @@
         17,
 };
 
- -static double _vq_quantthresh_res0_128a_160_2[] = {
+static float _vq_quantthresh_res0_128a_160_2[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_160_3.vqh

Index: res0_128a_160_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_160_3.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_160_3.vqh	2000/08/15 11:53:18	1.1
+++ res0_128a_160_3.vqh	2000/10/12 03:12:42	1.2
@@ -183,7 +183,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_128a_160_3[] = {
+static float _vq_quantthresh_res0_128a_160_3[] = {
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_160_4.vqh

Index: res0_128a_160_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_160_4.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_160_4.vqh	2000/08/15 11:53:18	1.1
+++ res0_128a_160_4.vqh	2000/10/12 03:12:42	1.2
@@ -40,7 +40,7 @@
         13,
 };
 
- -static double _vq_quantthresh_res0_128a_160_4[] = {
+static float _vq_quantthresh_res0_128a_160_4[] = {
         -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_160_5.vqh

Index: res0_128a_160_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_160_5.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_160_5.vqh	2000/08/15 11:53:18	1.1
+++ res0_128a_160_5.vqh	2000/10/12 03:12:42	1.2
@@ -82,7 +82,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_128a_160_5[] = {
+static float _vq_quantthresh_res0_128a_160_5[] = {
         -38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5, 
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5, 
         7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_192_1.vqh

Index: res0_128a_192_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_192_1.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_192_1.vqh	2000/08/15 14:01:03	1.1
+++ res0_128a_192_1.vqh	2000/10/12 03:12:43	1.2
@@ -34,7 +34,7 @@
          8,
 };
 
- -static double _vq_quantthresh_res0_128a_192_1[] = {
+static float _vq_quantthresh_res0_128a_192_1[] = {
         -0.5, 0.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_192_2.vqh

Index: res0_128a_192_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_192_2.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_192_2.vqh	2000/08/15 14:01:03	1.1
+++ res0_128a_192_2.vqh	2000/10/12 03:12:43	1.2
@@ -70,7 +70,7 @@
         16,
 };
 
- -static double _vq_quantthresh_res0_128a_192_2[] = {
+static float _vq_quantthresh_res0_128a_192_2[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_192_3.vqh

Index: res0_128a_192_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_192_3.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_192_3.vqh	2000/08/15 14:01:03	1.1
+++ res0_128a_192_3.vqh	2000/10/12 03:12:43	1.2
@@ -183,7 +183,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_128a_192_3[] = {
+static float _vq_quantthresh_res0_128a_192_3[] = {
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_192_4.vqh

Index: res0_128a_192_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_192_4.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_192_4.vqh	2000/08/15 14:01:03	1.1
+++ res0_128a_192_4.vqh	2000/10/12 03:12:43	1.2
@@ -40,7 +40,7 @@
         12,
 };
 
- -static double _vq_quantthresh_res0_128a_192_4[] = {
+static float _vq_quantthresh_res0_128a_192_4[] = {
         -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_192_5.vqh

Index: res0_128a_192_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_192_5.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_192_5.vqh	2000/08/15 14:01:03	1.1
+++ res0_128a_192_5.vqh	2000/10/12 03:12:43	1.2
@@ -82,7 +82,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_128a_192_5[] = {
+static float _vq_quantthresh_res0_128a_192_5[] = {
         -38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5, 
         -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5, 
         7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_256_1.vqh

Index: res0_128a_256_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_256_1.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_256_1.vqh	2000/08/15 09:09:39	1.2
+++ res0_128a_256_1.vqh	2000/10/12 03:12:43	1.3
@@ -70,7 +70,7 @@
         14,
 };
 
- -static double _vq_quantthresh_res0_128a_256_1[] = {
+static float _vq_quantthresh_res0_128a_256_1[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_256_2.vqh

Index: res0_128a_256_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_256_2.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_256_2.vqh	2000/08/15 09:09:39	1.2
+++ res0_128a_256_2.vqh	2000/10/12 03:12:43	1.3
@@ -44,7 +44,7 @@
         11,11,11,12,10,11,11,11,12,
 };
 
- -static double _vq_quantthresh_res0_128a_256_2[] = {
+static float _vq_quantthresh_res0_128a_256_2[] = {
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 
 };

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_256_3.vqh

Index: res0_128a_256_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_256_3.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_256_3.vqh	2000/08/15 09:09:39	1.2
+++ res0_128a_256_3.vqh	2000/10/12 03:12:43	1.3
@@ -55,7 +55,7 @@
         10,
 };
 
- -static double _vq_quantthresh_res0_128a_256_3[] = {
+static float _vq_quantthresh_res0_128a_256_3[] = {
         -9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5, 
         1.5, 2.5, 3.5, 5, 7, 9.5, 
 };

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_256_4.vqh

Index: res0_128a_256_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_256_4.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_256_4.vqh	2000/08/15 09:09:40	1.2
+++ res0_128a_256_4.vqh	2000/10/12 03:12:43	1.3
@@ -67,7 +67,7 @@
         12,13,13,12,12,12,13,13,16,
 };
 
- -static double _vq_quantthresh_res0_128a_256_4[] = {
+static float _vq_quantthresh_res0_128a_256_4[] = {
         -19.5, -13.5, -9.5, -7, -5, -3.5, -2.5, -1.5, 
         -0.5, 0.5, 1.5, 2.5, 3.5, 5, 7, 9.5, 
         13.5, 19.5, 

1.3       +1 -1      vorbis/include/vorbis/book/res0_128a_256_5.vqh

Index: res0_128a_256_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_256_5.vqh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- res0_128a_256_5.vqh	2000/08/15 09:09:40	1.2
+++ res0_128a_256_5.vqh	2000/10/12 03:12:43	1.3
@@ -98,7 +98,7 @@
         14, 0, 0, 0, 0, 0, 0, 0, 0,
 };
 
- -static double _vq_quantthresh_res0_128a_256_5[] = {
+static float _vq_quantthresh_res0_128a_256_5[] = {
         -75.5, -54, -38.5, -27.5, -19.5, -13.5, -9.5, -7, 
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_350_1.vqh

Index: res0_128a_350_1.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_350_1.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_350_1.vqh	2000/08/15 09:45:48	1.1
+++ res0_128a_350_1.vqh	2000/10/12 03:12:43	1.2
@@ -70,7 +70,7 @@
          0,
 };
 
- -static double _vq_quantthresh_res0_128a_350_1[] = {
+static float _vq_quantthresh_res0_128a_350_1[] = {
         -1.5, -0.5, 0.5, 1.5, 
 };
 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_350_2.vqh

Index: res0_128a_350_2.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_350_2.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_350_2.vqh	2000/08/15 09:45:48	1.1
+++ res0_128a_350_2.vqh	2000/10/12 03:12:43	1.2
@@ -44,7 +44,7 @@
          9, 9, 9, 9, 8, 8, 9, 8, 9,
 };
 
- -static double _vq_quantthresh_res0_128a_350_2[] = {
+static float _vq_quantthresh_res0_128a_350_2[] = {
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 
 };

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_350_3.vqh

Index: res0_128a_350_3.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_350_3.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_350_3.vqh	2000/08/15 09:45:48	1.1
+++ res0_128a_350_3.vqh	2000/10/12 03:12:43	1.2
@@ -55,7 +55,7 @@
         10,
 };
 
- -static double _vq_quantthresh_res0_128a_350_3[] = {
+static float _vq_quantthresh_res0_128a_350_3[] = {
         -9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5, 
         1.5, 2.5, 3.5, 5, 7, 9.5, 
 };

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_350_4.vqh

Index: res0_128a_350_4.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_350_4.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_350_4.vqh	2000/08/15 09:45:48	1.1
+++ res0_128a_350_4.vqh	2000/10/12 03:12:43	1.2
@@ -67,7 +67,7 @@
         12,12,12,12,12,12,12,12,13,
 };
 
- -static double _vq_quantthresh_res0_128a_350_4[] = {
+static float _vq_quantthresh_res0_128a_350_4[] = {
         -19.5, -13.5, -9.5, -7, -5, -3.5, -2.5, -1.5, 
         -0.5, 0.5, 1.5, 2.5, 3.5, 5, 7, 9.5, 
         13.5, 19.5, 

1.2       +1 -1      vorbis/include/vorbis/book/res0_128a_350_5.vqh

Index: res0_128a_350_5.vqh
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/book/res0_128a_350_5.vqh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- res0_128a_350_5.vqh	2000/08/15 09:45:48	1.1
+++ res0_128a_350_5.vqh	2000/10/12 03:12:43	1.2
@@ -98,7 +98,7 @@
         16,15,15,14,17,16, 0, 0, 0,
 };
 
- -static double _vq_quantthresh_res0_128a_350_5[] = {
+static float _vq_quantthresh_res0_128a_350_5[] = {
         -75.5, -54, -38.5, -27.5, -19.5, -13.5, -9.5, -7, 
         -5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 
         3.5, 5, 7, 9.5, 13.5, 19.5, 27.5, 38.5, 

1.2       +2 -0      vorbis/include/vorbis/book/.cvsignore

1.2       +30 -0     vorbis/include/vorbis/book/Makefile.am

1.35      +370 -99   vorbis/lib/Makefile.in

Index: Makefile.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/Makefile.in,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
- --- Makefile.in	2000/08/30 06:09:21	1.34
+++ Makefile.in	2000/10/12 03:12:52	1.35
@@ -1,100 +1,371 @@
- -# vorbis makefile configured for use with gcc on any platform
- -# $Id: Makefile.in,v 1.34 2000/08/30 06:09:21 xiphmont Exp $
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
 
- -############################################################################
###
- -#                                                                           
  #
- -# To build a production vorbis (preferrably using gmake), just type 'make'. 
  #
- -# To build with debugging or profiling information, use 'make debug' or     
  #
- -# 'make profile' respectively.  'make clean' is a good idea between builds  
  #
- -# with different target names, or before a final build.                     
  #
- -#                                                                           
  #
- -############################################################################
###
- -
- -
- -# DO NOT EDIT BELOW! #######################################################
###
- -# (unless, of course, you know what you are doing :) 
##########################
- -
- - at SET_MAKE@
- -FLAGS=-I. -I../include @CFLAGS@
- -OPT=@OPT@ $(FLAGS)
- -DEBUG=@DEBUG@ $(FLAGS)
- -PROFILE=@PROFILE@ $(FLAGS)
- -CC=@CC@
- -LD=@CC@
- -LDFLAGS=@LDFLAGS@ $(FLAGS)
- -AR=@AR@
- -RANLIB=@RANLIB@
- -LIBS=@LIBS@ 
- -
- -HFILES =	../include/vorbis/codec.h \
- -		../include/vorbis/internal.h ../include/vorbis/backends.h \
- -		../include/vorbis/codebook.h \
- -		bitwise.h envelope.h lpc.h lsp.h bookinternal.h misc.h\
- -		psy.h smallft.h window.h scales.h os.h mdct.h registry.h\
- -		masking.h sharedbook.h iir.h
- -LFILES = 	framing.o mdct.o smallft.o block.o envelope.o window.o\
- -		lsp.o lpc.o analysis.o synthesis.o psy.o info.o bitwise.o\
- -		time0.o floor0.o res0.o mapping0.o registry.o\
- -		codebook.o sharedbook.o iir.o
- -VF_HFILES = ../include/vorbis/vorbisfile.h ../include/vorbis/codec.h \
- -		../include/vorbis/internal.h ../include/vorbis/codebook.h \
- -		os.h misc.h 
- -VF_LFILES = vorbisfile.o
- -
- -PSY_FILES = mdct.o psy.o lpc.o smallft.o window.o psytune.o floor0.o \
- -	bitwise.o lsp.o codebook.o sharedbook.o
- -
- -all:
- -	$(MAKE) target CFLAGS="$(OPT)"
- -
- -debug:	
- -	$(MAKE) target CFLAGS="$(DEBUG)"
- -
- -analysis:	
- -	$(MAKE) target CFLAGS="$(DEBUG) -DANALYSIS"
- -
- -profile: 
- -	$(MAKE) target CFLAGS="$(PROFILE)"
- -
- -target:	libvorbis.a vorbisfile.a psytune
- -
- -selftest:	
- -	$(MAKE) clean
- -	$(CC) $(DEBUG) $(LDFLAGS) -D_V_SELFTEST framing.c -o test_framing 
- -	$(CC) $(DEBUG) $(LDFLAGS) -D_V_SELFTEST bitwise.c\
- -		-o test_bitwise $(LIBS)
- -	$(CC) $(DEBUG) $(LDFLAGS) -c bitwise.c
- -	$(CC) $(DEBUG) $(LDFLAGS) -D_V_SELFTEST sharedbook.c\
- -		-o test_sharedbook $(LIBS)
- -	$(CC) $(DEBUG) $(LDFLAGS) -c sharedbook.c
- -	$(CC) $(DEBUG) $(LDFLAGS) -D_V_SELFTEST codebook.c \
- -		sharedbook.o bitwise.o -o test_codebook $(LIBS)
- -	@echo
- -	@./test_framing
- -	@./test_bitwise
- -	@./test_sharedbook
- -	@./test_codebook
- -
- -libvorbis.a: 	$(LFILES)	
- -		$(AR) -r libvorbis.a $(LFILES)
- -		$(RANLIB) libvorbis.a
- -
- -vorbisfile.a:	$(VF_LFILES)
- -		$(AR) -r vorbisfile.a $(VF_LFILES)
- -		$(RANLIB) vorbisfile.a
- -
- -psytune:	$(PSY_FILES)
- -	        $(CC) $(CFLAGS) $(LDFLAGS) $(PSY_FILES) -o $@ $(LIBS)
- -
- -$(LFILES): 	$(HFILES)
- -$(VF_LFILES): 	$(VF_HFILES)
- -
- -.c.o:
- -	$(CC) $(CFLAGS) -c $<
- -
- -clean:
- -	-rm -f *.o *.a test* *~ *.out ogg config.* tone psytune
- -
- -distclean:	clean
- -	-rm -f Makefile
- -
+# Copyright (C) 1994, 1995-8, 1999 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@
+DEBUG = @DEBUG@
+DLLTOOL = @DLLTOOL@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+PROFILE = @PROFILE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+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
+
+INCLUDES = -I$(top_srcdir)/include
+
+lib_LTLIBRARIES = libvorbis.la libvorbisfile.la
+
+libvorbis_la_SOURCES = mdct.c smallft.c block.c envelope.c window.c lsp.c 
lpc.c 			analysis.c synthesis.c psy.c info.c time0.c floor0.c 			res0.c 
mapping0.c registry.c codebook.c sharedbook.c 			iir.c 			envelope.h lpc.h 
lsp.h bookinternal.h misc.h psy.h 			masking.h sharedbook.h iir.h os.h
+
+libvorbis_la_LDFLAGS = -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_A
GE@
+
+libvorbisfile_la_SOURCES = vorbisfile.c
+libvorbisfile_la_LDFLAGS = -version-info @VF_LIB_CURRENT@:@VF_LIB_REVISION@:@V
F_LIB_AGE@
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_CLEAN_FILES = 
+LTLIBRARIES =  $(lib_LTLIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) 
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+libvorbis_la_LIBADD = 
+libvorbis_la_OBJECTS =  mdct.lo smallft.lo block.lo envelope.lo \
+window.lo lsp.lo lpc.lo analysis.lo synthesis.lo psy.lo info.lo \
+time0.lo floor0.lo res0.lo mapping0.lo registry.lo codebook.lo \
+sharedbook.lo iir.lo
+libvorbisfile_la_LIBADD = 
+libvorbisfile_la_OBJECTS =  vorbisfile.lo
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) 
$(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON =  Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+DEP_FILES =  .deps/analysis.P .deps/block.P .deps/codebook.P \
+.deps/envelope.P .deps/floor0.P .deps/iir.P .deps/info.P .deps/lpc.P \
+.deps/lsp.P .deps/mapping0.P .deps/mdct.P .deps/psy.P .deps/registry.P \
+.deps/res0.P .deps/sharedbook.P .deps/smallft.P .deps/synthesis.P \
+.deps/time0.P .deps/vorbisfile.P .deps/window.P
+SOURCES = $(libvorbis_la_SOURCES) $(libvorbisfile_la_SOURCES)
+OBJECTS = $(libvorbis_la_OBJECTS) $(libvorbisfile_la_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .lo .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status 
$(BUILT_SOURCES)
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-libLTLIBRARIES:
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+
+distclean-libLTLIBRARIES:
+
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p 
$(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+	  else :; fi; \
+	done
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+	done
+
+.s.o:
+	$(COMPILE) -c $<
+
+.S.o:
+	$(COMPILE) -c $<
+
+mostlyclean-compile:
+	-rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+	-rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.s.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+libvorbis.la: $(libvorbis_la_OBJECTS) $(libvorbis_la_DEPENDENCIES)
+	$(LINK) -rpath $(libdir) $(libvorbis_la_LDFLAGS) $(libvorbis_la_OBJECTS) 
$(libvorbis_la_LIBADD) $(LIBS)
+
+libvorbisfile.la: $(libvorbisfile_la_OBJECTS) $(libvorbisfile_la_DEPENDENCIES)
+	$(LINK) -rpath $(libdir) $(libvorbisfile_la_LDFLAGS) 
$(libvorbisfile_la_OBJECTS) $(libvorbisfile_la_LIBADD) $(LIBS)
+
+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:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	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 $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o 
$$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+	-rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = lib
+
+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 lib/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
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-libLTLIBRARIES
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-libLTLIBRARIES
+uninstall: uninstall-am
+all-am: Makefile $(LTLIBRARIES)
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+	$(mkinstalldirs)  $(DESTDIR)$(libdir)
+
+
+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-libLTLIBRARIES mostlyclean-compile \
+		mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+		mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am:  clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
+		clean-depend clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am:  distclean-libLTLIBRARIES distclean-compile \
+		distclean-libtool distclean-tags distclean-depend \
+		distclean-generic clean-am
+	-rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am:  maintainer-clean-libLTLIBRARIES \
+		maintainer-clean-compile maintainer-clean-libtool \
+		maintainer-clean-tags maintainer-clean-depend \
+		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-am
+
+.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+mostlyclean-libtool distclean-libtool clean-libtool \
+maintainer-clean-libtool tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend 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 \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+debug:
+	$(MAKE) all CFLAGS="@DEBUG@"
+
+profile:
+	$(MAKE) all CFLAGS="@PROFILE@"
+
+# 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:

1.34      +15 -15    vorbis/lib/analysis.c

Index: analysis.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/analysis.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
- --- analysis.c	2000/08/15 09:09:42	1.33
+++ analysis.c	2000/10/12 03:12:52	1.34
@@ -12,15 +12,15 @@
  ********************************************************************
 
  function: single-block PCM analysis mode dispatch
- - last mod: $Id: analysis.c,v 1.33 2000/08/15 09:09:42 xiphmont Exp $
+ last mod: $Id: analysis.c,v 1.34 2000/10/12 03:12:52 xiphmont Exp $
 
  ********************************************************************/
 
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
+#include <ogg/ogg.h>
 #include "vorbis/codec.h"
- -#include "bitwise.h"
 #include "registry.h"
 #include "scales.h"
 #include "os.h"
@@ -38,9 +38,9 @@
   vb->res_bits=0;
 
   /* first things first.  Make sure encode is ready */
- -  _oggpack_reset(&vb->opb);
+  oggpack_reset(&vb->opb);
   /* Encode the packet type */
- -  _oggpack_write(&vb->opb,0,1);
+  oggpack_write(&vb->opb,0,1);
 
   /* currently lazy.  Short block dispatches to 0, long to 1. */
 
@@ -49,32 +49,32 @@
   vb->mode=mode;
 
   /* Encode frame mode, pre,post windowsize, then dispatch */
- -  _oggpack_write(&vb->opb,mode,vd->modebits);
+  oggpack_write(&vb->opb,mode,vd->modebits);
   if(vb->W){
- -    _oggpack_write(&vb->opb,vb->lW,1);
- -    _oggpack_write(&vb->opb,vb->nW,1);
- -    /*fprintf(stderr,"*");
- -  }else{
- -    fprintf(stderr,".");*/
- -  }
+    oggpack_write(&vb->opb,vb->lW,1);
+    oggpack_write(&vb->opb,vb->nW,1);
+    /*fprintf(stderr,"*");*/
+  }/*else{
+    fprintf(stderr,".");
+    }*/
 
   if(_mapping_P[type]->forward(vb,vd->mode[mode]))
     return(-1);
 
   /* set up the packet wrapper */
 
- -  op->packet=_oggpack_buffer(&vb->opb);
- -  op->bytes=_oggpack_bytes(&vb->opb);
+  op->packet=oggpack_get_buffer(&vb->opb);
+  op->bytes=oggpack_bytes(&vb->opb);
   op->b_o_s=0;
   op->e_o_s=vb->eofflag;
- -  op->frameno=vb->frameno;
+  op->granulepos=vb->granulepos;
   op->packetno=vb->sequence; /* for sake of completeness */
 
   return(0);
 }
 
 /* there was no great place to put this.... */
- -void _analysis_output(char *base,int i,double *v,int n,int bark,int dB){
+void _analysis_output(char *base,int i,float *v,int n,int bark,int dB){
 #ifdef ANALYSIS
   int j;
   FILE *of;

1.39      +45 -44    vorbis/lib/block.c

Index: block.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/block.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
- --- block.c	2000/08/27 07:59:19	1.38
+++ block.c	2000/10/12 03:12:52	1.39
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: PCM data vector blocking, windowing and dis/reassembly
- - last mod: $Id: block.c,v 1.38 2000/08/27 07:59:19 msmith Exp $
+ last mod: $Id: block.c,v 1.39 2000/10/12 03:12:52 xiphmont Exp $
 
  Handle windowing, overlap-add, etc of the PCM vectors.  This is made
  more amusing by Vorbis' current two allowed block sizes.
@@ -26,13 +26,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ogg/ogg.h>
 #include "vorbis/codec.h"
 
 #include "window.h"
 #include "envelope.h"
 #include "mdct.h"
 #include "lpc.h"
- -#include "bitwise.h"
 #include "registry.h"
 #include "sharedbook.h"
 #include "bookinternal.h"
@@ -98,7 +98,7 @@
   vb->localalloc=0;
   vb->localstore=NULL;
   if(v->analysisp)
- -    _oggpack_writeinit(&vb->opb);
+    oggpack_writeinit(&vb->opb);
 
   return(0);
 }
@@ -152,7 +152,7 @@
 int vorbis_block_clear(vorbis_block *vb){
   if(vb->vd)
     if(vb->vd->analysisp)
- -      _oggpack_writeclear(&vb->opb);
+      oggpack_writeclear(&vb->opb);
   _vorbis_block_ripcord(vb);
   if(vb->localstore)free(vb->localstore);
 
@@ -181,14 +181,14 @@
   mdct_init(v->transform[0][0],vi->blocksizes[0]);
   mdct_init(v->transform[1][0],vi->blocksizes[1]);
 
- -  v->window[0][0][0]=calloc(VI_WINDOWB,sizeof(double *));
+  v->window[0][0][0]=calloc(VI_WINDOWB,sizeof(float *));
   v->window[0][0][1]=v->window[0][0][0];
   v->window[0][1][0]=v->window[0][0][0];
   v->window[0][1][1]=v->window[0][0][0];
- -  v->window[1][0][0]=calloc(VI_WINDOWB,sizeof(double *));
- -  v->window[1][0][1]=calloc(VI_WINDOWB,sizeof(double *));
- -  v->window[1][1][0]=calloc(VI_WINDOWB,sizeof(double *));
- -  v->window[1][1][1]=calloc(VI_WINDOWB,sizeof(double *));
+  v->window[1][0][0]=calloc(VI_WINDOWB,sizeof(float *));
+  v->window[1][0][1]=calloc(VI_WINDOWB,sizeof(float *));
+  v->window[1][1][0]=calloc(VI_WINDOWB,sizeof(float *));
+  v->window[1][1][1]=calloc(VI_WINDOWB,sizeof(float *));
 
   for(i=0;i<VI_WINDOWB;i++){
     v->window[0][0][0][i]=
@@ -222,12 +222,12 @@
   v->pcm_storage=8192; /* we'll assume later that we have
                           a minimum of twice the blocksize of
                           accumulated samples in analysis */
- -  v->pcm=malloc(vi->channels*sizeof(double *));
- -  v->pcmret=malloc(vi->channels*sizeof(double *));
+  v->pcm=malloc(vi->channels*sizeof(float *));
+  v->pcmret=malloc(vi->channels*sizeof(float *));
   {
     int i;
     for(i=0;i<vi->channels;i++)
- -      v->pcm[i]=calloc(v->pcm_storage,sizeof(double));
+      v->pcm[i]=calloc(v->pcm_storage,sizeof(float));
   }
 
   /* all 1 (large block) or 0 (small block) */
@@ -328,7 +328,7 @@
   }
 }
 
- -double **vorbis_analysis_buffer(vorbis_dsp_state *v, int vals){
+float **vorbis_analysis_buffer(vorbis_dsp_state *v, int vals){
   int i;
   vorbis_info *vi=v->vi;
 
@@ -344,7 +344,7 @@
     v->pcm_storage=v->pcm_current+vals*2;
    
     for(i=0;i<vi->channels;i++){
- -      v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(double));
+      v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(float));
     }
   }
 
@@ -357,8 +357,8 @@
 static void _preextrapolate_helper(vorbis_dsp_state *v){
   int i;
   int order=32;
- -  double *lpc=alloca(order*sizeof(double));
- -  double *work=alloca(v->pcm_current*sizeof(double));
+  float *lpc=alloca(order*sizeof(float));
+  float *work=alloca(v->pcm_current*sizeof(float));
   long j;
   v->preextrapolate=1;
 
@@ -391,7 +391,7 @@
   if(vals<=0){
     int order=32;
     int i;
- -    double *lpc=alloca(order*sizeof(double));
+    float *lpc=alloca(order*sizeof(float));
 
     /* if it wasn't done earlier (very short sample) */
     if(!v->preextrapolate)
@@ -425,7 +425,7 @@
            guarding the overlap, but bulletproof in case that
            assumtion goes away). zeroes will do. */
         memset(v->pcm[i]+v->eofflag,0,
- -	       (v->pcm_current-v->eofflag)*sizeof(double));
+	       (v->pcm_current-v->eofflag)*sizeof(float));
 
       }
     }
@@ -512,15 +512,15 @@
   }
   vb->vd=v;
   vb->sequence=v->sequence;
- -  vb->frameno=v->frameno;
+  vb->granulepos=v->granulepos;
   vb->pcmend=vi->blocksizes[v->W];
   
   /* copy the vectors; this uses the local storage in vb */
   {
- -    vb->pcm=_vorbis_block_alloc(vb,sizeof(double *)*vi->channels);
+    vb->pcm=_vorbis_block_alloc(vb,sizeof(float *)*vi->channels);
     for(i=0;i<vi->channels;i++){
- -      vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(double));
- -      memcpy(vb->pcm[i],v->pcm[i]+beginW,vi->blocksizes[v->
W]*sizeof(double));
+      vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(float));
+      memcpy(vb->pcm[i],v->pcm[i]+beginW,vi->blocksizes[v->W]*sizeof(float));
     }
   }
   
@@ -546,7 +546,7 @@
 
     for(i=0;i<vi->channels;i++)
       memmove(v->pcm[i],v->pcm[i]+movementW,
- -	      v->pcm_current*sizeof(double));
+	      v->pcm_current*sizeof(float));
 
 
     v->lW=v->W;
@@ -559,12 +559,12 @@
       v->eofflag-=movementW;
       /* do not add padding to end of stream! */
       if(v->centerW>=v->eofflag){
- -	v->frameno+=movementW-(v->centerW-v->eofflag);
+	v->granulepos+=movementW-(v->centerW-v->eofflag);
       }else{
- -	v->frameno+=movementW;
+	v->granulepos+=movementW;
       }
     }else{
- -      v->frameno+=movementW;
+      v->granulepos+=movementW;
     }
   }
 
@@ -578,13 +578,13 @@
   /* Adjust centerW to allow an easier mechanism for determining output */
   v->pcm_returned=v->centerW;
   v->centerW-= vi->blocksizes[v->W]/4+vi->blocksizes[v->lW]/4;
- -  v->frameno=-1;
+  v->granulepos=-1;
   v->sequence=-1;
 
   return(0);
 }
 
- -/* Unike in analysis, the window is only partially applied for each
+/* Unlike in analysis, the window is only partially applied for each
    block.  The time domain envelope is not yet handled at the point of
    calling (as it relies on the previous block). */
 
@@ -609,7 +609,7 @@
       int i;
       for(i=0;i<vi->channels;i++)
         memmove(v->pcm[i],v->pcm[i]+shiftPCM,
- -		v->pcm_current*sizeof(double));
+		v->pcm_current*sizeof(float));
     }
   }
 
@@ -622,7 +622,7 @@
   v->floor_bits+=vb->floor_bits;
   v->res_bits+=vb->res_bits;
 
- -  if(v->sequence+1 != vb->sequence)v->frameno=-1; /* out of sequence;
+  if(v->sequence+1 != vb->sequence)v->granulepos=-1; /* out of sequence;
                                                      lose count */
 
   v->sequence=vb->sequence;
@@ -642,7 +642,7 @@
       v->pcm_storage=endW+vi->blocksizes[1];
    
       for(i=0;i<vi->channels;i++)
- -	v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(double)); 
+	v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(float)); 
     }
 
     /* overlap/add PCM */
@@ -659,20 +659,21 @@
     }
 
     for(j=0;j<vi->channels;j++){
- -      double *pcm=v->pcm[j]+beginW;
- -      
+      float *pcm=v->pcm[j]+beginW;
+      float *p=vb->pcm[j];
+
       /* the overlap/add section */
       for(i=beginSl;i<endSl;i++)
- -	pcm[i]+=vb->pcm[j][i];
+	pcm[i]+=p[i];
       /* the remaining section */
       for(;i<sizeW;i++)
- -	pcm[i]=vb->pcm[j][i];
+	pcm[i]=p[i];
     }
 
     /* track the frame number... This is for convenience, but also
        making sure our last packet doesn't end with added padding.  If
        the last packet is partial, the number of samples we'll have to
- -       return will be past the vb->frameno.
+       return will be past the vb->granulepos.
        
        This is not foolproof!  It will be confused if we begin
        decoding at the last page after a seek or hole.  In that case,
@@ -680,17 +681,17 @@
        is.  For this reason, vorbisfile will always try to make sure
        it reads the last two marked pages in proper sequence */
 
- -    if(v->frameno==-1)
- -      v->frameno=vb->frameno;
+    if(v->granulepos==-1)
+      v->granulepos=vb->granulepos;
     else{
- -      v->frameno+=(centerW-v->centerW);
- -      if(vb->frameno!=-1 && v->frameno!=vb->frameno){
- -	if(v->frameno>vb->frameno && vb->eofflag){
+      v->granulepos+=(centerW-v->centerW);
+      if(vb->granulepos!=-1 && v->granulepos!=vb->granulepos){
+	if(v->granulepos>vb->granulepos && vb->eofflag){
           /* partial last frame.  Strip the padding off */
- -	  centerW-=(v->frameno-vb->frameno);
+	  centerW-=(v->granulepos-vb->granulepos);
         }/* else{ Shouldn't happen *unless* the bitstream is out of
             spec.  Either way, believe the bitstream } */
- -	v->frameno=vb->frameno;
+	v->granulepos=vb->granulepos;
       }
     }
 
@@ -706,7 +707,7 @@
 }
 
 /* pcm==NULL indicates we just want the pending samples, no more */
- -int vorbis_synthesis_pcmout(vorbis_dsp_state *v,double ***pcm){
+int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm){
   vorbis_info *vi=v->vi;
   if(v->pcm_returned<v->centerW){
     if(pcm){

1.9       +8 -6      vorbis/lib/bookinternal.h

Index: bookinternal.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/bookinternal.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
- --- bookinternal.h	2000/06/14 01:38:31	1.8
+++ bookinternal.h	2000/10/12 03:12:52	1.9
@@ -12,28 +12,30 @@
  ********************************************************************
 
  function: basic codebook pack/unpack/code/decode operations
- - last mod: $Id: bookinternal.h,v 1.8 2000/06/14 01:38:31 xiphmont Exp $
+ last mod: $Id: bookinternal.h,v 1.9 2000/10/12 03:12:52 xiphmont Exp $
 
  ********************************************************************/
 
 #ifndef _V_INT_CODEBOOK_H_
 #define _V_INT_CODEBOOK_H_
 
+#include <ogg/ogg.h>
 #include "vorbis/codebook.h"
- -#include "bitwise.h"
 
 extern int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *b);
 extern int vorbis_staticbook_unpack(oggpack_buffer *b,static_codebook *c);
 
 extern int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b);
- -extern int vorbis_book_errorv(codebook *book, double *a);
- -extern int vorbis_book_encodev(codebook *book, int best,double *a, 
+extern int vorbis_book_errorv(codebook *book, float *a);
+extern int vorbis_book_encodev(codebook *book, int best,float *a, 
                                oggpack_buffer *b);
- -extern int vorbis_book_encodevs(codebook *book, double *a, oggpack_buffer 
*b,
+extern int vorbis_book_encodevs(codebook *book, float *a, oggpack_buffer *b,
                                 int step,int stagetype);
 
 extern long vorbis_book_decode(codebook *book, oggpack_buffer *b);
- -extern long vorbis_book_decodevs(codebook *book, double *a, oggpack_buffer 
*b,
+extern long vorbis_book_decodevs(codebook *book, float *a, oggpack_buffer *b,
                                  int step,int stagetype);
+extern long s_vorbis_book_decodevs(codebook *book, float *a, oggpack_buffer 
*b,
+				   int step,int stagetype);
 
 #endif

1.18      +125 -64   vorbis/lib/codebook.c

Index: codebook.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/codebook.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
- --- codebook.c	2000/07/07 01:37:00	1.17
+++ codebook.c	2000/10/12 03:12:52	1.18
@@ -12,16 +12,16 @@
  ********************************************************************
 
  function: basic codebook pack/unpack/code/decode operations
- - last mod: $Id: codebook.c,v 1.17 2000/07/07 01:37:00 xiphmont Exp $
+ last mod: $Id: codebook.c,v 1.18 2000/10/12 03:12:52 xiphmont Exp $
 
  ********************************************************************/
 
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#include <ogg/ogg.h>
 #include "vorbis/codec.h"
 #include "vorbis/codebook.h"
- -#include "bitwise.h"
 #include "scales.h"
 #include "sharedbook.h"
 #include "bookinternal.h"
@@ -35,9 +35,9 @@
   int ordered=0;
 
   /* first the basic parameters */
- -  _oggpack_write(opb,0x564342,24);
- -  _oggpack_write(opb,c->dim,16);
- -  _oggpack_write(opb,c->entries,24);
+  oggpack_write(opb,0x564342,24);
+  oggpack_write(opb,c->dim,16);
+  oggpack_write(opb,c->entries,24);
 
   /* pack the codewords.  There are two packings; length ordered and
      length random.  Decide between the two now. */
@@ -52,25 +52,25 @@
        deterministically */
 
     long count=0;
- -    _oggpack_write(opb,1,1);  /* ordered */
- -    _oggpack_write(opb,c->lengthlist[0]-1,5); /* 1 to 32 */
+    oggpack_write(opb,1,1);  /* ordered */
+    oggpack_write(opb,c->lengthlist[0]-1,5); /* 1 to 32 */
 
     for(i=1;i<c->entries;i++){
       long this=c->lengthlist[i];
       long last=c->lengthlist[i-1];
       if(this>last){
         for(j=last;j<this;j++){
- -	  _oggpack_write(opb,i-count,_ilog(c->entries-count));
+	  oggpack_write(opb,i-count,_ilog(c->entries-count));
           count=i;
         }
       }
     }
- -    _oggpack_write(opb,i-count,_ilog(c->entries-count));
+    oggpack_write(opb,i-count,_ilog(c->entries-count));
     
   }else{
     /* length random.  Again, we don't code the codeword itself, just
        the length.  This time, though, we have to encode each length */
- -    _oggpack_write(opb,0,1);   /* unordered */
+    oggpack_write(opb,0,1);   /* unordered */
     
     /* algortihmic mapping has use for 'unused entries', which we tag
        here.  The algorithmic mapping happens as usual, but the unused
@@ -79,17 +79,17 @@
       if(c->lengthlist[i]==0)break;
 
     if(i==c->entries){
- -      _oggpack_write(opb,0,1); /* no unused entries */
+      oggpack_write(opb,0,1); /* no unused entries */
       for(i=0;i<c->entries;i++)
- -	_oggpack_write(opb,c->lengthlist[i]-1,5);
+	oggpack_write(opb,c->lengthlist[i]-1,5);
     }else{
- -      _oggpack_write(opb,1,1); /* we have unused entries; thus we tag */
+      oggpack_write(opb,1,1); /* we have unused entries; thus we tag */
       for(i=0;i<c->entries;i++){
         if(c->lengthlist[i]==0){
- -	  _oggpack_write(opb,0,1);
+	  oggpack_write(opb,0,1);
         }else{
- -	  _oggpack_write(opb,1,1);
- -	  _oggpack_write(opb,c->lengthlist[i]-1,5);
+	  oggpack_write(opb,1,1);
+	  oggpack_write(opb,c->lengthlist[i]-1,5);
         }
       }
     }
@@ -97,7 +97,7 @@
 
   /* is the entry number the desired return value, or do we have a
      mapping? If we have a mapping, what type? */
- -  _oggpack_write(opb,c->maptype,4);
+  oggpack_write(opb,c->maptype,4);
   switch(c->maptype){
   case 0:
     /* no mapping */
@@ -112,10 +112,10 @@
     }
     
     /* values that define the dequantization */
- -    _oggpack_write(opb,c->q_min,32);
- -    _oggpack_write(opb,c->q_delta,32);
- -    _oggpack_write(opb,c->q_quant-1,4);
- -    _oggpack_write(opb,c->q_sequencep,1);
+    oggpack_write(opb,c->q_min,32);
+    oggpack_write(opb,c->q_delta,32);
+    oggpack_write(opb,c->q_quant-1,4);
+    oggpack_write(opb,c->q_sequencep,1);
     
     {
       int quantvals;
@@ -133,7 +133,7 @@
 
       /* quantized values */
       for(i=0;i<quantvals;i++)
- -	_oggpack_write(opb,labs(c->quantlist[i]),c->q_quant);
+	oggpack_write(opb,labs(c->quantlist[i]),c->q_quant);
 
     }
     break;
@@ -152,26 +152,26 @@
   memset(s,0,sizeof(static_codebook));
 
   /* make sure alignment is correct */
- -  if(_oggpack_read(opb,24)!=0x564342)goto _eofout;
+  if(oggpack_read(opb,24)!=0x564342)goto _eofout;
 
   /* first the basic parameters */
- -  s->dim=_oggpack_read(opb,16);
- -  s->entries=_oggpack_read(opb,24);
+  s->dim=oggpack_read(opb,16);
+  s->entries=oggpack_read(opb,24);
   if(s->entries==-1)goto _eofout;
 
   /* codeword ordering.... length ordered or unordered? */
- -  switch(_oggpack_read(opb,1)){
+  switch(oggpack_read(opb,1)){
   case 0:
     /* unordered */
     s->lengthlist=malloc(sizeof(long)*s->entries);
 
     /* allocated but unused entries? */
- -    if(_oggpack_read(opb,1)){
+    if(oggpack_read(opb,1)){
       /* yes, unused entries */
 
       for(i=0;i<s->entries;i++){
- -	if(_oggpack_read(opb,1)){
- -	  long num=_oggpack_read(opb,5);
+	if(oggpack_read(opb,1)){
+	  long num=oggpack_read(opb,5);
           if(num==-1)goto _eofout;
           s->lengthlist[i]=num+1;
         }else
@@ -180,7 +180,7 @@
     }else{
       /* all entries used; no tagging */
       for(i=0;i<s->entries;i++){
- -	long num=_oggpack_read(opb,5);
+	long num=oggpack_read(opb,5);
         if(num==-1)goto _eofout;
         s->lengthlist[i]=num+1;
       }
@@ -190,11 +190,11 @@
   case 1:
     /* ordered */
     {
- -      long length=_oggpack_read(opb,5)+1;
+      long length=oggpack_read(opb,5)+1;
       s->lengthlist=malloc(sizeof(long)*s->entries);
 
       for(i=0;i<s->entries;){
- -	long num=_oggpack_read(opb,_ilog(s->entries-i));
+	long num=oggpack_read(opb,_ilog(s->entries-i));
         if(num==-1)goto _eofout;
         for(j=0;j<num;j++,i++)
           s->lengthlist[i]=length;
@@ -208,7 +208,7 @@
   }
   
   /* Do we have a mapping to unpack? */
- -  switch((s->maptype=_oggpack_read(opb,4))){
+  switch((s->maptype=oggpack_read(opb,4))){
   case 0:
     /* no mapping */
     break;
@@ -216,10 +216,10 @@
     /* implicitly populated value mapping */
     /* explicitly populated value mapping */
 
- -    s->q_min=_oggpack_read(opb,32);
- -    s->q_delta=_oggpack_read(opb,32);
- -    s->q_quant=_oggpack_read(opb,4)+1;
- -    s->q_sequencep=_oggpack_read(opb,1);
+    s->q_min=oggpack_read(opb,32);
+    s->q_delta=oggpack_read(opb,32);
+    s->q_quant=oggpack_read(opb,4)+1;
+    s->q_sequencep=oggpack_read(opb,1);
 
     {
       int quantvals;
@@ -233,9 +233,9 @@
       }
       
       /* quantized values */
- -      s->quantlist=malloc(sizeof(double)*quantvals);
+      s->quantlist=malloc(sizeof(float)*quantvals);
       for(i=0;i<quantvals;i++)
- -	s->quantlist[i]=_oggpack_read(opb,s->q_quant);
+	s->quantlist[i]=oggpack_read(opb,s->q_quant);
       
       if(s->quantlist[quantvals-1]==-1)goto _eofout;
     }
@@ -255,7 +255,7 @@
 
 /* returns the number of bits ************************************************
/
 int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b){
- -  _oggpack_write(b,book->codelist[a],book->c->lengthlist[a]);
+  oggpack_write(b,book->codelist[a],book->c->lengthlist[a]);
   return(book->c->lengthlist[a]);
 }
 
@@ -268,13 +268,13 @@
 
 Residue0 encoding interleaves, uses multiple stages, and each stage
 peels of a specific amount of resolution from a lattice (thus we want
- -to match by threshhold, not nearest match).  Residue doesn't *have* to
+to match by threshold, not nearest match).  Residue doesn't *have* to
 be encoded that way, but to change it, one will need to add more
 infrastructure on the encode side (decode side is specced and simpler) */
 
 /* floor0 LSP (single stage, non interleaved, nearest match) */
 /* returns entry number and *modifies a* to the quantization value *****/
- -int vorbis_book_errorv(codebook *book,double *a){
+int vorbis_book_errorv(codebook *book,float *a){
   int dim=book->dim,k;
   int best=_best(book,a,1);
   for(k=0;k<dim;k++)
@@ -283,7 +283,7 @@
 }
 
 /* returns the number of bits and *modifies a* to the quantization value 
*****/
- -int vorbis_book_encodev(codebook *book,int best,double *a,oggpack_buffer 
*b){
+int vorbis_book_encodev(codebook *book,int best,float *a,oggpack_buffer *b){
   int k,dim=book->dim;
   for(k=0;k<dim;k++)
     a[k]=(book->valuelist+best*dim)[k];
@@ -292,7 +292,7 @@
 
 /* res0 (multistage, interleave, lattice) */
 /* returns the number of bits and *modifies a* to the remainder value 
********/
- -int vorbis_book_encodevs(codebook *book,double *a,oggpack_buffer *b,
+int vorbis_book_encodevs(codebook *book,float *a,oggpack_buffer *b,
                          int step,int addmul){
 
   int best=vorbis_book_besterror(book,a,step,addmul);
@@ -309,16 +309,25 @@
    Cascades may be additive or multiplicitive; this is not inherent in
    the codebook, but set in the code using the codebook.  Like
    interleaving, it's easiest to do it here.  
- -   stage==0 -> declarative (set the value)
- -   stage==1 -> additive
- -   stage==2 -> multiplicitive */
+   addmul==0 -> declarative (set the value)
+   addmul==1 -> additive
+   addmul==2 -> multiplicitive */
 
 /* returns the entry number or -1 on eof *************************************
/
 long vorbis_book_decode(codebook *book, oggpack_buffer *b){
   long ptr=0;
   decode_aux *t=book->decode_tree;
+  int lok = oggpack_look(b, t->tabn);
+
+  if (lok >= 0) {
+    ptr = t->tab[lok];
+    oggpack_adv(b, t->tabl[lok]);
+    if (ptr <= 0)
+      return -ptr;
+  }
+
   do{
- -    switch(_oggpack_read1(b)){
+    switch(oggpack_read1(b)){
     case 0:
       ptr=t->ptr0[ptr];
       break;
@@ -333,26 +342,78 @@
 }
 
 /* returns the entry number or -1 on eof *************************************
/
- -long vorbis_book_decodevs(codebook *book,double *a,oggpack_buffer *b,
+long vorbis_book_decodevs(codebook *book,float *a,oggpack_buffer *b,
                           int step,int addmul){
   long entry=vorbis_book_decode(book,b);
   int i,o;
+  float *t;
   if(entry==-1)return(-1);
+  t = book->valuelist+entry*book->dim;
+  switch(addmul){
+  case -1:
+    for(i=0,o=0;i<book->dim-3;i+=4,o+=4*step) {
+      a[o]=t[i];
+      a[o+step]=t[i+1];
+      a[o+2*step]=t[i+2];
+      a[o+3*step]=t[i+3];
+    }
+    for(;i<book->dim;i++,o+=step)
+      a[o]=t[i];
+    break;
+  case 0:
+    for(i=0,o=0;i<book->dim-3;i+=4,o+=4*step) {
+      a[o]+=t[i];
+      a[o+step]+=t[i+1];
+      a[o+2*step]+=t[i+2];
+      a[o+3*step]+=t[i+3];
+    }
+    for(;i<book->dim;i++,o+=step)
+      a[o]+=t[i];
+    break;
+  case 1:
+    for(i=0,o=0;i<book->dim-3;i+=4,o+=4*step) {
+      a[o]*=t[i];
+      a[o+step]*=t[i+1];
+      a[o+2*step]*=t[i+2];
+      a[o+3*step]*=t[i+3];
+    }
+    for(;i<book->dim;i++,o+=step)
+      a[o]*=t[i];
+    break;
+  }
+  return(entry);
+}
+
+/* returns 0 on OK or -1 on eof *************************************/
+long s_vorbis_book_decodevs(codebook *book,float *a,oggpack_buffer *b,
+                         int step,int addmul){
+  long *entry = alloca(sizeof(long)*step);
+  float **t = alloca(sizeof(float)*step);
+  int i,j,o;
+
+  for (i = 0; i < step; i++) {
+    entry[i]=vorbis_book_decode(book,b);
+    if(entry[i]==-1)return(-1);
+    t[i] = book->valuelist+entry[i]*book->dim;
+  }
   switch(addmul){
   case -1:
     for(i=0,o=0;i<book->dim;i++,o+=step)
- -      a[o]=(book->valuelist+entry*book->dim)[i];
+      for (j=0;j<step;j++)
+       a[o+j]=t[j][i];
     break;
   case 0:
     for(i=0,o=0;i<book->dim;i++,o+=step)
- -      a[o]+=(book->valuelist+entry*book->dim)[i];
+      for (j=0;j<step;j++)
+       a[o+j]+=t[j][i];
     break;
   case 1:
     for(i=0,o=0;i<book->dim;i++,o+=step)
- -      a[o]*=(book->valuelist+entry*book->dim)[i];
+      for (j=0;j<step;j++)
+       a[o+j]*=t[j][i];
     break;
   }
- -  return(entry);
+  return(0);
 }
 
 #ifdef _V_SELFTEST
@@ -368,7 +429,7 @@
 #include "vorbis/book/res0a_13.vqh"
 #define TESTSIZE 40
 
- -double test1[TESTSIZE]={
+float test1[TESTSIZE]={
   0.105939,
   0.215373,
   0.429117,
@@ -420,7 +481,7 @@
   0.708603,
 };
 
- -double test3[TESTSIZE]={
+float test3[TESTSIZE]={
   0,1,-2,3,4,-5,6,7,8,9,
   8,-2,7,-1,4,6,8,3,1,-9,
   10,11,12,13,14,15,26,17,18,19,
@@ -428,32 +489,32 @@
 
 static_codebook *testlist[]={&_vq_book_lsp20_0,
                              &_vq_book_res0a_13,NULL};
- -double   *testvec[]={test1,test3};
+float   *testvec[]={test1,test3};
 
 int main(){
   oggpack_buffer write;
   oggpack_buffer read;
   long ptr=0,i;
- -  _oggpack_writeinit(&write);
+  oggpack_writeinit(&write);
   
   fprintf(stderr,"Testing codebook abstraction...:\n");
 
   while(testlist[ptr]){
     codebook c;
     static_codebook s;
- -    double *qv=alloca(sizeof(double)*TESTSIZE);
- -    double *iv=alloca(sizeof(double)*TESTSIZE);
- -    memcpy(qv,testvec[ptr],sizeof(double)*TESTSIZE);
- -    memset(iv,0,sizeof(double)*TESTSIZE);
+    float *qv=alloca(sizeof(float)*TESTSIZE);
+    float *iv=alloca(sizeof(float)*TESTSIZE);
+    memcpy(qv,testvec[ptr],sizeof(float)*TESTSIZE);
+    memset(iv,0,sizeof(float)*TESTSIZE);
 
     fprintf(stderr,"\tpacking/coding %ld... ",ptr);
 
     /* pack the codebook, write the testvector */
- -    _oggpack_reset(&write);
+    oggpack_reset(&write);
     vorbis_book_init_encode(&c,testlist[ptr]); /* get it into memory
                                                   we can write */
     vorbis_staticbook_pack(testlist[ptr],&write);
- -    fprintf(stderr,"Codebook size %ld bytes... ",_oggpack_bytes(&write));
+    fprintf(stderr,"Codebook size %ld bytes... ",oggpack_bytes(&write));
     for(i=0;i<TESTSIZE;i+=c.dim){
       int best=_best(&c,qv+i,1);
       vorbis_book_encodev(&c,best,qv+i,&write);
@@ -464,7 +525,7 @@
     fprintf(stderr,"\tunpacking/decoding %ld... ",ptr);
 
     /* transfer the write data to a read buffer and unpack/read */
- -    _oggpack_readinit(&read,_oggpack_buffer(&write),_oggpack_bytes(&write));
+    oggpack_readinit(&read,oggpack_get_buffer(&write),oggpack_bytes(&write));
     if(vorbis_staticbook_unpack(&read,&s)){
       fprintf(stderr,"Error unpacking codebook.\n");
       exit(1);

1.23      +30 -30    vorbis/lib/envelope.c

Index: envelope.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/envelope.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
- --- envelope.c	2000/08/31 08:01:34	1.22
+++ envelope.c	2000/10/12 03:12:52	1.23
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: PCM data envelope analysis and manipulation
- - last mod: $Id: envelope.c,v 1.22 2000/08/31 08:01:34 xiphmont Exp $
+ last mod: $Id: envelope.c,v 1.23 2000/10/12 03:12:52 xiphmont Exp $
 
  Preecho calculation.
 
@@ -22,12 +22,12 @@
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
+#include <ogg/ogg.h>
 #include "vorbis/codec.h"
 
 #include "os.h"
 #include "scales.h"
 #include "envelope.h"
- -#include "bitwise.h"
 #include "misc.h"
 
 /* We use a Chebyshev bandbass for the preecho trigger bandpass; it's
@@ -40,9 +40,9 @@
 
 #if 0
 static int    cheb_bandpass_stages=10;
- -static double cheb_bandpass_gain=5.589612458e+01;
- -static double cheb_bandpass_B[]={-1.,0.,5.,0.,-10.,0.,10.,0.,-5.,0.,1};
- -static double cheb_bandpass_A[]={
+static float cheb_bandpass_gain=5.589612458e+01;
+static float cheb_bandpass_B[]={-1.,0.,5.,0.,-10.,0.,10.,0.,-5.,0.,1};
+static float cheb_bandpass_A[]={
   -0.1917409386,
   0.0078657069,
   -0.7126903444,
@@ -56,10 +56,10 @@
 #endif 
 
 static int    cheb_highpass_stages=10;
- -static double cheb_highpass_gain= 5.291963434e+01;
+static float cheb_highpass_gain= 5.291963434e+01;
 /* z^-stage, z^-stage+1... */
- -static double cheb_highpass_B[]={1,-10,45,-120,210,-252,210,-120,45,-10,1};
- -static double cheb_highpass_A[]={
+static float cheb_highpass_B[]={1,-10,45,-120,210,-252,210,-120,45,-10,1};
+static float cheb_highpass_A[]={
   -0.1247628029,
   0.1334086523,
   -0.3997715614,
@@ -78,17 +78,17 @@
   e->winlength=window;
   e->minenergy=fromdB(vi->preecho_minenergy);
   e->iir=calloc(ch,sizeof(IIR_state));
- -  e->filtered=calloc(ch,sizeof(double *));
+  e->filtered=calloc(ch,sizeof(float *));
   e->ch=ch;
   e->storage=128;
   for(i=0;i<ch;i++){
     IIR_init(e->iir+i,cheb_highpass_stages,cheb_highpass_gain,
              cheb_highpass_A,cheb_highpass_B);
- -    e->filtered[i]=calloc(e->storage,sizeof(double));
+    e->filtered[i]=calloc(e->storage,sizeof(float));
   }
 
   drft_init(&e->drft,window);
- -  e->window=malloc(e->winlength*sizeof(double));
+  e->window=malloc(e->winlength*sizeof(float));
   /* We just use a straight sin(x) window for this */
   for(i=0;i<e->winlength;i++)
     e->window[i]=sin((i+.5)/e->winlength*M_PI);
@@ -106,25 +106,25 @@
   memset(e,0,sizeof(envelope_lookup));
 }
 
- -static double _ve_deltai(envelope_lookup *ve,IIR_state *iir,
- -		      double *pre,double *post){
+static float _ve_deltai(envelope_lookup *ve,IIR_state *iir,
+		      float *pre,float *post){
   long n2=ve->winlength*2;
   long n=ve->winlength;
 
- -  double *workA=alloca(sizeof(double)*n2),A=0.;
- -  double *workB=alloca(sizeof(double)*n2),B=0.;
+  float *workA=alloca(sizeof(float)*n2),A=0.;
+  float *workB=alloca(sizeof(float)*n2),B=0.;
   long i;
 
- -  /*_analysis_output("A",frameno,pre,n,0,0);
- -    _analysis_output("B",frameno,post,n,0,0);*/
+  /*_analysis_output("A",granulepos,pre,n,0,0);
+    _analysis_output("B",granulepos,post,n,0,0);*/
 
   for(i=0;i<n;i++){
     workA[i]=pre[i]*ve->window[i];
     workB[i]=post[i]*ve->window[i];
   }
 
- -  /*_analysis_output("Awin",frameno,workA,n,0,0);
- -    _analysis_output("Bwin",frameno,workB,n,0,0);*/
+  /*_analysis_output("Awin",granulepos,workA,n,0,0);
+    _analysis_output("Bwin",granulepos,workB,n,0,0);*/
 
   drft_forward(&ve->drft,workA);
   drft_forward(&ve->drft,workB);
@@ -133,15 +133,15 @@
      basing blocks on quantization noise that outweighs the signal
      itself (for low power signals) */
   {
- -    double min=ve->minenergy;
+    float min=ve->minenergy;
     for(i=0;i<n;i++){
       if(fabs(workA[i])<min)workA[i]=min;
       if(fabs(workB[i])<min)workB[i]=min;
     }
   }
 
- -  /*_analysis_output("Afft",frameno,workA,n,0,0);
- -    _analysis_output("Bfft",frameno,workB,n,0,0);*/
+  /*_analysis_output("Afft",granulepos,workA,n,0,0);
+    _analysis_output("Bfft",granulepos,workB,n,0,0);*/
 
   for(i=0;i<n;i++){
     A+=workA[i]*workA[i];
@@ -163,13 +163,13 @@
   if(v->pcm_storage>ve->storage){
     ve->storage=v->pcm_storage;
     for(i=0;i<ve->ch;i++)
- -      ve->filtered[i]=realloc(ve->filtered[i],ve->storage*sizeof(double));
+      ve->filtered[i]=realloc(ve->filtered[i],ve->storage*sizeof(float));
   }
 
   /* catch up the highpass to match the pcm */
   for(i=0;i<ve->ch;i++){
- -    double *filtered=ve->filtered[i];
- -    double *pcm=v->pcm[i];
+    float *filtered=ve->filtered[i];
+    float *pcm=v->pcm[i];
     IIR_state *iir=ve->iir+i;
     
     for(j=ve->current;j<v->pcm_current;j++)
@@ -186,15 +186,15 @@
 
   while(j+ve->winlength<=v->pcm_current){
     for(i=0;i<ve->ch;i++){
- -      double *filtered=ve->filtered[i]+j;
+      float *filtered=ve->filtered[i]+j;
       IIR_state *iir=ve->iir+i;
- -      double m=_ve_deltai(ve,iir,filtered-ve->winlength,filtered);
+      float m=_ve_deltai(ve,iir,filtered-ve->winlength,filtered);
       
       if(m>vi->preecho_thresh){
- -	/*frameno++;*/
+	/*granulepos++;*/
         return(0);
       }
- -      /*frameno++;*/
+      /*granulepos++;*/
     }
     
     j+=vi->blocksizes[0]/2;
@@ -208,7 +208,7 @@
   int i;
   for(i=0;i<e->ch;i++)
     memmove(e->filtered[i],e->filtered[i]+shift,(e->current-shift)*
- -	    sizeof(double));
+	    sizeof(float));
   e->current-=shift;
 }
 

1.10      +4 -4      vorbis/lib/envelope.h

Index: envelope.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/envelope.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
- --- envelope.h	2000/08/15 09:09:42	1.9
+++ envelope.h	2000/10/12 03:12:52	1.10
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: PCM data envelope analysis and manipulation
- - last mod: $Id: envelope.h,v 1.9 2000/08/15 09:09:42 xiphmont Exp $
+ last mod: $Id: envelope.h,v 1.10 2000/10/12 03:12:52 xiphmont Exp $
 
  ********************************************************************/
 
@@ -28,15 +28,15 @@
   int ch;
   int winlength;
   int searchstep;
- -  double minenergy;
+  float minenergy;
 
   IIR_state *iir;
- -  double    **filtered;
+  float    **filtered;
   long storage;
   long current;
 
   drft_lookup drft;
- -  double *window;
+  float *window;
 } envelope_lookup;
 
 extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi);

1.25      +63 -95    vorbis/lib/floor0.c

Index: floor0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/floor0.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
- --- floor0.c	2000/08/31 08:01:34	1.24
+++ floor0.c	2000/10/12 03:12:52	1.25
@@ -12,15 +12,15 @@
  ********************************************************************
 
  function: floor backend 0 implementation
- - last mod: $Id: floor0.c,v 1.24 2000/08/31 08:01:34 xiphmont Exp $
+ last mod: $Id: floor0.c,v 1.25 2000/10/12 03:12:52 xiphmont Exp $
 
  ********************************************************************/
 
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#include <ogg/ogg.h>
 #include "vorbis/codec.h"
- -#include "bitwise.h"
 #include "registry.h"
 #include "lpc.h"
 #include "lsp.h"
@@ -41,19 +41,19 @@
 
   vorbis_info_floor0 *vi;
   lpc_lookup lpclook;
- -  double *lsp_look;
+  float *lsp_look;
 
 } vorbis_look_floor0;
 
 /* infrastructure for finding fit */
 static long _f0_fit(codebook *book,
- -		    double *orig,
- -		    double *workfit,
+		    float *orig,
+		    float *workfit,
                     int cursor){
   int dim=book->dim;
- -  double norm,base=0.;
+  float norm,base=0.;
   int i,best=0;
- -  double *lsp=workfit+cursor;
+  float *lsp=workfit+cursor;
 
   if(cursor)base=workfit[cursor-1];
   norm=orig[cursor+dim-1]-base;
@@ -62,7 +62,7 @@
     lsp[i]=(orig[i+cursor]-base);
   best=_best(book,lsp,1);
 
- -  memcpy(lsp,book->valuelist+best*dim,dim*sizeof(double));
+  memcpy(lsp,book->valuelist+best*dim,dim*sizeof(float));
   for(i=0;i<dim;i++)
     lsp[i]+=base;
   return(best);
@@ -70,14 +70,14 @@
 
 /***********************************************/
 
- -static void free_info(vorbis_info_floor *i){
+static void floor0_free_info(vorbis_info_floor *i){
   if(i){
     memset(i,0,sizeof(vorbis_info_floor0));
     free(i);
   }
 }
 
- -static void free_look(vorbis_look_floor *i){
+static void floor0_free_look(vorbis_look_floor *i){
   vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
   if(i){
     if(look->linearmap)free(look->linearmap);
@@ -88,28 +88,28 @@
   }
 }
 
- -static void pack (vorbis_info_floor *i,oggpack_buffer *opb){
+static void floor0_pack (vorbis_info_floor *i,oggpack_buffer *opb){
   vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
   int j;
- -  _oggpack_write(opb,info->order,8);
- -  _oggpack_write(opb,info->rate,16);
- -  _oggpack_write(opb,info->barkmap,16);
- -  _oggpack_write(opb,info->ampbits,6);
- -  _oggpack_write(opb,info->ampdB,8);
- -  _oggpack_write(opb,info->numbooks-1,4);
+  oggpack_write(opb,info->order,8);
+  oggpack_write(opb,info->rate,16);
+  oggpack_write(opb,info->barkmap,16);
+  oggpack_write(opb,info->ampbits,6);
+  oggpack_write(opb,info->ampdB,8);
+  oggpack_write(opb,info->numbooks-1,4);
   for(j=0;j<info->numbooks;j++)
- -    _oggpack_write(opb,info->books[j],8);
+    oggpack_write(opb,info->books[j],8);
 }
 
- -static vorbis_info_floor *unpack (vorbis_info *vi,oggpack_buffer *opb){
+static vorbis_info_floor *floor0_unpack (vorbis_info *vi,oggpack_buffer *opb){
   int j;
   vorbis_info_floor0 *info=malloc(sizeof(vorbis_info_floor0));
- -  info->order=_oggpack_read(opb,8);
- -  info->rate=_oggpack_read(opb,16);
- -  info->barkmap=_oggpack_read(opb,16);
- -  info->ampbits=_oggpack_read(opb,6);
- -  info->ampdB=_oggpack_read(opb,8);
- -  info->numbooks=_oggpack_read(opb,4)+1;
+  info->order=oggpack_read(opb,8);
+  info->rate=oggpack_read(opb,16);
+  info->barkmap=oggpack_read(opb,16);
+  info->ampbits=oggpack_read(opb,6);
+  info->ampdB=oggpack_read(opb,8);
+  info->numbooks=oggpack_read(opb,4)+1;
   
   if(info->order<1)goto err_out;
   if(info->rate<1)goto err_out;
@@ -117,12 +117,12 @@
   if(info->numbooks<1)goto err_out;
 
   for(j=0;j<info->numbooks;j++){
- -    info->books[j]=_oggpack_read(opb,8);
+    info->books[j]=oggpack_read(opb,8);
     if(info->books[j]<0 || info->books[j]>=vi->books)goto err_out;
   }
   return(info);  
  err_out:
- -  free_info(info);
+  floor0_free_info(info);
   return(NULL);
 }
 
@@ -134,10 +134,10 @@
    Note that the scale depends on the sampling rate as well as the
    linear block and mapping sizes */
 
- -static vorbis_look_floor *look (vorbis_dsp_state *vd,vorbis_info_mode *mi,
+static vorbis_look_floor *floor0_look (vorbis_dsp_state *vd,vorbis_info_mode 
*mi,
                               vorbis_info_floor *i){
   int j;
- -  double scale;
+  float scale;
   vorbis_info        *vi=vd->vi;
   vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
   vorbis_look_floor0 *look=calloc(1,sizeof(vorbis_look_floor0));
@@ -160,15 +160,16 @@
      the encoder may do what it wishes in filling them.  They're
      necessary in some mapping combinations to keep the scale spacing
      accurate */
- -  look->linearmap=malloc(look->n*sizeof(int));
+  look->linearmap=malloc((look->n+1)*sizeof(int));
   for(j=0;j<look->n;j++){
     int val=floor( toBARK((info->rate/2.)/look->n*j) 
                    *scale); /* bark numbers represent band edges */
     if(val>look->ln)val=look->ln; /* guard against the approximation */
     look->linearmap[j]=val;
   }
+  look->linearmap[j]=-1;
 
- -  look->lsp_look=malloc(look->ln*sizeof(double));
+  look->lsp_look=malloc(look->ln*sizeof(float));
   for(j=0;j<look->ln;j++)
     look->lsp_look[j]=2*cos(M_PI/look->ln*j);
 
@@ -178,16 +179,16 @@
 /* less efficient than the decode side (written for clarity).  We're
    not bottlenecked here anyway */
 
- -double _curve_to_lpc(double *curve,double *lpc,
- -		     vorbis_look_floor0 *l,long frameno){
+float _curve_to_lpc(float *curve,float *lpc,
+		     vorbis_look_floor0 *l){
   /* map the input curve to a bark-scale curve for encoding */
   
   int mapped=l->ln;
- -  double *work=alloca(sizeof(double)*mapped);
+  float *work=alloca(sizeof(float)*mapped);
   int i,j,last=0;
   int bark=0;
 
- -  memset(work,0,sizeof(double)*mapped);
+  memset(work,0,sizeof(float)*mapped);
   
   /* Only the decode side is behavior-specced; for now in the encoder,
      we select the maximum value of each band as representative (this
@@ -211,7 +212,7 @@
       /* we'll always have a bin zero, so we don't need to guard init */
       long span=bark-last;
       for(j=1;j<span;j++){
- -	double del=(double)j/span;
+	float del=(float)j/span;
         work[j+last]=work[bark]*del+work[last]*(1.-del);
       }
     }
@@ -222,49 +223,17 @@
   for(i=bark+1;i<mapped;i++)
     work[i]=work[i-1];
   
- -#if 0
- -    { /******************/
- -      FILE *of;
- -      char buffer[80];
- -      int i;
- -
- -      sprintf(buffer,"Fmask_%d.m",frameno);
- -      of=fopen(buffer,"w");
- -      for(i=0;i<mapped;i++)
- -	fprintf(of,"%g\n",work[i]);
- -      fclose(of);
- -    }
- -#endif
- -
   return vorbis_lpc_from_curve(work,lpc,&(l->lpclook));
 }
 
 /* generate the whole freq response curve of an LSP IIR filter */
- -
- -void _lsp_to_curve(double *curve,double *lsp,double amp,
- -			  vorbis_look_floor0 *l,char *name,long frameno){
- -  /* l->m+1 must be less than l->ln, but guard in case we get a bad stream 
*/
- -  double *lcurve=alloca(sizeof(double)*l->ln);
- -  int i;
- -
- -  if(amp==0){
- -    memset(curve,0,sizeof(double)*l->n);
- -    return;
- -  }
- -  vorbis_lsp_to_curve(lcurve,l->ln,lsp,l->m,amp,l->lsp_look);
- -
- -  for(i=0;i<l->n;i++)curve[i]=lcurve[l->linearmap[i]];
- -
- -}
- -
- -static long seq=0;
- -static int forward(vorbis_block *vb,vorbis_look_floor *i,
- -		    double *in,double *out){
+static int floor0_forward(vorbis_block *vb,vorbis_look_floor *i,
+		    float *in,float *out){
   long j;
   vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
   vorbis_info_floor0 *info=look->vi;
- -  double *work=alloca((look->ln+look->n)*sizeof(double));
- -  double amp;
+  float *work=alloca((look->ln+look->n)*sizeof(float));
+  float amp;
   long bits=0;
 
 #ifdef TRAIN_LSP
@@ -289,7 +258,7 @@
 
   /* use 'out' as temp storage */
   /* Convert our floor to a set of lpc coefficients */ 
- -  amp=sqrt(_curve_to_lpc(work,out,look,seq));
+  amp=sqrt(_curve_to_lpc(work,out,look));
 
   /* amp is in the range (0. to ampdB].  Encode that range using
      ampbits bits */
@@ -302,7 +271,7 @@
     if(val<0)val=0;           /* likely */
     if(val>maxval)val=maxval; /* not bloody likely */
 
- -    _oggpack_write(&vb->opb,val,info->ampbits);
+    oggpack_write(&vb->opb,val,info->ampbits);
     if(val>0)
       amp=(float)val/maxval*info->ampdB;
     else
@@ -314,7 +283,7 @@
     /* the spec supports using one of a number of codebooks.  Right
        now, encode using this lib supports only one */
     codebook *b=vb->vd->fullbooks+info->books[0];
- -    _oggpack_write(&vb->opb,0,_ilog(info->numbooks));
+    oggpack_write(&vb->opb,0,_ilog(info->numbooks));
 
     /* LSP <-> LPC is orthogonal and LSP quantizes more stably  */
     vorbis_lpc_to_lsp(out,out,look->m);
@@ -322,7 +291,7 @@
 #if 1
 #ifdef TRAIN_LSP
     {
- -      double last=0.;
+      float last=0.;
       for(j=0;j<look->m;j++){
         fprintf(of,"%.12g, ",out[j]-last);
         last=out[j];
@@ -349,13 +318,12 @@
 
 #ifdef ANALYSIS
     {
- -      double last=0;
+      float last=0;
       for(j=0;j<look->m;j++){
         out[j]=work[j]-last;
         last=work[j];
       }
     }
- -    _analysis_output("lsp",seq,out,look->m,0,0);
         
 #endif
 
@@ -364,56 +332,56 @@
 #endif
 
     /* take the coefficients back to a spectral envelope curve */
- -    _lsp_to_curve(out,work,amp,look,"Ffloor",seq++);
- -    for(j=0;j<look->n;j++)out[j]= fromdB(out[j]-info->ampdB);
+    vorbis_lsp_to_curve(out,look->linearmap,look->n,look->ln,
+			work,look->m,amp,info->ampdB);
     return(1);
   }
 
- -  memset(out,0,sizeof(double)*look->n);
- -  seq++;
+  memset(out,0,sizeof(float)*look->n);
   return(0);
 }
 
- -static int inverse(vorbis_block *vb,vorbis_look_floor *i,double *out){
+static int floor0_inverse(vorbis_block *vb,vorbis_look_floor *i,float *out){
   vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
   vorbis_info_floor0 *info=look->vi;
   int j,k;
   
- -  int ampraw=_oggpack_read(&vb->opb,info->ampbits);
+  int ampraw=oggpack_read(&vb->opb,info->ampbits);
   if(ampraw>0){ /* also handles the -1 out of data case */
     long maxval=(1<<info->ampbits)-1;
- -    double amp=(float)ampraw/maxval*info->ampdB;
- -    int booknum=_oggpack_read(&vb->opb,_ilog(info->numbooks));
+    float amp=(float)ampraw/maxval*info->ampdB;
+    int booknum=oggpack_read(&vb->opb,_ilog(info->numbooks));
+    float *lsp=alloca(sizeof(float)*look->m);
 
     if(booknum!=-1){
       codebook *b=vb->vd->fullbooks+info->books[booknum];
- -      double last=0.;
+      float last=0.;
       
       memset(out,0,sizeof(double)*look->m);    
       
       for(j=0;j<look->m;j+=b->dim)
- -	if(vorbis_book_decodevs(b,out+j,&vb->opb,1,-1)==-1)goto eop;
+	if(vorbis_book_decodevs(b,lsp+j,&vb->opb,1,-1)==-1)goto eop;
       for(j=0;j<look->m;){
- -	for(k=0;k<b->dim;k++,j++)out[j]+=last;
- -	last=out[j-1];
+	for(k=0;k<b->dim;k++,j++)lsp[j]+=last;
+	last=lsp[j-1];
       }
       
       /* take the coefficients back to a spectral envelope curve */
- -      _lsp_to_curve(out,out,amp,look,"",0);
- -      
- -      for(j=0;j<look->n;j++)out[j]=fromdB(out[j]-info->ampdB);
+      vorbis_lsp_to_curve(out,look->linearmap,look->n,look->ln,
+			  lsp,look->m,amp,info->ampdB);
       return(1);
     }
   }
 
  eop:
- -  memset(out,0,sizeof(double)*look->n);
+  memset(out,0,sizeof(float)*look->n);
   return(0);
 }
 
 /* export hooks */
 vorbis_func_floor floor0_exportbundle={
- -  &pack,&unpack,&look,&free_info,&free_look,&forward,&inverse
+  &floor0_pack,&floor0_unpack,&floor0_look,&floor0_free_info,
+  &floor0_free_look,&floor0_forward,&floor0_inverse
 };
 
 

1.2       +21 -21    vorbis/lib/iir.c

Index: iir.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/iir.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- iir.c	2000/07/12 09:36:18	1.1
+++ iir.c	2000/10/12 03:12:52	1.2
@@ -12,7 +12,7 @@
  ********************************************************************
 
   function: Direct Form I, II IIR filters, plus some specializations
- -  last mod: $Id: iir.c,v 1.1 2000/07/12 09:36:18 xiphmont Exp $
+  last mod: $Id: iir.c,v 1.2 2000/10/12 03:12:52 xiphmont Exp $
 
  ********************************************************************/
 
@@ -24,17 +24,17 @@
 #include <math.h>
 #include "iir.h"
 
- -void IIR_init(IIR_state *s,int stages,double gain, double *A, double *B){
+void IIR_init(IIR_state *s,int stages,float gain, float *A, float *B){
   memset(s,0,sizeof(IIR_state));
   s->stages=stages;
   s->gain=gain;
- -  s->coeff_A=malloc(stages*sizeof(double));
- -  s->coeff_B=malloc((stages+1)*sizeof(double));
- -  s->z_A=calloc(stages*2,sizeof(double));
- -  s->z_B=calloc(stages*2,sizeof(double));
+  s->coeff_A=malloc(stages*sizeof(float));
+  s->coeff_B=malloc((stages+1)*sizeof(float));
+  s->z_A=calloc(stages*2,sizeof(float));
+  s->z_B=calloc(stages*2,sizeof(float));
 
- -  memcpy(s->coeff_A,A,stages*sizeof(double));
- -  memcpy(s->coeff_B,B,(stages+1)*sizeof(double));
+  memcpy(s->coeff_A,A,stages*sizeof(float));
+  memcpy(s->coeff_B,B,(stages+1)*sizeof(float));
 }
 
 void IIR_clear(IIR_state *s){
@@ -47,11 +47,11 @@
   }
 }
 
- -double IIR_filter(IIR_state *s,double in){
+float IIR_filter(IIR_state *s,float in){
   int stages=s->stages,i;
- -  double newA;
- -  double newB=0;
- -  double *zA=s->z_A+s->ring;
+  float newA;
+  float newB=0;
+  float *zA=s->z_A+s->ring;
 
   newA=in/=s->gain;
   for(i=0;i<stages;i++){
@@ -68,11 +68,11 @@
 
 /* this assumes the symmetrical structure of the feed-forward stage of
    a Chebyshev bandpass to save multiplies */
- -double IIR_filter_ChebBand(IIR_state *s,double in){
+float IIR_filter_ChebBand(IIR_state *s,float in){
   int stages=s->stages,i;
- -  double newA;
- -  double newB=0;
- -  double *zA=s->z_A+s->ring;
+  float newA;
+  float newB=0;
+  float *zA=s->z_A+s->ring;
 
   newA=in/=s->gain;
 
@@ -96,8 +96,8 @@
 #ifdef _V_SELFTEST
 
 /* z^-stage, z^-stage+1... */
- -static double cheb_bandpass_B[]={-1.,0.,5.,0.,-10.,0.,10.,0.,-5.,0.,1};
- -static double cheb_bandpass_A[]={-0.6665900311,
+static float cheb_bandpass_B[]={-1.,0.,5.,0.,-10.,0.,10.,0.,-5.,0.,1};
+static float cheb_bandpass_A[]={-0.6665900311,
                                   1.0070146601,
                                  -3.1262875409,
                                    3.5017171569,
@@ -108,7 +108,7 @@
                                  -3.9134284363,
                                   1.3997338886};
 
- -static double data[128]={  
+static float data[128]={  
   0.0426331,
   0.0384521,
   0.0345764,
@@ -247,7 +247,7 @@
 
 static float xv[NZEROS+1], yv[NPOLES+1];
 
- -static double filterloop(double next){ 
+static float filterloop(float next){ 
   xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = xv[3]; xv[3] = xv[4]; xv[4] = xv[5]; 
   xv[5] = xv[6]; xv[6] = xv[7]; xv[7] = xv[8]; xv[8] = xv[9]; xv[9] = xv[10]; 
   xv[10] = next / GAIN;
@@ -267,7 +267,7 @@
 
   /* run the pregenerated Chebyshev filter, then our own distillation
      through the generic and specialized code */
- -  double *work=malloc(128*sizeof(double));
+  float *work=malloc(128*sizeof(float));
   IIR_state iir;
   int i;
 

1.2       +9 -9      vorbis/lib/iir.h

Index: iir.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/iir.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
- --- iir.h	2000/07/12 09:36:18	1.1
+++ iir.h	2000/10/12 03:12:52	1.2
@@ -12,7 +12,7 @@
  ********************************************************************
 
   function: Direct Form I, II IIR filters, plus some specializations
- -  last mod: $Id: iir.h,v 1.1 2000/07/12 09:36:18 xiphmont Exp $
+  last mod: $Id: iir.h,v 1.2 2000/10/12 03:12:52 xiphmont Exp $
 
  ********************************************************************/
 
@@ -21,17 +21,17 @@
 
 typedef struct {
   int stages;
- -  double *coeff_A;
- -  double *coeff_B;
- -  double *z_A;
- -  double *z_B;
+  float *coeff_A;
+  float *coeff_B;
+  float *z_A;
+  float *z_B;
   int ring;
- -  double gain;
+  float gain;
 } IIR_state;
 
- -void IIR_init(IIR_state *s,int stages,double gain, double *A, double *B);
+void IIR_init(IIR_state *s,int stages,float gain, float *A, float *B);
 void IIR_clear(IIR_state *s);
- -double IIR_filter(IIR_state *s,double in);
- -double IIR_filter_ChebBand(IIR_state *s,double in);
+float IIR_filter(IIR_state *s,float in);
+float IIR_filter_ChebBand(IIR_state *s,float in);
 
 #endif

1.31      +85 -85    vorbis/lib/info.c

Index: info.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/info.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
- --- info.c	2000/08/15 09:09:43	1.30
+++ info.c	2000/10/12 03:12:52	1.31
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: maintain the info structure, info <-> header packets
- - last mod: $Id: info.c,v 1.30 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: info.c,v 1.31 2000/10/12 03:12:52 xiphmont Exp $
 
  ********************************************************************/
 
@@ -22,9 +22,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <ogg/ogg.h>
 #include "vorbis/codec.h"
 #include "vorbis/backends.h"
- -#include "bitwise.h"
 #include "sharedbook.h"
 #include "bookinternal.h"
 #include "registry.h"
@@ -45,13 +45,13 @@
 
 static void _v_writestring(oggpack_buffer *o,char *s){
   while(*s){
- -    _oggpack_write(o,*s++,8);
+    oggpack_write(o,*s++,8);
   }
 }
 
 static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){
   while(bytes--){
- -    *buf++=_oggpack_read(o,8);
+    *buf++=oggpack_read(o,8);
   }
 }
 
@@ -189,25 +189,25 @@
 /* Header packing/unpacking ********************************************/
 
 static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
- -  vi->version=_oggpack_read(opb,32);
+  vi->version=oggpack_read(opb,32);
   if(vi->version!=0)return(-1);
 
- -  vi->channels=_oggpack_read(opb,8);
- -  vi->rate=_oggpack_read(opb,32);
+  vi->channels=oggpack_read(opb,8);
+  vi->rate=oggpack_read(opb,32);
 
- -  vi->bitrate_upper=_oggpack_read(opb,32);
- -  vi->bitrate_nominal=_oggpack_read(opb,32);
- -  vi->bitrate_lower=_oggpack_read(opb,32);
+  vi->bitrate_upper=oggpack_read(opb,32);
+  vi->bitrate_nominal=oggpack_read(opb,32);
+  vi->bitrate_lower=oggpack_read(opb,32);
 
- -  vi->blocksizes[0]=1<<_oggpack_read(opb,4);
- -  vi->blocksizes[1]=1<<_oggpack_read(opb,4);
+  vi->blocksizes[0]=1<<oggpack_read(opb,4);
+  vi->blocksizes[1]=1<<oggpack_read(opb,4);
   
   if(vi->rate<1)goto err_out;
   if(vi->channels<1)goto err_out;
   if(vi->blocksizes[0]<8)goto err_out; 
   if(vi->blocksizes[1]<vi->blocksizes[0])goto err_out;
   
- -  if(_oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
+  if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
 
   return(0);
  err_out:
@@ -217,23 +217,23 @@
 
 static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
   int i;
- -  int vendorlen=_oggpack_read(opb,32);
+  int vendorlen=oggpack_read(opb,32);
   if(vendorlen<0)goto err_out;
   vc->vendor=calloc(vendorlen+1,1);
   _v_readstring(opb,vc->vendor,vendorlen);
- -  vc->comments=_oggpack_read(opb,32);
+  vc->comments=oggpack_read(opb,32);
   if(vc->comments<0)goto err_out;
   vc->user_comments=calloc(vc->comments+1,sizeof(char **));
   vc->comment_lengths=calloc(vc->comments+1, sizeof(int));
             
   for(i=0;i<vc->comments;i++){
- -    int len=_oggpack_read(opb,32);
+    int len=oggpack_read(opb,32);
     if(len<0)goto err_out;
         vc->comment_lengths[i]=len;
     vc->user_comments[i]=calloc(len+1,1);
     _v_readstring(opb,vc->user_comments[i],len);
   }	  
- -  if(_oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
+  if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
 
   return(0);
  err_out:
@@ -247,7 +247,7 @@
   int i;
 
   /* codebooks */
- -  vi->books=_oggpack_read(opb,8)+1;
+  vi->books=oggpack_read(opb,8)+1;
   /*vi->book_param=calloc(vi->books,sizeof(static_codebook *));*/
   for(i=0;i<vi->books;i++){
     vi->book_param[i]=calloc(1,sizeof(static_codebook));
@@ -255,65 +255,65 @@
   }
 
   /* time backend settings */
- -  vi->times=_oggpack_read(opb,6)+1;
+  vi->times=oggpack_read(opb,6)+1;
   /*vi->time_type=malloc(vi->times*sizeof(int));*/
   /*vi->time_param=calloc(vi->times,sizeof(void *));*/
   for(i=0;i<vi->times;i++){
- -    vi->time_type[i]=_oggpack_read(opb,16);
+    vi->time_type[i]=oggpack_read(opb,16);
     if(vi->time_type[i]<0 || vi->time_type[i]>=VI_TIMEB)goto err_out;
     vi->time_param[i]=_time_P[vi->time_type[i]]->unpack(vi,opb);
     if(!vi->time_param[i])goto err_out;
   }
 
   /* floor backend settings */
- -  vi->floors=_oggpack_read(opb,6)+1;
+  vi->floors=oggpack_read(opb,6)+1;
   /*vi->floor_type=malloc(vi->floors*sizeof(int));*/
   /*vi->floor_param=calloc(vi->floors,sizeof(void *));*/
   for(i=0;i<vi->floors;i++){
- -    vi->floor_type[i]=_oggpack_read(opb,16);
+    vi->floor_type[i]=oggpack_read(opb,16);
     if(vi->floor_type[i]<0 || vi->floor_type[i]>=VI_FLOORB)goto err_out;
     vi->floor_param[i]=_floor_P[vi->floor_type[i]]->unpack(vi,opb);
     if(!vi->floor_param[i])goto err_out;
   }
 
   /* residue backend settings */
- -  vi->residues=_oggpack_read(opb,6)+1;
+  vi->residues=oggpack_read(opb,6)+1;
   /*vi->residue_type=malloc(vi->residues*sizeof(int));*/
   /*vi->residue_param=calloc(vi->residues,sizeof(void *));*/
   for(i=0;i<vi->residues;i++){
- -    vi->residue_type[i]=_oggpack_read(opb,16);
+    vi->residue_type[i]=oggpack_read(opb,16);
     if(vi->residue_type[i]<0 || vi->residue_type[i]>=VI_RESB)goto err_out;
     vi->residue_param[i]=_residue_P[vi->residue_type[i]]->unpack(vi,opb);
     if(!vi->residue_param[i])goto err_out;
   }
 
   /* map backend settings */
- -  vi->maps=_oggpack_read(opb,6)+1;
+  vi->maps=oggpack_read(opb,6)+1;
   /*vi->map_type=malloc(vi->maps*sizeof(int));*/
   /*vi->map_param=calloc(vi->maps,sizeof(void *));*/
   for(i=0;i<vi->maps;i++){
- -    vi->map_type[i]=_oggpack_read(opb,16);
+    vi->map_type[i]=oggpack_read(opb,16);
     if(vi->map_type[i]<0 || vi->map_type[i]>=VI_MAPB)goto err_out;
     vi->map_param[i]=_mapping_P[vi->map_type[i]]->unpack(vi,opb);
     if(!vi->map_param[i])goto err_out;
   }
   
   /* mode settings */
- -  vi->modes=_oggpack_read(opb,6)+1;
+  vi->modes=oggpack_read(opb,6)+1;
   /*vi->mode_param=calloc(vi->modes,sizeof(void *));*/
   for(i=0;i<vi->modes;i++){
     vi->mode_param[i]=calloc(1,sizeof(vorbis_info_mode));
- -    vi->mode_param[i]->blockflag=_oggpack_read(opb,1);
- -    vi->mode_param[i]->windowtype=_oggpack_read(opb,16);
- -    vi->mode_param[i]->transformtype=_oggpack_read(opb,16);
- -    vi->mode_param[i]->mapping=_oggpack_read(opb,8);
+    vi->mode_param[i]->blockflag=oggpack_read(opb,1);
+    vi->mode_param[i]->windowtype=oggpack_read(opb,16);
+    vi->mode_param[i]->transformtype=oggpack_read(opb,16);
+    vi->mode_param[i]->mapping=oggpack_read(opb,8);
 
     if(vi->mode_param[i]->windowtype>=VI_WINDOWB)goto err_out;
     if(vi->mode_param[i]->transformtype>=VI_WINDOWB)goto err_out;
     if(vi->mode_param[i]->mapping>=vi->maps)goto err_out;
   }
   
- -  if(_oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
+  if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
 
   return(0);
  err_out:
@@ -330,13 +330,13 @@
   oggpack_buffer opb;
   
   if(op){
- -    _oggpack_readinit(&opb,op->packet,op->bytes);
+    oggpack_readinit(&opb,op->packet,op->bytes);
 
     /* Which of the three types of header is this? */
     /* Also verify header-ness, vorbis */
     {
       char buffer[6];
- -      int packtype=_oggpack_read(&opb,8);
+      int packtype=oggpack_read(&opb,8);
       memset(buffer,0,6);
       _v_readstring(&opb,buffer,6);
       if(memcmp(buffer,"vorbis",6)){
@@ -386,21 +386,21 @@
 
 static int _vorbis_pack_info(oggpack_buffer *opb,vorbis_info *vi){
   /* preamble */  
- -  _oggpack_write(opb,0x01,8);
+  oggpack_write(opb,0x01,8);
   _v_writestring(opb,"vorbis");
 
   /* basic information about the stream */
- -  _oggpack_write(opb,0x00,32);
- -  _oggpack_write(opb,vi->channels,8);
- -  _oggpack_write(opb,vi->rate,32);
- -
- -  _oggpack_write(opb,vi->bitrate_upper,32);
- -  _oggpack_write(opb,vi->bitrate_nominal,32);
- -  _oggpack_write(opb,vi->bitrate_lower,32);
- -
- -  _oggpack_write(opb,ilog2(vi->blocksizes[0]),4);
- -  _oggpack_write(opb,ilog2(vi->blocksizes[1]),4);
- -  _oggpack_write(opb,1,1);
+  oggpack_write(opb,0x00,32);
+  oggpack_write(opb,vi->channels,8);
+  oggpack_write(opb,vi->rate,32);
+
+  oggpack_write(opb,vi->bitrate_upper,32);
+  oggpack_write(opb,vi->bitrate_nominal,32);
+  oggpack_write(opb,vi->bitrate_lower,32);
+
+  oggpack_write(opb,ilog2(vi->blocksizes[0]),4);
+  oggpack_write(opb,ilog2(vi->blocksizes[1]),4);
+  oggpack_write(opb,1,1);
 
   return(0);
 }
@@ -409,79 +409,79 @@
   char temp[]="Xiphophorus libVorbis I 20000508";
 
   /* preamble */  
- -  _oggpack_write(opb,0x03,8);
+  oggpack_write(opb,0x03,8);
   _v_writestring(opb,"vorbis");
 
   /* vendor */
- -  _oggpack_write(opb,strlen(temp),32);
+  oggpack_write(opb,strlen(temp),32);
   _v_writestring(opb,temp);
   
   /* comments */
 
- -  _oggpack_write(opb,vc->comments,32);
+  oggpack_write(opb,vc->comments,32);
   if(vc->comments){
     int i;
     for(i=0;i<vc->comments;i++){
       if(vc->user_comments[i]){
- -	_oggpack_write(opb,vc->comment_lengths[i],32);
+	oggpack_write(opb,vc->comment_lengths[i],32);
         _v_writestring(opb,vc->user_comments[i]);
       }else{
- -	_oggpack_write(opb,0,32);
+	oggpack_write(opb,0,32);
       }
     }
   }
- -  _oggpack_write(opb,1,1);
+  oggpack_write(opb,1,1);
 
   return(0);
 }
  
 static int _vorbis_pack_books(oggpack_buffer *opb,vorbis_info *vi){
   int i;
- -  _oggpack_write(opb,0x05,8);
+  oggpack_write(opb,0x05,8);
   _v_writestring(opb,"vorbis");
 
   /* books */
- -  _oggpack_write(opb,vi->books-1,8);
+  oggpack_write(opb,vi->books-1,8);
   for(i=0;i<vi->books;i++)
     if(vorbis_staticbook_pack(vi->book_param[i],opb))goto err_out;
 
   /* times */
- -  _oggpack_write(opb,vi->times-1,6);
+  oggpack_write(opb,vi->times-1,6);
   for(i=0;i<vi->times;i++){
- -    _oggpack_write(opb,vi->time_type[i],16);
+    oggpack_write(opb,vi->time_type[i],16);
     _time_P[vi->time_type[i]]->pack(vi->time_param[i],opb);
   }
 
   /* floors */
- -  _oggpack_write(opb,vi->floors-1,6);
+  oggpack_write(opb,vi->floors-1,6);
   for(i=0;i<vi->floors;i++){
- -    _oggpack_write(opb,vi->floor_type[i],16);
+    oggpack_write(opb,vi->floor_type[i],16);
     _floor_P[vi->floor_type[i]]->pack(vi->floor_param[i],opb);
   }
 
   /* residues */
- -  _oggpack_write(opb,vi->residues-1,6);
+  oggpack_write(opb,vi->residues-1,6);
   for(i=0;i<vi->residues;i++){
- -    _oggpack_write(opb,vi->residue_type[i],16);
+    oggpack_write(opb,vi->residue_type[i],16);
     _residue_P[vi->residue_type[i]]->pack(vi->residue_param[i],opb);
   }
 
   /* maps */
- -  _oggpack_write(opb,vi->maps-1,6);
+  oggpack_write(opb,vi->maps-1,6);
   for(i=0;i<vi->maps;i++){
- -    _oggpack_write(opb,vi->map_type[i],16);
+    oggpack_write(opb,vi->map_type[i],16);
     _mapping_P[vi->map_type[i]]->pack(vi,vi->map_param[i],opb);
   }
 
   /* modes */
- -  _oggpack_write(opb,vi->modes-1,6);
+  oggpack_write(opb,vi->modes-1,6);
   for(i=0;i<vi->modes;i++){
- -    _oggpack_write(opb,vi->mode_param[i]->blockflag,1);
- -    _oggpack_write(opb,vi->mode_param[i]->windowtype,16);
- -    _oggpack_write(opb,vi->mode_param[i]->transformtype,16);
- -    _oggpack_write(opb,vi->mode_param[i]->mapping,8);
+    oggpack_write(opb,vi->mode_param[i]->blockflag,1);
+    oggpack_write(opb,vi->mode_param[i]->windowtype,16);
+    oggpack_write(opb,vi->mode_param[i]->transformtype,16);
+    oggpack_write(opb,vi->mode_param[i]->mapping,8);
   }
- -  _oggpack_write(opb,1,1);
+  oggpack_write(opb,1,1);
 
   return(0);
 err_out:
@@ -498,51 +498,51 @@
 
   /* first header packet **********************************************/
 
- -  _oggpack_writeinit(&opb);
+  oggpack_writeinit(&opb);
   if(_vorbis_pack_info(&opb,vi))goto err_out;
 
   /* build the packet */
   if(v->header)free(v->header);
- -  v->header=malloc(_oggpack_bytes(&opb));
- -  memcpy(v->header,opb.buffer,_oggpack_bytes(&opb));
+  v->header=malloc(oggpack_bytes(&opb));
+  memcpy(v->header,opb.buffer,oggpack_bytes(&opb));
   op->packet=v->header;
- -  op->bytes=_oggpack_bytes(&opb);
+  op->bytes=oggpack_bytes(&opb);
   op->b_o_s=1;
   op->e_o_s=0;
- -  op->frameno=0;
+  op->granulepos=0;
 
   /* second header packet (comments) **********************************/
 
- -  _oggpack_reset(&opb);
+  oggpack_reset(&opb);
   if(_vorbis_pack_comment(&opb,vc))goto err_out;
 
   if(v->header1)free(v->header1);
- -  v->header1=malloc(_oggpack_bytes(&opb));
- -  memcpy(v->header1,opb.buffer,_oggpack_bytes(&opb));
+  v->header1=malloc(oggpack_bytes(&opb));
+  memcpy(v->header1,opb.buffer,oggpack_bytes(&opb));
   op_comm->packet=v->header1;
- -  op_comm->bytes=_oggpack_bytes(&opb);
+  op_comm->bytes=oggpack_bytes(&opb);
   op_comm->b_o_s=0;
   op_comm->e_o_s=0;
- -  op_comm->frameno=0;
+  op_comm->granulepos=0;
 
   /* third header packet (modes/codebooks) ****************************/
 
- -  _oggpack_reset(&opb);
+  oggpack_reset(&opb);
   if(_vorbis_pack_books(&opb,vi))goto err_out;
 
   if(v->header2)free(v->header2);
- -  v->header2=malloc(_oggpack_bytes(&opb));
- -  memcpy(v->header2,opb.buffer,_oggpack_bytes(&opb));
+  v->header2=malloc(oggpack_bytes(&opb));
+  memcpy(v->header2,opb.buffer,oggpack_bytes(&opb));
   op_code->packet=v->header2;
- -  op_code->bytes=_oggpack_bytes(&opb);
+  op_code->bytes=oggpack_bytes(&opb);
   op_code->b_o_s=0;
   op_code->e_o_s=0;
- -  op_code->frameno=0;
+  op_code->granulepos=0;
 
- -  _oggpack_writeclear(&opb);
+  oggpack_writeclear(&opb);
   return(0);
  err_out:
- -  _oggpack_writeclear(&opb);
+  oggpack_writeclear(&opb);
   memset(op,0,sizeof(ogg_packet));
   memset(op_comm,0,sizeof(ogg_packet));
   memset(op_code,0,sizeof(ogg_packet));

1.26      +21 -16    vorbis/lib/lpc.c

Index: lpc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/lpc.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
- --- lpc.c	2000/08/23 10:16:57	1.25
+++ lpc.c	2000/10/12 03:12:53	1.26
@@ -12,7 +12,7 @@
  ********************************************************************
 
   function: LPC low level routines
- -  last mod: $Id: lpc.c,v 1.25 2000/08/23 10:16:57 xiphmont Exp $
+  last mod: $Id: lpc.c,v 1.26 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -59,16 +59,16 @@
 /* Input : n elements of time doamin data
    Output: m lpc coefficients, excitation energy */
 
- -double vorbis_lpc_from_data(double *data,double *lpc,int n,int m){
- -  double *aut=alloca(sizeof(double)*(m+1));
- -  double error;
+float vorbis_lpc_from_data(float *data,float *lpc,int n,int m){
+  float *aut=alloca(sizeof(float)*(m+1));
+  float error;
   int i,j;
 
   /* autocorrelation, p+1 lag coefficients */
 
   j=m+1;
   while(j--){
- -    double d=0;
+    float d=0;
     for(i=j;i<n;i++)d+=data[i]*data[i-j];
     aut[j]=d;
   }
@@ -77,12 +77,12 @@
 
   error=aut[0];
   if(error==0){
- -    memset(lpc,0,m*sizeof(double));
+    memset(lpc,0,m*sizeof(float));
     return 0;
   }
   
   for(i=0;i<m;i++){
- -    double r=-aut[i+1];
+    float r=-aut[i+1];
 
     /* Sum up this iteration's reflection coefficient; note that in
        Vorbis we don't save it.  If anyone wants to recycle this code
@@ -96,7 +96,7 @@
     
     lpc[i]=r;
     for(j=0;j<i/2;j++){
- -      double tmp=lpc[j];
+      float tmp=lpc[j];
       lpc[j]+=r*lpc[i-1-j];
       lpc[i-1-j]+=r*tmp;
     }
@@ -114,11 +114,11 @@
 /* Input : n element envelope spectral curve
    Output: m lpc coefficients, excitation energy */
 
- -double vorbis_lpc_from_curve(double *curve,double *lpc,lpc_lookup *l){
+float vorbis_lpc_from_curve(float *curve,float *lpc,lpc_lookup *l){
   int n=l->ln;
   int m=l->m;
- -  double *work=alloca(sizeof(double)*(n+n));
- -  double fscale=.5/n;
+  float *work=alloca(sizeof(float)*(n+n));
+  float fscale=.5/n;
   int i,j;
   
   /* input is a real curve. make it complex-real */
@@ -136,7 +136,7 @@
      most of the power in the edges. */
   
   for(i=0,j=n/2;i<n/2;){
- -    double temp=work[i];
+    float temp=work[i];
     work[i++]=work[j];
     work[j++]=temp;
   }
@@ -165,16 +165,16 @@
   }
 }
 
- -void vorbis_lpc_predict(double *coeff,double *prime,int m,
- -                     double *data,long n){
+void vorbis_lpc_predict(float *coeff,float *prime,int m,
+                     float *data,long n){
 
   /* in: coeff[0...m-1] LPC coefficients 
          prime[0...m-1] initial values (allocated size of n+m-1)
     out: data[0...n-1] data samples */
 
   long i,j,o,p;
- -  double y;
- -  double *work=alloca(sizeof(double)*(m+n));
+  float y;
+  float *work=alloca(sizeof(float)*(m+n));
 
   if(!prime)
     for(i=0;i<m;i++)
@@ -193,3 +193,8 @@
     data[i]=work[o]=y;
   }
 }
+
+
+
+
+

1.14      +5 -6      vorbis/lib/lpc.h

Index: lpc.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/lpc.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
- --- lpc.h	2000/08/23 10:16:57	1.13
+++ lpc.h	2000/10/12 03:12:53	1.14
@@ -12,7 +12,7 @@
  ********************************************************************
 
   function: LPC low level routines
- -  last mod: $Id: lpc.h,v 1.13 2000/08/23 10:16:57 xiphmont Exp $
+  last mod: $Id: lpc.h,v 1.14 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -35,11 +35,10 @@
 extern void lpc_clear(lpc_lookup *l);
 
 /* simple linear scale LPC code */
- -extern double vorbis_lpc_from_data(double *data,double *lpc,int n,int m);
- -extern double vorbis_lpc_from_curve(double *curve,double *lpc,lpc_lookup 
*l);
+extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m);
+extern float vorbis_lpc_from_curve(float *curve,float *lpc,lpc_lookup *l);
 
- -extern void vorbis_lpc_predict(double *coeff,double *prime,int m,
- -			       double *data,long n);
- -
+extern void vorbis_lpc_predict(float *coeff,float *prime,int m,
+			       float *data,long n);
 
 #endif

1.10      +264 -45   vorbis/lib/lsp.c

Index: lsp.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/lsp.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
- --- lsp.c	2000/08/19 11:46:28	1.9
+++ lsp.c	2000/10/12 03:12:53	1.10
@@ -12,7 +12,7 @@
  ********************************************************************
 
   function: LSP (also called LSF) conversion routines
- -  last mod: $Id: lsp.c,v 1.9 2000/08/19 11:46:28 xiphmont Exp $
+  last mod: $Id: lsp.c,v 1.10 2000/10/12 03:12:53 xiphmont Exp $
 
   The LSP generation code is taken (with minimal modification) from
   "On the Computation of the LSP Frequencies" by Joseph Rothweiler
@@ -29,7 +29,7 @@
    LPC f response) which in turn should be impossible in our use of
    the code.  If this *does* happen anyway, it's a bug in the floor
    finder; find the cause of the confusion (probably a single bin
- -   spike or accidental near-double-limit resolution problems) and
+   spike or accidental near-float-limit resolution problems) and
    correct it. */
 
 #include <math.h>
@@ -38,26 +38,191 @@
 #include "lsp.h"
 #include "os.h"
 #include "misc.h"
+#include "lookup.h"
+#include "scales.h"
 
- -void vorbis_lsp_to_curve(double *curve,int n,double *lsp,int m,double amp,
- -			 double *w){
- -  int i,j,k;
- -  double *coslsp=alloca(m*sizeof(double));
- -  for(i=0;i<m;i++)coslsp[i]=2*cos(lsp[i]);
- -
- -  for(k=0;k<n;k++){
- -    double p=.70710678118654752440;
- -    double q=.70710678118654752440;
- -    for(j=0;j<m;){
- -      p*= *w-coslsp[j++];
- -      q*= *w-coslsp[j++];
+/* three possible LSP to f curve functions; the exact computation
+   (float), a lookup based float implementation, and an integer
+   implementation.  The float lookup is likely the optimal choice on
+   any machine with an FPU.  The integer implementation is *not* fixed
+   point (due to the need for a large dynamic range and thus a
+   seperately tracked exponent) and thus much more complex than the
+   relatively simple float implementations. It's mostly for future
+   work on a fully fixed point implementation for processors like the
+   ARM family. */
+
+/* undefine both for the 'old' but more precise implementation */
+#define  FLOAT_LOOKUP
+#undef   INT_LOOKUP
+
+#ifdef FLOAT_LOOKUP
+#include "lookup.c" /* catch this in the build system; we #include for
+                       compilers (like gcc) that can't inline across
+                       modules */
+
+/* side effect: changes *lsp to cosines of lsp */
+void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
+			    float amp,float ampoffset){
+  int i;
+  float wdel=M_PI/ln;
+  for(i=0;i<m;i++)lsp[i]=vorbis_coslook(lsp[i]);
+
+  i=0;
+  while(i<n){
+    int j,k=map[i];
+    int qexp;
+    float p=.7071067812;
+    float q=.7071067812;
+    float w=vorbis_coslook(wdel*k);
+
+    for(j=0;j<m;j+=2)    p *= lsp[j]-w;
+    for(j=1;j<m;j+=2)    q *= lsp[j]-w;
+
+    q=frexp(p*p*(1.+w)+q*q*(1.-w),&qexp);
+    q=vorbis_fromdBlook(amp*             
+			vorbis_invsqlook(q)*
+			vorbis_invsq2explook(qexp+m)- 
+			ampoffset);
+
+    curve[i++]=q;
+    while(map[i]==k)curve[i++]=q;
+  }
+}
+
+#else
+
+#ifdef INT_LOOKUP
+#include "lookup.c" /* catch this in the build system; we #include for
+                       compilers (like gcc) that can't inline across
+                       modules */
+
+static int MLOOP_1[64]={
+   0,10,11,11, 12,12,12,12, 13,13,13,13, 13,13,13,13,
+  14,14,14,14, 14,14,14,14, 14,14,14,14, 14,14,14,14,
+  15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15,
+  15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15,
+};
+
+static int MLOOP_2[64]={
+  0,4,5,5, 6,6,6,6, 7,7,7,7, 7,7,7,7,
+  8,8,8,8, 8,8,8,8, 8,8,8,8, 8,8,8,8,
+  9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9,
+  9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9,
+};
+
+static int MLOOP_3[8]={0,1,2,2,3,3,3,3};
+
+
+/* side effect: changes *lsp to cosines of lsp */
+void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
+			    float amp,float ampoffset){
+
+  /* 0 <= m < 256 */
+
+  /* set up for using all int later */
+  int i;
+  int ampoffseti=rint(ampoffset*4096.);
+  int ampi=rint(amp*16.);
+  long *ilsp=alloca(m*sizeof(long));
+  for(i=0;i<m;i++)ilsp[i]=vorbis_coslook_i(lsp[i]/M_PI*65536.+.5);
+
+  i=0;
+  while(i<n){
+    int j,k=map[i];
+    unsigned long pi=46341; /* 2**-.5 in 0.16 */
+    unsigned long qi=46341;
+    int qexp=0,shift;
+    long wi=vorbis_coslook_i(k*65536/ln);
+
+    pi*=labs(ilsp[0]-wi);
+    qi*=labs(ilsp[1]-wi);
+
+    for(j=2;j<m;j+=2){
+      if(!(shift=MLOOP_1[(pi|qi)>>25]))
+	if(!(shift=MLOOP_2[(pi|qi)>>19]))
+	  shift=MLOOP_3[(pi|qi)>>16];
+      pi=(pi>>shift)*labs(ilsp[j]-wi);
+      qi=(qi>>shift)*labs(ilsp[j+1]-wi);
+      qexp+=shift;
     }
- -    curve[k]=amp/sqrt(p*p*(1.+ *w*.5)+q*q*(1.- *w*.5));
- -    w++;
+    if(!(shift=MLOOP_1[(pi|qi)>>25]))
+      if(!(shift=MLOOP_2[(pi|qi)>>19]))
+	shift=MLOOP_3[(pi|qi)>>16];
+    pi>>=shift;
+    qi>>=shift;
+    qexp+=shift-7*m;
+
+    /* pi,qi normalized collectively, both tracked using qexp */
+
+    /* p*=p(1-w), q*=q(1+w), let normalization drift because it isn't
+       worth tracking step by step */
+
+    pi=((pi*pi)>>16);
+    qi=((qi*qi)>>16);
+    qexp=qexp*2+m;
+
+    qi*=(1<<14)-wi;
+    pi*=(1<<14)+wi;
+    
+    qi=(qi+pi)>>14;
+
+    /* we've let the normalization drift because it wasn't important;
+       however, for the lookup, things must be normalized again.  We
+       need at most one right shift or a number of left shifts */
+
+    if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */
+      qi>>=1; qexp++; 
+    }else
+      while(qi && !(qi&0x8000)){ /* checks for 0.0xxxxxxxxxxxxxxx or less*/
+	qi<<=1; qexp--; 
+      }
+
+    amp=vorbis_fromdBlook_i(ampi*                     /*  n.4         */
+			    vorbis_invsqlook_i(qi,qexp)- 
+			                              /*  m.8, m+n<=8 */
+			    ampoffseti);              /*  8.12[0]     */
+
+    curve[i]=amp;
+    while(map[++i]==k)curve[i]=amp;
   }
 }
 
- -static void cheby(double *g, int ord) {
+#else 
+
+/* old, nonoptimized but simple version for any poor sap who needs to
+   figure out what the hell this code does, or wants the other tiny
+   fraction of a dB precision */
+
+/* side effect: changes *lsp to cosines of lsp */
+void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
+			    float amp,float ampoffset){
+  int i;
+  float wdel=M_PI/ln;
+  for(i=0;i<m;i++)lsp[i]=2*cos(lsp[i]);
+
+  i=0;
+  while(i<n){
+    int j,k=map[i];
+    float p=.5;
+    float q=.5;
+    float w=2*cos(wdel*k);
+    for(j=0;j<m;j+=2){
+      p *= w-lsp[j];
+      q *= w-lsp[j+1];
+    }
+    p*=p*(2.+w);
+    q*=q*(2.-w);
+    q=fromdB(amp/sqrt(p+q)-ampoffset);
+
+    curve[i]=q;
+    while(map[++i]==k)curve[i]=q;
+  }
+}
+
+#endif
+#endif
+
+static void cheby(float *g, int ord) {
   int i, j;
 
   g[0] *= 0.5;
@@ -70,51 +235,105 @@
 }
 
 static int comp(const void *a,const void *b){
- -  if(*(double *)a<*(double *)b)
+  if(*(float *)a<*(float *)b)
     return(1);
   else
     return(-1);
 }
+
+/* This is one of those 'mathemeticians should not write code' kind of
+   cases.  Newton's method of polishing roots is straightforward
+   enough... except in those cases where it just fails in the real
+   world.  In our case below, we're worried about a local mini/maxima
+   shooting a root estimation off to infinity, or the new estimation
+   chaotically oscillating about convergence (shouldn't actually be a
+   problem in our usage.
+
+   Maehly's modification (zero suppression, to prevent two tenative
+   roots from collapsing to the same actual root) similarly can
+   temporarily shoot a root off toward infinity.  It would come
+   back... if it were not for the fact that machine representation has
+   limited dynamic range and resolution.  This too is guarded by
+   limiting delta.
+
+   Last problem is convergence criteria; we don't know what a 'double'
+   is on our hardware/compiler, and the convergence limit is bounded
+   by roundoff noise.  So, we hack convergence:
+
+   Require at most 1e-6 mean squared error for all zeroes.  When
+   converging, start the clock ticking at 1e-6; limit our polishing to
+   as many more iterations as took us to get this far, 100 max.
+
+   Past max iters, quit when MSE is no longer decreasing *or* we go
+   below ~1e-20 MSE, whichever happens first. */
+
+static void Newton_Raphson_Maehly(float *a,int ord,float *r){
+  int i, k, count=0, maxiter=0;
+  double error=1.,besterror=1.;
+  double *root=alloca(ord*sizeof(double));
 
- -/* CACM algorithm 283. */
- -static void cacm283(double *a,int ord,double *r){
- -  int i, k;
- -  double val, p, delta, error;
- -  double rooti;
- -
- -  for(i=0; i<ord;i++) r[i] = 2.0 * (i+0.5) / ord - 1.0;
- -  
- -  for(error=1 ; error > 1.e-12; ) {
- -    error = 0;
- -    for( i=0; i<ord; i++) {  /* Update each point. */
- -      rooti = r[i];
- -      val = a[ord];
- -      p = a[ord];
+  for(i=0; i<ord;i++) root[i] = 2.0 * (i+0.5) / ord - 1.0;
+  
+  while(error>1.e-20){
+    error=0;
+    
+    for(i=0; i<ord; i++) { /* Update each point. */
+      double ac=0.,pp=0.,delta;
+      double rooti=root[i];
+      double p=a[ord];
       for(k=ord-1; k>= 0; k--) {
- -	val = val * rooti + a[k];
- -	if (k != i) p *= rooti - r[k];
+
+	pp= pp* rooti + p;
+	p = p * rooti+ a[k];
+	if (k != i) ac += 1./(rooti - root[k]);
       }
- -      delta = val/p;
- -      r[i] -= delta;
+      ac=p*ac;
 
+      delta = p/(pp-ac);
+
+      /* don't allow the correction to scream off into infinity if we
+         happened to polish right at a local mini/maximum */
+
+      if(delta<-3)delta=-3;
+      if(delta>3.)delta=3.; /* 3 is not a random choice; it's large
+                               enough to make sure the first pass
+                               can't accidentally limit two poles to
+                               the same value in a fatal nonelastic
+                               collision.  */
+
+      root[i] -= delta;
       error += delta*delta;
     }
+    
+    if(maxiter && count>maxiter && error>=besterror)break;
+
+    /* anything to help out the polisher; converge using doubles */
+    if(!count || error<besterror){
+      for(i=0; i<ord; i++) r[i]=root[i]; 
+      besterror=error;
+      if(error<1.e-6){ /* rough minimum criteria */
+	maxiter=count*2+10;
+	if(maxiter>100)maxiter=100;
+      }
+    }
+
+    count++;
   }
- -  
+
   /* Replaced the original bubble sort with a real sort.  With your
      help, we can eliminate the bubble sort in our lifetime. --Monty */
   
- -  qsort(r,ord,sizeof(double),comp);
+  qsort(r,ord,sizeof(float),comp);
 
 }
 
 /* Convert lpc coefficients to lsp coefficients */
- -void vorbis_lpc_to_lsp(double *lpc,double *lsp,int m){
+void vorbis_lpc_to_lsp(float *lpc,float *lsp,int m){
   int order2=m/2;
- -  double *g1=alloca(sizeof(double)*(order2+1));
- -  double *g2=alloca(sizeof(double)*(order2+1));
- -  double *g1r=alloca(sizeof(double)*(order2+1));
- -  double *g2r=alloca(sizeof(double)*(order2+1));
+  float *g1=alloca(sizeof(float)*(order2+1));
+  float *g2=alloca(sizeof(float)*(order2+1));
+  float *g1r=alloca(sizeof(float)*(order2+1));
+  float *g2r=alloca(sizeof(float)*(order2+1));
   int i;
 
   /* Compute the lengths of the x polynomials. */
@@ -136,8 +355,8 @@
 
   /* Find the roots of the 2 even polynomials.*/
   
- -  cacm283(g1,order2,g1r);
- -  cacm283(g2,order2,g2r);
+  Newton_Raphson_Maehly(g1,order2,g1r);
+  Newton_Raphson_Maehly(g2,order2,g2r);
   
   for(i=0;i<m;i+=2){
     lsp[i] = acos(g1r[i/2]);

1.5       +6 -5      vorbis/lib/lsp.h

Index: lsp.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/lsp.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
- --- lsp.h	2000/08/19 11:46:28	1.4
+++ lsp.h	2000/10/12 03:12:53	1.5
@@ -12,7 +12,7 @@
  ********************************************************************
 
   function: LSP (also called LSF) conversion routines
- -  last mod: $Id: lsp.h,v 1.4 2000/08/19 11:46:28 xiphmont Exp $
+  last mod: $Id: lsp.h,v 1.5 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -20,9 +20,10 @@
 #ifndef _V_LSP_H_
 #define _V_LSP_H_
 
- -extern void vorbis_lpc_to_lsp(double *lpc,double *lsp,int m);
- -extern void vorbis_lsp_to_curve(double *curve,int n,
- -				double *lsp,int m,double amp,
- -				double *w);
+extern void vorbis_lpc_to_lsp(float *lpc,float *lsp,int m);
+
+extern void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,
+				float *lsp,int m,
+				float amp,float ampoffset);
   
 #endif

1.16      +38 -40    vorbis/lib/mapping0.c

Index: mapping0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mapping0.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
- --- mapping0.c	2000/08/15 09:09:43	1.15
+++ mapping0.c	2000/10/12 03:12:53	1.16
@@ -12,16 +12,16 @@
  ********************************************************************
 
  function: channel mapping 0 implementation
- - last mod: $Id: mapping0.c,v 1.15 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: mapping0.c,v 1.16 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#include <ogg/ogg.h>
 #include "vorbis/codec.h"
 #include "vorbis/backends.h"
- -#include "bitwise.h"
 #include "bookinternal.h"
 #include "registry.h"
 #include "psy.h"
@@ -51,19 +51,19 @@
   vorbis_func_residue **residue_func;
 
   int ch;
- -  double **decay;
+  float **decay;
   long lastframe; /* if a different mode is called, we need to 
                      invalidate decay */
 } vorbis_look_mapping0;
 
- -static void free_info(vorbis_info_mapping *i){
+static void mapping0_free_info(vorbis_info_mapping *i){
   if(i){
     memset(i,0,sizeof(vorbis_info_mapping0));
     free(i);
   }
 }
 
- -static void free_look(vorbis_look_mapping *look){
+static void mapping0_free_look(vorbis_look_mapping *look){
   int i;
   vorbis_look_mapping0 *l=(vorbis_look_mapping0 *)look;
   if(l){
@@ -93,7 +93,7 @@
   }
 }
 
- -static vorbis_look_mapping *look(vorbis_dsp_state *vd,vorbis_info_mode *vm,
+static vorbis_look_mapping *mapping0_look(vorbis_dsp_state 
*vd,vorbis_info_mode *vm,
                           vorbis_info_mapping *m){
   int i;
   vorbis_info *vi=vd->vi;
@@ -135,75 +135,72 @@
 
   look->ch=vi->channels;
   if(vi->psys){
- -    look->decay=calloc(vi->channels,sizeof(double *));
+    look->decay=calloc(vi->channels,sizeof(float *));
     for(i=0;i<vi->channels;i++)
- -      look->decay[i]=calloc(vi->blocksizes[vm->blockflag]/2,sizeof(double));
+      look->decay[i]=calloc(vi->blocksizes[vm->blockflag]/2,sizeof(float));
   }
 
   return(look);
 }
 
- -static void pack(vorbis_info *vi,vorbis_info_mapping *vm,oggpack_buffer 
*opb){
+static void mapping0_pack(vorbis_info *vi,vorbis_info_mapping 
*vm,oggpack_buffer *opb){
   int i;
   vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)vm;
 
- -  _oggpack_write(opb,info->submaps-1,4);
+  oggpack_write(opb,info->submaps-1,4);
   /* we don't write the channel submappings if we only have one... */
   if(info->submaps>1){
     for(i=0;i<vi->channels;i++)
- -      _oggpack_write(opb,info->chmuxlist[i],4);
+      oggpack_write(opb,info->chmuxlist[i],4);
   }
   for(i=0;i<info->submaps;i++){
- -    _oggpack_write(opb,info->timesubmap[i],8);
- -    _oggpack_write(opb,info->floorsubmap[i],8);
- -    _oggpack_write(opb,info->residuesubmap[i],8);
+    oggpack_write(opb,info->timesubmap[i],8);
+    oggpack_write(opb,info->floorsubmap[i],8);
+    oggpack_write(opb,info->residuesubmap[i],8);
   }
 }
 
 /* also responsible for range checking */
- -static vorbis_info_mapping *unpack(vorbis_info *vi,oggpack_buffer *opb){
+static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer 
*opb){
   int i;
   vorbis_info_mapping0 *info=calloc(1,sizeof(vorbis_info_mapping0));
   memset(info,0,sizeof(vorbis_info_mapping0));
 
- -  info->submaps=_oggpack_read(opb,4)+1;
+  info->submaps=oggpack_read(opb,4)+1;
 
   if(info->submaps>1){
     for(i=0;i<vi->channels;i++){
- -      info->chmuxlist[i]=_oggpack_read(opb,4);
+      info->chmuxlist[i]=oggpack_read(opb,4);
       if(info->chmuxlist[i]>=info->submaps)goto err_out;
     }
   }
   for(i=0;i<info->submaps;i++){
- -    info->timesubmap[i]=_oggpack_read(opb,8);
+    info->timesubmap[i]=oggpack_read(opb,8);
     if(info->timesubmap[i]>=vi->times)goto err_out;
- -    info->floorsubmap[i]=_oggpack_read(opb,8);
+    info->floorsubmap[i]=oggpack_read(opb,8);
     if(info->floorsubmap[i]>=vi->floors)goto err_out;
- -    info->residuesubmap[i]=_oggpack_read(opb,8);
+    info->residuesubmap[i]=oggpack_read(opb,8);
     if(info->residuesubmap[i]>=vi->residues)goto err_out;
   }
 
   return info;
 
  err_out:
- -  free_info(info);
+  mapping0_free_info(info);
   return(NULL);
 }
 
- -#include <stdio.h>
 #include "os.h"
 #include "lpc.h"
 #include "lsp.h"
 #include "envelope.h"
 #include "mdct.h"
 #include "psy.h"
- -#include "bitwise.h"
- -#include "spectrum.h"
 #include "scales.h"
 
 /* no time mapping implementation for now */
 static long seq=0;
- -static int forward(vorbis_block *vb,vorbis_look_mapping *l){
+static int mapping0_forward(vorbis_block *vb,vorbis_look_mapping *l){
   vorbis_dsp_state     *vd=vb->vd;
   vorbis_info          *vi=vd->vi;
   vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)l;
@@ -211,9 +208,9 @@
   vorbis_info_mode     *mode=look->mode;
   int                   n=vb->pcmend;
   int i,j;
- -  double *window=vd->window[vb->W][vb->lW][vb->nW][mode->windowtype];
+  float *window=vd->window[vb->W][vb->lW][vb->nW][mode->windowtype];
 
- -  double **pcmbundle=alloca(sizeof(double *)*vi->channels);
+  float **pcmbundle=alloca(sizeof(float *)*vi->channels);
   int *nonzero=alloca(sizeof(int)*vi->channels);
  
   /* time domain pre-window: NONE IMPLEMENTED */
@@ -221,7 +218,7 @@
   /* window the PCM data: takes PCM vector, vb; modifies PCM vector */
 
   for(i=0;i<vi->channels;i++){
- -    double *pcm=vb->pcm[i];
+    float *pcm=vb->pcm[i];
     for(j=0;j<n;j++)
       pcm[j]*=window[j];
   }
@@ -231,22 +228,22 @@
   /* transform the PCM data; takes PCM vector, vb; modifies PCM vector */
   /* only MDCT right now.... */
   for(i=0;i<vi->channels;i++){
- -    double *pcm=vb->pcm[i];
+    float *pcm=vb->pcm[i];
     mdct_forward(vd->transform[vb->W][0],pcm,pcm);
   }
 
   {
- -    double *floor=_vorbis_block_alloc(vb,n*sizeof(double)/2);
+    float *floor=_vorbis_block_alloc(vb,n*sizeof(float)/2);
     
     for(i=0;i<vi->channels;i++){
- -      double *pcm=vb->pcm[i];
- -      double *decay=look->decay[i];
+      float *pcm=vb->pcm[i];
+      float *decay=look->decay[i];
       int submap=info->chmuxlist[i];
 
       /* if some other mode/mapping was called last frame, our decay
          accumulator is out of date.  Clear it. */
       if(look->lastframe+1 != vb->sequence)
- -	memset(decay,0,n*sizeof(double)/2);
+	memset(decay,0,n*sizeof(float)/2);
 
       /* perform psychoacoustics; do masking */
       _vp_compute_mask(look->psy_look+submap,pcm,floor,decay);
@@ -305,7 +302,7 @@
   return(0);
 }
 
- -static int inverse(vorbis_block *vb,vorbis_look_mapping *l){
+static int mapping0_inverse(vorbis_block *vb,vorbis_look_mapping *l){
   vorbis_dsp_state     *vd=vb->vd;
   vorbis_info          *vi=vd->vi;
   vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)l;
@@ -314,8 +311,8 @@
   int                   i,j;
   long                  n=vb->pcmend=vi->blocksizes[vb->W];
 
- -  double *window=vd->window[vb->W][vb->lW][vb->nW][mode->windowtype];
- -  double **pcmbundle=alloca(sizeof(double *)*vi->channels);
+  float *window=vd->window[vb->W][vb->lW][vb->nW][mode->windowtype];
+  float **pcmbundle=alloca(sizeof(float *)*vi->channels);
   int *nonzero=alloca(sizeof(int)*vi->channels);
   
   /* time domain information decode (note that applying the
@@ -325,7 +322,7 @@
 
   /* recover the spectral envelope; store it in the PCM vector for now */
   for(i=0;i<vi->channels;i++){
- -    double *pcm=vb->pcm[i];
+    float *pcm=vb->pcm[i];
     int submap=info->chmuxlist[i];
     nonzero[i]=look->floor_func[submap]->
       inverse(vb,look->floor_look[submap],pcm);
@@ -347,7 +344,7 @@
   /* transform the PCM data; takes PCM vector, vb; modifies PCM vector */
   /* only MDCT right now.... */
   for(i=0;i<vi->channels;i++){
- -    double *pcm=vb->pcm[i];
+    float *pcm=vb->pcm[i];
     _analysis_output("out",seq+i,pcm,n/2,0,1);
     mdct_backward(vd->transform[vb->W][0],pcm,pcm);
   }
@@ -357,7 +354,7 @@
   
   /* window the data */
   for(i=0;i<vi->channels;i++){
- -    double *pcm=vb->pcm[i];
+    float *pcm=vb->pcm[i];
     if(nonzero[i])
       for(j=0;j<n;j++)
         pcm[j]*=window[j];
@@ -376,7 +373,8 @@
 
 /* export hooks */
 vorbis_func_mapping mapping0_exportbundle={
- -  &pack,&unpack,&look,&free_info,&free_look,&forward,&inverse
+  &mapping0_pack,&mapping0_unpack,&mapping0_look,&mapping0_free_info,
+  &mapping0_free_look,&mapping0_forward,&mapping0_inverse
 };
 
 

1.5       +38 -38    vorbis/lib/masking.h

Index: masking.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/masking.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
- --- masking.h	2000/08/15 09:09:43	1.4
+++ masking.h	2000/10/12 03:12:53	1.5
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: masking curve data for psychoacoustics
- - last mod: $Id: masking.h,v 1.4 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: masking.h,v 1.5 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -20,7 +20,7 @@
 #define _V_MASKING_H_
 
 /* Not really an ATH, more a bottom curve to limit LSP dynamic range */
- -double ATH_Bark_dB[]={  
+float ATH_Bark_dB[]={  
    15,   15,   15,    15,    11,    10,     8,    7,    7,    7,
     6,    2,    0,     0,    -3,    -5,    -6,   -6, -4.5,  2.5,
    10,   15,   15,    15,    15,    15,   15};
@@ -37,202 +37,202 @@
 #define EHMER_OFFSET 16
 #define EHMER_MAX 56
 
- -double tone_125_40dB_SL[EHMER_MAX]={
+float tone_125_40dB_SL[EHMER_MAX]={
   30,  30,  30,  30,  30,  30,  30,  30,   30, 30, 29, 27, 26, 25, 23, 21,  
   20,  18,  16,  14,  12,  11,   9,   7,    5,  3,  2,  0, -2, -4, -6, -8,
  -10, -12, -14, -16, -18, -20, -23, -25,  -28,-30,-34,-37,-40,-44,-48,-52,  
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_125_60dB_SL[EHMER_MAX]={
+float tone_125_60dB_SL[EHMER_MAX]={
   50,  50,  50,  50,  50,  50,  50,  50,   50, 50, 49, 47, 46, 45, 43, 41,  
   40,  38,  36,  34,  32,  31,  29,  27,   25, 23, 22, 20, 18, 16, 14, 12,
   10,   8,   6,   4,   2,   0,  -3,  -5,   -8,-10,-14,-17,-20,-24,-28,-32,  
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_125_80dB_SL[EHMER_MAX]={
+float tone_125_80dB_SL[EHMER_MAX]={
   70,  70,  70,  70,  70,  70,  70,  70,   70, 70, 69, 67, 66, 65, 63, 61,  
   60,  58,  56,  54,  52,  51,  49,  47,   45, 43, 42, 40, 38, 36, 34, 32,
   30,  28,  26,  24,  22,  20,  17,  15,   12, 10,  6,  3,  0, -4, -8,-12,  
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_125_100dB_SL[EHMER_MAX]={
+float tone_125_100dB_SL[EHMER_MAX]={
   85,  85,  85,  85,  85,  85,  85,  85,   85, 84, 84, 83, 82, 81, 80, 79,  
   78,  77,  75,  74,  73,  72,  71,  70,   69, 68, 67, 65, 64, 63, 62, 60,
   58,  57,  55,  54,  52,  50,  48,  46,   44, 42, 40, 38, 36, 34, 31, 29,  
   27,  24,  22,  20,  18,  15,  13,  11};
 
- -double tone_250_40dB_SL[EHMER_MAX]={
+float tone_250_40dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,   -19, -13,  -7,  -1,   4,   9,  15, 
 20,
   22,  23,  22,  19,  18,  18,  16,  13,     9,   7,   3,   1,  -1,  -3,  -6, 
 -8,
  -10, -13, -16, -19, -21, -24, -28, -32,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_250_60dB_SL[EHMER_MAX]={
+float tone_250_60dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -10,   -5,  1,  7, 13, 19, 25, 30, 33,  
   36,  39,  38,  37,  38,  39,  39,  40,   38, 36, 35, 34, 33, 31, 29, 28,
   28,  28,  25,  20,  14,  10,   5,   0,   -5,-10,-15,-20,-25,-30,-35,-40,  
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_250_80dB_SL[EHMER_MAX]={
+float tone_250_80dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -10,   10, 17, 24, 30, 37, 41, 48, 49,  
   50,  53,  54,  53,  53,  54,  55,  57,   57, 57, 58, 59, 60, 58, 57, 58,
   59,  58,  57,  54,  52,  50,  49,  47,   46, 47, 46, 44, 43, 42, 41, 40,  
   38,  32,  27,  22,  17,  11,   6,   0};
 /* no data, just interpolated from 80 */
- -double tone_250_100dB_SL[EHMER_MAX]={
+float tone_250_100dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -10,   15, 25, 34, 40, 50, 56, 60, 70,  
   70,  73,  74,  73,  73,  74,  75,  77,   77, 77, 78, 79, 80, 78, 77, 78,
   79,  78,  77,  74,  72,  70,  69,  67,   66, 67, 66, 64, 63, 62, 61, 60,  
   58,  52,  47,  42,  37,  31,  26,  20};
 
- -double tone_500_40dB_SL[EHMER_MAX]={
+float tone_500_40dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -40,   -26, -20, -14,  -8,  -2,   4,  10, 
 17,
   23,  16,  12,   9,   6,   3,   0,  -3,    -7, -10, -13, -16, -20, -23, -26, 
-30,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_500_60dB_SL[EHMER_MAX]={
+float tone_500_60dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,   -18, -12,  -6,   0,   6,  13,  20, 
 30,
   39,  34,  31,  29,  29,  27,  24,  21,    18,  16,  13,   8,   6,   3,   1, 
 -1,
   -5,  -2,  -5,  -8, -12, -15, -18, -22,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_500_80dB_SL[EHMER_MAX]={
+float tone_500_80dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,  -22,-16,-10,  0, 10, 20, 32, 43,  
   53,  52,  52,  50,  49,  50,  52,  55,   55, 54, 51, 49, 46, 44, 44, 42,
   38,  34,  32,  29,  29,  28,  25,  23,   20, 16, 10,  7,  4,  2, -1, -4,  
   -7, -10, -15, -20, -25, -30, -35, -40};
- -double tone_500_100dB_SL[EHMER_MAX]={
+float tone_500_100dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -10,   -7,  2, 10, 19, 27, 35, 55, 56,  
   62,  61,  60,  58,  57,  57,  59,  63,   65, 66, 62, 60, 57, 57, 58, 58,
   57,  56,  56,  56,  57,  57,  56,  57,   57, 54, 47, 41, 37, 28, 21, 16,  
   10,   3,  -3,  -8, -13, -18, -23, -28};
 
- -double tone_1000_40dB_SL[EHMER_MAX]={
+float tone_1000_40dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,   -55, -40, -30, -20, -10,  0,   9,  
20,
   27,  20,  13,  14,  13,   5,  -1,  -6,   -11, -20, 
-30,-900,-900,-900,-900,-900,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_1000_60dB_SL[EHMER_MAX]={
+float tone_1000_60dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -43,   -33,-23,-13, -3,  7,  17,  25,  
37,
   42,  33,  25,  25,  23,  18,  13,   9,     4, -1, -7,-13,-18, -23, -28, -33,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_1000_80dB_SL[EHMER_MAX]={
+float tone_1000_80dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -35,   -25,-14, -4,  6, 16, 27, 33, 50,  
   59,  57,  47,  41,  40,  43,  47,  48,    47, 42, 39, 37, 37, 36, 35, 32,
   30,  27,  21,  15,   5,  -2, -10, -18,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_1000_100dB_SL[EHMER_MAX]={
+float tone_1000_100dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900, -40, -30,   -20,-10,  0, 10, 23, 33, 45, 60,  
   70,  72,  55,  49,  43,  40,  44,  54,    59, 58, 49, 43, 52, 57, 57, 58,
   58,  54,  49,  47,  42,  39,  33,  28,    20, 15,  5,  0, -5,-15,-20,-25,  
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double tone_2000_40dB_SL[EHMER_MAX]={
+float tone_2000_40dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,   -40, -30, -21, -12, -3,   5,  12,  
20,
   24,  21,  14,   5,  -5, -15, -25, -35,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_2000_60dB_SL[EHMER_MAX]={
+float tone_2000_60dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,   -40, -30, -21, -12,  -2,   8,  19, 
 31,
   38,  34,  24,  17,  14,  13,  11,   7,     3,  -2,  -6, -10, -14, -20, -26, 
-32,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_2000_80dB_SL[EHMER_MAX]={
+float tone_2000_80dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,   -40, -30, -21, -12,  -2,  13,  28, 
 40,
   51,  51,  43,  35,  28,  29,  35,  37,    37,  35,  31,  28,  25,  22,  19, 
 15,
   11,   8,   6,  2,   -6, -14, -22, -30,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_2000_100dB_SL[EHMER_MAX]={  
+float tone_2000_100dB_SL[EHMER_MAX]={  
 -900,-900,-900,-900,-900,-900,-900,-900,   -40, -30, -21, -10,   6,  25,  42, 
 60,
   66,  60,  53,  43,  35,  31,  34,  47,    58,  51,  43,  45,  54,  59,  59, 
 56,
   54,  51,  40,  29,  20,  11,   2,  -8,   -17, -26, 
-35,-900,-900,-900,-900,-900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double tone_4000_40dB_SL[EHMER_MAX]={
+float tone_4000_40dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,   -40, -30, -21, -12,   0,   3,  10, 
 18,
   24,  21,  14,   5,  -5, -15, -25, -35,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double tone_4000_60dB_SL[EHMER_MAX]={
+float tone_4000_60dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,   -40, -30, -21, -12,  -2,   8,  19, 
 31,
   38,  33,  28,  23,  19,  14,  11,   8,     3,  -2,  -7, -12, -17, -22, -27, 
-37,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double tone_4000_80dB_SL[EHMER_MAX]={
+float tone_4000_80dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900,-900,   -60, -50, -40, -29, -12,   5,  19, 
 37,
   51,  49,  40,  35,  36,  36,  36,  33,    32,  24,  18,   8,  -3, -12, -20, 
-29,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double tone_4000_100dB_SL[EHMER_MAX]={
+float tone_4000_100dB_SL[EHMER_MAX]={
  -20, -12,  -8,  -4,   0,   4,   8,  11,    15,  22,  26,  28,  32,  36,  43, 
 52,
   62,  59,  50,  48,  50,  50,  45,  36,    45,  30,  20,  10,  0,  -10, -19, 
-28,
  -37,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double tone_8000_40dB_SL[EHMER_MAX]={
+float tone_8000_40dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -50,   -41, -30, -21, -12,   0,   3,  10, 
 18,
   23,  20,  16,  15,  16,  18,  21,  23,    25,  27,  29,  32,  35,  38,  41, 
 44,
   47,  50,  55,  60,  85,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
   -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_8000_60dB_SL[EHMER_MAX]={
+float tone_8000_60dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -10,   -21, -18, -14, -10,   0,  3,   15, 
 30,
   43,  40,  36,  35,  36,  38,  41,  43,    45,  47,  49,  52,  55,  58,  61, 
 64,
   67,  70,  75,  80,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
- -double tone_8000_80dB_SL[EHMER_MAX]={
+float tone_8000_80dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900,-900,-900, -10,    -1,   2,   6,  10,  13,  19,  25, 
 35,
   63,  60,  56,  55,  56,  58,  61,  63,    65,  70,  75,  80,  85,  90,  95, 
 100,
  100, 100, 100, 100,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double tone_8000_100dB_SL[EHMER_MAX]={
+float tone_8000_100dB_SL[EHMER_MAX]={
  -18, -12,  -7,  -3,   0,   2,   6,   9,    12,  19,  22,  21,  19,  21,  40, 
 40,
   80,  60,  35,  25,  15,   5,  -5, -15,   -25, -35,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
 #if 0 /* not used for the time being */
- -double noise_500_60dB_SL[EHMER_MAX]={
+float noise_500_60dB_SL[EHMER_MAX]={
 -900,-900,-900,-900,-900, -20, -11,  -2,     7,  16,  25,  34,  43,  52,  61, 
 66,
   69,  68,  58,  50,  44,  38,  32,  28,    25,  24,  20,  18,  17,  12,  10, 
  8,
    5,   0,  -5,  -8, -12, -15, -18, -22,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double noise_500_80dB_SL[EHMER_MAX]={
+float noise_500_80dB_SL[EHMER_MAX]={
 -900,-900,-900, -20, -10,  -1,   8,  17,    26,  35,  44,  53,  62,  70,  79, 
 83,
   85,  85,  81,  77,  74,  71,  68,  63,    61,  59,  56,  55,  54,  52,  48, 
 47,
   45,  46,  45,  43,  40,  37,  33,  32,    35,  32,  30,  29,  20,  10,   0, 
-10,
  -20, -30,-900,-900,-900,-900,-900,-900};
 
- -double noise_1000_60dB_SL[EHMER_MAX]={
+float noise_1000_60dB_SL[EHMER_MAX]={
 -900,-900,-900,-900, -24, -15,  -6,   3,    12,  21,  28,  34,  40,  48,  57, 
 60,
   61,  56,  54,  45,  36,  27,  21,  19,    17,  13,  10,   0, -10, -20, 
-20,-900,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double noise_1000_80dB_SL[EHMER_MAX]={
+float noise_1000_80dB_SL[EHMER_MAX]={
 -900, -26, -17,  -8,   1,  10,  19,  28,    37,  41,  46,  51,  58,  68,  74, 
 81,
   80,  81,  70,  66,  58,  61,  59,  55,    54,  53,  52,  49,  48,  42,  38, 
 38,
   39,  34,  30,  27,  20,  10,   0, -10,   -20, -30,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double noise_2000_60dB_SL[EHMER_MAX]={
+float noise_2000_60dB_SL[EHMER_MAX]={
 -900,-900,-900, -34, -25, -16,  -7,   2,    11,  18,  23,  30,  35,  42,  51, 
 58,
   58,  57,  50,  40,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double noise_2000_80dB_SL[EHMER_MAX]={
+float noise_2000_80dB_SL[EHMER_MAX]={
 -900, -26, -17,  -8,   1,  10,  19,  28,    33,  38,  43,  48,  53,  62,  70, 
 77,
   77,  75,  70,  67,  68,  66,  62,  61,    60,  59,  52,  47,  39,  35,  34, 
 35,
   35,  33,  30,  27,  20,  10,   0, -10,   -20, -30,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double noise_4000_60dB_SL[EHMER_MAX]={
+float noise_4000_60dB_SL[EHMER_MAX]={
 -900,-900,-900, -34, -25, -16,  -7,   2,    11,  20,  25,  31,  37,  45,  56, 
 62,
   64,  61,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,
 -900,-900,-900,-900,-900,-900,-900,-900};
 
- -double noise_4000_80dB_SL[EHMER_MAX]={
+float noise_4000_80dB_SL[EHMER_MAX]={
 -900, -26, -17,  -8,   1,  10,  19,  26,    33,  39,  45,  50,  55,  65,  75, 
 82,
   84,  81,  78,  72,  70,  69,  66,  61,    50,  48,  46,  40,  35,  30,  25, 
 20,
   15,  10,   5,   0, -10, -20, -30,-900,  -900,-900,-900,-900,-900,-900,-900,-
900,

1.17      +50 -50    vorbis/lib/mdct.c

Index: mdct.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mdct.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
- --- mdct.c	2000/03/10 13:21:18	1.16
+++ mdct.c	2000/10/12 03:12:53	1.17
@@ -13,7 +13,7 @@
 
  function: normalized modified discrete cosine transform
            power of two length transform only [16 <= n ]
- - last mod: $Id: mdct.c,v 1.16 2000/03/10 13:21:18 xiphmont Exp $
+ last mod: $Id: mdct.c,v 1.17 2000/10/12 03:12:53 xiphmont Exp $
 
  Algorithm adapted from _The use of multirate filter banks for coding
  of high quality digital audio_, by T. Sporer, K. Brandenburg and
@@ -46,13 +46,13 @@
 
 void mdct_init(mdct_lookup *lookup,int n){
   int    *bitrev=malloc(sizeof(int)*(n/4));
- -  double *trig=malloc(sizeof(double)*(n+n/4));
- -  double *AE=trig;
- -  double *AO=trig+1;
- -  double *BE=AE+n/2;
- -  double *BO=BE+1;
- -  double *CE=BE+n/2;
- -  double *CO=CE+1;
+  float *trig=malloc(sizeof(float)*(n+n/4));
+  float *AE=trig;
+  float *AO=trig+1;
+  float *BE=AE+n/2;
+  float *BO=BE+1;
+  float *CE=BE+n/2;
+  float *CO=CE+1;
   
   int i;
   int log2n=lookup->log2n=rint(log(n)/log(2));
@@ -96,21 +96,21 @@
   }
 }
 
- -static double *_mdct_kernel(double *x, double *w,
+static float *_mdct_kernel(float *x, float *w,
                             int n, int n2, int n4, int n8,
                             mdct_lookup *init){
   int i;
   /* step 2 */
 
   {
- -    double *xA=x+n4;
- -    double *xB=x;
- -    double *w2=w+n4;
- -    double *A=init->trig+n2;
+    float *xA=x+n4;
+    float *xB=x;
+    float *w2=w+n4;
+    float *A=init->trig+n2;
 
     for(i=0;i<n4;){
- -      double x0=*xA - *xB;
- -      double x1;
+      float x0=*xA - *xB;
+      float x1;
       w2[i]=    *xA++ + *xB++;
 
 
@@ -133,14 +133,14 @@
       int k0=n>>(i+2);
       int k1=1<<(i+3);
       int wbase=n2-2;
- -      double *A=init->trig;
- -      double *temp;
+      float *A=init->trig;
+      float *temp;
 
       for(r=0;r<(k0>>2);r++){
         int w1=wbase;
         int w2=w1-(k0>>1);
- -	double AEv= A[0],wA;
- -	double AOv= A[1],wB;
+	float AEv= A[0],wA;
+	float AOv= A[1],wB;
         wbase-=2;
 
         k0++;
@@ -170,23 +170,23 @@
 
   /* step 4, 5, 6, 7 */
   {
- -    double *C=init->trig+n;
+    float *C=init->trig+n;
     int *bit=init->bitrev;
- -    double *x1=x;
- -    double *x2=x+n2-1;
+    float *x1=x;
+    float *x2=x+n2-1;
     for(i=0;i<n8;i++){
       int t1=*bit++;
       int t2=*bit++;
 
- -      double wA=w[t1]-w[t2+1];
- -      double wB=w[t1-1]+w[t2];
- -      double wC=w[t1]+w[t2+1];
- -      double wD=w[t1-1]-w[t2];
- -
- -      double wACE=wA* *C;
- -      double wBCE=wB* *C++;
- -      double wACO=wA* *C;
- -      double wBCO=wB* *C++;
+      float wA=w[t1]-w[t2+1];
+      float wB=w[t1-1]+w[t2];
+      float wC=w[t1]+w[t2+1];
+      float wD=w[t1-1]-w[t2];
+
+      float wACE=wA* *C;
+      float wBCE=wB* *C++;
+      float wACO=wA* *C;
+      float wBCO=wB* *C++;
       
       *x1++=( wC+wACO+wBCE)*.5;
       *x2--=(-wD+wBCO-wACE)*.5;
@@ -197,11 +197,11 @@
   return(x);
 }
 
- -void mdct_forward(mdct_lookup *init, double *in, double *out){
+void mdct_forward(mdct_lookup *init, float *in, float *out){
   int n=init->n;
- -  double *x=alloca(sizeof(double)*(n/2));
- -  double *w=alloca(sizeof(double)*(n/2));
- -  double *xx;
+  float *x=alloca(sizeof(float)*(n/2));
+  float *w=alloca(sizeof(float)*(n/2));
+  float *xx;
   int n2=n>>1;
   int n4=n>>2;
   int n8=n>>3;
@@ -209,10 +209,10 @@
 
   /* window + rotate + step 1 */
   {
- -    double tempA,tempB;
+    float tempA,tempB;
     int in1=n2+n4-4;
     int in2=in1+5;
- -    double *A=init->trig+n2;
+    float *A=init->trig+n2;
 
     i=0;
     
@@ -253,9 +253,9 @@
   /* step 8 */
 
   {
- -    double *B=init->trig+n2;
- -    double *out2=out+n2;
- -    double scale=4./n;
+    float *B=init->trig+n2;
+    float *out2=out+n2;
+    float scale=4./n;
     for(i=0;i<n4;i++){
       out[i]   =(xx[0]*B[0]+xx[1]*B[1])*scale;
       *(--out2)=(xx[0]*B[1]-xx[1]*B[0])*scale;
@@ -266,11 +266,11 @@
   }
 }
 
- -void mdct_backward(mdct_lookup *init, double *in, double *out){
+void mdct_backward(mdct_lookup *init, float *in, float *out){
   int n=init->n;
- -  double *x=alloca(sizeof(double)*(n/2));
- -  double *w=alloca(sizeof(double)*(n/2));
- -  double *xx;
+  float *x=alloca(sizeof(float)*(n/2));
+  float *w=alloca(sizeof(float)*(n/2));
+  float *xx;
   int n2=n>>1;
   int n4=n>>2;
   int n8=n>>3;
@@ -278,9 +278,9 @@
 
   /* rotate + step 1 */
   {
- -    double *inO=in+1;
- -    double  *xO= x;
- -    double  *A=init->trig+n2;
+    float *inO=in+1;
+    float  *xO= x;
+    float  *A=init->trig+n2;
 
     for(i=0;i<n8;i++){
       A-=2;
@@ -305,13 +305,13 @@
   /* step 8 */
 
   {
- -    double *B=init->trig+n2;
+    float *B=init->trig+n2;
     int o1=n4,o2=o1-1;
     int o3=n4+n2,o4=o3-1;
     
     for(i=0;i<n4;i++){
- -      double temp1= (*xx * B[1] - *(xx+1) * B[0]);
- -      double temp2=-(*xx * B[0] + *(xx+1) * B[1]);
+      float temp1= (*xx * B[1] - *(xx+1) * B[0]);
+      float temp2=-(*xx * B[0] + *(xx+1) * B[1]);
     
       out[o1]=-temp1;
       out[o2]= temp1;

1.12      +4 -4      vorbis/lib/mdct.h

Index: mdct.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mdct.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
- --- mdct.h	2000/06/18 12:33:47	1.11
+++ mdct.h	2000/10/12 03:12:53	1.12
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: modified discrete cosine transform prototypes
- - last mod: $Id: mdct.h,v 1.11 2000/06/18 12:33:47 xiphmont Exp $
+ last mod: $Id: mdct.h,v 1.12 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -25,15 +25,15 @@
   int n;
   int log2n;
   
- -  double *trig;
+  float *trig;
   int    *bitrev;
 
 } mdct_lookup;
 
 extern void mdct_init(mdct_lookup *lookup,int n);
 extern void mdct_clear(mdct_lookup *l);
- -extern void mdct_forward(mdct_lookup *init, double *in, double *out);
- -extern void mdct_backward(mdct_lookup *init, double *in, double *out);
+extern void mdct_forward(mdct_lookup *init, float *in, float *out);
+extern void mdct_backward(mdct_lookup *init, float *in, float *out);
 
 #endif
 

1.5       +2 -2      vorbis/lib/misc.h

Index: misc.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/misc.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
- --- misc.h	2000/05/08 20:49:49	1.4
+++ misc.h	2000/10/12 03:12:53	1.5
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: miscellaneous prototypes
- - last mod: $Id: misc.h,v 1.4 2000/05/08 20:49:49 xiphmont Exp $
+ last mod: $Id: misc.h,v 1.5 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -22,7 +22,7 @@
 
 extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
 extern void _vorbis_block_ripcord(vorbis_block *vb);
- -extern void _analysis_output(char *base,int i,double *v,int n,int bark,int 
dB);
+extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB);
 
 #ifdef DEBUG_LEAKS
 extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line); 

1.10      +2 -7      vorbis/lib/os.h

Index: os.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/os.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
- --- os.h	2000/08/23 06:38:49	1.9
+++ os.h	2000/10/12 03:12:53	1.10
@@ -14,7 +14,7 @@
  ********************************************************************
 
  function: #ifdef jail to whip a few platforms into the UNIX ideal.
- - last mod: $Id: os.h,v 1.9 2000/08/23 06:38:49 xiphmont Exp $
+ last mod: $Id: os.h,v 1.10 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -41,7 +41,7 @@
 
 #endif
 
- -#ifdef USE_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
 #include <alloca.h>
 #endif
 
@@ -57,9 +57,4 @@
 #  define max(x,y)  ((x)<(y)?(y):(x))
 #endif
 
- -#include "../include/vorbis/os_types.h"
- -
 #endif /* _OS_H */
- -
- -
- -

1.29      +142 -142  vorbis/lib/psy.c

Index: psy.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psy.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
- --- psy.c	2000/09/07 13:23:44	1.28
+++ psy.c	2000/10/12 03:12:53	1.29
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: psychoacoustics not including preecho
- - last mod: $Id: psy.c,v 1.28 2000/09/07 13:23:44 msmith Exp $
+ last mod: $Id: psy.c,v 1.29 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -44,14 +44,14 @@
 /* Set up decibel threshhold slopes on a Bark frequency scale */
 /* ATH is the only bit left on a Bark scale.  No reason to change it
    right now */
- -static void set_curve(double *ref,double *c,int n, double crate){
+static void set_curve(float *ref,float *c,int n, float crate){
   int i,j=0;
 
   for(i=0;i<MAX_BARK-1;i++){
     int endpos=rint(fromBARK(i+1)*2*n/crate);
- -    double base=ref[i];
+    float base=ref[i];
     if(j<endpos){
- -      double delta=(ref[i+1]-base)/(endpos-j);
+      float delta=(ref[i+1]-base)/(endpos-j);
       for(;j<endpos && j<n;j++){
         c[j]=base;
         base+=delta;
@@ -60,24 +60,24 @@
   }
 }
 
- -static void min_curve(double *c,
- -		       double *c2){
+static void min_curve(float *c,
+		       float *c2){
   int i;  
   for(i=0;i<EHMER_MAX;i++)if(c2[i]<c[i])c[i]=c2[i];
 }
- -static void max_curve(double *c,
- -		       double *c2){
+static void max_curve(float *c,
+		       float *c2){
   int i;  
   for(i=0;i<EHMER_MAX;i++)if(c2[i]>c[i])c[i]=c2[i];
 }
 
- -static void attenuate_curve(double *c,double att){
+static void attenuate_curve(float *c,float att){
   int i;
   for(i=0;i<EHMER_MAX;i++)
     c[i]+=att;
 }
 
- -static void linear_curve(double *c){
+static void linear_curve(float *c){
   int i;  
   for(i=0;i<EHMER_MAX;i++)
     if(c[i]<=-200.)
@@ -86,21 +86,21 @@
       c[i]=fromdB(c[i]);
 }
 
- -static void interp_curve(double *c,double *c1,double *c2,double del){
+static void interp_curve(float *c,float *c1,float *c2,float del){
   int i;
   for(i=0;i<EHMER_MAX;i++)
     c[i]=c2[i]*del+c1[i]*(1.-del);
 }
 
- -static void setup_curve(double **c,
+static void setup_curve(float **c,
                         int band,
- -			double *curveatt_dB){
+			float *curveatt_dB){
   int i,j;
- -  double ath[EHMER_MAX];
- -  double tempc[P_LEVELS][EHMER_MAX];
+  float ath[EHMER_MAX];
+  float tempc[P_LEVELS][EHMER_MAX];
 
- -  memcpy(c[0],c[4],sizeof(double)*EHMER_MAX);
- -  memcpy(c[2],c[4],sizeof(double)*EHMER_MAX);
+  memcpy(c[0],c[4],sizeof(float)*EHMER_MAX);
+  memcpy(c[2],c[4],sizeof(float)*EHMER_MAX);
 
   /* we add back in the ATH to avoid low level curves falling off to
      -infinity and unneccessarily cutting off high level curves in the
@@ -109,12 +109,12 @@
      mask too little than too much, so be pessimal. */
 
   for(i=0;i<EHMER_MAX;i++){
- -    double oc_min=band*.5-1+(i-EHMER_OFFSET)*.125;
- -    double oc_max=band*.5-1+(i-EHMER_OFFSET+1)*.125;
- -    double bark=toBARK(fromOC(oc_min));
+    float oc_min=band*.5-1+(i-EHMER_OFFSET)*.125;
+    float oc_max=band*.5-1+(i-EHMER_OFFSET+1)*.125;
+    float bark=toBARK(fromOC(oc_min));
     int ibark=floor(bark);
- -    double del=bark-ibark;
- -    double ath_min,ath_max;
+    float del=bark-ibark;
+    float ath_min,ath_max;
 
     if(ibark<26)
       ath_min=ATH_Bark_dB[ibark]*(1.-del)+ATH_Bark_dB[ibark+1]*del;
@@ -143,7 +143,7 @@
   /* make temp curves with the ATH overlayed */
   for(i=0;i<P_LEVELS;i++){
     attenuate_curve(c[i],curveatt_dB[i]);
- -    memcpy(tempc[i],ath,EHMER_MAX*sizeof(double));
+    memcpy(tempc[i],ath,EHMER_MAX*sizeof(float));
     attenuate_curve(tempc[i],-i*10.);
     max_curve(tempc[i],c[i]);
   }
@@ -172,9 +172,9 @@
 void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,int n,long rate){
   long i,j;
   memset(p,0,sizeof(vorbis_look_psy));
- -  p->ath=malloc(n*sizeof(double));
+  p->ath=malloc(n*sizeof(float));
   p->octave=malloc(n*sizeof(int));
- -  p->bark=malloc(n*sizeof(double));
+  p->bark=malloc(n*sizeof(float));
   p->vi=vi;
   p->n=n;
 
@@ -193,70 +193,70 @@
     p->octave[i]=oc;
   }  
 
- -  p->tonecurves=malloc(P_BANDS*sizeof(double **));
- -  p->noiseatt=malloc(P_BANDS*sizeof(double **));
- -  p->peakatt=malloc(P_BANDS*sizeof(double *));
+  p->tonecurves=malloc(P_BANDS*sizeof(float **));
+  p->noiseatt=malloc(P_BANDS*sizeof(float **));
+  p->peakatt=malloc(P_BANDS*sizeof(float *));
   for(i=0;i<P_BANDS;i++){
- -    p->tonecurves[i]=malloc(P_LEVELS*sizeof(double *));
- -    p->noiseatt[i]=malloc(P_LEVELS*sizeof(double));
- -    p->peakatt[i]=malloc(P_LEVELS*sizeof(double));
+    p->tonecurves[i]=malloc(P_LEVELS*sizeof(float *));
+    p->noiseatt[i]=malloc(P_LEVELS*sizeof(float));
+    p->peakatt[i]=malloc(P_LEVELS*sizeof(float));
   }
 
   for(i=0;i<P_BANDS;i++)
     for(j=0;j<P_LEVELS;j++){
- -      p->tonecurves[i][j]=malloc(EHMER_MAX*sizeof(double));
+      p->tonecurves[i][j]=malloc(EHMER_MAX*sizeof(float));
     }
 
   /* OK, yeah, this was a silly way to do it */
- -  memcpy(p->tonecurves[0][4],tone_125_40dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[0][6],tone_125_60dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[0][8],tone_125_80dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[0][10],tone_125_100dB_SL,sizeof(double)*EHMER_MAX);
- -
- -  memcpy(p->tonecurves[2][4],tone_125_40dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[2][6],tone_125_60dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[2][8],tone_125_80dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[2][10],tone_125_100dB_SL,sizeof(double)*EHMER_MAX);
- -
- -  memcpy(p->tonecurves[4][4],tone_250_40dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[4][6],tone_250_60dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[4][8],tone_250_80dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[4][10],tone_250_100dB_SL,sizeof(double)*EHMER_MAX);
- -
- -  memcpy(p->tonecurves[6][4],tone_500_40dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[6][6],tone_500_60dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[6][8],tone_500_80dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[6][10],tone_500_100dB_SL,sizeof(double)*EHMER_MAX);
- -
- -  memcpy(p->tonecurves[8][4],tone_1000_40dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[8][6],tone_1000_60dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[8][8],tone_1000_80dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[8][10],tone_1000_100dB_SL,sizeof(double)*EHMER_MAX);
- -
- -  memcpy(p->tonecurves[10][4],tone_2000_40dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[10][6],tone_2000_60dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[10][8],tone_2000_80dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[10][10],tone_2000_100dB_SL,sizeof(double)*EHMER_MAX);
- -
- -  memcpy(p->tonecurves[12][4],tone_4000_40dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[12][6],tone_4000_60dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[12][8],tone_4000_80dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[12][10],tone_4000_100dB_SL,sizeof(double)*EHMER_MAX);
- -
- -  memcpy(p->tonecurves[14][4],tone_8000_40dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[14][6],tone_8000_60dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[14][8],tone_8000_80dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[14][10],tone_8000_100dB_SL,sizeof(double)*EHMER_MAX);
- -
- -  memcpy(p->tonecurves[16][4],tone_8000_40dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[16][6],tone_8000_60dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[16][8],tone_8000_80dB_SL,sizeof(double)*EHMER_MAX);
- -  memcpy(p->tonecurves[16][10],tone_8000_100dB_SL,sizeof(double)*EHMER_MAX);
+  memcpy(p->tonecurves[0][4],tone_125_40dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[0][6],tone_125_60dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[0][8],tone_125_80dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[0][10],tone_125_100dB_SL,sizeof(float)*EHMER_MAX);
+
+  memcpy(p->tonecurves[2][4],tone_125_40dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[2][6],tone_125_60dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[2][8],tone_125_80dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[2][10],tone_125_100dB_SL,sizeof(float)*EHMER_MAX);
+
+  memcpy(p->tonecurves[4][4],tone_250_40dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[4][6],tone_250_60dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[4][8],tone_250_80dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[4][10],tone_250_100dB_SL,sizeof(float)*EHMER_MAX);
+
+  memcpy(p->tonecurves[6][4],tone_500_40dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[6][6],tone_500_60dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[6][8],tone_500_80dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[6][10],tone_500_100dB_SL,sizeof(float)*EHMER_MAX);
+
+  memcpy(p->tonecurves[8][4],tone_1000_40dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[8][6],tone_1000_60dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[8][8],tone_1000_80dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[8][10],tone_1000_100dB_SL,sizeof(float)*EHMER_MAX);
+
+  memcpy(p->tonecurves[10][4],tone_2000_40dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[10][6],tone_2000_60dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[10][8],tone_2000_80dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[10][10],tone_2000_100dB_SL,sizeof(float)*EHMER_MAX);
+
+  memcpy(p->tonecurves[12][4],tone_4000_40dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[12][6],tone_4000_60dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[12][8],tone_4000_80dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[12][10],tone_4000_100dB_SL,sizeof(float)*EHMER_MAX);
+
+  memcpy(p->tonecurves[14][4],tone_8000_40dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[14][6],tone_8000_60dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[14][8],tone_8000_80dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[14][10],tone_8000_100dB_SL,sizeof(float)*EHMER_MAX);
+
+  memcpy(p->tonecurves[16][4],tone_8000_40dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[16][6],tone_8000_60dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[16][8],tone_8000_80dB_SL,sizeof(float)*EHMER_MAX);
+  memcpy(p->tonecurves[16][10],tone_8000_100dB_SL,sizeof(float)*EHMER_MAX);
 
   /* interpolate curves between */
   for(i=1;i<P_BANDS;i+=2)
     for(j=4;j<P_LEVELS;j+=2){
- -      memcpy(p->tonecurves[i][j],p->tonecurves[i-1][j],EHMER_MAX*sizeof(doub
le));
+      memcpy(p->tonecurves[i][j],p->tonecurves[i-1][j],EHMER_MAX*sizeof(float)
);
       /*interp_curve(p->tonecurves[i][j],
                    p->tonecurves[i-1][j],
                    p->tonecurves[i+1][j],.5);*/
@@ -303,17 +303,17 @@
   }
 }
 
- -static void compute_decay_fixed(vorbis_look_psy *p,double *f, double 
*decay, int n){
+static void compute_decay_fixed(vorbis_look_psy *p,float *f, float *decay, 
int n){
   /* handle decay */
   int i;
- -  double decscale=fromdB(p->vi->decay_coeff*n); 
- -  double attscale=1./fromdB(p->vi->attack_coeff); 
+  float decscale=fromdB(p->vi->decay_coeff*n); 
+  float attscale=1./fromdB(p->vi->attack_coeff); 
 
   for(i=10;i<n;i++){
- -    double pre=decay[i];
+    float pre=decay[i];
     if(decay[i]){
- -      double val=decay[i]*decscale;
- -      double att=fabs(f[i]/val);
+      float val=decay[i]*decscale;
+      float att=fabs(f[i]/val);
 
       if(att>attscale)
         decay[i]=fabs(f[i]/attscale);
@@ -343,13 +343,13 @@
   88752,96785,105545,115097,
   125515};
 
- -static int seed_curve(double *flr,
- -		      double **curves,
- -		       double amp,double specmax,
- -		       int x,int n,double specatt,
+static int seed_curve(float *flr,
+		      float **curves,
+		       float amp,float specmax,
+		       int x,int n,float specatt,
                        int maxEH){
   int i;
- -  double *curve;
+  float *curve;
 
   /* make this attenuation adjustable */
   int choice=(int)((todB(amp)-specmax+specatt)/10.+.5);
@@ -365,9 +365,9 @@
     if(curve[i]>0.)break;
   
   for(;i>=0;i--){
- -    double lin=curve[i];
+    float lin=curve[i];
     if(lin>0.){
- -      double *fp=flr+((x*_eights[i])>>12);
+      float *fp=flr+((x*_eights[i])>>12);
       lin*=amp;	
       if(*fp<lin)*fp=lin;
     }else break;
@@ -375,10 +375,10 @@
   return(maxEH);
 }
 
- -static void seed_peak(double *flr,
- -		      double *att,
- -		      double amp,double specmax,
- -		      int x,int n,double specatt){
+static void seed_peak(float *flr,
+		      float *att,
+		      float amp,float specmax,
+		      int x,int n,float specatt){
   int prevx=(x*_eights[16])>>12;
 
   /* make this attenuation adjustable */
@@ -387,7 +387,7 @@
   if(choice>=P_LEVELS)choice=P_LEVELS-1;
 
   if(prevx<n){
- -    double lin=att[choice];
+    float lin=att[choice];
     if(lin){
       lin*=amp;	
       if(flr[prevx]<lin)flr[prevx]=lin;
@@ -396,11 +396,11 @@
 }
 
 static void seed_generic(vorbis_look_psy *p,
- -			 double ***curves,
- -			 double *f, 
- -			 double *flr,
- -			 double *seeds,
- -			 double specmax){
+			 float ***curves,
+			 float *f, 
+			 float *flr,
+			 float *seeds,
+			 float specmax){
   vorbis_info_psy *vi=p->vi;
   long n=p->n,i;
   int maxEH=EHMER_MAX-1;
@@ -414,10 +414,10 @@
 }
 
 static void seed_att(vorbis_look_psy *p,
- -		     double **att,
- -		     double *f, 
- -		     double *flr,
- -		     double specmax){
+		     float **att,
+		     float *f, 
+		     float *flr,
+		     float specmax){
   vorbis_info_psy *vi=p->vi;
   long n=p->n,i;
   
@@ -428,17 +428,17 @@
 }
 
 static void seed_point(vorbis_look_psy *p,
- -		     double **att,
- -		     double *f, 
- -		     double *flr,
- -		     double specmax){
+		     float **att,
+		     float *f, 
+		     float *flr,
+		     float specmax){
   vorbis_info_psy *vi=p->vi;
   long n=p->n,i;
   
   for(i=0;i<n;i++){
     /* make this attenuation adjustable */
     int choice=rint((todB(f[i])-specmax+vi->max_curve_dB)/10.+.5);
- -    double lin;
+    float lin;
     if(choice<0)choice=0;
     if(choice>=P_LEVELS)choice=P_LEVELS-1;
     lin=att[p->octave[i]][choice]*f[i];
@@ -447,10 +447,10 @@
 }
 
 /* bleaugh, this is more complicated than it needs to be */
- -static void max_seeds(vorbis_look_psy *p,double *seeds,double *flr){
+static void max_seeds(vorbis_look_psy *p,float *seeds,float *flr){
   long n=p->n,i,j;
   long *posstack=alloca(n*sizeof(long));
- -  double *ampstack=alloca(n*sizeof(double));
+  float *ampstack=alloca(n*sizeof(float));
   long stack=0;
 
   for(i=0;i<n;i++){
@@ -505,17 +505,17 @@
      had in Grad Skool... I didn't solve it at the time ;-) */
 }
 
- -static void bark_noise(long n,double *b,double *f,double *noise){
+static void bark_noise(long n,float *b,float *f,float *noise){
   long i=1,lo=0,hi=2;
- -  double acc=0.,val,del=0.;
+  float acc=0.,val,del=0.;
 
- -  double *norm=alloca(n*sizeof(double));
+  float *norm=alloca(n*sizeof(float));
 
- -  memset(noise,0,n*sizeof(double));
- -  memset(norm,0,n*sizeof(double));
+  memset(noise,0,n*sizeof(float));
+  memset(norm,0,n*sizeof(float));
 
   while(hi<n){
- -    val=todB(f[i]*f[i])+400.;
+    val=todB_nn(f[i]*f[i])+400.;
     del=1./(i-lo);
     noise[lo]+=val*del;
     noise[i]-=val*del;
@@ -540,7 +540,7 @@
     long hii=hi-i;
 
     for(;i<n;i++){
- -      val=todB(f[i]*f[i])+400.;
+      val=todB_nn(f[i]*f[i])+400.;
       del=1./(hii);
       noise[i]-=val*del;
       norm[i]-=del;
@@ -552,7 +552,7 @@
       norm[i]-=del;      
     }
     for(i=1,lo=n-ilo;lo<n;lo++,i++){
- -      val=todB(f[n-i]*f[n-i])+400.;
+      val=todB_nn(f[n-i]*f[n-i])+400.;
       del=1./ilo;
       noise[lo]+=val*del;
       norm[lo]+=del;
@@ -579,27 +579,27 @@
       noise[i]=0.;
       norm[i]=0;
     }else{
- -      double v=acc/val-400;
+      float v=acc/val-400;
       noise[i]=sqrt(fromdB(v));
     }
   }
 }
 
- -void _vp_compute_mask(vorbis_look_psy *p,double *f, 
- -		      double *flr, 
- -		      double *decay){
- -  double *smooth=alloca(sizeof(double)*p->n);
+void _vp_compute_mask(vorbis_look_psy *p,float *f, 
+		      float *flr, 
+		      float *decay){
+  float *smooth=alloca(sizeof(float)*p->n);
   int i,n=p->n;
- -  double specmax=0.;
+  float specmax=0.;
 
- -  double *seed=alloca(sizeof(double)*p->n);
- -  double *seed2=alloca(sizeof(double)*p->n);
+  float *seed=alloca(sizeof(float)*p->n);
+  float *seed2=alloca(sizeof(float)*p->n);
 
- -  memset(flr,0,n*sizeof(double));
+  memset(flr,0,n*sizeof(float));
 
   /* noise masking */
   if(p->vi->noisemaskp){
- -    memset(seed,0,n*sizeof(double));
+    memset(seed,0,n*sizeof(float));
     bark_noise(n,p->bark,f,seed);
     seed_point(p,p->noiseatt,seed,flr,specmax);
 
@@ -611,19 +611,19 @@
     /* compute power^.5 of three neighboring bins to smooth for peaks
        that get split twixt bins/peaks that nail the bin.  This evens
        out treatment as we're not doing additive masking any longer. */
- -    double acc=smooth[0]*smooth[0]+smooth[1]*smooth[1];
- -    double prev=smooth[0];
+    float acc=smooth[0]*smooth[0]+smooth[1]*smooth[1];
+    float prev=smooth[0];
 
     smooth[0]=sqrt(acc);
     for(i=1;i<n-1;i++){
- -      double this=smooth[i];
+      float this=smooth[i];
       acc+=smooth[i+1]*smooth[i+1];
       if(acc<0)acc=0; /* it can happen due to finite precision */
       smooth[i]=sqrt(acc);
       acc-=prev*prev;
       prev=this;
     }
- -	if(acc<0)acc=0; /* in case it happens on the final iteration */
+    if(acc<0)acc=0; /* in case it happens on the final iteration */
     smooth[n-1]=sqrt(acc);
   }
 
@@ -635,27 +635,27 @@
 
   /* set the ATH (floating below specmax by a specified att) */
   if(p->vi->athp){
- -    double att=specmax+p->vi->ath_adjatt;
+    float att=specmax+p->vi->ath_adjatt;
     if(att<p->vi->ath_maxatt)att=p->vi->ath_maxatt;
     att=fromdB(att);
 
     for(i=0;i<n;i++){
- -      double av=p->ath[i]*att;
+      float av=p->ath[i]*att;
       if(av>flr[i])flr[i]=av;
     }
   }
 
   /* peak attenuation ******/
   if(p->vi->peakattp){
- -    memset(seed,0,n*sizeof(double));
+    memset(seed,0,n*sizeof(float));
     seed_att(p,p->peakatt,smooth,seed,specmax);
     max_seeds(p,seed,flr);
   }
 
   /* tone masking */
   if(p->vi->tonemaskp){
- -    memset(seed,0,n*sizeof(double));
- -    memset(seed2,0,n*sizeof(double));
+    memset(seed,0,n*sizeof(float));
+    memset(seed2,0,n*sizeof(float));
 
     seed_generic(p,p->tonecurves,smooth,flr,seed2,specmax);
     max_seeds(p,seed2,seed2);
@@ -677,7 +677,7 @@
      it than to just tack it on */
 
   for(i=0;i<n;i++)if(2.*f[i]>flr[i] || -2.*f[i]>flr[i])break;
- -  if(i==n)memset(flr,0,sizeof(double)*n);
+  if(i==n)memset(flr,0,sizeof(float)*n);
 
 }
 
@@ -685,8 +685,8 @@
 /* this applies the floor and (optionally) tries to preserve noise
    energy in low resolution portions of the spectrum */
 /* f and flr are *linear* scale, not dB */
- -void _vp_apply_floor(vorbis_look_psy *p,double *f, double *flr){
- -  double *work=alloca(p->n*sizeof(double));
+void _vp_apply_floor(vorbis_look_psy *p,float *f, float *flr){
+  float *work=alloca(p->n*sizeof(float));
   int j;
 
   /* subtract the floor */
@@ -697,7 +697,7 @@
       work[j]=f[j]/flr[j];
   }
 
- -  memcpy(f,work,p->n*sizeof(double));
+  memcpy(f,work,p->n*sizeof(float));
 }
 
 

1.15      +10 -10    vorbis/lib/psy.h

Index: psy.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psy.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
- --- psy.h	2000/08/15 09:09:43	1.14
+++ psy.h	2000/10/12 03:12:53	1.15
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: random psychoacoustics (not including preecho)
- - last mod: $Id: psy.h,v 1.14 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: psy.h,v 1.15 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -28,13 +28,13 @@
   int n;
   struct vorbis_info_psy *vi;
 
- -  double ***tonecurves;
- -  double **peakatt;
- -  double **noiseatt;
+  float ***tonecurves;
+  float **peakatt;
+  float **noiseatt;
 
- -  double *ath;
+  float *ath;
   int    *octave;
- -  double *bark;
+  float *bark;
 
 } vorbis_look_psy;
 
@@ -42,10 +42,10 @@
 extern void   _vp_psy_clear(vorbis_look_psy *p);
 extern void  *_vi_psy_dup(void *source);
 extern void   _vi_psy_free(vorbis_info_psy *i);
- -extern void   _vp_compute_mask(vorbis_look_psy *p,double *f, 
- -			       double *floor,
- -			       double *decay);
- -extern void _vp_apply_floor(vorbis_look_psy *p,double *f,double *flr);
+extern void   _vp_compute_mask(vorbis_look_psy *p,float *f, 
+			       float *floor,
+			       float *decay);
+extern void _vp_apply_floor(vorbis_look_psy *p,float *f,float *flr);
 
 #endif
 

1.7       +28 -39    vorbis/lib/psytune.c

Index: psytune.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psytune.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
- --- psytune.c	2000/08/19 11:46:28	1.6
+++ psytune.c	2000/10/12 03:12:53	1.7
@@ -13,7 +13,7 @@
 
  function: simple utility that runs audio through the psychoacoustics
            without encoding
- - last mod: $Id: psytune.c,v 1.6 2000/08/19 11:46:28 xiphmont Exp $
+ last mod: $Id: psytune.c,v 1.7 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -29,6 +29,7 @@
 #include "window.h"
 #include "scales.h"
 #include "lpc.h"
+#include "lsp.h"
 
 static vorbis_info_psy _psy_set0={
   1,/*athp*/
@@ -111,7 +112,7 @@
 };
 
 static int noisy=0;
- -void analysis(char *base,int i,double *v,int n,int bark,int dB){
+void analysis(char *base,int i,float *v,int n,int bark,int dB){
   if(noisy){
     int j;
     FILE *of;
@@ -126,7 +127,7 @@
         if(bark)
           fprintf(of,"%g ",toBARK(22050.*j/n));
         else
- -	  fprintf(of,"%g ",(double)j);
+	  fprintf(of,"%g ",(float)j);
       
         if(dB){
           fprintf(of,"%g\n",todB(fabs(v[j])));
@@ -149,17 +150,12 @@
   lpc_lookup lpclook;
 } vorbis_look_floor0;
 
- -extern double _curve_to_lpc(double *curve,double *lpc,vorbis_look_floor0 *l,
- -			    long frameno);
- -extern void _lsp_to_curve(double *curve,double *lpc,double amp,
- -			  vorbis_look_floor0 *l,char *name,long frameno);
+long granulepos=0;
 
- -long frameno=0;
- -
 /* hacked from floor0.c */
 static void floorinit(vorbis_look_floor0 *look,int n,int m,int ln){
   int j;
- -  double scale;
+  float scale;
   look->m=m;
   look->n=n;
   look->ln=ln;
@@ -177,15 +173,15 @@
 
 int main(int argc,char *argv[]){
   int eos=0;
- -  double nonz=0.;
- -  double acc=0.;
- -  double tot=0.;
+  float nonz=0.;
+  float acc=0.;
+  float tot=0.;
 
   int framesize=2048;
   int order=32;
   int map=256;
 
- -  double *pcm[2],*out[2],*window,*decay[2],*lpc,*floor;
+  float *pcm[2],*out[2],*window,*decay[2],*lpc,*floor;
   signed char *buffer,*buffer2;
   mdct_lookup m_look;
   vorbis_look_psy p_look;
@@ -234,14 +230,14 @@
     argv++;
   }
   
- -  pcm[0]=malloc(framesize*sizeof(double));
- -  pcm[1]=malloc(framesize*sizeof(double));
- -  out[0]=calloc(framesize/2,sizeof(double));
- -  out[1]=calloc(framesize/2,sizeof(double));
- -  decay[0]=calloc(framesize/2,sizeof(double));
- -  decay[1]=calloc(framesize/2,sizeof(double));
- -  floor=malloc(framesize*sizeof(double));
- -  lpc=malloc(order*sizeof(double));
+  pcm[0]=malloc(framesize*sizeof(float));
+  pcm[1]=malloc(framesize*sizeof(float));
+  out[0]=calloc(framesize/2,sizeof(float));
+  out[1]=calloc(framesize/2,sizeof(float));
+  decay[0]=calloc(framesize/2,sizeof(float));
+  decay[1]=calloc(framesize/2,sizeof(float));
+  floor=malloc(framesize*sizeof(float));
+  lpc=malloc(order*sizeof(float));
   buffer=malloc(framesize*4);
   buffer2=buffer+framesize*2;
   window=_vorbis_window(0,framesize,framesize/2,framesize/2);
@@ -280,9 +276,9 @@
       }
       
       for(i=0;i<2;i++){
- -	double amp;
+	float amp;
 
- -	analysis("pre",frameno,pcm[i],framesize,0,0);
+	analysis("pre",granulepos,pcm[i],framesize,0,0);
         
         /* do the psychacoustics */
         for(j=0;j<framesize;j++)
@@ -290,29 +286,22 @@
 
         mdct_forward(&m_look,pcm[i],pcm[i]);
 
- -	analysis("mdct",frameno,pcm[i],framesize/2,1,1);
+	analysis("mdct",granulepos,pcm[i],framesize/2,1,1);
 
         _vp_compute_mask(&p_look,pcm[i],floor,decay[i]);
         
- -	analysis("prefloor",frameno,floor,framesize/2,1,1);
+	analysis("floor",frameno,floor,framesize/2,1,1);
         analysis("decay",frameno,decay[i],framesize/2,1,1);
         
- -	for(j=0;j<framesize/2;j++)floor[j]=todB(floor[j])+150;
- -	amp=_curve_to_lpc(floor,lpc,&floorlook,frameno);
- -	vorbis_lpc_to_lsp(lpc,lpc,order);
- -	_lsp_to_curve(floor,lpc,sqrt(amp),&floorlook,"Ffloor",frameno);
- -	for(j=0;j<framesize/2;j++)floor[j]=fromdB(floor[j]-150);
- -	analysis("floor",frameno,floor,framesize/2,1,1);
- -
         _vp_apply_floor(&p_look,pcm[i],floor);
         /*r(j=0;j<framesize/2;j++)
           if(fabs(pcm[i][j])<1.)pcm[i][j]=0;*/
 
- -	analysis("quant",frameno,pcm[i],framesize/2,1,1);
+	analysis("quant",granulepos,pcm[i],framesize/2,1,1);
 
         /* re-add floor */
         for(j=0;j<framesize/2;j++){
- -	  double val=rint(pcm[i][j]);
+	  float val=rint(pcm[i][j]);
           tot++;
           if(val){
             nonz++;
@@ -323,20 +312,20 @@
           }
         }
         
- -	analysis("final",frameno,pcm[i],framesize/2,1,1);
+	analysis("final",granulepos,pcm[i],framesize/2,1,1);
 
         /* take it back to time */
         mdct_backward(&m_look,pcm[i],pcm[i]);
         for(j=0;j<framesize/2;j++)
           out[i][j]+=pcm[i][j]*window[j];
 
- -	frameno++;
+	granulepos++;
       }
            
       /* write data.  Use the part of buffer we're about to shift out */
       for(i=0;i<2;i++){
- -	char *ptr=buffer+i*2;
- -	double  *mono=out[i];
+	char  *ptr=buffer+i*2;
+	float *mono=out[i];
         for(j=0;j<framesize/2;j++){
           int val=mono[j]*32767.;
           /* might as well guard against clipping */

1.18      +49 -50    vorbis/lib/res0.c

Index: res0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/res0.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
- --- res0.c	2000/08/15 09:09:43	1.17
+++ res0.c	2000/10/12 03:12:53	1.18
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: residue backend 0 implementation
- - last mod: $Id: res0.c,v 1.17 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: res0.c,v 1.18 2000/10/12 03:12:53 xiphmont Exp $
 
  ********************************************************************/
 
@@ -25,8 +25,8 @@
 #include <string.h>
 #include <math.h>
 #include <stdio.h>
+#include <ogg/ogg.h>
 #include "vorbis/codec.h"
- -#include "bitwise.h"
 #include "registry.h"
 #include "bookinternal.h"
 #include "sharedbook.h"
@@ -45,14 +45,14 @@
   int       **decodemap;
 } vorbis_look_residue0;
 
- -void free_info(vorbis_info_residue *i){
+void res0_free_info(vorbis_info_residue *i){
   if(i){
     memset(i,0,sizeof(vorbis_info_residue0));
     free(i);
   }
 }
 
- -void free_look(vorbis_look_residue *i){
+void res0_free_look(vorbis_look_residue *i){
   int j;
   if(i){
     vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;
@@ -67,44 +67,44 @@
   }
 }
 
- -void pack(vorbis_info_residue *vr,oggpack_buffer *opb){
+void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
   vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
   int j,acc=0;
- -  _oggpack_write(opb,info->begin,24);
- -  _oggpack_write(opb,info->end,24);
+  oggpack_write(opb,info->begin,24);
+  oggpack_write(opb,info->end,24);
 
- -  _oggpack_write(opb,info->grouping-1,24);  /* residue vectors to group and 
+  oggpack_write(opb,info->grouping-1,24);  /* residue vectors to group and 
                                              code with a partitioned book */
- -  _oggpack_write(opb,info->partitions-1,6); /* possible partition choices */
- -  _oggpack_write(opb,info->groupbook,8);  /* group huffman book */
+  oggpack_write(opb,info->partitions-1,6); /* possible partition choices */
+  oggpack_write(opb,info->groupbook,8);  /* group huffman book */
   for(j=0;j<info->partitions;j++){
- -    _oggpack_write(opb,info->secondstages[j],4); /* zero *is* a valid 
choice */
+    oggpack_write(opb,info->secondstages[j],4); /* zero *is* a valid choice */
     acc+=info->secondstages[j];
   }
   for(j=0;j<acc;j++)
- -    _oggpack_write(opb,info->booklist[j],8);
+    oggpack_write(opb,info->booklist[j],8);
 
 }
 
 /* vorbis_info is for range checking */
- -vorbis_info_residue *unpack(vorbis_info *vi,oggpack_buffer *opb){
+vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
   int j,acc=0;
   vorbis_info_residue0 *info=calloc(1,sizeof(vorbis_info_residue0));
 
- -  info->begin=_oggpack_read(opb,24);
- -  info->end=_oggpack_read(opb,24);
- -  info->grouping=_oggpack_read(opb,24)+1;
- -  info->partitions=_oggpack_read(opb,6)+1;
- -  info->groupbook=_oggpack_read(opb,8);
+  info->begin=oggpack_read(opb,24);
+  info->end=oggpack_read(opb,24);
+  info->grouping=oggpack_read(opb,24)+1;
+  info->partitions=oggpack_read(opb,6)+1;
+  info->groupbook=oggpack_read(opb,8);
   for(j=0;j<info->partitions;j++){
- -    int cascade=info->secondstages[j]=_oggpack_read(opb,4);
+    int cascade=info->secondstages[j]=oggpack_read(opb,4);
     if(cascade>1)goto errout; /* temporary!  when cascading gets
                                  reworked and actually used, we don't
                                  want old code to DTWT */
     acc+=cascade;
   }
   for(j=0;j<acc;j++)
- -    info->booklist[j]=_oggpack_read(opb,8);
+    info->booklist[j]=oggpack_read(opb,8);
 
   if(info->groupbook>=vi->books)goto errout;
   for(j=0;j<acc;j++)
@@ -112,11 +112,11 @@
 
   return(info);
  errout:
- -  free_info(info);
+  res0_free_info(info);
   return(NULL);
 }
 
- -vorbis_look_residue *look (vorbis_dsp_state *vd,vorbis_info_mode *vm,
+vorbis_look_residue *res0_look (vorbis_dsp_state *vd,vorbis_info_mode *vm,
                           vorbis_info_residue *vr){
   vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
   vorbis_look_residue0 *look=calloc(1,sizeof(vorbis_look_residue0));
@@ -160,13 +160,13 @@
 
 /* does not guard against invalid settings; eg, a subn of 16 and a
    subgroup request of 32.  Max subn of 128 */
- -static int _testhack(double *vec,int n,vorbis_look_residue0 *look,
+static int _testhack(float *vec,int n,vorbis_look_residue0 *look,
                      int auxparts,int auxpartnum){
   vorbis_info_residue0 *info=look->info;
   int i,j=0;
- -  double max,localmax=0.;
- -  double temp[128];
- -  double entropy[8];
+  float max,localmax=0.;
+  float temp[128];
+  float entropy[8];
 
   /* setup */
   for(i=0;i<n;i++)temp[i]=fabs(vec[i]);
@@ -201,7 +201,7 @@
   return(i);
 }
 
- -static int _encodepart(oggpack_buffer *opb,double *vec, int n,
+static int _encodepart(oggpack_buffer *opb,float *vec, int n,
                        int stages, codebook **books,int mode,int part){
   int i,j,bits=0;
 
@@ -227,17 +227,16 @@
   return(bits);
 }
 
- -static int _decodepart(oggpack_buffer *opb,double *work,double *vec, int n,
+static int _decodepart(oggpack_buffer *opb,float *work,float *vec, int n,
                        int stages, codebook **books){
- -  int i,j;
+  int i;
   
- -  memset(work,0,sizeof(double)*n);
- -  for(j=0;j<stages;j++){
- -    int dim=books[j]->dim;
+  memset(work,0,sizeof(float)*n);
+  for(i=0;i<stages;i++){
+    int dim=books[i]->dim;
     int step=n/dim;
- -    for(i=0;i<step;i++)
- -      if(vorbis_book_decodevs(books[j],work+i,opb,step,0)==-1)
- -	return(-1);
+    if(s_vorbis_book_decodevs(books[i],work,opb,step,0)==-1)
+      return(-1);
   }
   
   for(i=0;i<n;i++)
@@ -246,8 +245,8 @@
   return(0);
 }
 
- -int forward(vorbis_block *vb,vorbis_look_residue *vl,
- -	    double **in,int ch){
+int res0_forward(vorbis_block *vb,vorbis_look_residue *vl,
+	    float **in,int ch){
   long i,j,k,l;
   vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
   vorbis_info_residue0 *info=look->info;
@@ -290,7 +289,7 @@
   /* we code the partition words for each channel, then the residual
      words for a partition per channel until we've written all the
      residual words for that partition word.  Then write the next
- -     parition channel words... */
+     partition channel words... */
   
   for(i=info->begin,l=0;i<info->end;){
     /* first we encode a partition codeword for each channel */
@@ -324,7 +323,7 @@
 }
 
 /* a truncated packet here just means 'stop working'; it's not an error */
- -int inverse(vorbis_block *vb,vorbis_look_residue *vl,double **in,int ch){
+int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,float **in,int ch){
   long i,j,k,l,transend=vb->pcmend/2;
   vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
   vorbis_info_residue0 *info=look->info;
@@ -337,12 +336,12 @@
   int partvals=n/samples_per_partition;
   int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
   int **partword=alloca(ch*sizeof(long *));
- -  double *work=alloca(sizeof(double)*samples_per_partition);
+  float *work=alloca(sizeof(float)*samples_per_partition);
   partvals=partwords*partitions_per_word;
 
   /* make sure we're zeroed up to the start */
   for(j=0;j<ch;j++)
- -    memset(in[j],0,sizeof(double)*info->begin);
+    memset(in[j],0,sizeof(float)*info->begin);
 
   for(i=info->begin,l=0;i<info->end;){
     /* fetch the partition word for each channel */
@@ -366,23 +365,23 @@
  eopbreak:
   if(i<transend){
     for(j=0;j<ch;j++)
- -      memset(in[j]+i,0,sizeof(double)*(transend-i));
+      memset(in[j]+i,0,sizeof(float)*(transend-i));
   }
 
   return(0);
 
  errout:
   for(j=0;j<ch;j++)
- -    memset(in[j],0,sizeof(double)*transend);
+    memset(in[j],0,sizeof(float)*transend);
   return(0);
 }
 
 vorbis_func_residue residue0_exportbundle={
- -  &pack,
- -  &unpack,
- -  &look,
- -  &free_info,
- -  &free_look,
- -  &forward,
- -  &inverse
+  &res0_pack,
+  &res0_unpack,
+  &res0_look,
+  &res0_free_info,
+  &res0_free_look,
+  &res0_forward,
+  &res0_inverse
 };

1.6       +3 -2      vorbis/lib/scales.h

Index: scales.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/scales.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
- --- scales.h	2000/06/14 01:38:32	1.5
+++ scales.h	2000/10/12 03:12:54	1.6
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: linear scale -> dB, Bark and Mel scales
- - last mod: $Id: scales.h,v 1.5 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: scales.h,v 1.6 2000/10/12 03:12:54 xiphmont Exp $
 
  ********************************************************************/
 
@@ -23,7 +23,8 @@
 
 /* 20log10(x) */
 #define DYNAMIC_RANGE_dB 200.
- -#define todB(x)   ((x)==0?-9.e40:log(fabs(x))*8.6858896)
+#define todB(x)   ((x)==0?-9.e38:log(fabs(x))*8.6858896)
+#define todB_nn(x)   ((x)==0?-9.e38:log(x)*8.6858896)
 #define fromdB(x) (exp((x)*.11512925))
 
 

1.9       +58 -39    vorbis/lib/sharedbook.c

Index: sharedbook.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/sharedbook.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
- --- sharedbook.c	2000/08/31 08:01:34	1.8
+++ sharedbook.c	2000/10/12 03:12:54	1.9
@@ -12,17 +12,17 @@
  ********************************************************************
 
  function: basic shared codebook operations
- - last mod: $Id: sharedbook.c,v 1.8 2000/08/31 08:01:34 xiphmont Exp $
+ last mod: $Id: sharedbook.c,v 1.9 2000/10/12 03:12:54 xiphmont Exp $
 
  ********************************************************************/
 
 #include <stdlib.h>
 #include <math.h>
 #include <string.h>
+#include <ogg/ogg.h>
 #include "os.h"
 #include "vorbis/codec.h"
 #include "vorbis/codebook.h"
- -#include "bitwise.h"
 #include "scales.h"
 #include "sharedbook.h"
 
@@ -45,7 +45,7 @@
 #define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. */
 
 /* doesn't currently guard under/overflow */
- -long _float32_pack(double val){
+long _float32_pack(float val){
   int sign=0;
   long exp;
   long mant;
@@ -60,10 +60,10 @@
   return(sign|exp|mant);
 }
 
- -double _float32_unpack(long val){
- -  double mant=val&0x1fffff;
- -  double sign=val&0x80000000;
- -  double exp =(val&0x7fe00000)>>VQ_FMAN;
+float _float32_unpack(long val){
+  float mant=val&0x1fffff;
+  float sign=val&0x80000000;
+  float exp =(val&0x7fe00000)>>VQ_FMAN;
   if(sign)mant= -mant;
   return(ldexp(mant,exp-(VQ_FMAN-1)-VQ_FEXP_BIAS));
 }
@@ -142,7 +142,7 @@
 /* build the decode helper tree from the codewords */
 decode_aux *_make_decode_tree(codebook *c){
   const static_codebook *s=c->c;
- -  long top=0,i,j;
+  long top=0,i,j,n;
   decode_aux *t=malloc(sizeof(decode_aux));
   long *ptr0=t->ptr0=calloc(c->entries*2,sizeof(long));
   long *ptr1=t->ptr1=calloc(c->entries*2,sizeof(long));
@@ -173,6 +173,25 @@
     }
   }
   free(codelist);
+
+  t->tabn = _ilog(c->entries)-4; /* this is magic */
+  if(t->tabn<5)t->tabn=5;
+  n = 1<<t->tabn;
+  t->tab = malloc(n*sizeof(long));
+  t->tabl = malloc(n*sizeof(int));
+  for (i = 0; i < n; i++) {
+    long p = 0;
+    for (j = 0; j < t->tabn && (p > 0 || j == 0); j++) {
+      if (i & (1 << j))
+	p = ptr1[p];
+      else
+	p = ptr0[p];
+    }
+    /* now j == length, and p == -code */
+    t->tab[i] = p;
+    t->tabl[i] = j;
+  }
+
   return(t);
 }
 
@@ -212,13 +231,13 @@
    generated algorithmically (each column of the vector counts through
    the values in the quant vector). in map type 2, all the values came
    in in an explicit list.  Both value lists must be unpacked */
- -double *_book_unquantize(const static_codebook *b){
+float *_book_unquantize(const static_codebook *b){
   long j,k;
   if(b->maptype==1 || b->maptype==2){
     int quantvals;
- -    double mindel=_float32_unpack(b->q_min);
- -    double delta=_float32_unpack(b->q_delta);
- -    double *r=calloc(b->entries*b->dim,sizeof(double));
+    float mindel=_float32_unpack(b->q_min);
+    float delta=_float32_unpack(b->q_delta);
+    float *r=calloc(b->entries*b->dim,sizeof(float));
 
     /* maptype 1 and 2 both use a quantized value vector, but
        different sizes */
@@ -233,11 +252,11 @@
          that */
       quantvals=_book_maptype1_quantvals(b);
       for(j=0;j<b->entries;j++){
- -	double last=0.;
+	float last=0.;
         int indexdiv=1;
         for(k=0;k<b->dim;k++){
           int index= (j/indexdiv)%quantvals;
- -	  double val=b->quantlist[index];
+	  float val=b->quantlist[index];
           val=fabs(val)*delta+mindel+last;
           if(b->q_sequencep)last=val;	  
           r[j*b->dim+k]=val;
@@ -247,9 +266,9 @@
       break;
     case 2:
       for(j=0;j<b->entries;j++){
- -	double last=0.;
+	float last=0.;
         for(k=0;k<b->dim;k++){
- -	  double val=b->quantlist[j*b->dim+k];
+	  float val=b->quantlist[j*b->dim+k];
           val=fabs(val)*delta+mindel+last;
           if(b->q_sequencep)last=val;	  
           r[j*b->dim+k]=val;
@@ -319,25 +338,25 @@
   return(-1);
 }
 
- -static double _dist(int el,double *ref, double *b,int step){
+static float _dist(int el,float *ref, float *b,int step){
   int i;
- -  double acc=0.;
+  float acc=0.;
   for(i=0;i<el;i++){
- -    double val=(ref[i]-b[i*step]);
+    float val=(ref[i]-b[i*step]);
     acc+=val*val;
   }
   return(acc);
 }
 
 #include <stdio.h>
- -int _best(codebook *book, double *a, int step){
+int _best(codebook *book, float *a, int step){
   encode_aux_nearestmatch *nt=book->c->nearest_tree;
   encode_aux_threshmatch *tt=book->c->thresh_tree;
   encode_aux_pigeonhole *pt=book->c->pigeon_tree;
   int dim=book->dim;
   int ptr=0,k,o;
   /*int savebest=-1;
- -    double saverr;*/
+    float saverr;*/
 
   /* do we have a threshhold encode hint? */
   if(tt){
@@ -364,14 +383,14 @@
   if(pt){
     const static_codebook *c=book->c;
     int i,besti=-1;
- -    double best;
+    float best;
     int entry=0;
 
     /* dealing with sequentialness is a pain in the ass */
     if(c->q_sequencep){
       int pv;
       long mul=1;
- -      double qlast=0;
+      float qlast=0;
       for(k=0,o=0;k<dim;k++,o+=step){
         pv=(int)((a[o]-qlast-pt->min)/pt->del);
         if(pv<0 || pv>=pt->mapentries)break;
@@ -393,7 +412,7 @@
       /* search the abbreviated list */
       long *list=pt->fitlist+pt->fitmap[entry];
       for(i=0;i<pt->fitlength[entry];i++){
- -	double this=_dist(dim,book->valuelist+list[i]*dim,a,step);
+	float this=_dist(dim,book->valuelist+list[i]*dim,a,step);
         if(besti==-1 || this<best){
           best=this;
           besti=list[i];
@@ -407,9 +426,9 @@
   if(nt){
     /* optimized using the decision tree */
     while(1){
- -      double c=0.;
- -      double *p=book->valuelist+nt->p[ptr];
- -      double *q=book->valuelist+nt->q[ptr];
+      float c=0.;
+      float *p=book->valuelist+nt->p[ptr];
+      float *q=book->valuelist+nt->q[ptr];
       
       for(k=0,o=0;k<dim;k++,o+=step)
         c+=(p[k]-q[k])*(a[o]-(p[k]+q[k])*.5);
@@ -427,11 +446,11 @@
   {
     const static_codebook *c=book->c;
     int i,besti=-1;
- -    double best;
- -    double *e=book->valuelist;
+    float best;
+    float *e=book->valuelist;
     for(i=0;i<book->entries;i++){
       if(c->lengthlist[i]>0){
- -	double this=_dist(dim,e,a,step);
+	float this=_dist(dim,e,a,step);
         if(besti==-1 || this<best){
           best=this;
           besti=i;
@@ -459,7 +478,7 @@
 }
 
 /* returns the entry number and *modifies a* to the remainder value ********/
- -int vorbis_book_besterror(codebook *book,double *a,int step,int addmul){
+int vorbis_book_besterror(codebook *book,float *a,int step,int addmul){
   int dim=book->dim,i,o;
   int best=_best(book,a,step);
   switch(addmul){
@@ -469,7 +488,7 @@
     break;
   case 1:
     for(i=0,o=0;i<dim;i++,o+=step){
- -      double val=(book->valuelist+best*dim)[i];
+      float val=(book->valuelist+best*dim)[i];
       if(val==0){
         a[o]=0;
       }else{
@@ -519,7 +538,7 @@
   NULL,
   NULL,NULL
 };
- -static double *test1_result=NULL;
+static float *test1_result=NULL;
   
 /* linear, full mapping, nonsequential */
 static_codebook test2={
@@ -530,7 +549,7 @@
   full_quantlist1,
   NULL,NULL
 };
- -static double test2_result[]={-3,-2,-1,0, 1,2,3,4, 5,0,3,-2};
+static float test2_result[]={-3,-2,-1,0, 1,2,3,4, 5,0,3,-2};
 
 /* linear, full mapping, sequential */
 static_codebook test3={
@@ -541,7 +560,7 @@
   full_quantlist1,
   NULL,NULL
 };
- -static double test3_result[]={-3,-5,-6,-6, 1,3,6,10, 5,5,8,6};
+static float test3_result[]={-3,-5,-6,-6, 1,3,6,10, 5,5,8,6};
 
 /* linear, algorithmic mapping, nonsequential */
 static_codebook test4={
@@ -552,7 +571,7 @@
   partial_quantlist1,
   NULL,NULL
 };
- -static double test4_result[]={-3,-3,-3, 4,-3,-3, -1,-3,-3,
+static float test4_result[]={-3,-3,-3, 4,-3,-3, -1,-3,-3,
                               -3, 4,-3, 4, 4,-3, -1, 4,-3,
                               -3,-1,-3, 4,-1,-3, -1,-1,-3, 
                               -3,-3, 4, 4,-3, 4, -1,-3, 4,
@@ -571,7 +590,7 @@
   partial_quantlist1,
   NULL,NULL
 };
- -static double test5_result[]={-3,-6,-9, 4, 1,-2, -1,-4,-7,
+static float test5_result[]={-3,-6,-9, 4, 1,-2, -1,-4,-7,
                               -3, 1,-2, 4, 8, 5, -1, 3, 0,
                               -3,-4,-7, 4, 3, 0, -1,-2,-5, 
                               -3,-6,-2, 4, 1, 5, -1,-4, 0,
@@ -581,8 +600,8 @@
                               -3, 1, 0, 4, 8, 7, -1, 3, 2,
                               -3,-4,-5, 4, 3, 2, -1,-2,-3};
 
- -void run_test(static_codebook *b,double *comp){
- -  double *out=_book_unquantize(b);
+void run_test(static_codebook *b,float *comp){
+  float *out=_book_unquantize(b);
   int i;
 
   if(comp){

1.3       +7 -7      vorbis/lib/sharedbook.h

Index: sharedbook.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/sharedbook.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- sharedbook.h	2000/05/08 20:49:50	1.2
+++ sharedbook.h	2000/10/12 03:12:54	1.3
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: basic shared codebook operations
- - last mod: $Id: sharedbook.h,v 1.2 2000/05/08 20:49:50 xiphmont Exp $
+ last mod: $Id: sharedbook.h,v 1.3 2000/10/12 03:12:54 xiphmont Exp $
 
  ********************************************************************/
 
@@ -26,15 +26,15 @@
 extern int vorbis_book_init_decode(codebook *dest,const static_codebook 
*source);
 extern void vorbis_book_clear(codebook *b);
 
- -extern double *_book_unquantize(const static_codebook *b);
- -extern double *_book_logdist(const static_codebook *b,double *vals);
- -extern double _float32_unpack(long val);
- -extern long   _float32_pack(double val);
- -extern int  _best(codebook *book, double *a, int step);
+extern float *_book_unquantize(const static_codebook *b);
+extern float *_book_logdist(const static_codebook *b,float *vals);
+extern float _float32_unpack(long val);
+extern long   _float32_pack(float val);
+extern int  _best(codebook *book, float *a, int step);
 extern int _ilog(unsigned int v);
 extern long _book_maptype1_quantvals(const static_codebook *b);
 
- -extern int vorbis_book_besterror(codebook *book,double *a,int step,int 
addmul);
+extern int vorbis_book_besterror(codebook *book,float *a,int step,int addmul);
 extern long vorbis_book_codeword(codebook *book,int entry);
 extern long vorbis_book_codelen(codebook *book,int entry);
 

1.9       +40 -40    vorbis/lib/smallft.c

Index: smallft.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/smallft.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
- --- smallft.c	2000/03/10 13:21:18	1.8
+++ smallft.c	2000/10/12 03:12:54	1.9
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: *unnormalized* fft transform
- - last mod: $Id: smallft.c,v 1.8 2000/03/10 13:21:18 xiphmont Exp $
+ last mod: $Id: smallft.c,v 1.9 2000/10/12 03:12:54 xiphmont Exp $
 
 ********************************************************************/
 
@@ -35,10 +35,10 @@
 #include "smallft.h"
 #include "misc.h"
 
- -static void drfti1(int n, double *wa, int *ifac){
+static void drfti1(int n, float *wa, int *ifac){
   static int ntryh[4] = { 4,2,3,5 };
- -  static double tpi = 6.28318530717958647692528676655900577;
- -  double arg,argh,argld,fi;
+  static float tpi = 6.28318530717958647692528676655900577;
+  float arg,argh,argld,fi;
   int ntry=0,i,j=-1;
   int k1, l1, l2, ib;
   int ld, ii, ip, is, nq, nr;
@@ -91,7 +91,7 @@
     for (j=0;j<ipm;j++){
       ld+=l1;
       i=is;
- -      argld=(double)ld*argh;
+      argld=(float)ld*argh;
       fi=0.;
       for (ii=2;ii<ido;ii+=2){
         fi+=1.;
@@ -105,15 +105,15 @@
   }
 }
 
- -static void fdrffti(int n, double *wsave, int *ifac){
+static void fdrffti(int n, float *wsave, int *ifac){
 
   if (n == 1) return;
   drfti1(n, wsave+n, ifac);
 }
 
- -static void dradf2(int ido,int l1,double *cc,double *ch,double *wa1){
+static void dradf2(int ido,int l1,float *cc,float *ch,float *wa1){
   int i,k;
- -  double ti2,tr2;
+  float ti2,tr2;
   int t0,t1,t2,t3,t4,t5,t6;
 
   t1=0;
@@ -166,11 +166,11 @@
   }
 }
 
- -static void dradf4(int ido,int l1,double *cc,double *ch,double *wa1,
- -	    double *wa2,double *wa3){
- -  static double hsqt2 = .70710678118654752440084436210485;
+static void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
+	    float *wa2,float *wa3){
+  static float hsqt2 = .70710678118654752440084436210485;
   int i,k,t0,t1,t2,t3,t4,t5,t6;
- -  double ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
+  float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
   t0=l1*ido;
   
   t1=t0;
@@ -268,18 +268,18 @@
   }
 }
 
- -static void dradfg(int ido,int ip,int l1,int idl1,double *cc,double *c1,
- -                          double *c2,double *ch,double *ch2,double *wa){
+static void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+                          float *c2,float *ch,float *ch2,float *wa){
 
- -  static double tpi=6.28318530717958647692528676655900577;
+  static float tpi=6.28318530717958647692528676655900577;
   int idij,ipph,i,j,k,l,ic,ik,is;
   int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
- -  double dc2,ai1,ai2,ar1,ar2,ds2;
+  float dc2,ai1,ai2,ar1,ar2,ds2;
   int nbd;
- -  double dcp,arg,dsp,ar1h,ar2h;
+  float dcp,arg,dsp,ar1h,ar2h;
   int idp2,ipp2;
   
- -  arg=tpi/(double)ip;
+  arg=tpi/(float)ip;
   dcp=cos(arg);
   dsp=sin(arg);
   ipph=(ip+1)>>1;
@@ -570,7 +570,7 @@
   }
 }
 
- -static void drftf1(int n,double *c,double *ch,double *wa,int *ifac){
+static void drftf1(int n,float *c,float *ch,float *wa,int *ifac){
   int i,k1,l1,l2;
   int na,kh,nf;
   int ip,iw,ido,idl1,ix2,ix3;
@@ -631,9 +631,9 @@
   for(i=0;i<n;i++)c[i]=ch[i];
 }
 
- -static void dradb2(int ido,int l1,double *cc,double *ch,double *wa1){
+static void dradb2(int ido,int l1,float *cc,float *ch,float *wa1){
   int i,k,t0,t1,t2,t3,t4,t5,t6;
- -  double ti2,tr2;
+  float ti2,tr2;
 
   t0=l1*ido;
   
@@ -683,12 +683,12 @@
   }
 }
 
- -static void dradb3(int ido,int l1,double *cc,double *ch,double *wa1,
- -                          double *wa2){
- -  static double taur = -.5;
- -  static double taui = .86602540378443864676372317075293618;
+static void dradb3(int ido,int l1,float *cc,float *ch,float *wa1,
+                          float *wa2){
+  static float taur = -.5;
+  static float taui = .86602540378443864676372317075293618;
   int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
- -  double ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2;
+  float ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2;
   t0=l1*ido;
 
   t1=0;
@@ -746,11 +746,11 @@
   }
 }
 
- -static void dradb4(int ido,int l1,double *cc,double *ch,double *wa1,
- -			  double *wa2,double *wa3){
- -  static double sqrt2=1.4142135623730950488016887242097;
+static void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
+			  float *wa2,float *wa3){
+  static float sqrt2=1.4142135623730950488016887242097;
   int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8;
- -  double ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
+  float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
   t0=l1*ido;
   
   t1=0;
@@ -837,19 +837,19 @@
   }
 }
 
- -static void dradbg(int ido,int ip,int l1,int idl1,double *cc,double *c1,
- -            double *c2,double *ch,double *ch2,double *wa){
- -  static double tpi=6.28318530717958647692528676655900577;
+static void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+            float *c2,float *ch,float *ch2,float *wa){
+  static float tpi=6.28318530717958647692528676655900577;
   int idij,ipph,i,j,k,l,ik,is,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,
       t11,t12;
- -  double dc2,ai1,ai2,ar1,ar2,ds2;
+  float dc2,ai1,ai2,ar1,ar2,ds2;
   int nbd;
- -  double dcp,arg,dsp,ar1h,ar2h;
+  float dcp,arg,dsp,ar1h,ar2h;
   int ipp2;
 
   t10=ip*ido;
   t0=l1*ido;
- -  arg=tpi/(double)ip;
+  arg=tpi/(float)ip;
   dcp=cos(arg);
   dsp=sin(arg);
   nbd=(ido-1)>>1;
@@ -1151,7 +1151,7 @@
   }
 }
 
- -static void drftb1(int n, double *c, double *ch, double *wa, int *ifac){
+static void drftb1(int n, float *c, float *ch, float *wa, int *ifac){
   int i,k1,l1,l2;
   int na;
   int nf,ip,iw,ix2,ix3,ido,idl1;
@@ -1229,19 +1229,19 @@
   for(i=0;i<n;i++)c[i]=ch[i];
 }
 
- -void drft_forward(drft_lookup *l,double *data){
+void drft_forward(drft_lookup *l,float *data){
   if(l->n==1)return;
   drftf1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache);
 }
 
- -void drft_backward(drft_lookup *l,double *data){
+void drft_backward(drft_lookup *l,float *data){
   if (l->n==1)return;
   drftb1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache);
 }
 
 void drft_init(drft_lookup *l,int n){
   l->n=n;
- -  l->trigcache=calloc(3*n,sizeof(double));
+  l->trigcache=calloc(3*n,sizeof(float));
   l->splitcache=calloc(32,sizeof(int));
   fdrffti(n, l->trigcache, l->splitcache);
 }

1.7       +4 -4      vorbis/lib/smallft.h

Index: smallft.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/smallft.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
- --- smallft.h	2000/01/22 13:28:32	1.6
+++ smallft.h	2000/10/12 03:12:54	1.7
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: fft transform
- - last mod: $Id: smallft.h,v 1.6 2000/01/22 13:28:32 xiphmont Exp $
+ last mod: $Id: smallft.h,v 1.7 2000/10/12 03:12:54 xiphmont Exp $
 
 ********************************************************************/
 
@@ -23,12 +23,12 @@
 
 typedef struct {
   int n;
- -  double *trigcache;
+  float *trigcache;
   int *splitcache;
 } drft_lookup;
 
- -extern void drft_forward(drft_lookup *l,double *data);
- -extern void drft_backward(drft_lookup *l,double *data);
+extern void drft_forward(drft_lookup *l,float *data);
+extern void drft_backward(drft_lookup *l,float *data);
 extern void drft_init(drft_lookup *l,int n);
 extern void drft_clear(drft_lookup *l);
 

1.18      +10 -10    vorbis/lib/synthesis.c

Index: synthesis.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/synthesis.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
- --- synthesis.c	2000/07/07 00:53:10	1.17
+++ synthesis.c	2000/10/12 03:12:54	1.18
@@ -12,14 +12,14 @@
  ********************************************************************
 
  function: single-block PCM synthesis
- - last mod: $Id: synthesis.c,v 1.17 2000/07/07 00:53:10 xiphmont Exp $
+ last mod: $Id: synthesis.c,v 1.18 2000/10/12 03:12:54 xiphmont Exp $
 
  ********************************************************************/
 
 #include <stdio.h>
+#include <ogg/ogg.h>
 #include "vorbis/codec.h"
 #include "registry.h"
- -#include "bitwise.h"
 #include "misc.h"
 #include "os.h"
 
@@ -31,23 +31,23 @@
  
   /* first things first.  Make sure decode is ready */
   _vorbis_block_ripcord(vb);
- -  _oggpack_readinit(opb,op->packet,op->bytes);
+  oggpack_readinit(opb,op->packet,op->bytes);
 
   /* Check the packet type */
- -  if(_oggpack_read(opb,1)!=0){
+  if(oggpack_read(opb,1)!=0){
     /* Oops.  This is not an audio data packet */
     return(-1);
   }
 
   /* read our mode and pre/post windowsize */
- -  mode=_oggpack_read(opb,vd->modebits);
+  mode=oggpack_read(opb,vd->modebits);
   if(mode==-1)return(-1);
   
   vb->mode=mode;
   vb->W=vi->mode_param[mode]->blockflag;
   if(vb->W){
- -    vb->lW=_oggpack_read(opb,1);
- -    vb->nW=_oggpack_read(opb,1);
+    vb->lW=oggpack_read(opb,1);
+    vb->nW=oggpack_read(opb,1);
     if(vb->nW==-1)   return(-1);
   }else{
     vb->lW=0;
@@ -55,15 +55,15 @@
   }
   
   /* more setup */
- -  vb->frameno=op->frameno;
+  vb->granulepos=op->granulepos;
   vb->sequence=op->packetno-3; /* first block is third packet */
   vb->eofflag=op->e_o_s;
 
   /* alloc pcm passback storage */
   vb->pcmend=vi->blocksizes[vb->W];
- -  vb->pcm=_vorbis_block_alloc(vb,sizeof(double *)*vi->channels);
+  vb->pcm=_vorbis_block_alloc(vb,sizeof(float *)*vi->channels);
   for(i=0;i<vi->channels;i++)
- -    vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(double));
+    vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(float));
 
   /* unpack_header enforces range checking */
   type=vi->map_type[vi->mode_param[mode]->mapping];

1.6       +12 -11    vorbis/lib/time0.c

Index: time0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/time0.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
- --- time0.c	2000/03/10 13:21:18	1.5
+++ time0.c	2000/10/12 03:12:54	1.6
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: time backend 0 (dummy)
- - last mod: $Id: time0.c,v 1.5 2000/03/10 13:21:18 xiphmont Exp $
+ last mod: $Id: time0.c,v 1.6 2000/10/12 03:12:54 xiphmont Exp $
 
  ********************************************************************/
 
@@ -22,30 +22,31 @@
 #include "registry.h"
 #include "misc.h"
 
- -static void pack (vorbis_info_time *i,oggpack_buffer *opb){
+static void time0_pack (vorbis_info_time *i,oggpack_buffer *opb){
 }
- -static vorbis_info_time *unpack (vorbis_info *vi,oggpack_buffer *opb){
+static vorbis_info_time *time0_unpack (vorbis_info *vi,oggpack_buffer *opb){
   return "";
 
 }
- -static vorbis_look_time *look (vorbis_dsp_state *vd,vorbis_info_mode *mi,
+static vorbis_look_time *time0_look (vorbis_dsp_state *vd,vorbis_info_mode 
*mi,
                               vorbis_info_time *i){
   return "";
 }
- -static void free_info(vorbis_info_time *i){
+static void time0_free_info(vorbis_info_time *i){
 }
- -static void free_look(vorbis_look_time *i){
+static void time0_free_look(vorbis_look_time *i){
 }
- -static int forward(vorbis_block *vb,vorbis_look_time *i,
- -		    double *in,double *out){
+static int time0_forward(vorbis_block *vb,vorbis_look_time *i,
+		    float *in,float *out){
   return(0);
 }
- -static int inverse(vorbis_block *vb,vorbis_look_time *i,
- -		    double *in,double *out){
+static int time0_inverse(vorbis_block *vb,vorbis_look_time *i,
+		    float *in,float *out){
   return(0);
 }
 
 /* export hooks */
 vorbis_func_time time0_exportbundle={
- -  &pack,&unpack,&look,&free_info,&free_look,&forward,&inverse
+  &time0_pack,&time0_unpack,&time0_look,&time0_free_info,
+  &time0_free_look,&time0_forward,&time0_inverse
 };

1.29      +42 -35    vorbis/lib/vorbisfile.c

Index: vorbisfile.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisfile.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
- --- vorbisfile.c	2000/08/30 06:09:21	1.28
+++ vorbisfile.c	2000/10/12 03:12:54	1.29
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: stdio-based convenience library for opening/seeking/decoding
- - last mod: $Id: vorbisfile.c,v 1.28 2000/08/30 06:09:21 xiphmont Exp $
+ last mod: $Id: vorbisfile.c,v 1.29 2000/10/12 03:12:54 xiphmont Exp $
 
  ********************************************************************/
 
@@ -202,19 +202,22 @@
 /* uses the local ogg_stream storage in vf; this is important for
    non-streaming input sources */
 static int _fetch_headers(OggVorbis_File *vf,vorbis_info *vi,vorbis_comment 
*vc,
- -			  long *serialno){
+			  long *serialno,ogg_page *og_ptr){
   ogg_page og;
   ogg_packet op;
   int i,ret;
- -
- -  ret=_get_next_page(vf,&og,CHUNKSIZE);
- -  if(ret==-1){
- -    fprintf(stderr,"Did not find initial header for bitstream.\n");
- -    return -1;
- -  }
   
- -  if(serialno)*serialno=ogg_page_serialno(&og);
- -  ogg_stream_init(&vf->os,ogg_page_serialno(&og));
+  if(!og_ptr){
+    ret=_get_next_page(vf,&og,CHUNKSIZE);
+    if(ret==-1){
+      fprintf(stderr,"Did not find initial header for bitstream.\n");
+      return -1;
+    }
+    og_ptr=&og;
+  }
+
+  if(serialno)*serialno=ogg_page_serialno(og_ptr);
+  ogg_stream_init(&vf->os,ogg_page_serialno(og_ptr));
   
   /* extract the initial header from the first page and verify that the
      Ogg bitstream is in fact Vorbis data */
@@ -224,7 +227,7 @@
   
   i=0;
   while(i<3){
- -    ogg_stream_pagein(&vf->os,&og);
+    ogg_stream_pagein(&vf->os,og_ptr);
     while(i<3){
       int result=ogg_stream_packetout(&vf->os,&op);
       if(result==0)break;
@@ -239,7 +242,7 @@
       i++;
     }
     if(i<3)
- -      if(_get_next_page(vf,&og,1)<0){
+      if(_get_next_page(vf,og_ptr,1)<0){
         fprintf(stderr,"Missing header in logical bitstream.\n");
         goto bail_header;
       }
@@ -281,7 +284,7 @@
       /* seek to the location of the initial header */
 
       _seek_helper(vf,vf->offsets[i]);
- -      if(_fetch_headers(vf,vf->vi+i,vf->vc+i,NULL)==-1){
+      if(_fetch_headers(vf,vf->vi+i,vf->vc+i,NULL,NULL)==-1){
         fprintf(stderr,"Error opening logical bitstream #%d.\n\n",i+1);
             vf->dataoffsets[i]=-1;
       }else{
@@ -306,9 +309,9 @@
           vorbis_comment_clear(vf->vc+i);
           break;
         }
- -	if(ogg_page_frameno(&og)!=-1){
+	if(ogg_page_granulepos(&og)!=-1){
           vf->serialnos[i]=ogg_page_serialno(&og);
- -	  vf->pcmlengths[i]=ogg_page_frameno(&og);
+	  vf->pcmlengths[i]=ogg_page_granulepos(&og);
           break;
         }
       }
@@ -318,7 +321,11 @@
 
 static int _make_decode_ready(OggVorbis_File *vf){
   if(vf->decode_ready)exit(1);
- -  vorbis_synthesis_init(&vf->vd,vf->vi);
+  if(vf->seekable){
+    vorbis_synthesis_init(&vf->vd,vf->vi+vf->current_link);
+  }else{
+    vorbis_synthesis_init(&vf->vd,vf->vi);
+  }    
   vorbis_block_init(&vf->vd,&vf->vb);
   vf->decode_ready=1;
   return(0);
@@ -333,7 +340,7 @@
   ogg_page og;
   
   /* is this even vorbis...? */
- -  ret=_fetch_headers(vf,&initial_i,&initial_c,&serialno);
+  ret=_fetch_headers(vf,&initial_i,&initial_c,&serialno,NULL);
   dataoffset=vf->offset;
   ogg_stream_clear(&vf->os);
   if(ret==-1)return(-1);
@@ -373,7 +380,7 @@
   vf->vc=calloc(vf->links,sizeof(vorbis_info));
 
   /* Try to fetch the headers, maintaining all the storage */
- -  if(_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno)==-1)return(-1);
+  if(_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno,NULL)==-1)return(-1
);
   _make_decode_ready(vf);
 
   return 0;
@@ -413,14 +420,14 @@
     if(vf->decode_ready){
       ogg_packet op;
       int result=ogg_stream_packetout(&vf->os,&op);
- -      ogg_int64_t frameno;
+      ogg_int64_t granulepos;
       
       /* if(result==-1)return(-1); hole in the data. For now, swallow
                                    and go. We'll need to add a real
                                    error code in a bit. */
       if(result>0){
         /* got a packet.  process it */
- -	frameno=op.frameno;
+	granulepos=op.granulepos;
         if(!vorbis_synthesis(&vf->vb,&op)){ /* lazy check for lazy
                                                header handling.  The
                                                header packets aren't
@@ -438,7 +445,7 @@
           }
           
           /* update the pcm offset. */
- -	  if(frameno!=-1 && !op.e_o_s){
+	  if(granulepos!=-1 && !op.e_o_s){
             int link=(vf->seekable?vf->current_link:0);
             int i,samples;
             
@@ -449,18 +456,18 @@
 
                As an aside, this trick is inaccurate if we begin
                reading anew right at the last page; the end-of-stream
- -	       frameno declares the last frame in the stream, and the
+	       granulepos declares the last frame in the stream, and the
                last packet of the last page may be a partial frame.
- -	       So, we need a previous frameno from an in-sequence page
+	       So, we need a previous granulepos from an in-sequence page
                to have a reference point.  Thus the !op.e_o_s clause
                above */
             
             samples=vorbis_synthesis_pcmout(&vf->vd,NULL);
             
- -	    frameno-=samples;
+	    granulepos-=samples;
             for(i=0;i<link;i++)
- -	      frameno+=vf->pcmlengths[i];
- -	    vf->pcm_offset=frameno;
+	      granulepos+=vf->pcmlengths[i];
+	    vf->pcm_offset=granulepos;
           }
           return(1);
         }
@@ -515,7 +522,7 @@
         /* we're streaming */
         /* fetch the three header packets, build the info struct */
         
- -	_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno);
+	_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno,&og);
         vf->current_link++;
         link=0;
       }
@@ -766,7 +773,7 @@
   /* we need to make sure the pcm_offset is set.  We use the
      _fetch_packet helper to process one packet with readp set, then
      call it until it returns '0' with readp not set (the last packet
- -     from a page has the 'frameno' field set, and that's how the
+     from a page has the 'granulepos' field set, and that's how the
      helper updates the offset */
 
   switch(_process_packet(vf,1)){
@@ -851,9 +858,9 @@
       if(ret==-1){
         end=bisect;
       }else{
- -	ogg_int64_t frameno=ogg_page_frameno(&og);
- -	if(frameno<target){
- -	  best=ret;  /* raw offset of packet with frameno */ 
+	ogg_int64_t granulepos=ogg_page_granulepos(&og);
+	if(granulepos<target){
+	  best=ret;  /* raw offset of packet with granulepos */ 
           begin=vf->offset; /* raw offset of next packet */
         }else{
           end=bisect;
@@ -873,7 +880,7 @@
   /* discard samples until we reach the desired position. Crossing a
      logical bitstream boundary with abandon is OK. */
   while(vf->pcm_offset<pos){
- -    double **pcm;
+    float **pcm;
     long target=pos-vf->pcm_offset;
     long samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);
 
@@ -1056,7 +1063,7 @@
 
   while(1){
     if(vf->decode_ready){
- -      double **pcm;
+      float **pcm;
       long samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);
       if(samples){
         /* yay! proceed to pack data into the byte buffer */
@@ -1083,7 +1090,7 @@
             if(host_endian==bigendianp){
               if(sgned){
                 for(i=0;i<channels;i++) { /* It's faster in this order */
- -		  double *src=pcm[i];
+		  float *src=pcm[i];
                   short *dest=((short *)buffer)+i;
                   for(j=0;j<samples;j++) {
                     val=(int)(src[j]*32768. + 0.5);
@@ -1095,7 +1102,7 @@
                 }
               }else{
                 for(i=0;i<channels;i++) {
- -		  double *src=pcm[i];
+		  float *src=pcm[i];
                   short *dest=((short *)buffer)+i;
                   for(j=0;j<samples;j++) {
                     val=(int)(src[j]*32768. + 0.5);

1.8       +5 -5      vorbis/lib/window.c

Index: window.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/window.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
- --- window.c	2000/03/10 13:21:18	1.7
+++ window.c	2000/10/12 03:12:54	1.8
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: window functions
- - last mod: $Id: window.c,v 1.7 2000/03/10 13:21:18 xiphmont Exp $
+ last mod: $Id: window.c,v 1.8 2000/10/12 03:12:54 xiphmont Exp $
 
  ********************************************************************/
 
@@ -21,8 +21,8 @@
 #include "os.h"
 #include "misc.h"
 
- -double *_vorbis_window(int type, int window,int left,int right){
- -  double *ret=calloc(window,sizeof(double));
+float *_vorbis_window(int type, int window,int left,int right){
+  float *ret=calloc(window,sizeof(float));
 
   switch(type){
   case 0:
@@ -33,7 +33,7 @@
       int i;
     
       for(i=0;i<left;i++){
- -	double x=(i+.5)/left*M_PI/2.;
+	float x=(i+.5)/left*M_PI/2.;
         x=sin(x);
         x*=x;
         x*=M_PI/2.;
@@ -45,7 +45,7 @@
         ret[i]=1.;
       
       for(i=0;i<right;i++){
- -	double x=(right-i-.5)/right*M_PI/2.;
+	float x=(right-i-.5)/right*M_PI/2.;
         x=sin(x);
         x*=x;
         x*=M_PI/2.;

1.4       +2 -2      vorbis/lib/window.h

Index: window.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/window.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
- --- window.h	2000/01/22 13:28:37	1.3
+++ window.h	2000/10/12 03:12:54	1.4
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: window functions
- - last mod: $Id: window.h,v 1.3 2000/01/22 13:28:37 xiphmont Exp $
+ last mod: $Id: window.h,v 1.4 2000/10/12 03:12:54 xiphmont Exp $
 
  ********************************************************************/
 
@@ -20,6 +20,6 @@
 #define _V_WINDOW_
 
 #define VI_WINDOWB 1
- -extern double *_vorbis_window(int type,int window,int left,int right);
+extern float *_vorbis_window(int type,int window,int left,int right);
 
 #endif

1.2       +6 -0      vorbis/lib/.cvsignore

1.2       +24 -0     vorbis/lib/Makefile.am

1.2       +92 -0     vorbis/lib/lookup.c

1.2       +33 -0     vorbis/lib/lookup.h

1.2       +190 -0    vorbis/lib/lookup_data.h

1.2       +143 -0    vorbis/lib/lookups.pl

1.2       +32 -0     vorbis/lib/tone.c

1.17      +10 -10    vorbis/vq/bookutil.c

Index: bookutil.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/bookutil.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
- --- bookutil.c	2000/08/15 09:09:44	1.16
+++ bookutil.c	2000/10/12 03:13:01	1.17
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility functions for loading .vqh and .vqd files
- - last mod: $Id: bookutil.c,v 1.16 2000/08/15 09:09:44 xiphmont Exp $
+ last mod: $Id: bookutil.c,v 1.17 2000/10/12 03:13:01 xiphmont Exp $
 
  ********************************************************************/
 
@@ -75,7 +75,7 @@
 /* read the next numerical value from the given file */
 static char *value_line_buff=NULL;
 
- -int get_line_value(FILE *in,double *value){
+int get_line_value(FILE *in,float *value){
   char *next;
 
   if(!value_line_buff)return(-1);
@@ -92,7 +92,7 @@
   }
 }
 
- -int get_next_value(FILE *in,double *value){
+int get_next_value(FILE *in,float *value){
   while(1){
     if(get_line_value(in,value)){
       value_line_buff=get_line(in);
@@ -104,13 +104,13 @@
 }
 
 int get_next_ivalue(FILE *in,long *ivalue){
- -  double value;
+  float value;
   int ret=get_next_value(in,&value);
   *ivalue=value;
   return(ret);
 }
 
- -static double sequence_base=0.;
+static float sequence_base=0.;
 static int v_sofar=0;
 void reset_next_value(void){
   value_line_buff=NULL;
@@ -125,7 +125,7 @@
 }
 
 
- -int get_vector(codebook *b,FILE *in,int start, int n,double *a){
+int get_vector(codebook *b,FILE *in,int start, int n,float *a){
   int i;
   const static_codebook *c=b->c;
 
@@ -146,7 +146,7 @@
         break;
     
     if(i==c->dim){
- -      double temp=a[c->dim-1];
+      float temp=a[c->dim-1];
       for(i=0;i<c->dim;i++)a[i]-=sequence_base;
       if(c->q_sequencep)sequence_base=temp;
       v_sofar++;
@@ -284,9 +284,9 @@
       exit(1);
     }
     /* load quantthresh */
- -    find_seek_to(in,"static double _vq_quantthresh_");
+    find_seek_to(in,"static float _vq_quantthresh_");
     reset_next_value();
- -    t->quantthresh=malloc(sizeof(double)*t->threshvals);
+    t->quantthresh=malloc(sizeof(float)*t->threshvals);
     for(i=0;i<t->threshvals-1;i++)
       if(get_next_value(in,t->quantthresh+i)){
         fprintf(stderr,"out of data 1 while reading codebook %s\n",filename);
@@ -581,7 +581,7 @@
 
   if(t){
     /* quantthresh */
- -    fprintf(out,"static double _vq_quantthresh_%s[] = {\n",name);
+    fprintf(out,"static float _vq_quantthresh_%s[] = {\n",name);
     for(j=0;j<t->threshvals-1;){
       fprintf(out,"\t");
       for(k=0;k<8 && j<t->threshvals-1;k++,j++)

1.7       +4 -4      vorbis/vq/bookutil.h

Index: bookutil.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/bookutil.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
- --- bookutil.h	2000/07/12 09:36:18	1.6
+++ bookutil.h	2000/10/12 03:13:01	1.7
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility functions for loading .vqh and .vqd files
- - last mod: $Id: bookutil.h,v 1.6 2000/07/12 09:36:18 xiphmont Exp $
+ last mod: $Id: bookutil.h,v 1.7 2000/10/12 03:13:01 xiphmont Exp $
 
  ********************************************************************/
 
@@ -26,11 +26,11 @@
 
 extern char     *get_line(FILE *in);
 extern char     *setup_line(FILE *in);
- -extern int       get_line_value(FILE *in,double *value);
- -extern int       get_next_value(FILE *in,double *value);
+extern int       get_line_value(FILE *in,float *value);
+extern int       get_next_value(FILE *in,float *value);
 extern int       get_next_ivalue(FILE *in,long *ivalue);
 extern void      reset_next_value(void);
- -extern int       get_vector(codebook *b,FILE *in,int start,int num,double 
*a);
+extern int       get_vector(codebook *b,FILE *in,int start,int num,float *a);
 extern char     *find_seek_to(FILE *in,char *s);
 
 extern codebook *codebook_load(char *filename);

1.15      +3 -3      vorbis/vq/build.c

Index: build.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/build.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
- --- build.c	2000/06/14 01:38:32	1.14
+++ build.c	2000/10/12 03:13:01	1.15
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility main for building codebooks from training sets
- - last mod: $Id: build.c,v 1.14 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: build.c,v 1.15 2000/10/12 03:13:01 xiphmont Exp $
 
  ********************************************************************/
 
@@ -149,7 +149,7 @@
   i=0;
   quantlist=malloc(sizeof(long)*v.elements*v.entries);
   for(j=0;j<entries;j++){
- -    double a;
+    float a;
     for(k=0;k<dim;k++){
       line=rline(in,out);
       sscanf(line,"%lf",&a);
@@ -165,7 +165,7 @@
   
   /* training points */
   {
- -    double *b=alloca(sizeof(double)*(dim+aux));
+    float *b=alloca(sizeof(float)*(dim+aux));
     i=0;
     v.entries=0; /* hack to avoid reseeding */
     while(1){

1.7       +7 -7      vorbis/vq/cascade.c

Index: cascade.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/cascade.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
- --- cascade.c	2000/05/08 20:49:50	1.6
+++ cascade.c	2000/10/12 03:13:01	1.7
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: function call to do simple data cascading
- - last mod: $Id: cascade.c,v 1.6 2000/05/08 20:49:50 xiphmont Exp $
+ last mod: $Id: cascade.c,v 1.7 2000/10/12 03:13:01 xiphmont Exp $
 
  ********************************************************************/
 
@@ -27,7 +27,7 @@
 
 /* set up metrics */
 
- -double count=0.;
+float count=0.;
 
 
 void process_preprocess(codebook **bs,char *basename){
@@ -37,12 +37,12 @@
   fprintf(stderr,"Done.                      \n");
 }
 
- -double process_one(codebook *b,double *a,int dim,int step,int addmul,
- -		   double base){
+float process_one(codebook *b,float *a,int dim,int step,int addmul,
+		   float base){
   int j;
 
   if(b->c->q_sequencep){
- -    double temp;
+    float temp;
     for(j=0;j<dim;j++){
       temp=a[j*step];
       a[j*step]-=base;
@@ -55,12 +55,12 @@
   return base;
 }
 
- -void process_vector(codebook **bs,int *addmul,int inter,double *a,int n){
+void process_vector(codebook **bs,int *addmul,int inter,float *a,int n){
   int i,bi=0;
   int booknum=0;
   
   while(*bs){
- -    double base=0.;
+    float base=0.;
     codebook *b=*bs;
     int dim=b->dim;
     

1.6       +6 -6      vorbis/vq/genericdata.c

Index: genericdata.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/genericdata.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
- --- genericdata.c	2000/05/08 20:49:50	1.5
+++ genericdata.c	2000/10/12 03:13:01	1.6
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: generic euclidian distance metric for VQ codebooks
- - last mod: $Id: genericdata.c,v 1.5 2000/05/08 20:49:50 xiphmont Exp $
+ last mod: $Id: genericdata.c,v 1.6 2000/10/12 03:13:01 xiphmont Exp $
 
  ********************************************************************/
 
@@ -31,23 +31,23 @@
   vqgen_quantize(v,q);
 }
 
- -double *vqext_weight(vqgen *v,double *p){
+float *vqext_weight(vqgen *v,float *p){
   /*noop*/
   return(p);
 }
 
                             /* candidate,actual */
- -double vqext_metric(vqgen *v,double *e, double *p){
+float vqext_metric(vqgen *v,float *e, float *p){
   int i;
- -  double acc=0.;
+  float acc=0.;
   for(i=0;i<v->elements;i++){
- -    double val=p[i]-e[i];
+    float val=p[i]-e[i];
     acc+=val*val;
   }
   return sqrt(acc/v->elements);
 }
 
- -void vqext_addpoint_adj(vqgen *v,double *b,int start,int dim,int cols,int 
num){
+void vqext_addpoint_adj(vqgen *v,float *b,int start,int dim,int cols,int num){
   vqgen_addpoint(v,b+start,NULL);
 }
 

1.5       +1 -1      vorbis/vq/huffbuild.c

Index: huffbuild.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/huffbuild.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
- --- huffbuild.c	2000/07/12 09:36:17	1.4
+++ huffbuild.c	2000/10/12 03:13:01	1.5
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: hufftree builder
- - last mod: $Id: huffbuild.c,v 1.4 2000/07/12 09:36:17 xiphmont Exp $
+ last mod: $Id: huffbuild.c,v 1.5 2000/10/12 03:13:01 xiphmont Exp $
 
  ********************************************************************/
 

1.6       +5 -5      vorbis/vq/latticebuild.c

Index: latticebuild.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/latticebuild.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
- --- latticebuild.c	2000/08/15 09:09:44	1.5
+++ latticebuild.c	2000/10/12 03:13:01	1.6
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility main for building codebooks from lattice descriptions
- - last mod: $Id: latticebuild.c,v 1.5 2000/08/15 09:09:44 xiphmont Exp $
+ last mod: $Id: latticebuild.c,v 1.6 2000/10/12 03:13:01 xiphmont Exp $
 
  ********************************************************************/
 
@@ -59,7 +59,7 @@
 int main(int argc,char *argv[]){
   codebook b;
   static_codebook c;
- -  double *quantlist;
+  float *quantlist;
   long *hits;
 
   int entries=-1,dim=-1,quantvals=-1,addmul=-1,sequencep=0;
@@ -128,8 +128,8 @@
 
   /* gen a real quant list from the more easily human-grokked input */
   {
- -    double min=quantlist[0];
- -    double mindel=-1;
+    float min=quantlist[0];
+    float mindel=-1;
     int fac=1;
     for(j=1;j<quantvals;j++)if(quantlist[j]<min)min=quantlist[j];
     for(j=0;j<quantvals;j++)
@@ -140,7 +140,7 @@
     j=0;
     while(j<quantvals){
       for(j=0;j<quantvals;j++){
- -	double test=(quantlist[j]-min)/(mindel/fac);
+	float test=(quantlist[j]-min)/(mindel/fac);
         if( fabs(rint(test)-test)>.000001) break;
       }
       if(j<quantvals)fac++;

1.3       +25 -25    vorbis/vq/latticehint.c

Index: latticehint.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/latticehint.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- latticehint.c	2000/08/15 09:09:44	1.2
+++ latticehint.c	2000/10/12 03:13:01	1.3
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility main for building thresh/pigeonhole encode hints
- - last mod: $Id: latticehint.c,v 1.2 2000/08/15 09:09:44 xiphmont Exp $
+ last mod: $Id: latticehint.c,v 1.3 2000/10/12 03:13:01 xiphmont Exp $
 
  ********************************************************************/
 
@@ -69,10 +69,10 @@
 }
 
 static void setvals(int dim,encode_aux_pigeonhole *p,
- -		    long *temptrack,double *tempmin,double *tempmax,
+		    long *temptrack,float *tempmin,float *tempmax,
                     int seqp){
   int i;
- -  double last=0.;
+  float last=0.;
   for(i=0;i<dim;i++){
     tempmin[i]=(temptrack[i])*p->del+p->min+last;
     tempmax[i]=tempmin[i]+p->del;
@@ -84,12 +84,12 @@
    quantize outside the pigeonmap are dropped and brute-forced.  So we
    can ignore the <0 and >=n boundary cases in min/max error */
 
- -static double minerror(int dim,double *a,encode_aux_pigeonhole *p,
- -		       long *temptrack,double *tempmin,double *tempmax){
+static float minerror(int dim,float *a,encode_aux_pigeonhole *p,
+		       long *temptrack,float *tempmin,float *tempmax){
   int i;
- -  double err=0.;
+  float err=0.;
   for(i=0;i<dim;i++){
- -    double eval=0.;
+    float eval=0.;
     if(a[i]<tempmin[i]){
       eval=tempmin[i]-a[i];
     }else if(a[i]>tempmax[i]){
@@ -100,17 +100,17 @@
   return(err);
 }
 
- -static double maxerror(int dim,double *a,encode_aux_pigeonhole *p,
- -		       long *temptrack,double *tempmin,double *tempmax){
+static float maxerror(int dim,float *a,encode_aux_pigeonhole *p,
+		       long *temptrack,float *tempmin,float *tempmax){
   int i;
- -  double err=0.,eval;
+  float err=0.,eval;
   for(i=0;i<dim;i++){
     if(a[i]<tempmin[i]){
       eval=tempmax[i]-a[i];
     }else if(a[i]>tempmax[i]){
       eval=a[i]-tempmin[i];
     }else{
- -      double t1=a[i]-tempmin[i];
+      float t1=a[i]-tempmin[i];
       eval=tempmax[i]-a[i];
       if(t1>eval)eval=t1;
     }
@@ -123,7 +123,7 @@
   codebook *b;
   static_codebook *c;
   int entries=-1,dim=-1;
- -  double min,del;
+  float min,del;
   char *name;
   long i,j;
   long dB=0;
@@ -172,7 +172,7 @@
     fprintf(stderr,"Adding threshold hint to %s...\n",name);
 
     /* simplest possible threshold hint only */
- -    t->quantthresh=calloc(quantvals-1,sizeof(double));
+    t->quantthresh=calloc(quantvals-1,sizeof(float));
     t->quantmap=calloc(quantvals,sizeof(int));
     t->threshvals=quantvals;
     t->quantvals=quantvals;
@@ -184,8 +184,8 @@
     /* ok, gen the map and thresholds */
     for(i=0;i<quantvals;i++)t->quantmap[i]=quantsort[i]-c->quantlist;
     for(i=0;i<quantvals-1;i++){
- -      double v1=*(quantsort[i])*del+min;
- -      double v2=*(quantsort[i+1])*del+min;
+      float v1=*(quantsort[i])*del+min;
+      float v2=*(quantsort[i+1])*del+min;
       if(dB){
         if(fabs(v1)<.01)v1=(v1+v2)*.5;
         if(fabs(v2)<.01)v2=(v1+v2)*.5;
@@ -204,8 +204,8 @@
     long **tempstack;
     long *tempcount;
     long *temptrack;
- -    double *tempmin;
- -    double *tempmax;
+    float *tempmin;
+    float *tempmax;
     long totalstack=0;
     long pigeons;
     long subpigeons;
@@ -244,11 +244,11 @@
        exact pigeonhole grouping is an optimization issue, not a
        correctness issue */
     for(i=0;i<p->mapentries;i++){
- -      double thisval=del*i+min; /* middle of the quant zone */
+      float thisval=del*i+min; /* middle of the quant zone */
       int quant=0;
- -      double err=fabs(c->quantlist[0]*del+min-thisval);
+      float err=fabs(c->quantlist[0]*del+min-thisval);
       for(j=1;j<quantvals;j++){
- -	double thiserr=fabs(c->quantlist[j]*del+min-thisval);
+	float thiserr=fabs(c->quantlist[j]*del+min-thisval);
         if(thiserr<err){
           quant=j/factor;
           err=thiserr;
@@ -275,13 +275,13 @@
     for(i=0;i<dim;i++)subpigeons*=p->mapentries;
     for(i=0;i<dim;i++)pigeons*=p->quantvals;
     temptrack=calloc(dim,sizeof(long));
- -    tempmin=calloc(dim,sizeof(double));
- -    tempmax=calloc(dim,sizeof(double));
+    tempmin=calloc(dim,sizeof(float));
+    tempmax=calloc(dim,sizeof(float));
     tempstack=calloc(pigeons,sizeof(long *));
     tempcount=calloc(pigeons,sizeof(long));
 
     while(1){
- -      double errorpost=-1;
+      float errorpost=-1;
       char buffer[80];
 
       /* map our current pigeonhole to a 'big pigeonhole' so we know
@@ -296,7 +296,7 @@
          maximum error.  Record that error */
       for(i=0;i<entries;i++){
         if(c->lengthlist[i]>0){
- -	  double this=maxerror(dim,b->valuelist+i*dim,p,
+	  float this=maxerror(dim,b->valuelist+i*dim,p,
                                temptrack,tempmin,tempmax);
           if(errorpost==-1 || this<errorpost)errorpost=this;
           spinnit(buffer,subpigeons);
@@ -329,7 +329,7 @@
        improbable is determined by c->lengthlist; we assume that
        pigeonholing is in sync with the codeword cells, which it is */
     /*for(i=0;i<entries;i++){
- -      double probability= 1./(1<<c->lengthlist[i]);
+      float probability= 1./(1<<c->lengthlist[i]);
       if(c->lengthlist[i]==0 || probability*entries<cutoff){
         totalstack-=tempcount[i];
         tempcount[i]=0;

1.5       +34 -34    vorbis/vq/latticepare.c

Index: latticepare.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/latticepare.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
- --- latticepare.c	2000/07/12 09:36:18	1.4
+++ latticepare.c	2000/10/12 03:13:01	1.5
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility for paring low hit count cells from lattice codebook
- - last mod: $Id: latticepare.c,v 1.4 2000/07/12 09:36:18 xiphmont Exp $
+ last mod: $Id: latticepare.c,v 1.5 2000/10/12 03:13:01 xiphmont Exp $
 
  ********************************************************************/
 
@@ -59,20 +59,20 @@
    produces a new output book on stdout 
 */
 
- -static double _dist(int el,double *a, double *b){
+static float _dist(int el,float *a, float *b){
   int i;
- -  double acc=0.;
+  float acc=0.;
   for(i=0;i<el;i++){
- -    double val=(a[i]-b[i]);
+    float val=(a[i]-b[i]);
     acc+=val*val;
   }
   return(acc);
 }
 
- -static double *pointlist;
+static float *pointlist;
 static long points=0;
 
- -void add_vector(codebook *b,double *vec,long n){
+void add_vector(codebook *b,float *vec,long n){
   int dim=b->dim,i,j;
   int step=n/dim;
   for(i=0;i<step;i++){
@@ -82,7 +82,7 @@
   }
 }
 
- -static int bestm(codebook *b,double *vec){
+static int bestm(codebook *b,float *vec){
   encode_aux_threshmatch *tt=b->c->thresh_tree;
   int dim=b->dim;
   int i,k,o;
@@ -100,12 +100,12 @@
   return(best);
 }
 
- -static int closest(codebook *b,double *vec,int current){
+static int closest(codebook *b,float *vec,int current){
   encode_aux_threshmatch *tt=b->c->thresh_tree;
   int dim=b->dim;
   int i,k,o;
 
- -  double bestmetric=0;
+  float bestmetric=0;
   int bestentry=-1;
   int best=bestm(b,vec);
 
@@ -113,7 +113,7 @@
 
   for(i=0;i<b->entries;i++){
     if(b->c->lengthlist[i]>0 && i!=best && i!=current){
- -      double thismetric=_dist(dim, vec, b->valuelist+i*dim);
+      float thismetric=_dist(dim, vec, b->valuelist+i*dim);
       if(bestentry==-1 || thismetric<bestmetric){
         bestentry=i;
         bestmetric=thismetric;
@@ -124,15 +124,15 @@
   return(bestentry);
 }
 
- -static double _heuristic(codebook *b,double *ppt,int secondbest){
- -  double *secondcell=b->valuelist+secondbest*b->dim;
+static float _heuristic(codebook *b,float *ppt,int secondbest){
+  float *secondcell=b->valuelist+secondbest*b->dim;
   int best=bestm(b,ppt);
- -  double *firstcell=b->valuelist+best*b->dim;
- -  double error=_dist(b->dim,firstcell,secondcell);
- -  double *zero=alloca(b->dim*sizeof(double));
- -  double fromzero;
+  float *firstcell=b->valuelist+best*b->dim;
+  float error=_dist(b->dim,firstcell,secondcell);
+  float *zero=alloca(b->dim*sizeof(float));
+  float fromzero;
   
- -  memset(zero,0,b->dim*sizeof(double));
+  memset(zero,0,b->dim*sizeof(float));
   fromzero=sqrt(_dist(b->dim,firstcell,zero));
 
   return(error/fromzero);
@@ -217,7 +217,7 @@
             int cols;
             long lines=0;
             char *line;
- -	    double *vec;
+	    float *vec;
             FILE *in=fopen(name,"r");
             if(!in){
               fprintf(stderr,"Could not open input file %s\n",name);
@@ -235,7 +235,7 @@
                 while(*temp==' ')temp++;
               }
             }
- -	    vec=alloca(cols*sizeof(double));
+	    vec=alloca(cols*sizeof(float));
             /* count, then load, to avoid fragmenting the hell out of
                memory */
             while(line){
@@ -248,7 +248,7 @@
               if((lines&0xff)==0)spinnit("counting samples...",lines*cols);
               line=setup_line(in);
             }
- -	    pointlist=malloc((cols*lines+entries*dim)*sizeof(double));
+	    pointlist=malloc((cols*lines+entries*dim)*sizeof(float));
             
             rewind(in);
             line=setup_line(in);
@@ -319,8 +319,8 @@
 
     long *cellcount=calloc(entries,sizeof(long));
     long *cellcount2=calloc(entries,sizeof(long));
- -    double *cellerror=calloc(entries,sizeof(double));
- -    double *cellerrormax=calloc(entries,sizeof(double));
+    float *cellerror=calloc(entries,sizeof(float));
+    float *cellerrormax=calloc(entries,sizeof(float));
     long cellsleft=entries;
     for(i=0;i<points;i++)membership[i]=-1;
     for(i=0;i<entries;i++)firsthead[i]=-1;
@@ -330,11 +330,11 @@
     for(i=0;i<points;i++){
       /* assign vectors to the nearest cell.  Also keep track of second
          nearest for error statistics */
- -      double *ppt=pointlist+i*dim;
+      float *ppt=pointlist+i*dim;
       int    firstentry=closest(b,ppt,-1);
       int    secondentry=closest(b,ppt,firstentry);
- -      double firstmetric=_dist(dim,b->valuelist+dim*firstentry,ppt);
- -      double secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
+      float firstmetric=_dist(dim,b->valuelist+dim*firstentry,ppt);
+      float secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
       
       if(!(i&0xff))spinnit("initializing... ",points-i);
     
@@ -382,8 +382,8 @@
     /* do the automatic cull request */
     while(cellsleft>target){
       int bestcell=-1;
- -      double besterror=0;
- -      double besterror2=0;
+      float besterror=0;
+      float besterror2=0;
       long head=-1;
       char spinbuf[80];
       sprintf(spinbuf,"cells left to eliminate: %ld : ",cellsleft-target);
@@ -413,11 +413,11 @@
       firsthead[bestcell]=-1;
       while(head!=-1){
         /* head is a point number */
- -	double *ppt=pointlist+head*dim;
+	float *ppt=pointlist+head*dim;
         int firstentry=closest(b,ppt,-1);
         int secondentry=closest(b,ppt,firstentry);
- -	double firstmetric=_dist(dim,b->valuelist+dim*firstentry,ppt);
- -	double secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
+	float firstmetric=_dist(dim,b->valuelist+dim*firstentry,ppt);
+	float secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
         long next=membership[head];
 
         if(head<points-entries){
@@ -441,15 +441,15 @@
       head=secondhead[bestcell];
       secondhead[bestcell]=-1;
       while(head!=-1){
- -	double *ppt=pointlist+head*dim;
+	float *ppt=pointlist+head*dim;
         /* who are we assigned to now? */
         int firstentry=closest(b,ppt,-1);
         /* what is the new second closest match? */
         int secondentry=closest(b,ppt,firstentry);
         /* old second closest is the cell being disbanded */
- -	double oldsecondmetric=_dist(dim,b->valuelist+dim*bestcell,ppt);
+	float oldsecondmetric=_dist(dim,b->valuelist+dim*bestcell,ppt);
         /* new second closest error */
- -	double secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
+	float secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
         long next=secondary[head];
 
         if(head<points-entries){
@@ -541,7 +541,7 @@
     for(i=0;i<entries;i++)entryindex[i]=1;
     for(i=0;i<points-entries;i++){
       int best=_best(b,pointlist+i*dim,1);
- -      double *a=pointlist+i*dim;
+      float *a=pointlist+i*dim;
       if(!(i&0xff))spinnit("counting hits...",i);
       if(best==-1){
         fprintf(stderr,"\nINTERNAL ERROR; a point count not be matched to a\n"

1.3       +3 -3      vorbis/vq/latticetune.c

Index: latticetune.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/latticetune.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- latticetune.c	2000/08/15 09:09:44	1.2
+++ latticetune.c	2000/10/12 03:13:02	1.3
@@ -13,7 +13,7 @@
 
  function: utility main for setting entropy encoding parameters
            for lattice codebooks
- - last mod: $Id: latticetune.c,v 1.2 2000/08/15 09:09:44 xiphmont Exp $
+ last mod: $Id: latticetune.c,v 1.3 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -109,7 +109,7 @@
     long step;
     long lines=0;
     long cols=-1;
- -    double *vec;
+    float *vec;
     line=setup_line(in);
     while(line){
       int code;
@@ -122,7 +122,7 @@
           while(*temp>32)temp++;
           while(*temp==' ')temp++;
         }
- -	vec=alloca(sizeof(double)*cols);
+	vec=alloca(sizeof(float)*cols);
         step=cols/dim;
       }
       

1.13      +23 -23    vorbis/vq/lspdata.c

Index: lspdata.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/lspdata.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
- --- lspdata.c	2000/05/08 20:49:50	1.12
+++ lspdata.c	2000/10/12 03:13:02	1.13
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: metrics and quantization code for LSP VQ codebooks
- - last mod: $Id: lspdata.c,v 1.12 2000/05/08 20:49:50 xiphmont Exp $
+ last mod: $Id: lspdata.c,v 1.13 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -27,12 +27,12 @@
 quant_meta q={0,0,0,1};          /* set sequence data */
 int vqext_aux=1;
 
- -double global_maxdel=M_PI;
- -double global_mindel=M_PI;
+float global_maxdel=M_PI;
+float global_mindel=M_PI;
 #if 0
 void vqext_quantize(vqgen *v,quant_meta *q){
- -  double delta,mindel;
- -  double maxquant=((1<<q->quant)-1);
+  float delta,mindel;
+  float maxquant=((1<<q->quant)-1);
   int j,k;
 
   /* first find the basic delta amount from the maximum span to be
@@ -48,10 +48,10 @@
   delta=_float32_unpack(q->delta);
 
   for(j=0;j<v->entries;j++){
- -    double last=0;
+    float last=0;
     for(k=0;k<v->elements;k++){
- -      double val=_now(v,j)[k];
- -      double now=rint((val-last-mindel)/delta);
+      float val=_now(v,j)[k];
+      float now=rint((val-last-mindel)/delta);
       
       _now(v,j)[k]=now;
       if(now<0){
@@ -76,7 +76,7 @@
 }
 #endif
 
- -double *weight=NULL;
+float *weight=NULL;
 #if 0
 /* LSP training metric.  We weight error proportional to distance
    *between* LSP vector values.  The idea of this metric is not to set
@@ -86,13 +86,13 @@
 
 #define FUDGE (global_maxdel-weight[i])
 
- -double *vqext_weight(vqgen *v,double *p){
+float *vqext_weight(vqgen *v,float *p){
   int i;
   int el=v->elements;
- -  double lastp=0.;
+  float lastp=0.;
   for(i=0;i<el;i++){
- -    double predist=(p[i]-lastp);
- -    double postdist=(p[i+1]-p[i]);
+    float predist=(p[i]-lastp);
+    float postdist=(p[i+1]-p[i]);
     weight[i]=(predist<postdist?predist:postdist);
     lastp=p[i];
   }
@@ -100,18 +100,18 @@
 }
 #else
 #define FUDGE 1.
- -double *vqext_weight(vqgen *v,double *p){
+float *vqext_weight(vqgen *v,float *p){
   return p;
 }
 #endif
 
                             /* candidate,actual */
- -double vqext_metric(vqgen *v,double *e, double *p){
+float vqext_metric(vqgen *v,float *e, float *p){
   int i;
   int el=v->elements;
- -  double acc=0.;
+  float acc=0.;
   for(i=0;i<el;i++){
- -    double val=(p[i]-e[i])*FUDGE;
+    float val=(p[i]-e[i])*FUDGE;
     acc+=val*val;
   }
   return sqrt(acc/v->elements);
@@ -124,9 +124,9 @@
    trailing space */
 
 /* assume vqext_aux==1 */
- -void vqext_addpoint_adj(vqgen *v,double *b,int start,int dim,int cols,int 
num){
- -  double *a=alloca(sizeof(double)*(dim+1)); /* +aux */
- -  double base=0;
+void vqext_addpoint_adj(vqgen *v,float *b,int start,int dim,int cols,int num){
+  float *a=alloca(sizeof(float)*(dim+1)); /* +aux */
+  float base=0;
   int i;
 
   if(start>0)base=b[start-1];
@@ -146,15 +146,15 @@
   global_maxdel=0.;
   global_mindel=M_PI;
   for(j=0;j<v->points;j++){
- -    double last=0.;
+    float last=0.;
     for(k=0;k<v->elements+v->aux;k++){
- -      double p=_point(v,j)[k];
+      float p=_point(v,j)[k];
       if(p-last>global_maxdel)global_maxdel=p-last;
       if(p-last<global_mindel)global_mindel=p-last;
       last=p;
     }
   }
 
- -  weight=malloc(sizeof(double)*v->elements);
+  weight=malloc(sizeof(float)*v->elements);
 }
 

1.9       +38 -38    vorbis/vq/metrics.c

Index: metrics.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/metrics.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
- --- metrics.c	2000/06/14 01:38:32	1.8
+++ metrics.c	2000/10/12 03:13:02	1.9
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: function calls to collect codebook metrics
- - last mod: $Id: metrics.c,v 1.8 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: metrics.c,v 1.9 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -39,20 +39,20 @@
 
 /* set up metrics */
 
- -double meanamplitude_acc=0.;
- -double meanamplitudesq_acc=0.;
- -double meanerror_acc=0.;
- -double meanerrorsq_acc=0.;
- -
- -double **histogram=NULL;
- -double **histogram_error=NULL;
- -double **histogram_errorsq=NULL;
- -double **histogram_hi=NULL;
- -double **histogram_lo=NULL;
- -double bits=0.;
- -double count=0.;
+float meanamplitude_acc=0.;
+float meanamplitudesq_acc=0.;
+float meanerror_acc=0.;
+float meanerrorsq_acc=0.;
+
+float **histogram=NULL;
+float **histogram_error=NULL;
+float **histogram_errorsq=NULL;
+float **histogram_hi=NULL;
+float **histogram_lo=NULL;
+float bits=0.;
+float count=0.;
 
- -static double *_now(codebook *c, int i){
+static float *_now(codebook *c, int i){
   return c->valuelist+i*c->c->dim;
 }
 
@@ -63,11 +63,11 @@
   while(bs[books])books++;
   
   if(books){
- -    histogram=calloc(books,sizeof(double *));
- -    histogram_error=calloc(books,sizeof(double *));
- -    histogram_errorsq=calloc(books,sizeof(double *));
- -    histogram_hi=calloc(books,sizeof(double *));
- -    histogram_lo=calloc(books,sizeof(double *));
+    histogram=calloc(books,sizeof(float *));
+    histogram_error=calloc(books,sizeof(float *));
+    histogram_errorsq=calloc(books,sizeof(float *));
+    histogram_hi=calloc(books,sizeof(float *));
+    histogram_lo=calloc(books,sizeof(float *));
   }else{
     fprintf(stderr,"Specify at least one codebook\n");
     exit(1);
@@ -75,19 +75,19 @@
 
   for(i=0;i<books;i++){
     codebook *b=bs[i];
- -    histogram[i]=calloc(b->entries,sizeof(double));
- -    histogram_error[i]=calloc(b->entries*b->dim,sizeof(double));
- -    histogram_errorsq[i]=calloc(b->entries*b->dim,sizeof(double));
- -    histogram_hi[i]=calloc(b->entries*b->dim,sizeof(double));
- -    histogram_lo[i]=calloc(b->entries*b->dim,sizeof(double));
+    histogram[i]=calloc(b->entries,sizeof(float));
+    histogram_error[i]=calloc(b->entries*b->dim,sizeof(float));
+    histogram_errorsq[i]=calloc(b->entries*b->dim,sizeof(float));
+    histogram_hi[i]=calloc(b->entries*b->dim,sizeof(float));
+    histogram_lo[i]=calloc(b->entries*b->dim,sizeof(float));
   }
 }
 
- -static double _dist(int el,double *a, double *b){
+static float _dist(int el,float *a, float *b){
   int i;
- -  double acc=0.;
+  float acc=0.;
   for(i=0;i<el;i++){
- -    double val=(a[i]-b[i]);
+    float val=(a[i]-b[i]);
     acc+=val*val;
   }
   return acc;
@@ -95,16 +95,16 @@
 
 void cell_spacing(codebook *c){
   int j,k;
- -  double min=-1,max=-1,mean=0.,meansq=0.;
+  float min=-1,max=-1,mean=0.,meansq=0.;
   long total=0;
 
   /* minimum, maximum, mean, ms cell spacing */
   for(j=0;j<c->c->entries;j++){
     if(c->c->lengthlist[j]>0){
- -      double localmin=-1.;
+      float localmin=-1.;
       for(k=0;k<c->c->entries;k++){
         if(c->c->lengthlist[k]>0){
- -	  double this=_dist(c->c->dim,_now(c,j),_now(c,k));
+	  float this=_dist(c->c->dim,_now(c,j),_now(c,k));
           if(j!=k &&
              (localmin==-1 || this<localmin))
             localmin=this;
@@ -209,13 +209,13 @@
   }
 }
 
- -double process_one(codebook *b,int book,double *a,int dim,int step,int 
addmul,
- -		   double base){
+float process_one(codebook *b,int book,float *a,int dim,int step,int addmul,
+		   float base){
   int j,entry;
- -  double amplitude=0.;
+  float amplitude=0.;
 
   if(book==0){
- -    double last=base;
+    float last=base;
     for(j=0;j<dim;j++){
       amplitude=a[j*step]-(b->c->q_sequencep?last:0);
       meanamplitude_acc+=fabs(amplitude);
@@ -226,7 +226,7 @@
   }
 
   if(b->c->q_sequencep){
- -    double temp;
+    float temp;
     for(j=0;j<dim;j++){
       temp=a[j*step];
       a[j*step]-=base;
@@ -245,7 +245,7 @@
   bits+=vorbis_book_codelen(b,entry);
           
   for(j=0;j<dim;j++){
- -    double error=a[j*step];
+    float error=a[j*step];
 
     if(book==books-1){
       meanerror_acc+=fabs(error);
@@ -262,14 +262,14 @@
 }
 
 
- -void process_vector(codebook **bs,int *addmul,int inter,double *a,int n){
+void process_vector(codebook **bs,int *addmul,int inter,float *a,int n){
   int bi;
   int i;
 
   for(bi=0;bi<books;bi++){
     codebook *b=bs[bi];
     int dim=b->dim;
- -    double base=0.;
+    float base=0.;
 
     if(inter){
       for(i=0;i<n/dim;i++)

1.4       +22 -22    vorbis/vq/residuedata.c

Index: residuedata.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/residuedata.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
- --- residuedata.c	2000/05/08 20:49:51	1.3
+++ residuedata.c	2000/10/12 03:13:02	1.4
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: metrics and quantization code for residue VQ codebooks
- - last mod: $Id: residuedata.c,v 1.3 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: residuedata.c,v 1.4 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -31,9 +31,9 @@
 quant_meta q={0,0,0,0};          /* set sequence data */
 int vqext_aux=0;
 
- -static double *quant_save=NULL;
+static float *quant_save=NULL;
 
- -double *vqext_weight(vqgen *v,double *p){
+float *vqext_weight(vqgen *v,float *p){
   return p;
 }
 
@@ -45,16 +45,16 @@
   int j,k;
   long dim=v->elements;
   long n=v->entries;
- -  double max=-1;
- -  double *test=alloca(sizeof(double)*dim);
+  float max=-1;
+  float *test=alloca(sizeof(float)*dim);
   int moved=0;
 
   
   /* allow movement only to unoccupied coordinates on the coarse grid */
   for(j=0;j<n;j++){
     for(k=0;k<dim;k++){
- -      double val=_now(v,j)[k];
- -      double norm=rint(fabs(val)/scalequant);
+      float val=_now(v,j)[k];
+      float norm=rint(fabs(val)/scalequant);
       if(norm>max)max=norm;
       test[k]=norm;
     }
@@ -62,15 +62,15 @@
     /* allow move only if unoccupied */
     if(quant_save){
       for(k=0;k<n;k++)
- -	if(j!=k && memcmp(test,quant_save+dim*k,dim*sizeof(double))==0)
+	if(j!=k && memcmp(test,quant_save+dim*k,dim*sizeof(float))==0)
           break;
       if(k==n){
- -	if(memcmp(test,quant_save+dim*j,dim*sizeof(double)))	
+	if(memcmp(test,quant_save+dim*j,dim*sizeof(float)))	
           moved++;
- -	memcpy(quant_save+dim*j,test,sizeof(double)*dim);
+	memcpy(quant_save+dim*j,test,sizeof(float)*dim);
       }
     }else{
- -      memcpy(_now(v,j),test,sizeof(double)*dim);
+      memcpy(_now(v,j),test,sizeof(float)*dim);
     }
   }
 
@@ -83,17 +83,17 @@
   q->quant=_ilog(max);
 
   if(quant_save){
- -    memcpy(_now(v,0),quant_save,sizeof(double)*dim*n);
+    memcpy(_now(v,0),quant_save,sizeof(float)*dim*n);
     fprintf(stderr,"cells shifted this iteration: %d\n",moved);
   }
 }
 
                             /* candidate,actual */
- -double vqext_metric(vqgen *v,double *e, double *p){
+float vqext_metric(vqgen *v,float *e, float *p){
   int i;
- -  double acc=0.;
+  float acc=0.;
   for(i=0;i<v->elements;i++){
- -    double val=p[i]-e[i];
+    float val=p[i]-e[i];
     acc+=val*val;
   }
   return sqrt(acc);
@@ -101,7 +101,7 @@
 
 /* We don't interleave here; we assume that the interleave is provided
    for us by residuesplit in vorbis/huff/ */
- -void vqext_addpoint_adj(vqgen *v,double *b,int start,int dim,int cols,int 
num){
+void vqext_addpoint_adj(vqgen *v,float *b,int start,int dim,int cols,int num){
   vqgen_addpoint(v,b+start,NULL);
 }
 
@@ -109,7 +109,7 @@
    residuals (which causes lots & lots of dupes) */
 void vqext_preprocess(vqgen *v){
   long i,j,k,l;
- -  double *test=alloca(sizeof(double)*v->elements);
+  float *test=alloca(sizeof(float)*v->elements);
   scalequant=q.quant;
 
   vqext_quantize(v,&q);
@@ -118,7 +118,7 @@
   /* if there are any dupes, reseed */
   for(k=0;k<v->entries;k++){
     for(l=0;l<k;l++){
- -      if(memcmp(_now(v,k),_now(v,l),sizeof(double)*v->elements)==0)
+      if(memcmp(_now(v,k),_now(v,l),sizeof(float)*v->elements)==0)
         break;
     }
     if(l<k)break;
@@ -132,7 +132,7 @@
     
     for(i=0,j=0;i<v->points && j<v->entries;i++){
       for(k=0;k<v->elements;k++){
- -	double val=_point(v,i)[k];
+	float val=_point(v,i)[k];
         test[k]=rint(val/scalequant)*scalequant;
       }
       
@@ -143,7 +143,7 @@
         if(k==v->elements)break;
       }
       if(l==j){
- -	memcpy(_now(v,j),test,v->elements*sizeof(double));
+	memcpy(_now(v,j),test,v->elements*sizeof(float));
         j++;
       }
     }
@@ -154,8 +154,8 @@
     }
   }  
   vqext_quantize(v,&q);
- -  quant_save=malloc(sizeof(double)*v->elements*v->entries);
- -  memcpy(quant_save,_now(v,0),sizeof(double)*v->elements*v->entries);
+  quant_save=malloc(sizeof(float)*v->elements*v->entries);
+  memcpy(quant_save,_now(v,0),sizeof(float)*v->elements*v->entries);
   vqgen_unquantize(v,&q);
 
 }

1.5       +12 -12    vorbis/vq/residuesplit.c

Index: residuesplit.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/residuesplit.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
- --- residuesplit.c	2000/08/15 09:09:32	1.4
+++ residuesplit.c	2000/10/12 03:13:02	1.5
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: residue backend 0 partitioner/classifier
- - last mod: $Id: residuesplit.c,v 1.4 2000/08/15 09:09:32 xiphmont Exp $
+ last mod: $Id: residuesplit.c,v 1.5 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -25,10 +25,10 @@
 
 /* does not guard against invalid settings; eg, a subn of 16 and a
    subgroup request of 32.  Max subn of 128 */
- -static void _testhack(double *vec,int n,double *entropy){
+static void _testhack(float *vec,int n,float *entropy){
   int i,j=0;
- -  double max=0.;
- -  double temp[128];
+  float max=0.;
+  float temp[128];
 
   /* setup */
   for(i=0;i<n;i++)temp[i]=fabs(vec[i]);
@@ -61,13 +61,13 @@
 /* This is currently a bit specific to/hardwired for mapping 0; things
    will need to change in the future when we get real multichannel
    mappings */
- -int quantaux(double *res,int n,double *ebound,double *mbound,int 
*subgrp,int parts, int subn){
+int quantaux(float *res,int n,float *ebound,float *mbound,int *subgrp,int 
parts, int subn){
   long i,j;
- -  double entropy[8];
+  float entropy[8];
   int aux;
 
   for(i=0;i<=n-subn;i+=subn){
- -    double max=0.;
+    float max=0.;
 
     _testhack(res+i,subn,entropy);
     for(j=0;j<subn;j++)
@@ -92,7 +92,7 @@
   return(0);
 }
 
- -static int getline(FILE *in,double *vec,int begin,int n){
+static int getline(FILE *in,float *vec,int begin,int n){
   int i,next=0;
 
   reset_next_value();
@@ -135,7 +135,7 @@
   char *base;
   int i,parts,begin,n,subn,*subgrp;
   FILE *res;
- -  double *ebound,*mbound,*vec;
+  float *ebound,*mbound,*vec;
   long c=0;
   if(argc<5)usage();
 
@@ -162,8 +162,8 @@
   /* how many parts?... */
   parts=argc-3;
   
- -  ebound=malloc(sizeof(double)*parts);
- -  mbound=malloc(sizeof(double)*parts);
+  ebound=malloc(sizeof(float)*parts);
+  mbound=malloc(sizeof(float)*parts);
   subgrp=malloc(sizeof(int)*parts);
   
   for(i=0;i<parts-1;i++){
@@ -217,7 +217,7 @@
     }
   }
   
- -  vec=malloc(sizeof(double)*n);
+  vec=malloc(sizeof(float)*n);
   /* get the input line by line and process it */
   while(!feof(res)){
     if(getline(res,vec,begin,n))

1.11      +6 -6      vorbis/vq/run.c

Index: run.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/run.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
- --- run.c	2000/05/08 20:49:51	1.10
+++ run.c	2000/10/12 03:13:02	1.11
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility main for loading and operating on codebooks
- - last mod: $Id: run.c,v 1.10 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: run.c,v 1.11 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -39,7 +39,7 @@
 
 extern void process_preprocess(codebook **b,char *basename);
 extern void process_postprocess(codebook **b,char *basename);
- -extern void process_vector(codebook **b,int *addmul, int inter,double 
*a,int n);
+extern void process_vector(codebook **b,int *addmul, int inter,float *a,int 
n);
 extern void process_usage(void);
 
 int main(int argc,char *argv[]){
@@ -127,7 +127,7 @@
         int cols;
         long lines=0;
         char *line;
- -	double *vec;
+	float *vec;
         FILE *in=fopen(name,"r");
         if(!in){
           fprintf(stderr,"Could not open input file %s\n",name);
@@ -150,7 +150,7 @@
             while(*temp==' ')temp++;
           }
         }
- -	vec=alloca(cols*sizeof(double));
+	vec=alloca(cols*sizeof(float));
         while(line){
           lines++;
           for(j=0;j<cols;j++)
@@ -179,7 +179,7 @@
       int cols;
       char *line;
       long lines=0;
- -      double *vec;
+      float *vec;
       if(!input){
         process_preprocess(b,basename);
         input++;
@@ -195,7 +195,7 @@
           while(*temp==' ')temp++;
         }
       }
- -      vec=alloca(cols*sizeof(double));
+      vec=alloca(cols*sizeof(float));
       while(line){
         lines++;
         for(j=0;j<cols;j++)

1.19      +6 -6      vorbis/vq/train.c

Index: train.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/train.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
- --- train.c	2000/06/14 01:38:32	1.18
+++ train.c	2000/10/12 03:13:02	1.19
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility main for training codebooks
- - last mod: $Id: train.c,v 1.18 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: train.c,v 1.19 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -79,7 +79,7 @@
 
   int entries=-1,dim=-1;
   int start=0,num=-1;
- -  double desired=.05,mindist=0.;
+  float desired=.05,mindist=0.;
   int iter=1000;
   int biasp=1;
   int centroid=0;
@@ -120,7 +120,7 @@
     
     if(in){
       /* we wish to suck in a preexisting book and continue to train it */
- -      double a;
+      float a;
       
       line=rline(in,out,1);
       if(strcmp(line,vqext_booktype)){
@@ -167,7 +167,7 @@
       
       v.seeded=1;
       {
- -	double *b=alloca((dim+vqext_aux)*sizeof(double));
+	float *b=alloca((dim+vqext_aux)*sizeof(float));
         i=0;
         while(1){
           for(k=0;k<dim+vqext_aux;k++){
@@ -263,7 +263,7 @@
         }
         {
           int i;
- -	  double b[cols];
+	  float b[cols];
           if(start+num*dim>cols){
             fprintf(stderr,"ran out of columns reading %s\n",file);
             exit(1);
@@ -306,7 +306,7 @@
   signal(SIGINT,setexit);
 
   for(i=0;i<iter && !exiting;i++){
- -    double result;
+    float result;
     if(i!=0){
       vqgen_unquantize(&v,&q);
       vqgen_cellmetric(&v);

1.10      +4 -4      vorbis/vq/vqext.h

Index: vqext.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/vqext.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
- --- vqext.h	2000/05/08 20:49:51	1.9
+++ vqext.h	2000/10/12 03:13:02	1.10
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: prototypes for extermal metrics specific to data type
- - last mod: $Id: vqext.h,v 1.9 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: vqext.h,v 1.10 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -25,9 +25,9 @@
 extern quant_meta q;
 extern int vqext_aux;
 
- -extern double vqext_metric(vqgen *v,double *e, double *p);
- -extern double *vqext_weight(vqgen *v,double *p);
- -extern void vqext_addpoint_adj(vqgen *v,double *b,int start,int dim,int 
cols,int num);
+extern float vqext_metric(vqgen *v,float *e, float *p);
+extern float *vqext_weight(vqgen *v,float *p);
+extern void vqext_addpoint_adj(vqgen *v,float *b,int start,int dim,int 
cols,int num);
 extern void vqext_preprocess(vqgen *v);
 extern void vqext_quantize(vqgen *v,quant_meta *);
 

1.34      +64 -64    vorbis/vq/vqgen.c

Index: vqgen.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/vqgen.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
- --- vqgen.c	2000/07/17 12:55:37	1.33
+++ vqgen.c	2000/10/12 03:13:02	1.34
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: train a VQ codebook 
- - last mod: $Id: vqgen.c,v 1.33 2000/07/17 12:55:37 xiphmont Exp $
+ last mod: $Id: vqgen.c,v 1.34 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -59,18 +59,18 @@
 #define vN(data,i) (data+v->elements*i)
 
 /* default metric; squared 'distance' from desired value. */
- -double _dist(vqgen *v,double *a, double *b){
+float _dist(vqgen *v,float *a, float *b){
   int i;
   int el=v->elements;
- -  double acc=0.;
+  float acc=0.;
   for(i=0;i<el;i++){
- -    double val=(a[i]-b[i]);
+    float val=(a[i]-b[i]);
     acc+=val*val;
   }
   return sqrt(acc);
 }
 
- -double *_weight_null(vqgen *v,double *a){
+float *_weight_null(vqgen *v,float *a){
   return a;
 }
 
@@ -78,25 +78,25 @@
 void _vqgen_seed(vqgen *v){
   long i;
   for(i=0;i<v->entries;i++)
- -    memcpy(_now(v,i),_point(v,i),sizeof(double)*v->elements);
+    memcpy(_now(v,i),_point(v,i),sizeof(float)*v->elements);
   v->seeded=1;
 }
 
 int directdsort(const void *a, const void *b){
- -  double av=*((double *)a);
- -  double bv=*((double *)b);
+  float av=*((float *)a);
+  float bv=*((float *)b);
   if(av>bv)return(-1);
   return(1);
 }
 
 void vqgen_cellmetric(vqgen *v){
   int j,k;
- -  double min=-1.,max=-1.,mean=0.,acc=0.;
+  float min=-1.,max=-1.,mean=0.,acc=0.;
   long dup=0,unused=0;
  #ifdef NOISY
   int i;
    char buff[80];
- -   double spacings[v->entries];
+   float spacings[v->entries];
    int count=0;
    FILE *cells;
    sprintf(buff,"cellspace%d.m",v->it);
@@ -105,11 +105,11 @@
 
   /* minimum, maximum, cell spacing */
   for(j=0;j<v->entries;j++){
- -    double localmin=-1.;
+    float localmin=-1.;
 
     for(k=0;k<v->entries;k++){
       if(j!=k){
- -	double this=_dist(v,_now(v,j),_now(v,k));
+	float this=_dist(v,_now(v,j),_now(v,k));
         if(this>0){
           if(v->assigned[k] && (localmin==-1 || this<localmin))
             localmin=this;
@@ -142,7 +142,7 @@
           min,mean/acc,max,unused,dup);
 
 #ifdef NOISY
- -  qsort(spacings,count,sizeof(double),directdsort);
+  qsort(spacings,count,sizeof(float),directdsort);
   for(i=0;i<count;i++)
     fprintf(cells,"%g\n",spacings[i]);
   fclose(cells);
@@ -167,18 +167,18 @@
 
 void vqgen_quantize(vqgen *v,quant_meta *q){
 
- -  double maxdel;
- -  double mindel;
+  float maxdel;
+  float mindel;
 
- -  double delta;
- -  double maxquant=((1<<q->quant)-1);
+  float delta;
+  float maxquant=((1<<q->quant)-1);
 
   int j,k;
 
   mindel=maxdel=_now(v,0)[0];
   
   for(j=0;j<v->entries;j++){
- -    double last=0.;
+    float last=0.;
     for(k=0;k<v->elements;k++){
       if(mindel>_now(v,j)[k]-last)mindel=_now(v,j)[k]-last;
       if(maxdel<_now(v,j)[k]-last)maxdel=_now(v,j)[k]-last;
@@ -200,10 +200,10 @@
   delta=_float32_unpack(q->delta);
 
   for(j=0;j<v->entries;j++){
- -    double last=0;
+    float last=0;
     for(k=0;k<v->elements;k++){
- -      double val=_now(v,j)[k];
- -      double now=rint((val-last-mindel)/delta);
+      float val=_now(v,j)[k];
+      float now=rint((val-last-mindel)/delta);
       
       _now(v,j)[k]=now;
       if(now<0){
@@ -226,13 +226,13 @@
    scales; we just make sure they're properly offset. */
 void vqgen_unquantize(vqgen *v,quant_meta *q){
   long j,k;
- -  double mindel=_float32_unpack(q->min);
- -  double delta=_float32_unpack(q->delta);
+  float mindel=_float32_unpack(q->min);
+  float delta=_float32_unpack(q->delta);
 
   for(j=0;j<v->entries;j++){
- -    double last=0.;
+    float last=0.;
     for(k=0;k<v->elements;k++){
- -      double now=_now(v,j)[k];
+      float now=_now(v,j)[k];
       now=fabs(now)*delta+last+mindel;
       if(q->sequencep)last=now;
       _now(v,j)[k]=now;
@@ -240,9 +240,9 @@
   }
 }
 
- -void vqgen_init(vqgen *v,int elements,int aux,int entries,double mindist,
- -		double  (*metric)(vqgen *,double *, double *),
- -		double *(*weight)(vqgen *,double *),int centroid){
+void vqgen_init(vqgen *v,int elements,int aux,int entries,float mindist,
+		float  (*metric)(vqgen *,float *, float *),
+		float *(*weight)(vqgen *,float *),int centroid){
   memset(v,0,sizeof(vqgen));
 
   v->centroid=centroid;
@@ -250,13 +250,13 @@
   v->aux=aux;
   v->mindist=mindist;
   v->allocated=32768;
- -  v->pointlist=malloc(v->allocated*(v->elements+v->aux)*sizeof(double));
+  v->pointlist=malloc(v->allocated*(v->elements+v->aux)*sizeof(float));
 
   v->entries=entries;
- -  v->entrylist=malloc(v->entries*v->elements*sizeof(double));
+  v->entrylist=malloc(v->entries*v->elements*sizeof(float));
   v->assigned=malloc(v->entries*sizeof(long));
- -  v->bias=calloc(v->entries,sizeof(double));
- -  v->max=calloc(v->entries,sizeof(double));
+  v->bias=calloc(v->entries,sizeof(float));
+  v->max=calloc(v->entries,sizeof(float));
   if(metric)
     v->metric_func=metric;
   else
@@ -270,7 +270,7 @@
 
 }
 
- -void vqgen_addpoint(vqgen *v, double *p,double *a){
+void vqgen_addpoint(vqgen *v, float *p,float *a){
   int k;
   for(k=0;k<v->elements;k++)
     fprintf(v->asciipoints,"%.12g\n",p[k]);
@@ -280,11 +280,11 @@
   if(v->points>=v->allocated){
     v->allocated*=2;
     v->pointlist=realloc(v->pointlist,v->allocated*(v->elements+v->aux)*
- -			 sizeof(double));
+			 sizeof(float));
   }
 
- -  memcpy(_point(v,v->points),p,sizeof(double)*v->elements);
- -  if(v->aux)memcpy(_point(v,v->points)+v->elements,a,sizeof(double)*v->aux);
+  memcpy(_point(v,v->points),p,sizeof(float)*v->elements);
+  if(v->aux)memcpy(_point(v,v->points)+v->elements,a,sizeof(float)*v->aux);
  
   /* quantize to the density mesh if it's selected */
   if(v->mindist>0.){
@@ -311,7 +311,7 @@
     long i,march=1;
 
     /* sort to make uniqueness detection trivial */
- -    sortsize=(v->elements+v->aux)*sizeof(double);
+    sortsize=(v->elements+v->aux)*sizeof(float);
     qsort(v->pointlist,v->points,sortsize,meshcomp);
 
     /* now march through and eliminate dupes */
@@ -333,19 +333,19 @@
   v->sorted=1;
 }
 
- -double vqgen_iterate(vqgen *v,int biasp){
+float vqgen_iterate(vqgen *v,int biasp){
   long   i,j,k;
 
- -  double fdesired;
+  float fdesired;
   long  desired;
   long  desired2;
 
- -  double asserror=0.;
- -  double meterror=0.;
- -  double *new;
- -  double *new2;
+  float asserror=0.;
+  float meterror=0.;
+  float *new;
+  float *new2;
   long   *nearcount;
- -  double *nearbias;
+  float *nearbias;
  #ifdef NOISY
    char buff[80];
    FILE *assig;
@@ -368,30 +368,30 @@
   if(!v->sorted)vqgen_sortmesh(v);
   if(!v->seeded)_vqgen_seed(v);
 
- -  fdesired=(double)v->points/v->entries;
+  fdesired=(float)v->points/v->entries;
   desired=fdesired;
   desired2=desired*2;
- -  new=malloc(sizeof(double)*v->entries*v->elements);
- -  new2=malloc(sizeof(double)*v->entries*v->elements);
+  new=malloc(sizeof(float)*v->entries*v->elements);
+  new2=malloc(sizeof(float)*v->entries*v->elements);
   nearcount=malloc(v->entries*sizeof(long));
- -  nearbias=malloc(v->entries*desired2*sizeof(double));
+  nearbias=malloc(v->entries*desired2*sizeof(float));
 
   /* fill in nearest points for entry biasing */
- -  /*memset(v->bias,0,sizeof(double)*v->entries);*/
+  /*memset(v->bias,0,sizeof(float)*v->entries);*/
   memset(nearcount,0,sizeof(long)*v->entries);
   memset(v->assigned,0,sizeof(long)*v->entries);
   if(biasp){
     for(i=0;i<v->points;i++){
- -      double *ppt=v->weight_func(v,_point(v,i));
- -      double firstmetric=v->metric_func(v,_now(v,0),ppt)+v->bias[0];
- -      double secondmetric=v->metric_func(v,_now(v,1),ppt)+v->bias[1];
+      float *ppt=v->weight_func(v,_point(v,i));
+      float firstmetric=v->metric_func(v,_now(v,0),ppt)+v->bias[0];
+      float secondmetric=v->metric_func(v,_now(v,1),ppt)+v->bias[1];
       long   firstentry=0;
       long   secondentry=1;
       
       if(!(i&0xff))spinnit("biasing... ",v->points+v->points+v->entries-i);
       
       if(firstmetric>secondmetric){
- -	double temp=firstmetric;
+	float temp=firstmetric;
         firstmetric=secondmetric;
         secondmetric=temp;
         firstentry=1;
@@ -399,7 +399,7 @@
       }
       
       for(j=2;j<v->entries;j++){
- -	double thismetric=v->metric_func(v,_now(v,j),ppt)+v->bias[j];
+	float thismetric=v->metric_func(v,_now(v,j),ppt)+v->bias[j];
         if(thismetric<secondmetric){
           if(thismetric<firstmetric){
             secondmetric=firstmetric;
@@ -416,8 +416,8 @@
       j=firstentry;
       for(j=0;j<v->entries;j++){
         
- -	double thismetric,localmetric;
- -	double *nearbiasptr=nearbias+desired2*j;
+	float thismetric,localmetric;
+	float *nearbiasptr=nearbias+desired2*j;
         long k=nearcount[j];
         
         localmetric=v->metric_func(v,_now(v,j),ppt);
@@ -441,7 +441,7 @@
           k++;
           if(k==desired){
             spinnit("biasing... ",v->points+v->points+v->entries-i);
- -	    qsort(nearbiasptr,desired,sizeof(double),directdsort);
+	    qsort(nearbiasptr,desired,sizeof(float),directdsort);
           }
           
         }else if(thismetric>nearbiasptr[desired-1]){
@@ -449,7 +449,7 @@
           k++;
           if(k==desired2){
             spinnit("biasing... ",v->points+v->points+v->entries-i);
- -	    qsort(nearbiasptr,desired2,sizeof(double),directdsort);
+	    qsort(nearbiasptr,desired2,sizeof(float),directdsort);
             k=desired;
           }
         }
@@ -460,31 +460,31 @@
     /* inflate/deflate */
     
     for(i=0;i<v->entries;i++){
- -      double *nearbiasptr=nearbias+desired2*i;
+      float *nearbiasptr=nearbias+desired2*i;
       
       spinnit("biasing... ",v->points+v->entries-i);
       
       /* due to the delayed sorting, we likely need to finish it off....*/
       if(nearcount[i]>desired)
- -	qsort(nearbiasptr,nearcount[i],sizeof(double),directdsort);
+	qsort(nearbiasptr,nearcount[i],sizeof(float),directdsort);
 
       v->bias[i]=nearbiasptr[desired-1];
 
     }
   }else{ 
- -    memset(v->bias,0,v->entries*sizeof(double));
+    memset(v->bias,0,v->entries*sizeof(float));
   }
 
   /* Now assign with new bias and find new midpoints */
   for(i=0;i<v->points;i++){
- -    double *ppt=v->weight_func(v,_point(v,i));
- -    double firstmetric=v->metric_func(v,_now(v,0),ppt)+v->bias[0];
+    float *ppt=v->weight_func(v,_point(v,i));
+    float firstmetric=v->metric_func(v,_now(v,0),ppt)+v->bias[0];
     long   firstentry=0;
 
     if(!(i&0xff))spinnit("centering... ",v->points-i);
 
     for(j=0;j<v->entries;j++){
- -      double thismetric=v->metric_func(v,_now(v,j),ppt)+v->bias[j];
+      float thismetric=v->metric_func(v,_now(v,j),ppt)+v->bias[j];
       if(thismetric<firstmetric){
         firstmetric=thismetric;
         firstentry=j;

1.15      +16 -16    vorbis/vq/vqgen.h

Index: vqgen.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/vqgen.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
- --- vqgen.h	2000/06/14 01:38:32	1.14
+++ vqgen.h	2000/10/12 03:13:02	1.15
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: build a VQ codebook 
- - last mod: $Id: vqgen.h,v 1.14 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: vqgen.h,v 1.15 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -27,23 +27,23 @@
   int elements;
 
   int aux;
- -  double mindist;
+  float mindist;
   int centroid;
 
   /* point cache */
- -  double *pointlist; 
+  float *pointlist; 
   long   points;
   long   allocated;
 
   /* entries */
- -  double *entrylist;
+  float *entrylist;
   long   *assigned;
- -  double *bias;
+  float *bias;
   long   entries;
- -  double *max;
+  float *max;
   
- -  double  (*metric_func) (struct vqgen *v,double *entry,double *point);
- -  double *(*weight_func) (struct vqgen *v,double *point);
+  float  (*metric_func) (struct vqgen *v,float *entry,float *point);
+  float *(*weight_func) (struct vqgen *v,float *point);
 
   FILE *asciipoints;
 } vqgen;
@@ -55,25 +55,25 @@
   int    sequencep; /* bitflag */
 } quant_meta;
 
- -static inline double *_point(vqgen *v,long ptr){
+static inline float *_point(vqgen *v,long ptr){
   return v->pointlist+((v->elements+v->aux)*ptr);
 }
 
- -static inline double *_aux(vqgen *v,long ptr){
+static inline float *_aux(vqgen *v,long ptr){
   return _point(v,ptr)+v->aux;
 }
 
- -static inline double *_now(vqgen *v,long ptr){
+static inline float *_now(vqgen *v,long ptr){
   return v->entrylist+(v->elements*ptr);
 }
 
 extern void vqgen_init(vqgen *v,
- -		       int elements,int aux,int entries,double mindist,
- -		       double  (*metric)(vqgen *,double *, double *),
- -		       double *(*weight)(vqgen *,double *),int centroid);
- -extern void vqgen_addpoint(vqgen *v, double *p,double *aux);
+		       int elements,int aux,int entries,float mindist,
+		       float  (*metric)(vqgen *,float *, float *),
+		       float *(*weight)(vqgen *,float *),int centroid);
+extern void vqgen_addpoint(vqgen *v, float *p,float *aux);
 
- -extern double vqgen_iterate(vqgen *v,int biasp);
+extern float vqgen_iterate(vqgen *v,int biasp);
 extern void vqgen_unquantize(vqgen *v,quant_meta *q);
 extern void vqgen_quantize(vqgen *v,quant_meta *q);
 extern void vqgen_cellmetric(vqgen *v);

1.20      +30 -30    vorbis/vq/vqsplit.c

Index: vqsplit.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/vqsplit.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
- --- vqsplit.c	2000/05/08 20:49:51	1.19
+++ vqsplit.c	2000/10/12 03:13:02	1.20
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: build a VQ codebook and the encoding decision 'tree'
- - last mod: $Id: vqsplit.c,v 1.19 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: vqsplit.c,v 1.20 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -68,11 +68,11 @@
   return(av-bv);
 }
 
- -static double _Ndist(int el,double *a, double *b){
+static float _Ndist(int el,float *a, float *b){
   int i;
- -  double acc=0.;
+  float acc=0.;
   for(i=0;i<el;i++){
- -    double val=(a[i]-b[i]);
+    float val=(a[i]-b[i]);
     acc+=val*val;
   }
   return sqrt(acc);
@@ -83,7 +83,7 @@
 
 
 /* goes through the split, but just counts it and returns a metric*/
- -int vqsp_count(double *entrylist,double *pointlist,int dim,
+int vqsp_count(float *entrylist,float *pointlist,int dim,
                long *membership,long *reventry,
                long *entryindex,long entries, 
                long *pointindex,long points,int splitp,
@@ -109,7 +109,7 @@
      both? */
 
   for(i=0;i<points;i++){
- -    double *ppt=_Npoint(pointindex[i]);
+    float *ppt=_Npoint(pointindex[i]);
     long   firstentry=membership[pointindex[i]];
 
     if(firstentry==besti){
@@ -123,8 +123,8 @@
       continue;
     }
     {
- -      double distA=_Ndist(dim,ppt,_Nnow(besti));
- -      double distB=_Ndist(dim,ppt,_Nnow(bestj));
+      float distA=_Ndist(dim,ppt,_Nnow(besti));
+      float distB=_Ndist(dim,ppt,_Nnow(bestj));
       if(distA<distB){
         entryA[reventry[firstentry]]=1;
         if(splitp)temppointsA[pointsA++]=pointindex[i];
@@ -156,7 +156,7 @@
   return(pointsA);
 }
 
- -int lp_split(double *pointlist,long totalpoints,
+int lp_split(float *pointlist,long totalpoints,
              codebook *b,
              long *entryindex,long entries, 
              long *pointindex,long points,
@@ -172,7 +172,7 @@
      even a midpoint division won't disturb the basic properties) */
 
   int dim=b->dim;
- -  double *entrylist=b->valuelist;
+  float *entrylist=b->valuelist;
   long ret;
   long *entryA=calloc(entries,sizeof(long));
   long *entryB=calloc(entries,sizeof(long));
@@ -198,10 +198,10 @@
   /* more than one way to do this part.  For small sets, we can brute
      force it. */
 
- -  if(entries<8 || (double)points*entries*entries<16.*1024*1024){
+  if(entries<8 || (float)points*entries*entries<16.*1024*1024){
     /* try every pair possibility */
- -    double best=0;
- -    double this;
+    float best=0;
+    float this;
     for(i=0;i<entries-1;i++){
       for(j=i+1;j<entries;j++){
         spinnit(spinbuf,entries-i);
@@ -230,9 +230,9 @@
       }
     }
   }else{
- -    double *p=alloca(dim*sizeof(double));
- -    double *q=alloca(dim*sizeof(double));
- -    double best=0.;
+    float *p=alloca(dim*sizeof(float));
+    float *q=alloca(dim*sizeof(float));
+    float best=0.;
     
     /* try COG/normal and furthest pairs */
     /* meanpoint */
@@ -253,10 +253,10 @@
        center */
 
     for(i=0;i<entries;i++){
- -      double *ppi=_Nnow(entryindex[i]);
- -      double ref_best=0.;
- -      double ref_j=-1;
- -      double this;
+      float *ppi=_Nnow(entryindex[i]);
+      float ref_best=0.;
+      float ref_j=-1;
+      float this;
       spinnit(spinbuf,entries-i);
       
       for(k=0;k<dim;k++)
@@ -264,7 +264,7 @@
 
       for(j=0;j<entries;j++){
         if(j!=i){
- -	  double this=_Ndist(dim,q,_Nnow(entryindex[j]));
+	  float this=_Ndist(dim,q,_Nnow(entryindex[j]));
           if(ref_j==-1 || this<=ref_best){ /* <=, not <; very important */
             ref_best=this;
             ref_j=entryindex[j];
@@ -390,7 +390,7 @@
       if(_Ndist(v->elements,_now(v,i),_now(v,j))==0.){
         fprintf(stderr,"found a duplicate entry!  removing...\n");
         v->entries--;
- -	memcpy(_now(v,i),_now(v,v->entries),sizeof(double)*v->elements);
+	memcpy(_now(v,i),_now(v,v->entries),sizeof(float)*v->elements);
         memcpy(quantlist+i*v->elements,quantlist+v->entries*v->elements,
                sizeof(long)*v->elements);
         break;
@@ -402,14 +402,14 @@
   {
     v->assigned=calloc(v->entries,sizeof(long));
     for(i=0;i<v->points;i++){
- -      double *ppt=_point(v,i);
- -      double firstmetric=_Ndist(v->elements,_now(v,0),ppt);
+      float *ppt=_point(v,i);
+      float firstmetric=_Ndist(v->elements,_now(v,0),ppt);
       long   firstentry=0;
 
       if(!(i&0xff))spinnit("checking... ",v->points-i);
 
       for(j=0;j<v->entries;j++){
- -	double thismetric=_Ndist(v->elements,_now(v,j),ppt);
+	float thismetric=_Ndist(v->elements,_now(v,j),ppt);
         if(thismetric<firstmetric){
           firstmetric=thismetric;
           firstentry=j;
@@ -423,7 +423,7 @@
       if(v->assigned[j]==0){
         fprintf(stderr,"found an unused entry!  removing...\n");
         v->entries--;
- -	memcpy(_now(v,j),_now(v,v->entries),sizeof(double)*v->elements);
+	memcpy(_now(v,j),_now(v,v->entries),sizeof(float)*v->elements);
         v->assigned[j]=v->assigned[v->elements];
         memcpy(quantlist+j*v->elements,quantlist+v->entries*v->elements,
                sizeof(long)*v->elements);
@@ -460,15 +460,15 @@
 
     for(i=0;i<v->points;i++)membership[i]=-1;
     for(i=0;i<v->points;i++){
- -      double *ppt=_point(v,i);
+      float *ppt=_point(v,i);
       long   firstentry=0;
- -      double firstmetric=_Ndist(v->elements,_now(v,0),ppt);
+      float firstmetric=_Ndist(v->elements,_now(v,0),ppt);
     
       if(!(i&0xff))spinnit("assigning... ",v->points-i);
 
       for(j=1;j<v->entries;j++){
         if(v->assigned[j]!=-1){
- -	  double thismetric=_Ndist(v->elements,_now(v,j),ppt);
+	  float thismetric=_Ndist(v->elements,_now(v,j),ppt);
           if(thismetric<=firstmetric){
             firstmetric=thismetric;
             firstentry=j;
@@ -595,7 +595,7 @@
 
     /* map lengthlist and vallist with index */
     c->lengthlist=calloc(c->entries,sizeof(long));
- -    b->valuelist=malloc(sizeof(double)*c->entries*c->dim);
+    b->valuelist=malloc(sizeof(float)*c->entries*c->dim);
     c->quantlist=malloc(sizeof(long)*c->entries*c->dim);
     for(i=0;i<c->entries;i++){
       long e=index[i];

1.3       +3 -3      vorbis/vq/vqsplit.h

Index: vqsplit.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/vqsplit.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
- --- vqsplit.h	2000/05/08 20:49:51	1.2
+++ vqsplit.h	2000/10/12 03:13:02	1.3
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: build a VQ codebook decision tree 
- - last mod: $Id: vqsplit.h,v 1.2 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: vqsplit.h,v 1.3 2000/10/12 03:13:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -22,8 +22,8 @@
 #include "vorbis/codebook.h"
 
 extern void vqsp_book(vqgen *v,codebook *b,long *quantlist);
- -extern int vqenc_entry(codebook *b,double *val);
- -extern int lp_split(double *pointlist,long totalpoints,
+extern int vqenc_entry(codebook *b,float *val);
+extern int lp_split(float *pointlist,long totalpoints,
                     codebook *b,
                     long *entryindex,long entries, 
                     long *pointindex,long points,

------- End of Forwarded Message

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list