[xiph-cvs] cvs commit: vorbis/xmms Makefile.in README vorbis.c
Jack Moffitt
jack at xiph.org
Tue Sep 26 23:21:05 PDT 2000
jack 00/09/26 23:21:05
Modified: . Tag: branch_postbeta2 configure.in
examples Tag: branch_postbeta2 Makefile.in
chaining_example.c decoder_example.c
encoder_example.c vorbisfile_example.c
include/vorbis Tag: branch_postbeta2 codec.h
lib Tag: branch_postbeta2 analysis.c block.c
bookinternal.h codebook.c envelope.c floor0.c
info.c mapping0.c os.h psytune.c res0.c scales.h
sharedbook.c synthesis.c vorbisfile.c
Added: . Tag: branch_postbeta2 .cvsignore Makefile.am
autogen.sh libvorbis.spec
examples Tag: branch_postbeta2 .cvsignore
include Tag: branch_postbeta2 .cvsignore Makefile.am
include/vorbis Tag: branch_postbeta2 .cvsignore Makefile.am
include/vorbis/book Tag: branch_postbeta2 .cvsignore
Makefile.am
lib Tag: branch_postbeta2 .cvsignore Makefile.am
Removed: . Tag: branch_postbeta2 COPYING.LIB Makefile.in
configure.guess configure.sub install.sh
vorbis.spec
docs Tag: branch_postbeta2 framing.html oggstream.html
programming.html stream.png v-comment.html
vorbis.html vorbisword2.png wait.png white-ogg.png
white-xifish.png
examples Tag: branch_postbeta2 seeking_test.c
include/vorbis Tag: branch_postbeta2 internal.h
os_types.h.in
kmpg Tag: branch_postbeta2 Makefile.in README
vorbisPlugin.cpp vorbisPlugin.h
lib Tag: branch_postbeta2 framing.c
vorbis-tools Tag: branch_postbeta2 Changelog Makefile.in
audio.c audio.h encode.h getopt.c getopt.h
getopt1.c mp3tovorbis oe_unix.c oe_win32.c ogg123.1
oggenc.1 oggenc.c platform.h riff.h
vorbis-tools/libao Tag: branch_postbeta2 COPYING Makefile.in
README ao_esd.c ao_irix.c ao_libs.inc.in ao_null.c
ao_solaris.c config.h.in configure configure.in
winamp Tag: branch_postbeta2 README
xmms Tag: branch_postbeta2 Makefile.in README vorbis.c
Log:
merged branch_jackoggsvorbis into branch_postbeta2
Revision Changes Path
No revision
No revision
1.20.2.4 +75 -265 vorbis/configure.in
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis/configure.in,v
retrieving revision 1.20.2.3
retrieving revision 1.20.2.4
diff -u -r1.20.2.3 -r1.20.2.4
--- configure.in 2000/09/02 05:19:24 1.20.2.3
+++ configure.in 2000/09/27 06:20:53 1.20.2.4
@@ -1,59 +1,64 @@
-# $Id: configure.in,v 1.20.2.3 2000/09/02 05:19:24 xiphmont Exp $
+dnl Process this file with autoconf to produce a configure script
+dnl ------------------------------------------------
+dnl Initialization and Versioning
+dnl ------------------------------------------------
+
AC_INIT(lib/mdct.c)
-#AC_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(libvorbis,1.0.0)
-cp configure.guess config.guess
-cp configure.sub config.sub
+dnl Library versioning
-AC_CANONICAL_HOST
+LIB_CURRENT=0
+LIB_REVISION=0
+LIB_AGE=0
+AC_SUBST(LIB_CURRENT)
+AC_SUBST(LIB_REVISION)
+AC_SUBST(LIB_AGE)
+
+dnl --------------------------------------------------
+dnl Check for programs
+dnl --------------------------------------------------
-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
-
-esac
-
+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)
-
-#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="")
+AM_PROG_LIBTOOL
+
+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,7 +66,7 @@
case $host in
*86-*-linux*)
DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
- OPT="-O20 -ffast-math -mno-ieee-fp -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"
@@ -101,259 +106,64 @@
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
-
-AC_HEADER_STDC
-
-dnl AC_PATH_X
-dnl AC_PATH_XTRA
-
-#AC_CHECK_LIB(pthread, pthread_create,
-# pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
-# We no longer use config.h
-AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
-
-#dnl Linuxthreads require you to define _REENTRANT in all threaded
-#dnl code. Bogus, bogus...
-#
-#if test -n "$pthread_lib"; then
-# case $host in
-# i?86-*-linux*)
-# AC_DEFINE(_REENTRANT)
-# ;;
-# esac
-#fi
-# We no longer use config.h
-
-#if test -n "$x_libraries"; then
-# XOGG="yes"
-#
-# dnl If we find libgtk installed, great; otherwise assume we have
-# dnl to build it ourselves.
-#
-# AC_CHECK_LIB(gtk, gtk_main, :, LIBGTKDIR="libgtk", $X_LIBS -lglib -lgdk -lX11 -lXext -lm)
-#
-# dnl libpthread is required for xogg.
-#
-# if test -z "$pthread_lib"; then XOGG=""; fi
-#
-# dnl If we don't have libgtk installed, and we don't have a libgtk
-# dnl subdirectory to build the library ourself, we can't build xogg.
-#
-# if test -n "$LIBGTKDIR" -a ! -d "$LIBGTKDIR"; then
-# XOGG=""
-# LIBGTKDIR=""
-# fi
-#fi
-
-dnl This seems to be the only way to make autoconf only *sometimes* configure
-dnl a subdirectory with AC_CONFIG_SUBDIRS. "__noconf" is assumed to not
-dnl exist as a directory, so configure won't try to recursively enter it, unless
-dnl the shell variable $dummy is reset to an existing directory inside the
-dnl if clause.
-
-dummy="__noconf"
-
-#if test -d "$LIBGTKDIR"; then
-# enable_shared="no"; export enable_shared
-# dummy="libgtk"
-# AC_CONFIG_SUBDIRS("$dummy")
-# X_LIBS="-L${srcdir}/libgtk/gtk/.libs -L${srcdir}/libgtk/gdk/.libs -L${srcdir}/libgtk/glib/.libs $X_LIBS"
-#fi
-
-# check macro modified from Jon Shiring's to compensate for autoconf's lagging
-# behind the times on type madness
-
-AC_MSG_CHECKING(for int16_t)
-AC_CACHE_VAL(has_int16_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-int16_t foo;
-int main() {return 0;}
-],
-has_int16_t=yes,
-has_int16_t=no,
-has_int16_t=no
-)])
-AC_MSG_RESULT($has_int16_t)
-
-AC_MSG_CHECKING(for int32_t)
-AC_CACHE_VAL(has_int32_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-int32_t foo;
-int main() {return 0;}
-],
-has_int32_t=yes,
-has_int32_t=no,
-has_int32_t=no
-)])
-AC_MSG_RESULT($has_int32_t)
-
-AC_MSG_CHECKING(for uint32_t)
-AC_CACHE_VAL(has_uint32_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-uint32_t foo;
-int main() {return 0;}
-],
-has_uint32_t=yes,
-has_uint32_t=no,
-has_uint32_t=no
-)])
-AC_MSG_RESULT($has_uint32_t)
-
-AC_MSG_CHECKING(for u_int32_t)
-AC_CACHE_VAL(has_u_int32_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-u_int32_t foo;
-int main() {return 0;}
-],
-has_u_int32_t=yes,
-has_u_int32_t=no,
-has_u_int32_t=no
-)])
-AC_MSG_RESULT($has_u_int32_t)
-
-AC_MSG_CHECKING(for int64_t)
-AC_CACHE_VAL(has_int64_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-int64_t foo;
-int main() {return 0;}
-],
-has_int64_t=yes,
-has_int64_t=no,
-has_int64_t=no
-)])
-AC_MSG_RESULT($has_int64_t)
-
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
+dnl --------------------------------------------------
+dnl Check for headers
+dnl --------------------------------------------------
-if test x$has_int16_t = "xyes" ; then
- SIZE16="int16_t"
-else
- case 2 in
- $ac_cv_sizeof_short) SIZE16="short";;
- $ac_cv_sizeof_int) SIZE16="int";;
- 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"
-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 xmms/Makefile kmpg/Makefile)
+AC_OUTPUT(Makefile lib/Makefile doc/Makefile include/Makefile include/vorbis/Makefile include/vorbis/book/Makefile)
No revision
No revision
1.1.4.1 +10 -0 vorbis/Attic/.cvsignore
1.1.4.1 +13 -0 vorbis/Attic/Makefile.am
1.1.4.1 +47 -0 vorbis/Attic/autogen.sh
1.1.4.1 +73 -0 vorbis/Attic/libvorbis.spec
No revision
No revision
1.13.2.1 +2 -2 vorbis/examples/Makefile.in
Index: Makefile.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis/examples/Makefile.in,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -r1.13 -r1.13.2.1
--- Makefile.in 2000/08/15 11:53:18 1.13
+++ Makefile.in 2000/09/27 06:20:54 1.13.2.1
@@ -1,6 +1,6 @@
# vorbis makefile configured for use with gcc on any platform
-# $Id: Makefile.in,v 1.13 2000/08/15 11:53:18 xiphmont Exp $
+# $Id: Makefile.in,v 1.13.2.1 2000/09/27 06:20:54 jack Exp $
###############################################################################
# #
@@ -28,7 +28,7 @@
LIBS=@LIBS@
HFILES = ../include/vorbis/codec.h ../include/vorbis/vorbisfile.h \
- ../include/vorbis/internal.h ../include/vorbis/backends.h \
+ ../include/vorbis/backends.h \
../include/vorbis/codebook.h
OFILES = encoder_example.o decoder_example.o chaining_example.o \
vorbisfile_example.o seeking_test.o
1.5.6.1 +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.5.6.1
diff -u -r1.5 -r1.5.6.1
--- chaining_example.c 2000/06/14 10:13:35 1.5
+++ chaining_example.c 2000/09/27 06:20:54 1.5.6.1
@@ -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.5.6.1 2000/09/27 06:20:54 jack 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.11.2.4 +2 -2 vorbis/examples/decoder_example.c
Index: decoder_example.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/examples/decoder_example.c,v
retrieving revision 1.11.2.3
retrieving revision 1.11.2.4
diff -u -r1.11.2.3 -r1.11.2.4
--- decoder_example.c 2000/09/02 05:19:24 1.11.2.3
+++ decoder_example.c 2000/09/27 06:20:54 1.11.2.4
@@ -12,7 +12,7 @@
********************************************************************
function: simple example decoder
- last mod: $Id: decoder_example.c,v 1.11.2.3 2000/09/02 05:19:24 xiphmont Exp $
+ last mod: $Id: decoder_example.c,v 1.11.2.4 2000/09/27 06:20:54 jack 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>
1.13.2.3 +2 -2 vorbis/examples/encoder_example.c
Index: encoder_example.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/examples/encoder_example.c,v
retrieving revision 1.13.2.2
retrieving revision 1.13.2.3
diff -u -r1.13.2.2 -r1.13.2.3
--- encoder_example.c 2000/09/06 13:28:33 1.13.2.2
+++ encoder_example.c 2000/09/27 06:20:54 1.13.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: simple example encoder
- last mod: $Id: encoder_example.c,v 1.13.2.2 2000/09/06 13:28:33 msmith Exp $
+ last mod: $Id: encoder_example.c,v 1.13.2.3 2000/09/27 06:20:54 jack 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>
1.1.6.1 +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.1.6.1
diff -u -r1.1 -r1.1.6.1
--- vorbisfile_example.c 2000/06/19 10:05:57 1.1
+++ vorbisfile_example.c 2000/09/27 06:20:54 1.1.6.1
@@ -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.1.6.1 2000/09/27 06:20:54 jack 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>
No revision
No revision
1.1.4.1 +4 -0 vorbis/examples/Attic/.cvsignore
No revision
No revision
1.1.4.1 +2 -0 vorbis/include/Attic/.cvsignore
1.1.4.1 +5 -0 vorbis/include/Attic/Makefile.am
No revision
No revision
1.27.2.3 +4 -116 vorbis/include/vorbis/codec.h
Index: codec.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/codec.h,v
retrieving revision 1.27.2.2
retrieving revision 1.27.2.3
diff -u -r1.27.2.2 -r1.27.2.3
--- codec.h 2000/08/31 08:59:58 1.27.2.2
+++ codec.h 2000/09/27 06:20:56 1.27.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: libvorbis codec headers
- last mod: $Id: codec.h,v 1.27.2.2 2000/08/31 08:59:58 xiphmont Exp $
+ last mod: $Id: codec.h,v 1.27.2.3 2000/09/27 06:20:56 jack 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;
@@ -150,81 +149,6 @@
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 ****************************************************/
@@ -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;
@@ -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 */
@@ -347,42 +271,6 @@
files. Over the net (such as with UDP), the framing and
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 ***************************************/
No revision
No revision
1.1.4.1 +2 -0 vorbis/include/vorbis/Attic/.cvsignore
1.1.4.1 +11 -0 vorbis/include/vorbis/Attic/Makefile.am
No revision
No revision
1.1.4.1 +2 -0 vorbis/include/vorbis/book/Attic/.cvsignore
1.1.4.1 +30 -0 vorbis/include/vorbis/book/Attic/Makefile.am
No revision
No revision
1.33.2.3 +10 -10 vorbis/lib/analysis.c
Index: analysis.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/analysis.c,v
retrieving revision 1.33.2.2
retrieving revision 1.33.2.3
diff -u -r1.33.2.2 -r1.33.2.3
--- analysis.c 2000/09/02 09:39:19 1.33.2.2
+++ analysis.c 2000/09/27 06:20:58 1.33.2.3
@@ -12,15 +12,15 @@
********************************************************************
function: single-block PCM analysis mode dispatch
- last mod: $Id: analysis.c,v 1.33.2.2 2000/09/02 09:39:19 xiphmont Exp $
+ last mod: $Id: analysis.c,v 1.33.2.3 2000/09/27 06:20:58 jack 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,10 +49,10 @@
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);
+ oggpack_write(&vb->opb,vb->lW,1);
+ oggpack_write(&vb->opb,vb->nW,1);
fprintf(stderr,"*");
}else{
fprintf(stderr,".");
@@ -63,11 +63,11 @@
/* 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);
1.38.2.3 +18 -18 vorbis/lib/block.c
Index: block.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/block.c,v
retrieving revision 1.38.2.2
retrieving revision 1.38.2.3
diff -u -r1.38.2.2 -r1.38.2.3
--- block.c 2000/09/02 05:19:24 1.38.2.2
+++ block.c 2000/09/27 06:20:58 1.38.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: PCM data vector blocking, windowing and dis/reassembly
- last mod: $Id: block.c,v 1.38.2.2 2000/09/02 05:19:24 xiphmont Exp $
+ last mod: $Id: block.c,v 1.38.2.3 2000/09/27 06:20:58 jack 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);
@@ -512,7 +512,7 @@
}
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 */
@@ -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,7 +578,7 @@
/* 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);
@@ -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;
@@ -673,7 +673,7 @@
/* 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,
@@ -681,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;
}
}
1.8.6.3 +2 -2 vorbis/lib/bookinternal.h
Index: bookinternal.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/bookinternal.h,v
retrieving revision 1.8.6.2
retrieving revision 1.8.6.3
diff -u -r1.8.6.2 -r1.8.6.3
--- bookinternal.h 2000/09/02 05:19:24 1.8.6.2
+++ bookinternal.h 2000/09/27 06:20:59 1.8.6.3
@@ -12,15 +12,15 @@
********************************************************************
function: basic codebook pack/unpack/code/decode operations
- last mod: $Id: bookinternal.h,v 1.8.6.2 2000/09/02 05:19:24 xiphmont Exp $
+ last mod: $Id: bookinternal.h,v 1.8.6.3 2000/09/27 06:20:59 jack 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);
1.17.4.4 +46 -46 vorbis/lib/codebook.c
Index: codebook.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/codebook.c,v
retrieving revision 1.17.4.3
retrieving revision 1.17.4.4
diff -u -r1.17.4.3 -r1.17.4.4
--- codebook.c 2000/09/03 06:24:00 1.17.4.3
+++ codebook.c 2000/09/27 06:20:59 1.17.4.4
@@ -12,16 +12,16 @@
********************************************************************
function: basic codebook pack/unpack/code/decode operations
- last mod: $Id: codebook.c,v 1.17.4.3 2000/09/03 06:24:00 jack Exp $
+ last mod: $Id: codebook.c,v 1.17.4.4 2000/09/27 06:20:59 jack 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;
@@ -235,7 +235,7 @@
/* quantized values */
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]);
}
@@ -317,17 +317,17 @@
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);
+ int lok = oggpack_look(b, t->tabn);
if (lok >= 0) {
ptr = t->tab[lok];
- _oggpack_adv(b, t->tabl[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;
@@ -495,7 +495,7 @@
oggpack_buffer write;
oggpack_buffer read;
long ptr=0,i;
- _oggpack_writeinit(&write);
+ oggpack_writeinit(&write);
fprintf(stderr,"Testing codebook abstraction...:\n");
@@ -510,11 +510,11 @@
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);
@@ -525,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.21.2.3 +10 -10 vorbis/lib/envelope.c
Index: envelope.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/envelope.c,v
retrieving revision 1.21.2.2
retrieving revision 1.21.2.3
diff -u -r1.21.2.2 -r1.21.2.3
--- envelope.c 2000/08/31 09:00:00 1.21.2.2
+++ envelope.c 2000/09/27 06:20:59 1.21.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: PCM data envelope analysis and manipulation
- last mod: $Id: envelope.c,v 1.21.2.2 2000/08/31 09:00:00 xiphmont Exp $
+ last mod: $Id: envelope.c,v 1.21.2.3 2000/09/27 06:20:59 jack 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
@@ -115,16 +115,16 @@
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);
@@ -140,8 +140,8 @@
}
}
- /*_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];
@@ -191,10 +191,10 @@
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;
1.23.2.5 +19 -19 vorbis/lib/floor0.c
Index: floor0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/floor0.c,v
retrieving revision 1.23.2.4
retrieving revision 1.23.2.5
diff -u -r1.23.2.4 -r1.23.2.5
--- floor0.c 2000/09/26 22:31:50 1.23.2.4
+++ floor0.c 2000/09/27 06:20:59 1.23.2.5
@@ -12,15 +12,15 @@
********************************************************************
function: floor backend 0 implementation
- last mod: $Id: floor0.c,v 1.23.2.4 2000/09/26 22:31:50 xiphmont Exp $
+ last mod: $Id: floor0.c,v 1.23.2.5 2000/09/27 06:20:59 jack 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"
@@ -91,25 +91,25 @@
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 *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,7 +117,7 @@
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);
@@ -272,7 +272,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
@@ -284,7 +284,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);
@@ -347,7 +347,7 @@
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;
float amp=(float)ampraw/maxval*info->ampdB;
1.30.2.1 +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.30.2.1
diff -u -r1.30 -r1.30.2.1
--- info.c 2000/08/15 09:09:43 1.30
+++ info.c 2000/09/27 06:20:59 1.30.2.1
@@ -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.30.2.1 2000/09/27 06:20:59 jack 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.15.2.3 +12 -13 vorbis/lib/mapping0.c
Index: mapping0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mapping0.c,v
retrieving revision 1.15.2.2
retrieving revision 1.15.2.3
diff -u -r1.15.2.2 -r1.15.2.3
--- mapping0.c 2000/09/02 05:19:25 1.15.2.2
+++ mapping0.c 2000/09/27 06:20:59 1.15.2.3
@@ -12,16 +12,16 @@
********************************************************************
function: channel mapping 0 implementation
- last mod: $Id: mapping0.c,v 1.15.2.2 2000/09/02 05:19:25 xiphmont Exp $
+ last mod: $Id: mapping0.c,v 1.15.2.3 2000/09/27 06:20:59 jack 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"
@@ -147,16 +147,16 @@
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);
}
}
@@ -166,20 +166,20 @@
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;
}
@@ -196,7 +196,6 @@
#include "envelope.h"
#include "mdct.h"
#include "psy.h"
-#include "bitwise.h"
#include "scales.h"
/* no time mapping implementation for now */
1.9.2.1 +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.9.2.1
diff -u -r1.9 -r1.9.2.1
--- os.h 2000/08/23 06:38:49 1.9
+++ os.h 2000/09/27 06:20:59 1.9.2.1
@@ -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.9.2.1 2000/09/27 06:20:59 jack 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.6.2.3 +7 -8 vorbis/lib/psytune.c
Index: psytune.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psytune.c,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -u -r1.6.2.2 -r1.6.2.3
--- psytune.c 2000/09/26 22:31:50 1.6.2.2
+++ psytune.c 2000/09/27 06:20:59 1.6.2.3
@@ -13,7 +13,7 @@
function: simple utility that runs audio through the psychoacoustics
without encoding
- last mod: $Id: psytune.c,v 1.6.2.2 2000/09/26 22:31:50 xiphmont Exp $
+ last mod: $Id: psytune.c,v 1.6.2.3 2000/09/27 06:20:59 jack Exp $
********************************************************************/
@@ -150,9 +150,8 @@
lpc_lookup lpclook;
} vorbis_look_floor0;
+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;
@@ -279,7 +278,7 @@
for(i=0;i<2;i++){
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++)
@@ -287,7 +286,7 @@
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]);
@@ -298,7 +297,7 @@
/*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++){
@@ -313,14 +312,14 @@
}
}
- 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 */
1.17.2.4 +16 -16 vorbis/lib/res0.c
Index: res0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/res0.c,v
retrieving revision 1.17.2.3
retrieving revision 1.17.2.4
diff -u -r1.17.2.3 -r1.17.2.4
--- res0.c 2000/09/02 09:39:20 1.17.2.3
+++ res0.c 2000/09/27 06:21:00 1.17.2.4
@@ -12,7 +12,7 @@
********************************************************************
function: residue backend 0 implementation
- last mod: $Id: res0.c,v 1.17.2.3 2000/09/02 09:39:20 xiphmont Exp $
+ last mod: $Id: res0.c,v 1.17.2.4 2000/09/27 06:21:00 jack 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"
@@ -70,19 +70,19 @@
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);
}
@@ -91,20 +91,20 @@
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++)
1.5.6.2 +3 -3 vorbis/lib/scales.h
Index: scales.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/scales.h,v
retrieving revision 1.5.6.1
retrieving revision 1.5.6.2
diff -u -r1.5.6.1 -r1.5.6.2
--- scales.h 2000/09/02 05:19:25 1.5.6.1
+++ scales.h 2000/09/27 06:21:00 1.5.6.2
@@ -12,7 +12,7 @@
********************************************************************
function: linear scale -> dB, Bark and Mel scales
- last mod: $Id: scales.h,v 1.5.6.1 2000/09/02 05:19:25 xiphmont Exp $
+ last mod: $Id: scales.h,v 1.5.6.2 2000/09/27 06:21:00 jack Exp $
********************************************************************/
@@ -23,8 +23,8 @@
/* 20log10(x) */
#define DYNAMIC_RANGE_dB 200.
-#define todB(x) ((x)==0?-9.e40:log(fabs(x))*8.6858896)
-#define todB_nn(x) ((x)==0?-9.e40:log(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.7.4.4 +2 -2 vorbis/lib/sharedbook.c
Index: sharedbook.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/sharedbook.c,v
retrieving revision 1.7.4.3
retrieving revision 1.7.4.4
diff -u -r1.7.4.3 -r1.7.4.4
--- sharedbook.c 2000/09/02 05:19:25 1.7.4.3
+++ sharedbook.c 2000/09/27 06:21:00 1.7.4.4
@@ -12,17 +12,17 @@
********************************************************************
function: basic shared codebook operations
- last mod: $Id: sharedbook.c,v 1.7.4.3 2000/09/02 05:19:25 xiphmont Exp $
+ last mod: $Id: sharedbook.c,v 1.7.4.4 2000/09/27 06:21:00 jack 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"
1.17.4.2 +8 -8 vorbis/lib/synthesis.c
Index: synthesis.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/synthesis.c,v
retrieving revision 1.17.4.1
retrieving revision 1.17.4.2
diff -u -r1.17.4.1 -r1.17.4.2
--- synthesis.c 2000/08/31 09:00:02 1.17.4.1
+++ synthesis.c 2000/09/27 06:21:00 1.17.4.2
@@ -12,14 +12,14 @@
********************************************************************
function: single-block PCM synthesis
- last mod: $Id: synthesis.c,v 1.17.4.1 2000/08/31 09:00:02 xiphmont Exp $
+ last mod: $Id: synthesis.c,v 1.17.4.2 2000/09/27 06:21:00 jack 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,7 +55,7 @@
}
/* 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;
1.27.2.3 +15 -15 vorbis/lib/vorbisfile.c
Index: vorbisfile.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisfile.c,v
retrieving revision 1.27.2.2
retrieving revision 1.27.2.3
diff -u -r1.27.2.2 -r1.27.2.3
--- vorbisfile.c 2000/08/31 09:00:02 1.27.2.2
+++ vorbisfile.c 2000/09/27 06:21:00 1.27.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.c,v 1.27.2.2 2000/08/31 09:00:02 xiphmont Exp $
+ last mod: $Id: vorbisfile.c,v 1.27.2.3 2000/09/27 06:21:00 jack Exp $
********************************************************************/
@@ -306,9 +306,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;
}
}
@@ -413,14 +413,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 +438,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 +449,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);
}
@@ -766,7 +766,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 +851,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;
No revision
No revision
1.1.4.1 +6 -0 vorbis/lib/Attic/.cvsignore
1.1.4.1 +21 -0 vorbis/lib/Attic/Makefile.am
--- >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