Update twolame to 0.3.13.

This commit is contained in:
lllucius 2013-10-24 04:32:13 +00:00
parent 99acb56af6
commit 3effa9693f
124 changed files with 44671 additions and 44430 deletions

View File

@ -294,7 +294,7 @@ twolame
-------
http://www.twolame.org/
MPEG I layer 2 audio encoding library used for MP2 exports
Version in Audacity SVN: 0.3.12
Version in Audacity SVN: 0.3.13
Patches: None
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
by default

View File

@ -2,12 +2,12 @@ TwoLAME Authors
===============
.Nicholas Humfrey - <njh at ecs.soton.ac.uk>
.Nicholas J Humfrey - <njh at aelius.com>
- Current Maintainer
- New automake build system
- Added libsndfile support
- Reference documentation for API
- Lots of cleaning and improving !
- Lots of cleaning and improving!
- New frontend
@ -15,7 +15,7 @@ TwoLAME Authors
- Changes to make libtwolame thread-safe
.'Mean' - <mean@users.sourceforge.net>
.'Mean' - <mean at users.sourceforge.net>
- Fix for AMD64 processors
- Fix for CRC protection

View File

@ -1,6 +1,24 @@
What is new in TwoLAME
======================
Version 0.3.13 (2010-01-21)
---------------------------
- Fixed documentation location (--docdir in configure)
* thanks to Chris Mayo for patch
- Moved source code control to Github
- Improvements to build system
- Updated to autoconf 2.60, libtool 2.2, automake 1.10 and Doxygen 1.7.3
- Fix problem with 'extern inline' by changing them to 'static inline'
- Wrote perl script to test output of the frontend
- Changed all debugging messages, writing to stdout to write to stderr
- Removed calls to exit() from libtwolame.
- Added --non-copyright option (which is enabled by default)
- Fix for bad copy/paste of variable assignment.
- Manpage correction
- Changed fopen() options to wb to fix Windows
Version 0.3.12 (2008-01-09)
---------------------------

View File

@ -1,11 +1,15 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I build-scripts
SUBDIRS = libtwolame frontend simplefrontend doc
SUBDIRS = libtwolame frontend simplefrontend doc tests
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = twolame.pc
INDENT = indent -npro -kr -nsob -fca -blf -ip1 -hnl -l100 -lc100 -nut -ts4 -v
indent:
find $(top_srcdir) -type f -name "*.[ch]" -print -exec $(INDENT) {} ';'
EXTRA_DIST = \
autogen.sh \
@ -17,5 +21,4 @@ EXTRA_DIST = \
win32/libtwolame_static.vcproj \
win32/winutil.h
#tell aclocal where extra macros can be found
ACLOCAL_AMFLAGS = -I build/m4
test: check

View File

@ -32,23 +32,26 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/twolame.pc.in \
$(top_srcdir)/build/config.h.in $(top_srcdir)/configure \
AUTHORS COPYING ChangeLog TODO build/config.guess \
build/config.sub build/depcomp build/install-sh \
build/ltmain.sh build/missing build/mkinstalldirs
$(top_srcdir)/configure AUTHORS COPYING ChangeLog TODO \
build-scripts/config.guess build-scripts/config.sub \
build-scripts/depcomp build-scripts/install-sh \
build-scripts/ltmain.sh build-scripts/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/build/m4/libtool.m4 \
$(top_srcdir)/build/m4/pkg.m4 $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/build-scripts/libtool.m4 \
$(top_srcdir)/build-scripts/ltoptions.m4 \
$(top_srcdir)/build-scripts/ltsugar.m4 \
$(top_srcdir)/build-scripts/ltversion.m4 \
$(top_srcdir)/build-scripts/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/build/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/build/config.h
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtwolame/config.h
CONFIG_CLEAN_FILES = twolame.pc
SOURCES =
DIST_SOURCES =
@ -96,46 +99,53 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_ASCIIDOC = @PATH_ASCIIDOC@
PATH_DOXYGEN = @PATH_DOXYGEN@
PATH_SEPARATOR = @PATH_SEPARATOR@
PATH_XMLTO = @PATH_XMLTO@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
@ -144,17 +154,17 @@ SHELL = @SHELL@
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
SNDFILE_LIBS = @SNDFILE_LIBS@
STRIP = @STRIP@
STWOLAME_BIN = @STWOLAME_BIN@
TWOLAME_BIN = @TWOLAME_BIN@
TWOLAME_SO_VERSION = @TWOLAME_SO_VERSION@
VERSION = @VERSION@
WARNING_CFLAGS = @WARNING_CFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@ -196,18 +206,16 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = libtwolame frontend simplefrontend doc
ACLOCAL_AMFLAGS = -I build-scripts
SUBDIRS = libtwolame frontend simplefrontend doc tests
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = twolame.pc
INDENT = indent -npro -kr -nsob -fca -blf -ip1 -hnl -l100 -lc100 -nut -ts4 -v
EXTRA_DIST = \
autogen.sh \
twolame.pc.in \
@ -218,9 +226,6 @@ EXTRA_DIST = \
win32/libtwolame_static.vcproj \
win32/winutil.h
#tell aclocal where extra macros can be found
ACLOCAL_AMFLAGS = -I build/m4
all: all-recursive
.SUFFIXES:
@ -257,23 +262,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
build/config.h: build/stamp-h1
@if test ! -f $@; then \
rm -f build/stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) build/stamp-h1; \
else :; fi
build/stamp-h1: $(top_srcdir)/build/config.h.in $(top_builddir)/config.status
@rm -f build/stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status build/config.h
$(top_srcdir)/build/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f build/stamp-h1
touch $@
distclean-hdr:
-rm -f build/config.h build/stamp-h1
twolame.pc: $(top_builddir)/config.status $(srcdir)/twolame.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
@ -620,8 +608,8 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
@ -678,19 +666,23 @@ uninstall-am: uninstall-pkgconfigDATA
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
distclean distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-recursive uninstall uninstall-am \
distclean distclean-generic distclean-libtool distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-pkgconfigDATA install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am \
uninstall-pkgconfigDATA
indent:
find $(top_srcdir) -type f -name "*.[ch]" -print -exec $(INDENT) {} ';'
test: check
# 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:

View File

@ -1,22 +1,18 @@
TwoLAME TODO List
=================
- Fix bug with Padding and framesizes with samplerate of 44.1 and 22kHz
- use Exact-width integer types (eg uint16_t)
- Add libresample support to libtoolame (toolame_set_in_samplerate etc.)
- parameter checking in toolame.c using assert
- Create a new toolame.spec (be sure to include twolame.pc)
- quite a lot of duplicated code between toolame_encode_buffer_interleaved
and toolame_encode_buffer
- sort out changing parameter for toolame_set_VBR_q from FLOAT to int (like LAME)
- Add libresample support to libtwolame (twolame_set_in_samplerate etc.)
- parameter checking in twolame.c using assert
- Create a new twolame.spec (be sure to include twolame.pc)
- quite a lot of duplicated code between twolame_encode_buffer_interleaved
and twolame_encode_buffer
- sort out changing parameter for twolame_set_VBR_q from FLOAT to int (like LAME)
- better use of verbosity settings
- full options sanity checking/verification in toolame_init_params
- full options sanity checking/verification in twolame_init_params
- don't allow twolame_set_* after twolame_init_params() has been called

1067
lib-src/twolame/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,80 +1,328 @@
#!/bin/sh
# Run this to set up the build system: configure, makefiles, etc.
#
# autogen.sh - Generates initial makefiles from a pristine GIT tree
#
# USAGE:
# autogen.sh [configure options]
#
# Configuration is affected by environment variables as follows:
#
# DRYRUN
# If set to any value it will do no configuring but will emit the
# programs that would be run.
# e.g. DRYRUN=1 ./autogen.sh
#
# AUTOMAKE ACLOCAL AUTOCONF AUTOHEADER LIBTOOLIZE
# If set (named after program) then this overrides any searching for
# the programs on the current PATH.
# e.g. AUTOMAKE=automake-1.7 ACLOCAL=aclocal-1.7 ./autogen.sh
#
# PATH
# Where the programs are searched for
#
# SRCDIR (default .)
# Source directory
#
# This script is based on similar scripts used in various tools
# commonly made available via GIT and used with GNU automake.
# Try 'locate autogen.sh' on your system and see what you get.
#
# This script is in the public domain
#
package="TwoLAME"
# Directory for the sources
SRCDIR=${SRCDIR-.}
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
cd "$srcdir"
DIE=0
(autoheader --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $package."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $package."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to compile $package."
echo "Download the appropriate package for your system,"
echo "or get the source from one of the GNU ftp sites"
echo "listed in http://www.gnu.org/order/ftp.html"
DIE=1
}
(libtoolize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have libtool installed to compile $package."
echo "Download the appropriate package for your system,"
echo "or get the source from one of the GNU ftp sites"
echo "listed in http://www.gnu.org/order/ftp.html"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
# Because GIT doesn't support empty directories
if [ ! -d "$SRCDIR/build-scripts" ]; then
mkdir "$SRCDIR/build-scripts"
fi
echo "Generating configuration files for $package, please wait...."
# Create the (empty) build directory if it doesn't exist
if ! [ -d build ]; then
echo " creating build directory"
mkdir build
# The programs required for configuring which will be searched for
# in the current PATH.
# Set an envariable of the same name in uppercase, to override scan
#
programs="automake aclocal autoconf autoheader libtoolize"
confs=`find . -name configure.ac -print`
ltdl_args=
if grep "^AC_LIBLTDL_" $confs >/dev/null; then
ltdl_args="--ltdl"
fi
# Some dependencies for autotools:
# automake 1.11 requires autoconf 2.62
# automake 1.10 requires autoconf 2.60
# automake 1.9 requires autoconf 2.58
# automake 1.8 requires autoconf 2.58
# automake 1.7 requires autoconf 2.54
automake_min_vers=011000
aclocal_min_vers=$automake_min_vers
autoconf_min_vers=026000
autoheader_min_vers=$autoconf_min_vers
libtoolize_min_vers=020200
# Default program arguments
automake_args="--gnu --add-missing --force --copy -Wall"
aclocal_args=
autoconf_args=
libtoolize_args="--force --copy --automake $ltdl_args"
configure_args="--enable-maintainer-mode"
run_cmd() {
echo " running $* ..."
if ! $*; then
echo failed!
exit 1
# You should not need to edit below here
######################################################################
# number comparisons may need a C locale
LANG=C
LC_NUMERIC=C
program=`basename $0`
if test "X$DRYRUN" != X; then
DRYRUN=echo
fi
cat > autogen-get-version.pl <<EOF
use File::Basename;
my \$prog=basename \$0;
die "\$prog: USAGE PATH PROGRAM-NAME\n e.g. \$prog /usr/bin/foo-123 foo\n"
unless @ARGV==2;
my(\$path,\$name)=@ARGV;
exit 0 if !-f \$path;
die "\$prog: \$path not found\n" if !-r \$path;
my \$mname=\$name; \$mname =~ s/^g(libtoolize)\$/\$1/;
my(@vnums);
for my \$varg (qw(--version -version)) {
my \$cmd="\$path \$varg";
open(PIPE, "\$cmd 2>&1 |") || next;
while(<PIPE>) {
chomp;
next if @vnums; # drain pipe if we got a vnums
next unless /^\$mname/i;
my(\$v)=/(\S+)\$/i; \$v =~ s/-.*\$//;
@vnums=grep { defined \$_ && !/^\s*\$/} map { s/\D//g; \$_; } split(/\./, \$v);
}
close(PIPE);
last if @vnums;
}
@vnums=(@vnums, 0, 0, 0)[0..2];
\$vn=join('', map { sprintf('%02d', \$_) } @vnums);
print "\$vn\n";
exit 0;
EOF
autogen_get_version="`pwd`/autogen-get-version.pl"
trap "rm -f $autogen_get_version" 0 1 9 15
update_prog_version() {
dir=$1
prog=$2
# If there exists an envariable PROG in uppercase, use that and do not scan
ucprog=`echo $prog | tr 'a-z' 'A-Z' `
eval env=\$${ucprog}
if test X$env != X; then
prog_name=$env
prog_vers=`perl $autogen_get_version $prog_name $prog`
if test X$prog_vers = X; then
prog_vers=0
fi
eval ${prog}_name=${prog_name}
eval ${prog}_vers=${prog_vers}
eval ${prog}_dir=environment
return
fi
eval prog_name=\$${prog}_name
eval prog_vers=\$${prog}_vers
eval prog_dir=\$${prog}_dir
if test X$prog_vers = X; then
prog_vers=0
fi
save_PATH="$PATH"
cd "$dir"
PATH=".:$PATH"
nameglob="$prog*"
if [ -x /usr/bin/uname ]; then
if [ `/usr/bin/uname`x = 'Darwinx' -a $prog = 'libtoolize' ] ; then
nameglob="g$nameglob"
fi
fi
names=`ls $nameglob 2>/dev/null`
if [ "X$names" != "X" ]; then
for name in $names; do
vers=`perl $autogen_get_version $dir/$name $prog`
if [ "X$vers" = "X" ]; then
continue
fi
if expr $vers '>' $prog_vers >/dev/null; then
prog_name=$name
prog_vers=$vers
prog_dir="$dir"
fi
done
fi
eval ${prog}_name=${prog_name}
eval ${prog}_vers=${prog_vers}
eval ${prog}_dir=${prog_dir}
PATH="$save_PATH"
}
run_cmd aclocal
run_cmd autoheader
run_cmd libtoolize --force --copy
run_cmd automake --add-missing --copy
run_cmd autoconf
check_prog_version() {
prog=$1
eval min=\$${prog}_min_vers
eval prog_name=\$${prog}_name
eval prog_vers=\$${prog}_vers
eval prog_dir=\$${prog}_dir
echo "$program: $prog program '$prog_name' V $prog_vers (min $min) in $prog_dir" 1>&2
rc=1
if test $prog_vers != 0; then
if expr $prog_vers '<' $min >/dev/null; then
echo "$program: ERROR: \`$prog' version $prog_vers in $prog_dir is too old."
echo " (version $min or newer is required)"
rc=0
else
# Things are ok, so set the ${prog} name
eval ${prog}=${prog_name}
fi
else
echo "$program: ERROR: You must have \`$prog' installed to compile this package."
echo " (version $min or newer is required)"
rc=0
fi
return $rc
}
$srcdir/configure --enable-debug && echo
# Find newest version of programs in the current PATH
save_args=${1+"$*"}
save_ifs="$IFS"
IFS=":"
set - $PATH
IFS="$save_ifs"
echo "$program: Looking for programs: $programs"
here=`pwd`
while [ $# -ne 0 ] ; do
dir=$1
shift
if [ ! -d "$dir" ]; then
continue
fi
for prog in $programs; do
update_prog_version "$dir" $prog
done
done
cd $here
set - $save_args
# END Find programs
# Check the versions meet the requirements
for prog in $programs; do
if check_prog_version $prog; then
exit 1
fi
done
echo "$program: Dependencies satisfied"
if test -d $SRCDIR/libltdl; then
touch $SRCDIR/libltdl/NO-AUTO-GEN
fi
for coin in `find $SRCDIR -name configure.ac -print`
do
dir=`dirname $coin`
if test -f "$dir/NO-AUTO-GEN"; then
echo $program: Skipping $dir -- flagged as no auto-gen
else
echo " "
echo $program: Processing directory $dir
( cd "$dir"
# Ensure that these are created by the versions on this system
# (indirectly via automake)
$DRYRUN rm -f ltconfig ltmain.sh libtool stamp-h*
# Made by automake
$DRYRUN rm -f missing depcomp
# automake junk
$DRYRUN rm -rf autom4te*.cache
config_macro_dir=`sed -ne 's/^AC_CONFIG_MACRO_DIR(\([^)]*\).*/\1/p' configure.ac`
if test "X$config_macro_dir" = X; then
config_macro_dir=.
else
aclocal_args="$aclocal_args -I $config_macro_dir "
fi
config_aux_dir=`sed -ne 's/^AC_CONFIG_AUX_DIR(\([^)]*\).*/\1/p' configure.ac`
if test "X$config_aux_dir" = X; then
config_aux_dir=.
fi
echo "$program: Running $libtoolize $libtoolize_args"
$DRYRUN rm -f ltmain.sh libtool
eval $DRYRUN $libtoolize $libtoolize_args
echo "$program: Running $aclocal $aclocal_args"
$DRYRUN $aclocal $aclocal_args
if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
echo "$program: Running $autoheader"
$DRYRUN $autoheader
fi
echo "$program: Running $automake $automake_args"
$DRYRUN $automake $automake_args $automake_args
echo "$program: Running $autoconf"
$DRYRUN $autoconf $autoconf_args
)
fi
done
rm -f config.cache
AUTOMAKE=$automake
AUTOCONF=$autoconf
ACLOCAL=$aclocal
export AUTOMAKE AUTOCONF ACLOCAL
echo " "
if test -z "$*"; then
echo "$program: WARNING: Running \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo "\`$program' command line."
fi
echo "$program: Running ./configure $configure_args $@"
if test "X$DRYRUN" = X; then
$DRYRUN ./configure $configure_args "$@" \
&& echo "$program: Now type \`make' to compile this package" || exit 1
else
$DRYRUN ./configure $configure_args "$@"
fi

View File

@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2008-01-23'
timestamp='2008-11-15'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -139,23 +139,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
eval $set_cc_for_build
cat << EOF > $dummy.c
#include <features.h>
#ifdef __UCLIBC__
# ifdef __UCLIBC_CONFIG_VERSION__
LIBC=uclibc __UCLIBC_CONFIG_VERSION__
# else
LIBC=uclibc
# endif
#else
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
fi
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@ -348,7 +331,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
eval $set_cc_for_build
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if echo '\n#ifdef __amd64\nIS_64BIT_ARCH\n#endif' | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
@ -813,7 +809,7 @@ EOF
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
EM64T | authenticamd | genuineintel)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
@ -857,31 +853,31 @@ EOF
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-${LIBC}
echo cris-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-${LIBC}
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-${LIBC}
echo frv-unknown-linux-gnu
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:*)
eval $set_cc_for_build
@ -904,7 +900,7 @@ EOF
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
@ -927,16 +923,16 @@ EOF
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-${LIBC}
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-${LIBC}
echo powerpc-unknown-linux-gnu
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-${LIBC}
echo powerpc64-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@ -949,40 +945,43 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
*) echo hppa-unknown-linux-${LIBC} ;;
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-${LIBC}
echo hppa64-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-${LIBC}
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
@ -997,22 +996,17 @@ EOF
p'`
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
exit ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit ;;
esac
# This should get integrated into the C code below, but now we hack
if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@ -1235,6 +1229,9 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;

View File

@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2008-01-16'
timestamp='2008-09-08'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -244,18 +244,20 @@ case $basic_machine in
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx | dvp \
| d10v | d30v | dlx | dsp16xx \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep \
| maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64vr | mips64vrel \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
@ -277,7 +279,7 @@ case $basic_machine in
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| score \
| sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@ -286,7 +288,7 @@ case $basic_machine in
| v850 | v850e \
| we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
@ -331,12 +333,14 @@ case $basic_machine in
| ip2k-* | iq2000-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64vr-* | mips64vrel-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
@ -358,20 +362,20 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-*)
| z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
@ -459,6 +463,10 @@ case $basic_machine in
basic_machine=c90-cray
os=-unicos
;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@ -526,6 +534,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
@ -714,24 +726,6 @@ case $basic_machine in
basic_machine=m68k-atari
os=-mint
;;
mipsEE* | ee | ps2)
basic_machine=mips64r5900el-scei
case $os in
-linux*)
;;
*)
os=-elf
;;
esac
;;
iop)
basic_machine=mipsel-scei
os=-irx
;;
dvp)
basic_machine=dvp-scei
os=-elf
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
@ -1146,6 +1140,10 @@ case $basic_machine in
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
@ -1266,7 +1264,7 @@ case $os in
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
@ -1276,7 +1274,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@ -1406,6 +1404,9 @@ case $os in
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-none)
;;
*)

View File

@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2006-10-15.18
scriptversion=2007-03-29.01
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@ -215,34 +215,39 @@ aix)
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile

View File

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-10-14.15
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -48,7 +48,7 @@ IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
@ -58,34 +58,49 @@ fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
mvcmd="$mvprog"
stripcmd=
src=
dst=
dir_arg=
dstarg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
@ -95,65 +110,55 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) shift
continue;;
-c) ;;
-d) dir_arg=true
shift
continue;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
shift
shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
continue;;
shift;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
shift;;
-s) stripcmd=$stripprog
shift
continue;;
-s) stripcmd=$stripprog;;
-t) dstarg=$2
shift
shift
continue;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true
shift
continue;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
@ -165,21 +170,22 @@ while test $# -ne 0; do
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dstarg=$arg
dst_arg=$arg
done
fi
@ -224,7 +230,7 @@ for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
@ -242,22 +248,22 @@ do
exit 1
fi
if test -z "$dstarg"; then
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
@ -378,26 +384,19 @@ do
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix=/ ;;
-*) prefix=./ ;;
*) prefix= ;;
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob && set -f
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob && set +f
$posix_glob set +f
IFS=$oIFS
prefixes=
@ -459,41 +458,54 @@ do
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dst"; then
$doit $rmcmd -f "$dst" 2>/dev/null \
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|| {
echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
else
:
fi
} &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
} || exit 1
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi

7831
lib-src/twolame/build-scripts/libtool.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,369 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file 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.
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[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.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[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.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[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.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[pic_mode="$withval"],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

123
lib-src/twolame/build-scripts/ltsugar.m4 vendored Normal file
View File

@ -0,0 +1,123 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file 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.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

View File

@ -0,0 +1,23 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file 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.
# @configure_input@
# serial 3293 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4])
m4_define([LT_PACKAGE_REVISION], [1.3293])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4'
macro_revision='1.3293'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

View File

@ -0,0 +1,98 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file 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.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,155 +0,0 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
#
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
ifelse([$4], , [AC_MSG_ERROR(dnl
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT
])],
[AC_MSG_RESULT([no])
$4])
elif test $pkg_failed = untried; then
ifelse([$4], , [AC_MSG_FAILURE(dnl
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
[$4])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
ifelse([$3], , :, [$3])
fi[]dnl
])# PKG_CHECK_MODULES

View File

@ -1,111 +0,0 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

25201
lib-src/twolame/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,20 @@
dnl Require autoconf version >= 2.57
AC_PREREQ(2.57)
dnl Require autoconf version >= 2.60
AC_PREREQ(2.60)
dnl ############# Initialization
AC_INIT([twolame], [0.3.12], [twolame-discuss@lists.sourceforge.net])
AC_INIT([twolame],[0.3.13],[twolame-discuss@lists.sourceforge.net])
AC_CONFIG_SRCDIR(libtwolame/twolame.h)
AC_CONFIG_AUX_DIR(build)
dnl we have some extra m4 macros to point at
AC_CONFIG_MACRO_DIR([build/m4])
AC_CANONICAL_SYSTEM
AC_CONFIG_AUX_DIR(build-scripts)
AC_CONFIG_MACRO_DIR(build-scripts)
AM_INIT_AUTOMAKE([1.10])
dnl Version 1.7 of automake is recommended
AM_INIT_AUTOMAKE(1.7)
dnl Audacity policy: don't enable automatic rebuild of configure et al if
dnl sources change
AM_MAINTAINER_MODE([enabled])
LT_PREREQ([2.2])
LT_INIT
AM_CONFIG_HEADER(build/config.h)
AM_MAINTAINER_MODE
@ -48,34 +43,23 @@ AC_SUBST(TWOLAME_SO_VERSION)
dnl ############# Compiler and tools Checks
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_LIBTOOL
AC_C_BIGENDIAN
AC_C_INLINE
AC_C_CONST
dnl ############# Configure Arguments
AC_ARG_ENABLE(debug,
[ --enable-debug=[no/yes] turn on debugging],
[ Debugging="Enabled"
AC_DEFINE(DEBUG, 1, [ Define if debugging is enabled. ]) ],
[ Debugging="Disabled" ]
)
AC_ARG_ENABLE(programs,
[AS_HELP_STRING([--enable-programs],
[compile front-end programs as well as libtwolame [default=yes]])],
FRONTEND_ARG=$enableval,
FRONTEND_ARG="yes")
BUILD_FRONTEND="no"
if test "x$FRONTEND_ARG" = "xyes" ; then
BUILD_FRONTEND="yes"
if test "$USE_MAINTAINER_MODE" = yes; then
AC_PATH_PROG([PATH_ASCIIDOC], [asciidoc])
AC_PATH_PROG([PATH_DOXYGEN], [doxygen])
AC_PATH_PROG([PATH_XMLTO], [xmlto])
fi
dnl ############## Check that types are the right size
AC_CHECK_SIZEOF(short)
@ -97,23 +81,21 @@ AC_CHECK_LIB([m], [sqrt])
AC_CHECK_LIB([m], [lrintf])
AC_CHECK_LIB([mx], [powf])
dnl we only need to do this test if we are building front-ends
if test "x$BUILD_FRONTEND" = "xyes"; then
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
[ HAVE_SNDFILE="yes" ],
[ AC_CHECK_LIB( [sndfile], [sf_command],
[ AC_CHECK_HEADER( [sndfile.h],
[ HAVE_SNDFILE="yes"
SNDFILE_CFLAGS=""
SNDFILE_LIBS="-lsndfile" ],
[ AC_MSG_WARN([Can't find sndfile.h on your system]) ] ) ],
[ AC_MSG_WARN([Can't find libsndfile library on your system]) ]
) ]
)
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
[ HAVE_SNDFILE="yes" ],
[ AC_CHECK_LIB( [sndfile], [sf_command],
[ AC_CHECK_HEADER( [sndfile.h],
[ HAVE_SNDFILE="yes"
SNDFILE_CFLAGS=""
SNDFILE_LIBS="-lsndfile" ],
[ AC_MSG_WARN([Can't find sndfile.h on your system]) ] ) ],
[ AC_MSG_WARN([Can't find libsndfile library on your system]) ]
) ]
)
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)
fi
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)
dnl ############## Header Checks
@ -128,52 +110,47 @@ AC_CHECK_HEADER(getopt.h,
dnl ############## Only compile frontend if sndfile is available
TWOLAME_BIN=""
if test "x$HAVE_SNDFILE" = "xyes"; then
if test "$HAVE_GETOPT_H" = "yes"; then
TWOLAME_BIN="twolame${EXEEXT}"
else
AC_MSG_WARN([Not building twolame frontend because getopt.h is missing.])
fi
else
AC_MSG_WARN([Not building twolame frontend because libsndfile is missing.])
fi
AC_SUBST(TWOLAME_BIN)
dnl ############## Compiler and Linker Flags
CFLAGS="$CFLAGS -std=c99 -Wunused -Wall"
LDFLAGS="$LDFLAGS"
# If debugging is enabled then make warnings errors
if test "$Debugging" = "Enabled"; then
CFLAGS="$CFLAGS -g -Werror -pedantic"
else
# Optimize flag. 3 is about as high as you can sanely go with GCC3.2.
CFLAGS="$CFLAGS -O3"
# If maintainer mode is enabled then make warnings errors
if test "$USE_MAINTAINER_MODE" = yes; then
WARNING_CFLAGS="-Wall -Werror -pedantic -Wunused"
WARNING_CFLAGS="$WARNING_CFLAGS -Wmissing-prototypes -Wmissing-declarations"
AC_SUBST(WARNING_CFLAGS)
fi
dnl ############## Only compile full frontend if sndfile is available,
dnl only compile anything if it wasn't asked to turn it off
dnl ############## Output files
if test "x$BUILD_FRONTEND" = "xyes" ; then
STWOLAME_BIN="stwolame${EXEEXT}" ;dnl build simple frontend - no deps
TWOLAME_BIN="" ;dnl don't build full unless we have it's deps
if test "x$HAVE_SNDFILE" = "xyes"; then
if test "$HAVE_GETOPT_H" = "yes"; then
TWOLAME_BIN="twolame${EXEEXT}"
else
AC_MSG_WARN([Not building twolame frontend because getopt.h is missing.])
fi
else
AC_MSG_WARN([Not building twolame frontend because libsndfile is missing.])
fi
else
TWOLAME_BIN="" ;dnl don't build
STWOLAME_BIN="" ;dnl either binary to simplify build
fi
AC_CONFIG_HEADERS([libtwolame/config.h])
AC_SUBST(TWOLAME_BIN)
AC_SUBST(STWOLAME_BIN)
dnl ############## Final Output
AC_OUTPUT(
AC_CONFIG_FILES([
Makefile \
twolame.pc \
doc/Makefile \
doc/html/Makefile \
doc/html/Doxyfile \
libtwolame/Makefile \
frontend/Makefile \
simplefrontend/Makefile \
)
tests/Makefile \
])
AC_OUTPUT

View File

@ -1,13 +1,4 @@
## Man Page
man_MANS = twolame.1
## The documentation is distributed with the package
## and only needs to be rebuilt if it is modified or
## when building from subversion
doc: build-man build-html
SUBDIRS=html
## Building the manpage requires:
@ -15,77 +6,36 @@ doc: build-man build-html
## xmlto: http://cyberelk.net/tim/xmlto/
##
build-man:
rm -f twolame.1.xml twolame.1
## Man Page
man_MANS = twolame.1
if MAINTAINER_MODE
twolame.1.xml: twolame.1.txt
asciidoc -d manpage -b docbook -o twolame.1.xml twolame.1.txt
xmlto man twolame.1.xml
twolame.1: twolame.1.xml
@PATH_XMLTO@ man twolame.1.xml
endif
## Building HTML documentation requires:
## asciidoc: http://www.methods.co.nz/asciidoc/
## doxygen: http://www.doxygen.org
##
htmldir=$(srcdir)/html
asciidoc=asciidoc -b xhtml11 \
-a revision="@PACKAGE_VERSION@" \
-a theme=twolame \
-a linkcss \
-a stylesdir=.
doxygen=doxygen doxygen.conf
build-html:
rm -f $(htmldir)/*.html
$(doxygen)
rm -f $(htmldir)/index.html $(htmldir)/files.html $(htmldir)/globals*.html
$(asciidoc) -o $(htmldir)/index.html $(srcdir)/index.txt
$(asciidoc) -o $(htmldir)/readme.html $(top_srcdir)/README
$(asciidoc) -o $(htmldir)/authors.html $(top_srcdir)/AUTHORS
$(asciidoc) -o $(htmldir)/changelog.html $(top_srcdir)/ChangeLog
$(asciidoc) -o $(htmldir)/todo.html $(top_srcdir)/TODO
$(asciidoc) -o $(htmldir)/api.html $(srcdir)/api.txt
$(asciidoc) -o $(htmldir)/psycho.html $(srcdir)/psycho.txt
$(asciidoc) -o $(htmldir)/vbr.html $(srcdir)/vbr.txt
$(asciidoc) -d manpage -o $(htmldir)/twolame.1.html $(srcdir)/twolame.1.txt
## Install HTML Documention
docdir = $(datadir)/doc
pkgdocdir = $(docdir)/$(PACKAGE)
pkghtmldir = $(pkgdocdir)/html
pkghtml_DATA = \
$(htmldir)/api.html \
$(htmldir)/authors.html \
$(htmldir)/doxygen.css \
$(htmldir)/doxygen.png \
$(htmldir)/index.html \
$(htmldir)/changelog.html \
$(htmldir)/psycho.html \
$(htmldir)/readme.html \
$(htmldir)/todo.html \
$(htmldir)/twolame_8h-source.html \
$(htmldir)/twolame_8h.html \
$(htmldir)/twolame.1.html \
$(htmldir)/twolame.css \
$(htmldir)/twolame-manpage.css \
$(htmldir)/twolame-quirks.css \
$(htmldir)/vbr.html
MAINTAINERCLEANFILES=twolame.1 twolame.1.xml
pkgdocdir = @docdir@
pkgdoc_DATA = \
$(srcdir)/api.txt \
$(srcdir)/psycho.txt \
$(srcdir)/vbr.txt
api.txt \
psycho.txt \
vbr.txt
EXTRA_DIST = \
$(man_MANS) \
$(pkgdoc_DATA) \
$(pkghtml_DATA) \
dist10-text/*.txt \
doxygen.conf \
dist10-text/common.txt \
dist10-text/commonh.txt \
dist10-text/encode.txt \
dist10-text/encoderh.txt \
dist10-text/musicin.txt \
dist10-text/psy.txt \
dist10-text/tonal.txt \
index.txt \
twolame.1.txt \
twolame.1.xml
twolame.1.txt

View File

@ -32,22 +32,31 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/build/m4/libtool.m4 \
$(top_srcdir)/build/m4/pkg.m4 $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/build-scripts/libtool.m4 \
$(top_srcdir)/build-scripts/ltoptions.m4 \
$(top_srcdir)/build-scripts/ltsugar.m4 \
$(top_srcdir)/build-scripts/ltversion.m4 \
$(top_srcdir)/build-scripts/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/build/config.h
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtwolame/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgdocdir)" \
"$(DESTDIR)$(pkghtmldir)"
am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgdocdir)"
NROFF = nroff
MANS = $(man_MANS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@ -57,8 +66,12 @@ am__vpath_adj = case $$p in \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
pkgdocDATA_INSTALL = $(INSTALL_DATA)
pkghtmlDATA_INSTALL = $(INSTALL_DATA)
DATA = $(pkgdoc_DATA) $(pkghtml_DATA)
DATA = $(pkgdoc_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -72,46 +85,53 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_ASCIIDOC = @PATH_ASCIIDOC@
PATH_DOXYGEN = @PATH_DOXYGEN@
PATH_SEPARATOR = @PATH_SEPARATOR@
PATH_XMLTO = @PATH_XMLTO@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
@ -120,17 +140,17 @@ SHELL = @SHELL@
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
SNDFILE_LIBS = @SNDFILE_LIBS@
STRIP = @STRIP@
STWOLAME_BIN = @STWOLAME_BIN@
TWOLAME_BIN = @TWOLAME_BIN@
TWOLAME_SO_VERSION = @TWOLAME_SO_VERSION@
VERSION = @VERSION@
WARNING_CFLAGS = @WARNING_CFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@ -145,7 +165,7 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = $(datadir)/doc
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
@ -153,7 +173,7 @@ host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = $(srcdir)/html
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@ -172,58 +192,33 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = html
man_MANS = twolame.1
asciidoc = asciidoc -b xhtml11 \
-a revision="@PACKAGE_VERSION@" \
-a theme=twolame \
-a linkcss \
-a stylesdir=.
doxygen = doxygen doxygen.conf
pkgdocdir = $(docdir)/$(PACKAGE)
pkghtmldir = $(pkgdocdir)/html
pkghtml_DATA = \
$(htmldir)/api.html \
$(htmldir)/authors.html \
$(htmldir)/doxygen.css \
$(htmldir)/doxygen.png \
$(htmldir)/index.html \
$(htmldir)/changelog.html \
$(htmldir)/psycho.html \
$(htmldir)/readme.html \
$(htmldir)/todo.html \
$(htmldir)/twolame_8h-source.html \
$(htmldir)/twolame_8h.html \
$(htmldir)/twolame.1.html \
$(htmldir)/twolame.css \
$(htmldir)/twolame-manpage.css \
$(htmldir)/twolame-quirks.css \
$(htmldir)/vbr.html
MAINTAINERCLEANFILES = twolame.1 twolame.1.xml
pkgdocdir = @docdir@
pkgdoc_DATA = \
$(srcdir)/api.txt \
$(srcdir)/psycho.txt \
$(srcdir)/vbr.txt
api.txt \
psycho.txt \
vbr.txt
EXTRA_DIST = \
$(man_MANS) \
$(pkgdoc_DATA) \
$(pkghtml_DATA) \
dist10-text/*.txt \
doxygen.conf \
dist10-text/common.txt \
dist10-text/commonh.txt \
dist10-text/encode.txt \
dist10-text/encoderh.txt \
dist10-text/musicin.txt \
dist10-text/psy.txt \
dist10-text/tonal.txt \
index.txt \
twolame.1.txt \
twolame.1.xml
twolame.1.txt
all: all-am
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@ -323,29 +318,136 @@ uninstall-pkgdocDATA:
echo " rm -f '$(DESTDIR)$(pkgdocdir)/$$f'"; \
rm -f "$(DESTDIR)$(pkgdocdir)/$$f"; \
done
install-pkghtmlDATA: $(pkghtml_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkghtmldir)" || $(MKDIR_P) "$(DESTDIR)$(pkghtmldir)"
@list='$(pkghtml_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(pkghtmlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkghtmldir)/$$f'"; \
$(pkghtmlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkghtmldir)/$$f"; \
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
uninstall-pkghtmlDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkghtml_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pkghtmldir)/$$f'"; \
rm -f "$(DESTDIR)$(pkghtmldir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS:
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS:
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@ -373,22 +475,40 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
check: check-recursive
all-am: Makefile $(MANS) $(DATA)
installdirs:
for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgdocdir)" "$(DESTDIR)$(pkghtmldir)"; do \
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgdocdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
@ -404,99 +524,87 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
dvi: dvi-recursive
dvi-am:
html: html-am
html: html-recursive
info: info-am
info: info-recursive
info-am:
install-data-am: install-man install-pkgdocDATA install-pkghtmlDATA
install-data-am: install-man install-pkgdocDATA
install-dvi: install-dvi-am
install-dvi: install-dvi-recursive
install-exec-am:
install-html: install-html-am
install-html: install-html-recursive
install-info: install-info-am
install-info: install-info-recursive
install-man: install-man1
install-pdf: install-pdf-am
install-pdf: install-pdf-recursive
install-ps: install-ps-am
install-ps: install-ps-recursive
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf: pdf-recursive
pdf-am:
ps: ps-am
ps: ps-recursive
ps-am:
uninstall-am: uninstall-man uninstall-pkgdocDATA uninstall-pkghtmlDATA
uninstall-am: uninstall-man uninstall-pkgdocDATA
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-man1 \
install-pdf install-pdf-am install-pkgdocDATA \
install-pkghtmlDATA install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-man uninstall-man1 uninstall-pkgdocDATA \
uninstall-pkghtmlDATA
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic clean-libtool \
ctags ctags-recursive distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-man1 install-pdf \
install-pdf-am install-pkgdocDATA install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-recursive uninstall uninstall-am \
uninstall-man uninstall-man1 uninstall-pkgdocDATA
doc: build-man build-html
@MAINTAINER_MODE_TRUE@twolame.1.xml: twolame.1.txt
@MAINTAINER_MODE_TRUE@ asciidoc -d manpage -b docbook -o twolame.1.xml twolame.1.txt
build-man:
rm -f twolame.1.xml twolame.1
asciidoc -d manpage -b docbook -o twolame.1.xml twolame.1.txt
xmlto man twolame.1.xml
build-html:
rm -f $(htmldir)/*.html
$(doxygen)
rm -f $(htmldir)/index.html $(htmldir)/files.html $(htmldir)/globals*.html
$(asciidoc) -o $(htmldir)/index.html $(srcdir)/index.txt
$(asciidoc) -o $(htmldir)/readme.html $(top_srcdir)/README
$(asciidoc) -o $(htmldir)/authors.html $(top_srcdir)/AUTHORS
$(asciidoc) -o $(htmldir)/changelog.html $(top_srcdir)/ChangeLog
$(asciidoc) -o $(htmldir)/todo.html $(top_srcdir)/TODO
$(asciidoc) -o $(htmldir)/api.html $(srcdir)/api.txt
$(asciidoc) -o $(htmldir)/psycho.html $(srcdir)/psycho.txt
$(asciidoc) -o $(htmldir)/vbr.html $(srcdir)/vbr.txt
$(asciidoc) -d manpage -o $(htmldir)/twolame.1.html $(srcdir)/twolame.1.txt
@MAINTAINER_MODE_TRUE@twolame.1: twolame.1.xml
@MAINTAINER_MODE_TRUE@ @PATH_XMLTO@ man twolame.1.xml
# 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:

View File

@ -2,9 +2,9 @@
* ISO MPEG Audio Subgroup Software Simulation Group (1996)
* ISO 13818-3 MPEG-2 Audio Encoder - Lower Sampling Frequency Extension
*
* $Id: common.txt,v 1.3 2008-02-01 19:44:21 richardash1981 Exp $
* $Id$
*
* $Log: not supported by cvs2svn $
* $Log$
* Revision 1.1 2005/11/15 16:04:26 nhumfrey
* Changed suffix for files.
*

View File

@ -2,9 +2,9 @@
* ISO MPEG Audio Subgroup Software Simulation Group (1996)
* ISO 13818-3 MPEG-2 Audio Encoder - Lower Sampling Frequency Extension
*
* $Id: commonh.txt,v 1.3 2008-02-01 19:44:21 richardash1981 Exp $
* $Id$
*
* $Log: not supported by cvs2svn $
* $Log$
* Revision 1.1 2005/11/15 16:04:26 nhumfrey
* Changed suffix for files.
*

View File

@ -2,9 +2,9 @@
* ISO MPEG Audio Subgroup Software Simulation Group (1996)
* ISO 13818-3 MPEG-2 Audio Encoder - Lower Sampling Frequency Extension
*
* $Id: encode.txt,v 1.3 2008-02-01 19:44:21 richardash1981 Exp $
* $Id$
*
* $Log: not supported by cvs2svn $
* $Log$
* Revision 1.1 2005/11/15 16:04:26 nhumfrey
* Changed suffix for files.
*

View File

@ -2,9 +2,9 @@
* ISO MPEG Audio Subgroup Software Simulation Group (1996)
* ISO 13818-3 MPEG-2 Audio Encoder - Lower Sampling Frequency Extension
*
* $Id: encoderh.txt,v 1.3 2008-02-01 19:44:21 richardash1981 Exp $
* $Id$
*
* $Log: not supported by cvs2svn $
* $Log$
* Revision 1.1 2005/11/15 16:04:26 nhumfrey
* Changed suffix for files.
*

View File

@ -2,9 +2,9 @@
* ISO MPEG Audio Subgroup Software Simulation Group (1996)
* ISO 13818-3 MPEG-2 Audio Encoder - Lower Sampling Frequency Extension
*
* $Id: musicin.txt,v 1.3 2008-02-01 19:44:22 richardash1981 Exp $
* $Id$
*
* $Log: not supported by cvs2svn $
* $Log$
* Revision 1.1 2005/11/15 16:04:26 nhumfrey
* Changed suffix for files.
*

View File

@ -2,9 +2,9 @@
* ISO MPEG Audio Subgroup Software Simulation Group (1996)
* ISO 13818-3 MPEG-2 Audio Encoder - Lower Sampling Frequency Extension
*
* $Id: psy.txt,v 1.3 2008-02-01 19:44:22 richardash1981 Exp $
* $Id$
*
* $Log: not supported by cvs2svn $
* $Log$
* Revision 1.1 2005/11/15 16:04:26 nhumfrey
* Changed suffix for files.
*

View File

@ -2,9 +2,9 @@
* ISO MPEG Audio Subgroup Software Simulation Group (1996)
* ISO 13818-3 MPEG-2 Audio Encoder - Lower Sampling Frequency Extension
*
* $Id: tonal.txt,v 1.3 2008-02-01 19:44:22 richardash1981 Exp $
* $Id$
*
* $Log: not supported by cvs2svn $
* $Log$
* Revision 1.1 2005/11/15 16:04:26 nhumfrey
* Changed suffix for files.
*

View File

@ -1,35 +0,0 @@
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
PROJECT_NAME = "libtwolame"
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
INPUT = ../libtwolame/twolame.h
OPTIMIZE_OUTPUT_FOR_C = YES
EXTRACT_ALL = NO
HIDE_UNDOC_MEMBERS = YES
QUIET = YES
WARNINGS = YES
GENERATE_HTML = YES
HTML_OUTPUT = html
DISABLE_INDEX = YES
SORT_MEMBER_DOCS = NO
SORT_BRIEF_DOCS = NO
ENUM_VALUES_PER_LINE = 1
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = DLL_EXPORT=
GENERATE_LATEX = NO
GENERATE_RTF = NO
GENERATE_MAN = NO
GENERATE_XML = NO

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,75 @@
asciidoc=@PATH_ASCIIDOC@ -b xhtml11 \
-a revision="@PACKAGE_VERSION@" \
-a theme=twolame \
-a linkcss \
-a stylesdir=$(srcdir)
pkgdocdir = @docdir@
pkghtmldir = $(pkgdocdir)/html
doxygen_files = \
doxygen.css \
doxygen.png \
nav_f.png \
nav_h.png \
tabs.css \
twolame_8h_source.html \
twolame_8h.html
asciidoc_files = \
api.html \
authors.html \
changelog.html \
index.html \
psycho.html \
readme.html \
todo.html \
twolame.1.html \
vbr.html
stylesheet_files = \
twolame-manpage.css \
twolame.css
pkghtml_DATA = $(doxygen_files) $(asciidoc_files) $(stylesheet_files)
EXTRA_DIST = Doxyfile.in $(pkghtml_DATA)
if MAINTAINER_MODE
$(doxygen_files): Doxyfile $(top_srcdir)/libtwolame/twolame.h
@PATH_DOXYGEN@
rm -f index.html files.html globals*.html
index.html: $(top_srcdir)/doc/index.txt
$(asciidoc) -o $@ $<
readme.html: $(top_srcdir)/README
$(asciidoc) -o $@ $<
authors.html: $(top_srcdir)/AUTHORS
$(asciidoc) -o $@ $<
changelog.html: $(top_srcdir)/ChangeLog
$(asciidoc) -o $@ $<
todo.html: $(top_srcdir)/TODO
$(asciidoc) -o $@ $<
api.html: $(top_srcdir)/doc/api.txt
$(asciidoc) -o $@ $<
psycho.html: $(top_srcdir)/doc/psycho.txt
$(asciidoc) -o $@ $<
vbr.html: $(top_srcdir)/doc/vbr.txt
$(asciidoc) -o $@ $<
twolame.1.html: $(top_srcdir)/doc/twolame.1.txt
$(asciidoc) -d manpage -o $@ $<
endif
MAINTAINERCLEANFILES = $(doxygen_files) $(asciidoc_files)

View File

@ -0,0 +1,443 @@
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 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.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc/html
DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/build-scripts/libtool.m4 \
$(top_srcdir)/build-scripts/ltoptions.m4 \
$(top_srcdir)/build-scripts/ltsugar.m4 \
$(top_srcdir)/build-scripts/ltversion.m4 \
$(top_srcdir)/build-scripts/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtwolame/config.h
CONFIG_CLEAN_FILES = Doxyfile
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(pkghtmldir)"
pkghtmlDATA_INSTALL = $(INSTALL_DATA)
DATA = $(pkghtml_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_ASCIIDOC = @PATH_ASCIIDOC@
PATH_DOXYGEN = @PATH_DOXYGEN@
PATH_SEPARATOR = @PATH_SEPARATOR@
PATH_XMLTO = @PATH_XMLTO@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
SNDFILE_LIBS = @SNDFILE_LIBS@
STRIP = @STRIP@
TWOLAME_BIN = @TWOLAME_BIN@
TWOLAME_SO_VERSION = @TWOLAME_SO_VERSION@
VERSION = @VERSION@
WARNING_CFLAGS = @WARNING_CFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
asciidoc = @PATH_ASCIIDOC@ -b xhtml11 \
-a revision="@PACKAGE_VERSION@" \
-a theme=twolame \
-a linkcss \
-a stylesdir=$(srcdir)
pkgdocdir = @docdir@
pkghtmldir = $(pkgdocdir)/html
doxygen_files = \
doxygen.css \
doxygen.png \
nav_f.png \
nav_h.png \
tabs.css \
twolame_8h_source.html \
twolame_8h.html
asciidoc_files = \
api.html \
authors.html \
changelog.html \
index.html \
psycho.html \
readme.html \
todo.html \
twolame.1.html \
vbr.html
stylesheet_files = \
twolame-manpage.css \
twolame.css
pkghtml_DATA = $(doxygen_files) $(asciidoc_files) $(stylesheet_files)
EXTRA_DIST = Doxyfile.in $(pkghtml_DATA)
MAINTAINERCLEANFILES = $(doxygen_files) $(asciidoc_files)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/html/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/html/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-pkghtmlDATA: $(pkghtml_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkghtmldir)" || $(MKDIR_P) "$(DESTDIR)$(pkghtmldir)"
@list='$(pkghtml_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(pkghtmlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkghtmldir)/$$f'"; \
$(pkghtmlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkghtmldir)/$$f"; \
done
uninstall-pkghtmlDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkghtml_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pkghtmldir)/$$f'"; \
rm -f "$(DESTDIR)$(pkghtmldir)/$$f"; \
done
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(pkghtmldir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-pkghtmlDATA
install-dvi: install-dvi-am
install-exec-am:
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-pkghtmlDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-pkghtmlDATA install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall uninstall-am uninstall-pkghtmlDATA
@MAINTAINER_MODE_TRUE@$(doxygen_files): Doxyfile $(top_srcdir)/libtwolame/twolame.h
@MAINTAINER_MODE_TRUE@ @PATH_DOXYGEN@
@MAINTAINER_MODE_TRUE@ rm -f index.html files.html globals*.html
@MAINTAINER_MODE_TRUE@index.html: $(top_srcdir)/doc/index.txt
@MAINTAINER_MODE_TRUE@ $(asciidoc) -o $@ $<
@MAINTAINER_MODE_TRUE@readme.html: $(top_srcdir)/README
@MAINTAINER_MODE_TRUE@ $(asciidoc) -o $@ $<
@MAINTAINER_MODE_TRUE@authors.html: $(top_srcdir)/AUTHORS
@MAINTAINER_MODE_TRUE@ $(asciidoc) -o $@ $<
@MAINTAINER_MODE_TRUE@changelog.html: $(top_srcdir)/ChangeLog
@MAINTAINER_MODE_TRUE@ $(asciidoc) -o $@ $<
@MAINTAINER_MODE_TRUE@todo.html: $(top_srcdir)/TODO
@MAINTAINER_MODE_TRUE@ $(asciidoc) -o $@ $<
@MAINTAINER_MODE_TRUE@api.html: $(top_srcdir)/doc/api.txt
@MAINTAINER_MODE_TRUE@ $(asciidoc) -o $@ $<
@MAINTAINER_MODE_TRUE@psycho.html: $(top_srcdir)/doc/psycho.txt
@MAINTAINER_MODE_TRUE@ $(asciidoc) -o $@ $<
@MAINTAINER_MODE_TRUE@vbr.html: $(top_srcdir)/doc/vbr.txt
@MAINTAINER_MODE_TRUE@ $(asciidoc) -o $@ $<
@MAINTAINER_MODE_TRUE@twolame.1.html: $(top_srcdir)/doc/twolame.1.txt
@MAINTAINER_MODE_TRUE@ $(asciidoc) -d manpage -o $@ $<
# 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:

View File

@ -2,28 +2,35 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.3" />
<title>The libtwolame API</title>
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
/*]]>*/
</script>
<script type="text/javascript" src="./asciidoc-xhtml11.js"></script>
</head>
<body>
<body class="article">
<div id="header">
<h1>The libtwolame API</h1>
<span id="revision">version 0.3.11</span>
<span id="revnumber">version 0.3.13</span>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<p>This is the interface for encoding PCM audio to MPEG Audio Layer 2.</p>
<p>It is <em>very</em> similar to the libmp3lame API.</p>
<p>See simplefrontend/simplefrontend.c for a very simple application
using the API.</p>
<div class="paragraph"><p>This is the interface for encoding PCM audio to MPEG Audio Layer 2.</p></div>
<div class="paragraph"><p>It is <em>very</em> similar to the libmp3lame API.</p></div>
<div class="paragraph"><p>See simplefrontend/simplefrontend.c for a very simple application
using the API.</p></div>
</div>
</div>
<h2>Steps to encode PCM to MP2</h2>
<div class="sect1">
<h2 id="_steps_to_encode_pcm_to_mp2">Steps to encode PCM to MP2</h2>
<div class="sectionbody">
<ol>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
Grab a set of default options by calling:
@ -82,7 +89,7 @@ One frame of MPEG audio will be returned for every 1152 samples of PCM audio.
Multiple calls can be made to this function.
It is the users responsibility to:</tt></pre>
</div></div>
<ul>
<div class="ulist"><ul>
<li>
<p>
allocate the mp2buffer
@ -99,7 +106,7 @@ read the pcmaudio from somewhere with new samples always staring from
write the mp2buffer contents to somewhere (it is overwritten with each call)
</p>
</li>
</ul>
</ul></div>
</li>
<li>
<p>
@ -139,12 +146,15 @@ associated with this set of encoding parameters.
POST: glopts = NULL</tt></pre>
</div></div>
</li>
</ol>
</ol></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:17 BST
Version 0.3.13<br />
Last updated 2011-01-01 19:15:01 GMT
</div>
</div>
</body>

View File

@ -2,20 +2,26 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.3" />
<title>TwoLAME Authors</title>
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
/*]]>*/
</script>
<script type="text/javascript" src="./asciidoc-xhtml11.js"></script>
</head>
<body>
<body class="article">
<div id="header">
<h1>TwoLAME Authors</h1>
<span id="revision">version 0.3.11</span>
<span id="revnumber">version 0.3.13</span>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="title">Nicholas Humfrey - &lt;njh at ecs.soton.ac.uk&gt;</div><ul>
<div class="ulist"><div class="title">Nicholas J Humfrey - &lt;njh at aelius.com&gt;</div><ul>
<li>
<p>
Current Maintainer
@ -38,7 +44,7 @@ Reference documentation for API
</li>
<li>
<p>
Lots of cleaning and improving !
Lots of cleaning and improving!
</p>
</li>
<li>
@ -46,15 +52,15 @@ Lots of cleaning and improving !
New frontend
</p>
</li>
</ul>
<div class="title">Christophe Massiot - &lt;cmassiot at freebox.fr&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title">Christophe Massiot - &lt;cmassiot at freebox.fr&gt;</div><ul>
<li>
<p>
Changes to make libtwolame thread-safe
</p>
</li>
</ul>
<div class="title"><em>Mean</em> - &lt;mean@users.sourceforge.net&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title"><em>Mean</em> - &lt;mean at users.sourceforge.net&gt;</div><ul>
<li>
<p>
Fix for AMD64 processors
@ -65,22 +71,22 @@ Fix for AMD64 processors
Fix for CRC protection
</p>
</li>
</ul>
<div class="title">Mike Cheng &lt;mikecheng at NOT planckenergy.com&gt; (remove the NOT)</div><ul>
</ul></div>
<div class="ulist"><div class="title">Mike Cheng &lt;mikecheng at NOT planckenergy.com&gt; (remove the NOT)</div><ul>
<li>
<p>
Author of tooLAME, which TwoLAME is based on.
</p>
</li>
</ul>
<div class="title">ISO Dist10 code writers</div><ul>
</ul></div>
<div class="ulist"><div class="title">ISO Dist10 code writers</div><ul>
<li>
<p>
original basis of toolame
</p>
</li>
</ul>
<div class="title">LAME specific contributions</div><ul>
</ul></div>
<div class="ulist"><div class="title">LAME specific contributions</div><ul>
<li>
<p>
fht routines from Ron Mayer &lt;mayer at acuson.com&gt;
@ -95,18 +101,18 @@ fht tweaking by Mathew Hendry &lt;math at vissci.com&gt;
<p>
window_subband &amp; filter subband from LAME circa v3.30
(multiple LAME authors)
(before Takehiro's window/filter/mdct combination)
(before Takehiro&#8217;s window/filter/mdct combination)
</p>
</li>
</ul>
<div class="title">Oliver Lietz &lt;lietz at nanocosmos.de&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title">Oliver Lietz &lt;lietz at nanocosmos.de&gt;</div><ul>
<li>
<p>
Tables now included in the exe! (yay! :)
</p>
</li>
</ul>
<div class="title">Patrick de Smet &lt;pds at telin.rug.ac.be&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title">Patrick de Smet &lt;pds at telin.rug.ac.be&gt;</div><ul>
<li>
<p>
scale_factor calc speedup.
@ -117,15 +123,15 @@ scale_factor calc speedup.
subband_quantization speedup
</p>
</li>
</ul>
<div class="title">Bill Eldridge &lt;bill at hk.rfa.org&gt; and Federico Grau &lt;grauf at rfa.org&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title">Bill Eldridge &lt;bill at hk.rfa.org&gt; and Federico Grau &lt;grauf at rfa.org&gt;</div><ul>
<li>
<p>
option for "no padding"
</p>
</li>
</ul>
<div class="title">Nick Burch &lt;gagravarr at SoftHome.net&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title">Nick Burch &lt;gagravarr at SoftHome.net&gt;</div><ul>
<li>
<p>
WAV file reading
@ -136,8 +142,8 @@ WAV file reading
os/2 Makefile mods.
</p>
</li>
</ul>
<div class="title">Phillipe Jouguet &lt;philippe.jouguet at vdldiffusion.com&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title">Phillipe Jouguet &lt;philippe.jouguet at vdldiffusion.com&gt;</div><ul>
<li>
<p>
DAB extensions
@ -148,34 +154,36 @@ DAB extensions
spelling, LSF using psyII, WAVE reading
</p>
</li>
</ul>
<div class="title">Henrik Herranen - &lt;leopold at vlsi.fi&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title">Henrik Herranen - &lt;leopold at vlsi.fi&gt;</div><ul>
<li>
<p>
WAVE reading
</p>
</li>
</ul>
<div class="title">Andreas Neukoetter - &lt;anti at webhome.de&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title">Andreas Neukoetter - &lt;anti at webhome.de&gt;</div><ul>
<li>
<p>
verbosity patch <em>-t</em> switch for transcode plugin
</p>
</li>
</ul>
<div class="title">Sami Sallinen - &lt;sami.sallinen at g-cluster.com&gt;</div><ul>
</ul></div>
<div class="ulist"><div class="title">Sami Sallinen - &lt;sami.sallinen at g-cluster.com&gt;</div><ul>
<li>
<p>
filter subband loop unroll psychoi fix for "% 1408" calcs
</p>
</li>
</ul>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:16 BST
Version 0.3.13<br />
Last updated 2011-01-19 22:38:21 GMT
</div>
</div>
</body>

View File

@ -2,54 +2,144 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.3" />
<title>What is new in TwoLAME</title>
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
/*]]>*/
</script>
<script type="text/javascript" src="./asciidoc-xhtml11.js"></script>
</head>
<body>
<body class="article">
<div id="header">
<h1>What is new in TwoLAME</h1>
<span id="revision">version 0.3.11</span>
<span id="revnumber">version 0.3.13</span>
</div>
<h2>Version 0.3.11 (2007-07-02)</h2>
<div id="content">
<div class="sect1">
<h2 id="_version_0_3_13_2010_01_21">Version 0.3.13 (2010-01-21)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
Fixed energy levels bug for mono audio
Fixed documentation location (--docdir in configure)
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
thanks to Staale Helleberg for patch
thanks to Chris Mayo for patch
</p>
</li>
</ul>
</ul></div>
</li>
<li>
<p>
Moved source code control to Github
</p>
</li>
<li>
<p>
Improvements to build system
</p>
</li>
<li>
<p>
Updated to autoconf 2.60, libtool 2.2, automake 1.10 and Doxygen 1.7.3
</p>
</li>
<li>
<p>
Fix problem with <em>extern inline</em> by changing them to <em>static inline</em>
</p>
</li>
<li>
<p>
Wrote perl script to test output of the frontend
</p>
</li>
<li>
<p>
Changed all debugging messages, writing to stdout to write to stderr
</p>
</li>
<li>
<p>
Removed calls to exit() from libtwolame.
</p>
</li>
<li>
<p>
Added --non-copyright option (which is enabled by default)
</p>
</li>
<li>
<p>
Fix for bad copy/paste of variable assignment.
</p>
</li>
<li>
<p>
Manpage correction
</p>
</li>
<li>
<p>
Changed fopen() options to wb to fix Windows
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_version_0_3_12_2008_01_09">Version 0.3.12 (2008-01-09)</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Fixed <em>inline</em> for the forthcoming gcc-4.3
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
thanks to Martin Michlmayr for patch
</p>
</li>
</ul>
</ul></div>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_version_0_3_11_2007_07_02">Version 0.3.11 (2007-07-02)</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Fixed energy levels bug for mono audio
</p>
<div class="ulist"><ul>
<li>
<p>
thanks to Staale Helleberg for patch
</p>
</li>
</ul></div>
</li>
<li>
<p>
Fixed STDIN support in twolame frontend
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.10 (2007-03-20)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_10_2007_03_20">Version 0.3.10 (2007-03-20)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
Added win32/winutil.h to tarball - fixes bug #1629945
@ -57,7 +147,7 @@ Added win32/winutil.h to tarball - fixes bug #1629945
</li>
<li>
<p>
Fixed presentation of &#8212;enable-debug in configure script
Fixed presentation of --enable-debug in configure script
</p>
</li>
<li>
@ -85,46 +175,48 @@ Added source file Ids to the top of every file
Added -pedantic to CFLAGS for debug build
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.9 (2006-12-31)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_9_2006_12_31">Version 0.3.9 (2006-12-31)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
Fix for Windows in simple frontend: open files in binary mode
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
thanks to Kurien Mathew
</p>
</li>
</ul>
</ul></div>
</li>
<li>
<p>
(libtwolame) Fixed energy level support
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
thanks to Staale Helleberg
</p>
</li>
</ul>
</ul></div>
</li>
<li>
<p>
Nows displays the version number of libsndfile in frontend
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
as suggested by Elio Blanca
</p>
</li>
</ul>
</ul></div>
</li>
<li>
<p>
@ -156,7 +248,7 @@ Added TWOLAME_SAMPLES_PER_FRAME macro, clarifying that there are
<p>
Frontend now displays extra information
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
Duration of input file (if known)
@ -172,18 +264,20 @@ Total number of frames to be encoded and percentage complete
The filesize of the output file
</p>
</li>
</ul>
</ul></div>
</li>
<li>
<p>
Cleaned up source files so that it is consistent and all uses tabs (tab width 4)
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.8 (2006-06-19)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_8_2006_06_19">Version 0.3.8 (2006-06-19)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
(libtwolame) Fixed CRC protection
@ -209,11 +303,13 @@ frontend now has the exectuable suffix appended to filename
added -std=c99 to the compiler options
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.7 (2006-05-07)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_7_2006_05_07">Version 0.3.7 (2006-05-07)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
(libtwolame) Added twolame_encode_buffer_float32() function
@ -229,33 +325,37 @@ added -std=c99 to the compiler options
Checks type sizes of short and float
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.6 (2006-12-25)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_6_2006_12_25">Version 0.3.6 (2006-12-25)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
Removed comma which was causing problems with -pedantic
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
Thanks to Akos Maroy
</p>
</li>
</ul>
</ul></div>
</li>
<li>
<p>
(libtwolame) Added libtool library versioning
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.5 (2005-11-29)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_5_2005_11_29">Version 0.3.5 (2005-11-29)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
(libtwolame) Added back twolame_get_VBR_q/twolame_set_VBR_q
@ -266,11 +366,13 @@ Thanks to Akos Maroy
More documentation is installed
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.4 (2005-11-19)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_4_2005_11_19">Version 0.3.4 (2005-11-19)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
(libtwolame) Checks parameters a bit better
@ -341,11 +443,13 @@ Documentation improvements and corrections
(libtwolame) made some of VBR debugging send to stderr instead of stdout
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.3 (2005-04-19)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_3_2005_04_19">Version 0.3.3 (2005-04-19)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
Added Debian package description
@ -361,11 +465,13 @@ Now installs documentation
Removed old unused tables.c and tables.h sources
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.2 (2005-04-10)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_2_2005_04_10">Version 0.3.2 (2005-04-10)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
Added scaling of input samples
@ -381,11 +487,13 @@ Added downmixing/upmixing of samples
Applied patch from Christophe Massiot to make TwoLAME thread-safe
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.1 (2004-09-17)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_1_2004_09_17">Version 0.3.1 (2004-09-17)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
Frontend displays information about the input file format
@ -406,11 +514,13 @@ Added asciidoc documentation
Added doxygen documentation
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Version 0.3.0 (2004-09-14)</h2>
</div>
<div class="sect1">
<h2 id="_version_0_3_0_2004_09_14">Version 0.3.0 (2004-09-14)</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
Based on tooLAME 0.2m beta 8
@ -430,13 +540,13 @@ now builds shared library
<p>
restructured lots of code
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
Removed some dead code and unused files
</p>
</li>
</ul>
</ul></div>
</li>
<li>
<p>
@ -452,7 +562,7 @@ removed memory leaks / static variables
<p>
changed library API so that it is almost the same as LAMEs
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
hopefully not too many people have been using the old API
@ -478,7 +588,7 @@ API is ready for resampling support to be added
ready for downmixing to be added to libtoolame
</p>
</li>
</ul>
</ul></div>
</li>
<li>
<p>
@ -505,12 +615,15 @@ Added LGPL header to the top of all the files
Added toolame_encode_buffer_interleaved
</p>
</li>
</ul>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:16 BST
Version 0.3.13<br />
Last updated 2011-01-21 18:15:40 GMT
</div>
</div>
</body>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -2,21 +2,27 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.3" />
<title>TwoLAME Documentation</title>
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
/*]]>*/
</script>
<script type="text/javascript" src="./asciidoc-xhtml11.js"></script>
</head>
<body>
<body class="article">
<div id="header">
<h1>TwoLAME Documentation</h1>
<span id="revision">version 0.3.11</span>
<span id="revnumber">version 0.3.13</span>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<p>TwoLAME - an optimized MPEG Audio Layer 2 encoder</p>
<ul>
<div class="paragraph"><p>TwoLAME - an optimized MPEG Audio Layer 2 encoder</p></div>
<div class="ulist"><ul>
<li>
<p>
<a href="readme.html">Read Me</a>
@ -62,15 +68,17 @@
<a href="authors.html">The TwoLAME Authors</a>
</p>
</li>
</ul>
<p>twolame homepage: <a href="http://www.twolame.org">http://www.twolame.org</a><br />
twolame mailing list: <a href="http://lists.sourceforge.net/lists/listinfo/twolame-discuss">twolame-discuss@lists.sourceforge.net</a></p>
</ul></div>
<div class="paragraph"><p>twolame homepage: <a href="http://www.twolame.org/">http://www.twolame.org/</a><br />
twolame mailing list: <a href="http://lists.sourceforge.net/lists/listinfo/twolame-discuss">twolame-discuss@lists.sourceforge.net</a></p></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:15 BST
Version 0.3.13<br />
Last updated 2011-01-17 08:49:16 GMT
</div>
</div>
</body>

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

View File

@ -2,97 +2,116 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.3" />
<title>Psychoacoustic Models in TwoLAME</title>
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
/*]]>*/
</script>
<script type="text/javascript" src="./asciidoc-xhtml11.js"></script>
</head>
<body>
<body class="article">
<div id="header">
<h1>Psychoacoustic Models in TwoLAME</h1>
<span id="revision">version 0.3.11</span>
<span id="revnumber">version 0.3.13</span>
</div>
<h2>Introduction</h2>
<div id="content">
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<p>In MPEG audio encoding, a psychoacoustic model (PAM) is used to determine which
<div class="paragraph"><p>In MPEG audio encoding, a psychoacoustic model (PAM) is used to determine which
are the sonically important parts of the waveform that is being encoded. The PAM
looks for loud sounds which may mask soft sounds, noise which may affect the level
of sounds nearby, sounds which are too soft for us to hear and should be ignored
and so on. The information from the PAM is used to determine which parts of the
spectrum should get more bits and thus be encoded at greater quality - and which
parts are inaudible/unimportant and should thus get fewer bits.</p>
<p>In MPEG Audio LayerII encoding, 1152 sound samples are read in - this constitutes
parts are inaudible/unimportant and should thus get fewer bits.</p></div>
<div class="paragraph"><p>In MPEG Audio LayerII encoding, 1152 sound samples are read in - this constitutes
a <em>frame</em>. For each frame the PAM outputs just <strong>32</strong> values
(The values are the Signal to Masking Ratio [SMR] in that subband). This is important!
There are only 32 values to determine how to alloctate bits for 1152 samples - this
is a pretty coarse technique.</p>
<p>The different PAMs listed below use different techniques to decide on these 32
is a pretty coarse technique.</p></div>
<div class="paragraph"><p>The different PAMs listed below use different techniques to decide on these 32
values. Some models are better than others - meaning that the 32 values chosen
are pretty good at spreading the bits where they should go. Even with a really
bad PAM (e.g. Model -1) you can still get satisfactory results a lot of the time.
All of these models have strengths and weaknesses. The model <em>you</em> end up using
will be the one that produces the best sound for your ears, for your audio.</p>
will be the one that produces the best sound for your ears, for your audio.</p></div>
</div>
<h2>Psychoacoustic Model -1</h2>
</div>
<div class="sect1">
<h2 id="_psychoacoustic_model_1">Psychoacoustic Model -1</h2>
<div class="sectionbody">
<p>This PAM doesn't actually look at the samples being encoded to decide upon the
<div class="paragraph"><p>This PAM doesn&#8217;t actually look at the samples being encoded to decide upon the
output values. There is simply a set of 32 default values which are used,
regardless of input.</p>
<p><strong>Pros</strong>: Faaaast. Low complexity. Surprisingly good.
regardless of input.</p></div>
<div class="paragraph"><p><strong>Pros</strong>: Faaaast. Low complexity. Surprisingly good.
"Surprising" in that the other PAMs go to the effort of calculating FFTs
and subbands and masking, and this one does absolutely <strong>nothing</strong>.
Zip. Nada. Diddly Squat. This model might be the best example of why
it is hard to make a good model - if having no computations sounds OK,
how do you improve on it?</p>
<p><strong>Cons</strong>: Absolutely no attempt to consider any of the masking effects that
would help the audio sound better.</p>
how do you improve on it?</p></div>
<div class="paragraph"><p><strong>Cons</strong>: Absolutely no attempt to consider any of the masking effects that
would help the audio sound better.</p></div>
</div>
<h2>Psychoacoustic Model 0</h2>
</div>
<div class="sect1">
<h2 id="_psychoacoustic_model_0">Psychoacoustic Model 0</h2>
<div class="sectionbody">
<p>This PAM looks at the sizes of the <em>scalefactors</em> for the audio and combines
it with the Absolute Threshold of Hearing (ATH) to make the 32 SMR values.</p>
<p><strong>Pros</strong>: Faaast. Low complexity.</p>
<p><strong>Cons</strong>: This model has absolutely no mathematical basis and does not use
<div class="paragraph"><p>This PAM looks at the sizes of the <em>scalefactors</em> for the audio and combines
it with the Absolute Threshold of Hearing (ATH) to make the 32 SMR values.</p></div>
<div class="paragraph"><p><strong>Pros</strong>: Faaast. Low complexity.</p></div>
<div class="paragraph"><p><strong>Cons</strong>: This model has absolutely no mathematical basis and does not use
any perceptual model of hearing. It simply juggles some of the numbers of
the input sound to determine the values. Feel free to hack the daylights out
of this PAM - add multipliers, constants, log-tables <strong>anything</strong>. Tweak it until
you begin to like the sound.</p>
you begin to like the sound.</p></div>
</div>
<h2>Psychoacoustic Model 1 and 2</h2>
<div class="sectionbody">
<p>These PAMs are from the ISO standard. Just because they are the standard,
doesn't mean that they are any good. Look at LAME which basically threw out
the MP3 standard psycho models and made their own (GPSYCHO).</p>
<p><strong>Pros</strong>: A reference for future PAMs</p>
<p><strong>Cons</strong>: Terrible ISO code, buggy tables, poor documentation.</p>
</div>
<h2>Psychoacoustic Model 3</h2>
<div class="sect1">
<h2 id="_psychoacoustic_model_1_and_2">Psychoacoustic Model 1 and 2</h2>
<div class="sectionbody">
<p>A re-implementation of psychoacoustic model 1. ISO11172 was used as the guide
for re-writing this PAM from the ground up.</p>
<p><strong>Pros</strong>: No more obscure tables of values from the ISO code. Hopefully a good
base to work upon for tweaking PAMs</p>
<p><strong>Cons</strong>: At the moment, doesn't really sound any better than PAM1</p>
<div class="paragraph"><p>These PAMs are from the ISO standard. Just because they are the standard,
doesn&#8217;t mean that they are any good. Look at LAME which basically threw out
the MP3 standard psycho models and made their own (GPSYCHO).</p></div>
<div class="paragraph"><p><strong>Pros</strong>: A reference for future PAMs</p></div>
<div class="paragraph"><p><strong>Cons</strong>: Terrible ISO code, buggy tables, poor documentation.</p></div>
</div>
<h2>Psychoacoustic Model 4</h2>
<div class="sectionbody">
<p>A cleaned up version of PAM2.</p>
<p><strong>Pros</strong>: Faster than PAM2. No more obscure tables of values from the ISO
standard. Hopefully a good base to work from for improving the PAMs</p>
<p><strong>Cons</strong>: Still has the same "warbling"/"Davros" problems as PAM2.</p>
</div>
<h2>Future psychoacoustic models</h2>
<div class="sect1">
<h2 id="_psychoacoustic_model_3">Psychoacoustic Model 3</h2>
<div class="sectionbody">
<p>There's a heap that could be done. Unfortunately, I've got a set of tin
ears, crappy speakers and a noisy computer room. If you've got the
<div class="paragraph"><p>A re-implementation of psychoacoustic model 1. ISO11172 was used as the guide
for re-writing this PAM from the ground up.</p></div>
<div class="paragraph"><p><strong>Pros</strong>: No more obscure tables of values from the ISO code. Hopefully a good
base to work upon for tweaking PAMs</p></div>
<div class="paragraph"><p><strong>Cons</strong>: At the moment, doesn&#8217;t really sound any better than PAM1</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_psychoacoustic_model_4">Psychoacoustic Model 4</h2>
<div class="sectionbody">
<div class="paragraph"><p>A cleaned up version of PAM2.</p></div>
<div class="paragraph"><p><strong>Pros</strong>: Faster than PAM2. No more obscure tables of values from the ISO
standard. Hopefully a good base to work from for improving the PAMs</p></div>
<div class="paragraph"><p><strong>Cons</strong>: Still has the same "warbling"/"Davros" problems as PAM2.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_future_psychoacoustic_models">Future psychoacoustic models</h2>
<div class="sectionbody">
<div class="paragraph"><p>There&#8217;s a heap that could be done. Unfortunately, I&#8217;ve got a set of tin
ears, crappy speakers and a noisy computer room. If you&#8217;ve got the
capability to do proper PAM testing then please feel free to do so.
Otherwise, I'll just keep plodding along with new ideas as they
arise, such as:</p>
<ul>
Otherwise, I&#8217;ll just keep plodding along with new ideas as they
arise, such as:</p></div>
<div class="ulist"><ul>
<li>
<p>
Temporal masking (there's no pre-echo or anything in TwoLAME)
Temporal masking (there&#8217;s no pre-echo or anything in TwoLAME)
</p>
</li>
<li>
@ -102,7 +121,7 @@ Left Right Masking
</li>
<li>
<p>
A PAM that's fully tuneable from the command line?
A PAM that&#8217;s fully tuneable from the command line?
</p>
</li>
<li>
@ -120,12 +139,15 @@ Re-sampling routines
Low/High pass filtering
</p>
</li>
</ul>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:18 BST
Version 0.3.13<br />
Last updated 2011-01-01 19:15:01 GMT
</div>
</div>
</body>

View File

@ -2,22 +2,28 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.3" />
<title>TwoLAME</title>
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
/*]]>*/
</script>
<script type="text/javascript" src="./asciidoc-xhtml11.js"></script>
</head>
<body>
<body class="article">
<div id="header">
<h1>TwoLAME</h1>
<span id="revision">version 0.3.11</span>
<span id="revnumber">version 0.3.13</span>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<p>Based on tooLAME by Michael Cheng</p>
<p>All changes to the ISO source are licensed under the LGPL
(see COPYING for details)</p>
<div class="paragraph"><p>Based on tooLAME by Michael Cheng</p></div>
<div class="paragraph"><p>All changes to the ISO source are licensed under the LGPL
(see COPYING for details)</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>TwoLAME is free software; you can redistribute it and/or
@ -40,11 +46,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</tt></
</div></div>
</div>
</div>
<h2>INTRODUCTION</h2>
<div class="sect1">
<h2 id="_introduction">INTRODUCTION</h2>
<div class="sectionbody">
<p>TwoLAME is an optimized MPEG Audio Layer 2 (MP2) encoder.
It is based heavily on:</p>
<ul>
<div class="paragraph"><p>TwoLAME is an optimized MPEG Audio Layer 2 (MP2) encoder.
It is based heavily on:</p></div>
<div class="ulist"><ul>
<li>
<p>
tooLAME by Michael Cheng
@ -65,28 +72,32 @@ improvement to algorithms as part of the LAME project (lame.sf.net)
other contributors (see AUTHORS)
</p>
</li>
</ul>
<p>TwoLAME should be able to be used as a drop-in replacement for
</ul></div>
<div class="paragraph"><p>TwoLAME should be able to be used as a drop-in replacement for
LAME (a MPEG Layer 3 encoder). The frontend takes very similar
command line options to LAME, and the backend library has a very
similar API to LAME.</p>
<p>For the latest version of TwoLAME, visit the project homepage:
http://www.twolame.org/</p>
similar API to LAME.</p></div>
<div class="paragraph"><p>For the latest version of TwoLAME, visit the project homepage:
<a href="http://www.twolame.org/">http://www.twolame.org/</a></p></div>
</div>
<h2>MPEG Audio Layer 2 (MP2)</h2>
</div>
<div class="sect1">
<h2 id="_mpeg_audio_layer_2_mp2">MPEG Audio Layer 2 (MP2)</h2>
<div class="sectionbody">
<p>(taken from Wikipedia article on MP2)</p>
<p>MP2 (sometimes incorrectly named Musicam) is a short form of MPEG Audio Layer II,
<div class="paragraph"><p>(taken from Wikipedia article on MP2)</p></div>
<div class="paragraph"><p>MP2 (sometimes incorrectly named Musicam) is a short form of MPEG Audio Layer II,
and it is also used as a file extension for files containing audio data of this
type. While it has largely been superseded by MP3 for PC and Internet applications,
it remains a dominant standard for audio broadcasting as part of the DAB digital
radio and DVB digital television standards. It is also used internally within the
radio industry, for example in NPR's PRSS Content Depot programming distribution
system.</p>
radio industry, for example in NPR&#8217;s PRSS Content Depot programming distribution
system.</p></div>
</div>
<h2>INSTALLATION</h2>
</div>
<div class="sect1">
<h2 id="_installation">INSTALLATION</h2>
<div class="sectionbody">
<p>Standard automake process:</p>
<div class="paragraph"><p>Standard automake process:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>./configure
@ -94,29 +105,34 @@ make
make install</tt></pre>
</div></div>
</div>
<h2>REFERENCE PAPERS</h2>
<div class="sectionbody">
<p>(Specifically Layer II Papers)</p>
<p>Kumar, M &amp; Zubair, M., A high performance software implementation of mpeg audio
encoder, 1996, ICASSP Conf Proceedings (I think)</p>
<p>Fischer, K.A., Calculation of the psychoacoustic simultaneous masked threshold
based on MPEG/Audio Encoder Model One, ICSI Technical Report, 1997
ftp://ftp.icsi.berkeley.edu/pub/real/kyrill/PsychoMpegOne.tar.Z</p>
<p>Hyen-O et al, New Implementation techniques of a real-time mpeg-2 audio encoding
system. p2287, ICASSP 99.</p>
<p>Imai, T., et al, MPEG-1 Audio real-time encoding system, IEEE Trans on Consumer
Electronics, v44, n3 1998. p888</p>
<p>Teh, D., et al, Efficient bit allocation algorithm for ISO/MPEG audio encoder,
Electronics Letters, v34, n8, p721</p>
<p>Murphy, C &amp; Anandakumar, K, Real-time MPEG-1 audio coding and decoding on a DSP
Chip, IEEE Trans on Consumer Electronics, v43, n1, 1997 p40</p>
<p>Hans, M &amp; Bhaskaran, V., A compliant MPEG-1 layer II audio decoder with 16-B
arithmetic operations, IEEE Signal Proc Letters v4 n5 1997 p121</p>
</div>
<div class="sect1">
<h2 id="_reference_papers">REFERENCE PAPERS</h2>
<div class="sectionbody">
<div class="paragraph"><p>(Specifically Layer II Papers)</p></div>
<div class="paragraph"><p>Kumar, M &amp; Zubair, M., A high performance software implementation of mpeg audio
encoder, 1996, ICASSP Conf Proceedings (I think)</p></div>
<div class="paragraph"><p>Fischer, K.A., Calculation of the psychoacoustic simultaneous masked threshold
based on MPEG/Audio Encoder Model One, ICSI Technical Report, 1997
<a href="ftp://ftp.icsi.berkeley.edu/pub/real/kyrill/PsychoMpegOne.tar.Z">ftp://ftp.icsi.berkeley.edu/pub/real/kyrill/PsychoMpegOne.tar.Z</a></p></div>
<div class="paragraph"><p>Hyen-O et al, New Implementation techniques of a real-time mpeg-2 audio encoding
system. p2287, ICASSP 99.</p></div>
<div class="paragraph"><p>Imai, T., et al, MPEG-1 Audio real-time encoding system, IEEE Trans on Consumer
Electronics, v44, n3 1998. p888</p></div>
<div class="paragraph"><p>Teh, D., et al, Efficient bit allocation algorithm for ISO/MPEG audio encoder,
Electronics Letters, v34, n8, p721</p></div>
<div class="paragraph"><p>Murphy, C &amp; Anandakumar, K, Real-time MPEG-1 audio coding and decoding on a DSP
Chip, IEEE Trans on Consumer Electronics, v43, n1, 1997 p40</p></div>
<div class="paragraph"><p>Hans, M &amp; Bhaskaran, V., A compliant MPEG-1 layer II audio decoder with 16-B
arithmetic operations, IEEE Signal Proc Letters v4 n5 1997 p121</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:15 BST
Version 0.3.13<br />
Last updated 2011-01-01 19:15:01 GMT
</div>
</div>
</body>

View File

@ -0,0 +1,59 @@
.tabs, .tabs2, .tabs3 {
background-image: url('tab_b.png');
width: 100%;
z-index: 101;
font-size: 13px;
}
.tabs2 {
font-size: 10px;
}
.tabs3 {
font-size: 9px;
}
.tablist {
margin: 0;
padding: 0;
display: table;
}
.tablist li {
float: left;
display: table-cell;
background-image: url('tab_b.png');
line-height: 36px;
list-style: none;
}
.tablist a {
display: block;
padding: 0 20px;
font-weight: bold;
background-image:url('tab_s.png');
background-repeat:no-repeat;
background-position:right;
color: #283A5D;
text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
text-decoration: none;
outline: none;
}
.tabs3 .tablist a {
padding: 0 10px;
}
.tablist a:hover {
background-image: url('tab_h.png');
background-repeat:repeat-x;
color: #fff;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
text-decoration: none;
}
.tablist li.current a {
background-image: url('tab_a.png');
background-repeat:repeat-x;
color: #fff;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
}

View File

@ -2,25 +2,26 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.3" />
<title>TwoLAME TODO List</title>
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
/*]]>*/
</script>
<script type="text/javascript" src="./asciidoc-xhtml11.js"></script>
</head>
<body>
<body class="article">
<div id="header">
<h1>TwoLAME TODO List</h1>
<span id="revision">version 0.3.11</span>
<span id="revnumber">version 0.3.13</span>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<ul>
<li>
<p>
Fix bug with Padding and framesizes with samplerate of 44.1 and 22kHz
</p>
</li>
<div class="ulist"><ul>
<li>
<p>
use Exact-width integer types (eg uint16_t)
@ -28,28 +29,28 @@ use Exact-width integer types (eg uint16_t)
</li>
<li>
<p>
Add libresample support to libtoolame (toolame_set_in_samplerate etc.)
Add libresample support to libtwolame (twolame_set_in_samplerate etc.)
</p>
</li>
<li>
<p>
parameter checking in toolame.c using assert
parameter checking in twolame.c using assert
</p>
</li>
<li>
<p>
Create a new toolame.spec (be sure to include twolame.pc)
Create a new twolame.spec (be sure to include twolame.pc)
</p>
</li>
<li>
<p>
quite a lot of duplicated code between toolame_encode_buffer_interleaved
and toolame_encode_buffer
quite a lot of duplicated code between twolame_encode_buffer_interleaved
and twolame_encode_buffer
</p>
</li>
<li>
<p>
sort out changing parameter for toolame_set_VBR_q from FLOAT to int (like LAME)
sort out changing parameter for twolame_set_VBR_q from FLOAT to int (like LAME)
</p>
</li>
<li>
@ -59,12 +60,12 @@ better use of verbosity settings
</li>
<li>
<p>
full options sanity checking/verification in toolame_init_params
full options sanity checking/verification in twolame_init_params
</p>
</li>
<li>
<p>
don't allow twolame_set_* after twolame_init_params() has been called
don&#8217;t allow twolame_set_* after twolame_init_params() has been called
</p>
</li>
<li>
@ -74,7 +75,7 @@ Fix broken DAB support
</li>
<li>
<p>
with this VBR mode, we know the bits aren't going to run out, so we can
with this VBR mode, we know the bits aren&#8217;t going to run out, so we can
just assign them "greedily".
</p>
</li>
@ -93,13 +94,15 @@ Add a layer 2 decoder ? mpglib ?
use 32-bit floats internally where possible
</p>
</li>
</ul>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:17 BST
Version 0.3.13<br />
Last updated 2011-01-21 17:09:20 GMT
</div>
</div>
</body>

View File

@ -1,33 +0,0 @@
/*
twolame-quirks.css
Based on xhtml11-quirks.css from asciidoc version 7.0.2
*/
/* Workarounds for IE6's broken and incomplete CSS2. */
div.sidebar-content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.sidebar-title, div.image-title {
font-family: sans-serif;
font-weight: bold;
margin-top: 0.0em;
margin-bottom: 0.5em;
}
div.listingblock div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock-content {
padding-left: 2.0em;
}
div.exampleblock-content {
border-left: 2px solid silver;
padding-left: 0.5em;
}

View File

@ -2,14 +2,19 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.3" />
<title>TWOLAME(1)</title>
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-manpage.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<title>TWOLAME(1)</title>
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
/*]]>*/
</script>
<script type="text/javascript" src="./asciidoc-xhtml11.js"></script>
</head>
<body>
<body class="manpage">
<div id="header">
<h1>
TWOLAME(1) Manual Page
@ -21,29 +26,40 @@ TWOLAME(1) Manual Page
</p>
</div>
</div>
<h2>SYNOPSIS</h2>
<div id="content">
<div class="sect1">
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<p><em>twolame</em> [options] &lt;infile&gt; [outfile]</p>
<div class="paragraph"><p><em>twolame</em> [options] &lt;infile&gt; [outfile]</p></div>
</div>
<h2>DESCRIPTION</h2>
</div>
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<p>TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on tooLAME by
<div class="paragraph"><p>TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on tooLAME by
Mike Cheng, which in turn is based upon the ISO dist10 code and portions of
LAME. Encoding is performed by the libtwolame library backend.</p>
LAME. Encoding is performed by the libtwolame library backend.</p></div>
</div>
<h2>OPTIONS</h2>
</div>
<div class="sect1">
<h2 id="_options">OPTIONS</h2>
<div class="sectionbody">
<h3>Input File</h3>
<p>twolame uses libsndfile for reading the input sound file, so
<div class="sect2">
<h3 id="_input_file">Input File</h3>
<div class="paragraph"><p>twolame uses libsndfile for reading the input sound file, so
the input file can be in any format supported by libsndfile.
To read raw PCM audio from STDIN, then use - as the input filename.</p>
<h3>Output File</h3>
<p>If no output filename is specified, then suffix of the input filename
To read raw PCM audio from STDIN, then use - as the input filename.</p></div>
</div>
<div class="sect2">
<h3 id="_output_file">Output File</h3>
<div class="paragraph"><p>If no output filename is specified, then suffix of the input filename
is automatically changed to .mp2. To write the encoded audio to STDOUT
then use - as the output filename.</p>
<h3>Input Options</h3>
<dl>
<dt>
then use - as the output filename.</p></div>
</div>
<div class="sect2">
<h3 id="_input_options">Input Options</h3>
<div class="dlist"><dl>
<dt class="hdlist1">
-r, --raw-input
</dt>
<dd>
@ -53,17 +69,17 @@ then use - as the output filename.</p>
between the two channels.
</p>
</dd>
<dt>
<dt class="hdlist1">
-x, --byte-swap
</dt>
<dd>
<p>
Force byte-swapping of the input. Endian detection is performed
automatically by libsndfile, so this option shouldn't
automatically by libsndfile, so this option shouldn&#8217;t
normally be needed.
</p>
</dd>
<dt>
<dt class="hdlist1">
-s, --samplerate &lt;int&gt;
</dt>
<dd>
@ -74,7 +90,7 @@ then use - as the output filename.</p>
Default sample rate is 44100Hz.
</p>
</dd>
<dt>
<dt class="hdlist1">
--samplesize &lt;int&gt;
</dt>
<dd>
@ -84,7 +100,7 @@ then use - as the output filename.</p>
Default sample size is 16-bit.
</p>
</dd>
<dt>
<dt class="hdlist1">
-N, --channels &lt;int&gt;
</dt>
<dd>
@ -93,7 +109,7 @@ then use - as the output filename.</p>
in the input audio. Default number of channels is 2.
</p>
</dd>
<dt>
<dt class="hdlist1">
-g, --swap-channels
</dt>
<dd>
@ -101,7 +117,7 @@ then use - as the output filename.</p>
Swap the Left and Right channels of a stereo input file.
</p>
</dd>
<dt>
<dt class="hdlist1">
--scale &lt;float&gt;
</dt>
<dd>
@ -112,7 +128,7 @@ then use - as the output filename.</p>
above 1 will increase the gain of the audio.
</p>
</dd>
<dt>
<dt class="hdlist1">
--scale-l &lt;float&gt;
</dt>
<dd>
@ -120,7 +136,7 @@ then use - as the output filename.</p>
Same as --scale, but only affects the left channel.
</p>
</dd>
<dt>
<dt class="hdlist1">
--scale-r &lt;float&gt;
</dt>
<dd>
@ -128,17 +144,19 @@ then use - as the output filename.</p>
Same as --scale, but only affects the right channel.
</p>
</dd>
</dl>
<h3>Output Options</h3>
<dl>
<dt>
</dl></div>
</div>
<div class="sect2">
<h3 id="_output_options">Output Options</h3>
<div class="dlist"><dl>
<dt class="hdlist1">
-m, --mode &lt;char&gt;
</dt>
<dd>
<p>
Choose the mode of the resulting audio. Default is auto.
</p>
<ul>
<div class="ulist"><ul>
<li>
<p>
"a" auto - choose mode automatically based on the input
@ -164,9 +182,9 @@ then use - as the output filename.</p>
"m" mono
</p>
</li>
</ul>
</ul></div>
</dd>
<dt>
<dt class="hdlist1">
-a, --downmix
</dt>
<dd>
@ -175,7 +193,7 @@ then use - as the output filename.</p>
input channels into a single mono channel.
</p>
</dd>
<dt>
<dt class="hdlist1">
-b, --bitrate &lt;int&gt;
</dt>
<dd>
@ -198,7 +216,7 @@ Sample Rate Mono Stereo
------------------------------</tt></pre>
</div></div>
</dd>
<dt>
<dt class="hdlist1">
-P, --psyc-mode &lt;int&gt;
</dt>
<dd>
@ -211,7 +229,7 @@ Sample Rate Mono Stereo
Default model is 3.
</p>
</dd>
<dt>
<dt class="hdlist1">
-v, --vbr
</dt>
<dd>
@ -220,8 +238,8 @@ Sample Rate Mono Stereo
Default VBR level is 5.0.
</p>
</dd>
<dt>
-v, --vbr-level &lt;float&gt;
<dt class="hdlist1">
-V, --vbr-level &lt;float&gt;
</dt>
<dd>
<p>
@ -231,7 +249,7 @@ Sample Rate Mono Stereo
See <em>vbr</em> documentation file for details.
</p>
</dd>
<dt>
<dt class="hdlist1">
-l, --ath &lt;float&gt;
</dt>
<dd>
@ -239,7 +257,7 @@ Sample Rate Mono Stereo
Set the ATH level. Default level is 0.0.
</p>
</dd>
<dt>
<dt class="hdlist1">
-q, --quick &lt;int&gt;
</dt>
<dd>
@ -248,7 +266,7 @@ Sample Rate Mono Stereo
model every specified number of frames.
</p>
</dd>
<dt>
<dt class="hdlist1">
-S, --single-frame
</dt>
<dd>
@ -257,10 +275,12 @@ Sample Rate Mono Stereo
is output and then the program terminates.
</p>
</dd>
</dl>
<h3>Miscellaneous Options</h3>
<dl>
<dt>
</dl></div>
</div>
<div class="sect2">
<h3 id="_miscellaneous_options">Miscellaneous Options</h3>
<div class="dlist"><dl>
<dt class="hdlist1">
-c, --copyright
</dt>
<dd>
@ -268,7 +288,7 @@ Sample Rate Mono Stereo
Turn on Copyright flag in output bitstream.
</p>
</dd>
<dt>
<dt class="hdlist1">
-o, --non-original
</dt>
<dd>
@ -276,7 +296,7 @@ Sample Rate Mono Stereo
Turn off Original flag in output bitstream.
</p>
</dd>
<dt>
<dt class="hdlist1">
--original
</dt>
<dd>
@ -284,7 +304,7 @@ Sample Rate Mono Stereo
Turn on Original flag in output bitstream.
</p>
</dd>
<dt>
<dt class="hdlist1">
-p, --protect
</dt>
<dd>
@ -293,7 +313,7 @@ Sample Rate Mono Stereo
An extra 16-bit checksum is added to frames.
</p>
</dd>
<dt>
<dt class="hdlist1">
-d, --padding
</dt>
<dd>
@ -301,7 +321,7 @@ Sample Rate Mono Stereo
Turn on padding in output bitstream.
</p>
</dd>
<dt>
<dt class="hdlist1">
-R, --reserve &lt;int&gt;
</dt>
<dd>
@ -310,7 +330,7 @@ Sample Rate Mono Stereo
output bitstream.
</p>
</dd>
<dt>
<dt class="hdlist1">
-e, --deemphasis &lt;char&gt;
</dt>
<dd>
@ -318,7 +338,7 @@ Sample Rate Mono Stereo
Set the de-emphasis type (n/c/5). Default is none.
</p>
</dd>
<dt>
<dt class="hdlist1">
-E, --energy
</dt>
<dd>
@ -326,10 +346,12 @@ Sample Rate Mono Stereo
Turn on energy level extensions.
</p>
</dd>
</dl>
<h3>Verbosity Options</h3>
<dl>
<dt>
</dl></div>
</div>
<div class="sect2">
<h3 id="_verbosity_options">Verbosity Options</h3>
<div class="dlist"><dl>
<dt class="hdlist1">
-t, --talkativity &lt;int&gt;
</dt>
<dd>
@ -338,16 +360,16 @@ Sample Rate Mono Stereo
Default is 2.
</p>
</dd>
<dt>
<dt class="hdlist1">
--quiet
</dt>
<dd>
<p>
Don't send any messages to stderr, unless there is an error.
Don&#8217;t send any messages to stderr, unless there is an error.
(Same as --talkativity=0)
</p>
</dd>
<dt>
<dt class="hdlist1">
--brief
</dt>
<dd>
@ -357,7 +379,7 @@ Sample Rate Mono Stereo
(Same as --talkativity=1)
</p>
</dd>
<dt>
<dt class="hdlist1">
--verbose
</dt>
<dd>
@ -367,13 +389,16 @@ Sample Rate Mono Stereo
(Same as --talkativity=4)
</p>
</dd>
</dl>
</dl></div>
</div>
<h2>Return Codes</h2>
</div>
</div>
<div class="sect1">
<h2 id="_return_codes">Return Codes</h2>
<div class="sectionbody">
<p>If encoding completes successfully, then twolame will return 0.
However if encoding is not successful, then it will return one of the following codes.</p>
<ul>
<div class="paragraph"><p>If encoding completes successfully, then twolame will return 0.
However if encoding is not successful, then it will return one of the following codes.</p></div>
<div class="ulist"><ul>
<li>
<p>
1 (No encoding performed)
@ -414,62 +439,75 @@ However if encoding is not successful, then it will return one of the following
14 (Error writing output audio)
</p>
</li>
</ul>
</ul></div>
</div>
<h2>EXAMPLES</h2>
</div>
<div class="sect1">
<h2 id="_examples">EXAMPLES</h2>
<div class="sectionbody">
<p>This will encode sound.wav to sound.mp2 using the default constant bitrate of 192 kbps
and using the default psycho-acoustic model (model 3):</p>
<div class="paragraph"><p>This will encode sound.wav to sound.mp2 using the default constant bitrate of 192 kbps
and using the default psycho-acoustic model (model 3):</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>twolame sound.wav</tt></pre>
</div></div>
<p>Constant bitrate of 160kbps and joint stereo encoding, saved to file sound_160.mp2:</p>
<div class="paragraph"><p>Constant bitrate of 160kbps and joint stereo encoding, saved to file sound_160.mp2:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>twolame -b 160 -m j sound.aiff sound_160.mp2</tt></pre>
</div></div>
<p>Encode sound.wav to newfile.mp2 using psycho-acoustic model 2 and encoding
with variable bitrate:</p>
<div class="paragraph"><p>Encode sound.wav to newfile.mp2 using psycho-acoustic model 2 and encoding
with variable bitrate:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>twolame -P 2 -v sound.wav newfile.mp2</tt></pre>
</div></div>
<p>Same as example above, except that the negative value of the "-V" argument
means that the lower bitrates will be favoured over the higher ones:</p>
<div class="paragraph"><p>Same as example above, except that the negative value of the "-V" argument
means that the lower bitrates will be favoured over the higher ones:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>twolame -P 2 -V -5 sound.wav newfile.mp2</tt></pre>
</div></div>
<p>Resample audio file using sox and pipe straight through twolame:</p>
<div class="paragraph"><p>Resample audio file using sox and pipe straight through twolame:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>sox sound_11025.aiff -t raw -r 16000 | twolame -r -s 16000 - - &gt; out.mp2</tt></pre>
</div></div>
</div>
<h2>AUTHORS</h2>
</div>
<div class="sect1">
<h2 id="_authors">AUTHORS</h2>
<div class="sectionbody">
<p>The twolame frontend was (re)written by Nicholas J Humfrey.
<div class="paragraph"><p>The twolame frontend was (re)written by Nicholas J Humfrey.
The libtwolame library is based on toolame by Mike Cheng.
For a full list of authors, please see the AUTHORS file.</p>
For a full list of authors, please see the AUTHORS file.</p></div>
</div>
<h2>RESOURCES</h2>
</div>
<div class="sect1">
<h2 id="_resources">RESOURCES</h2>
<div class="sectionbody">
<p>TwoLAME web site: http://www.twolame.org/</p>
<div class="paragraph"><p>TwoLAME web site: <a href="http://www.twolame.org/">http://www.twolame.org/</a></p></div>
</div>
<h2>SEE ALSO</h2>
</div>
<div class="sect1">
<h2 id="_see_also">SEE ALSO</h2>
<div class="sectionbody">
<p>lame(1), mpg123(1), madplay(1), sox(1)</p>
<div class="paragraph"><p>lame(1), mpg123(1), madplay(1), sox(1)</p></div>
</div>
<h2>COPYING</h2>
</div>
<div class="sect1">
<h2 id="_copying">COPYING</h2>
<div class="sectionbody">
<p>Copyright &#169; 2004-2006 The TwoLAME Project. Free use of this software is
granted under the terms of the GNU Lesser General Public License (LGPL).</p>
<div class="paragraph"><p>Copyright &#169; 2004-2006 The TwoLAME Project. Free use of this software is
granted under the terms of the GNU Lesser General Public License (LGPL).</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:19 BST
Version 0.3.13<br />
Last updated 2011-01-02 12:18:34 GMT
</div>
</div>
</body>

View File

@ -1,377 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>libtwolame: /home/humfrn01/Projects/twolame/trunk/libtwolame/twolame.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.1 -->
<h1>/home/humfrn01/Projects/twolame/trunk/libtwolame/twolame.h</h1><a href="twolame_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * TwoLAME: an optimized MPEG Audio Layer Two encoder</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2001-2004 Michael Cheng</span>
<a name="l00005"></a>00005 <span class="comment"> * Copyright (C) 2004-2006 The TwoLAME Project</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00008"></a>00008 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00009"></a>00009 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00010"></a>00010 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00015"></a>00015 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00018"></a>00018 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00019"></a>00019 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
<a name="l00020"></a>00020 <span class="comment"> *</span>
<a name="l00021"></a>00021 <span class="comment"> * $Id: twolame_8h-source.html,v 1.3 2008-02-01 19:44:25 richardash1981 Exp $</span>
<a name="l00022"></a>00022 <span class="comment"> *</span>
<a name="l00023"></a>00023 <span class="comment"> */</span>
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <span class="preprocessor">#ifndef __TWOLAME_H__</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define __TWOLAME_H__</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="comment">/*</span>
<a name="l00035"></a>00035 <span class="comment"> * ATTENTION WIN32 USERS!</span>
<a name="l00036"></a>00036 <span class="comment"> * </span>
<a name="l00037"></a>00037 <span class="comment"> * By default, when you use this header file, it is configured to use</span>
<a name="l00038"></a>00038 <span class="comment"> * symbols from the "twolame.dll" file. If you use the static version of</span>
<a name="l00039"></a>00039 <span class="comment"> * the library, define LIBTWOLAME_STATIC prior to including this header.</span>
<a name="l00040"></a>00040 <span class="comment"> */</span>
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="preprocessor">#ifdef _WIN32</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#ifdef LIBTWOLAME_STATIC</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#define DLL_EXPORT</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#ifdef LIBTWOLAME_DLL_EXPORTS</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define DLL_EXPORT __declspec(dllexport)</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define DLL_EXPORT __declspec(dllimport)</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define DLL_EXPORT</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span>
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="preprocessor">#ifndef TRUE</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define TRUE (1)</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span>
<a name="l00061"></a>00061 <span class="preprocessor">#ifndef FALSE</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define FALSE (0)</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span>
<a name="l00065"></a>00065
<a name="l00067"></a><a class="code" href="twolame_8h.html#91879045676d9146c9bfcb8b0a30b57f">00067</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00068"></a>00068 <a class="code" href="twolame_8h.html#91879045676d9146c9bfcb8b0a30b57fb0b25df193c4be6b5c7bda71166df264">TWOLAME_AUTO_MODE</a> = -1,
<a name="l00069"></a>00069 <a class="code" href="twolame_8h.html#91879045676d9146c9bfcb8b0a30b57f785df1b22ebb296610b938793906f66d">TWOLAME_STEREO</a> = 0,
<a name="l00070"></a>00070 <a class="code" href="twolame_8h.html#91879045676d9146c9bfcb8b0a30b57f944018843ef67ac47d3e680c749b2967">TWOLAME_JOINT_STEREO</a>,
<a name="l00071"></a>00071 <a class="code" href="twolame_8h.html#91879045676d9146c9bfcb8b0a30b57fe054f4dcb5762d5c58c3db92e5338601">TWOLAME_DUAL_CHANNEL</a>,
<a name="l00072"></a>00072 <a class="code" href="twolame_8h.html#91879045676d9146c9bfcb8b0a30b57f482d714be97e4cb21c223850ece06456">TWOLAME_MONO</a>,
<a name="l00073"></a>00073 TWOLAME_NOT_SET
<a name="l00074"></a>00074 } <a class="code" href="twolame_8h.html#91879045676d9146c9bfcb8b0a30b57f">TWOLAME_MPEG_mode</a>;
<a name="l00075"></a>00075
<a name="l00076"></a>00076
<a name="l00081"></a><a class="code" href="twolame_8h.html#0f4e287fec57b8ba38e28395996eb6e3">00081</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00082"></a>00082 <a class="code" href="twolame_8h.html#0f4e287fec57b8ba38e28395996eb6e389b91170fa0bb8423f45ff7a1b45b1d8">TWOLAME_MPEG2</a> = 0,
<a name="l00083"></a><a class="code" href="twolame_8h.html#0f4e287fec57b8ba38e28395996eb6e3e8dc89cc37c6203400e64768eb6b59d5">00083</a> <a class="code" href="twolame_8h.html#0f4e287fec57b8ba38e28395996eb6e3e8dc89cc37c6203400e64768eb6b59d5">TWOLAME_MPEG1</a>
<a name="l00084"></a>00084 } <a class="code" href="twolame_8h.html#0f4e287fec57b8ba38e28395996eb6e3">TWOLAME_MPEG_version</a>;
<a name="l00085"></a>00085
<a name="l00086"></a>00086
<a name="l00088"></a><a class="code" href="twolame_8h.html#f83f4f73e4c57db45269667b4421730e">00088</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00089"></a>00089 <a class="code" href="twolame_8h.html#f83f4f73e4c57db45269667b4421730eb2dd0f81e433f7f708622c96466dbff3">TWOLAME_PAD_NO</a> = 0,
<a name="l00090"></a><a class="code" href="twolame_8h.html#f83f4f73e4c57db45269667b4421730eecf832eac6e75140fc9397b621e590a8">00090</a> <a class="code" href="twolame_8h.html#f83f4f73e4c57db45269667b4421730eecf832eac6e75140fc9397b621e590a8">TWOLAME_PAD_ALL</a>
<a name="l00091"></a>00091 <span class="comment">// TWOLAME_PAD_ADJUST // unsupported by twolame</span>
<a name="l00092"></a>00092 } <a class="code" href="twolame_8h.html#f83f4f73e4c57db45269667b4421730e">TWOLAME_Padding</a>;
<a name="l00093"></a>00093
<a name="l00095"></a><a class="code" href="twolame_8h.html#50521fc75f96f949634f8f6536c1be1b">00095</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00096"></a>00096 <a class="code" href="twolame_8h.html#50521fc75f96f949634f8f6536c1be1b73eced6173758db8e4186d07ee510dd1">TWOLAME_EMPHASIS_N</a> = 0,
<a name="l00097"></a>00097 <a class="code" href="twolame_8h.html#50521fc75f96f949634f8f6536c1be1beca80cfc79ece58fd01e06f974394c6e">TWOLAME_EMPHASIS_5</a> = 1,
<a name="l00098"></a>00098 <span class="comment">// reserved</span>
<a name="l00099"></a><a class="code" href="twolame_8h.html#50521fc75f96f949634f8f6536c1be1b038be927e1993710372565262a73e62d">00099</a> <a class="code" href="twolame_8h.html#50521fc75f96f949634f8f6536c1be1b038be927e1993710372565262a73e62d">TWOLAME_EMPHASIS_C</a> = 3
<a name="l00100"></a>00100 } <a class="code" href="twolame_8h.html#50521fc75f96f949634f8f6536c1be1b">TWOLAME_Emphasis</a>;
<a name="l00101"></a>00101
<a name="l00102"></a>00102
<a name="l00104"></a><a class="code" href="twolame_8h.html#09bd4a4970ba3c49e9f1327daefeb8c1">00104</a> <span class="preprocessor">#define TWOLAME_SAMPLES_PER_FRAME (1152)</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span>
<a name="l00106"></a>00106
<a name="l00108"></a>00108 <span class="keyword">struct </span>twolame_options_struct;
<a name="l00109"></a>00109
<a name="l00111"></a><a class="code" href="twolame_8h.html#429c5c35b47d5d7cc34a07e48a82866d">00111</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>twolame_options_struct twolame_options;
<a name="l00112"></a>00112
<a name="l00113"></a>00113
<a name="l00114"></a>00114
<a name="l00115"></a>00115
<a name="l00116"></a>00116
<a name="l00122"></a>00122 DLL_EXPORT <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="twolame_8h.html#c73aa5af9bd007a90ec39fc2d463f486">get_twolame_version</a>( <span class="keywordtype">void</span> );
<a name="l00123"></a>00123
<a name="l00124"></a>00124
<a name="l00130"></a>00130 DLL_EXPORT <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="twolame_8h.html#3e82f14e8b2973a4621dd7f599ba6702">get_twolame_url</a>( <span class="keywordtype">void</span> );
<a name="l00131"></a>00131
<a name="l00132"></a>00132
<a name="l00143"></a>00143 DLL_EXPORT <span class="keywordtype">void</span> <a class="code" href="twolame_8h.html#3a0793a526503a0833736287a38722d3">twolame_print_config</a>(twolame_options *glopts);
<a name="l00144"></a>00144
<a name="l00145"></a>00145
<a name="l00155"></a>00155 DLL_EXPORT twolame_options *<a class="code" href="twolame_8h.html#c4cdab0d6542badab38bb4ddf96957fb">twolame_init</a>(<span class="keywordtype">void</span>);
<a name="l00156"></a>00156
<a name="l00157"></a>00157
<a name="l00169"></a>00169 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#479229b288016a4b7b1dd696e4000257">twolame_init_params</a>(twolame_options *glopts);
<a name="l00170"></a>00170
<a name="l00171"></a>00171
<a name="l00186"></a>00186 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#7656283020d9b131790bf5a99af055c4">twolame_encode_buffer</a>(
<a name="l00187"></a>00187 twolame_options *glopts,
<a name="l00188"></a>00188 <span class="keyword">const</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> leftpcm[],
<a name="l00189"></a>00189 <span class="keyword">const</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> rightpcm[],
<a name="l00190"></a>00190 <span class="keywordtype">int</span> num_samples,
<a name="l00191"></a>00191 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer,
<a name="l00192"></a>00192 <span class="keywordtype">int</span> mp2buffer_size );
<a name="l00193"></a>00193
<a name="l00194"></a>00194
<a name="l00208"></a>00208 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#578b70ad7abfcc2bbed09ecf661fd66e">twolame_encode_buffer_interleaved</a>(
<a name="l00209"></a>00209 twolame_options *glopts,
<a name="l00210"></a>00210 <span class="keyword">const</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> pcm[],
<a name="l00211"></a>00211 <span class="keywordtype">int</span> num_samples,
<a name="l00212"></a>00212 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer,
<a name="l00213"></a>00213 <span class="keywordtype">int</span> mp2buffer_size );
<a name="l00214"></a>00214
<a name="l00215"></a>00215
<a name="l00233"></a>00233 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#8e77eb0f22479f8ec1bd4f1b042f9cd9">twolame_encode_buffer_float32</a>(
<a name="l00234"></a>00234 twolame_options *glopts,
<a name="l00235"></a>00235 <span class="keyword">const</span> <span class="keywordtype">float</span> leftpcm [],
<a name="l00236"></a>00236 <span class="keyword">const</span> <span class="keywordtype">float</span> rightpcm [],
<a name="l00237"></a>00237 <span class="keywordtype">int</span> num_samples,
<a name="l00238"></a>00238 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer,
<a name="l00239"></a>00239 <span class="keywordtype">int</span> mp2buffer_size );
<a name="l00240"></a>00240
<a name="l00241"></a>00241
<a name="l00255"></a>00255 <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ca716bf42f767e889c0505206c3f1160">twolame_encode_buffer_float32_interleaved</a>(
<a name="l00256"></a>00256 twolame_options *glopts,
<a name="l00257"></a>00257 <span class="keyword">const</span> <span class="keywordtype">float</span> pcm[],
<a name="l00258"></a>00258 <span class="keywordtype">int</span> num_samples,
<a name="l00259"></a>00259 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer,
<a name="l00260"></a>00260 <span class="keywordtype">int</span> mp2buffer_size );
<a name="l00261"></a>00261
<a name="l00262"></a>00262
<a name="l00275"></a>00275 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#3903ae20e7e99b7774c527e3e9ed3ab3">twolame_encode_flush</a>(
<a name="l00276"></a>00276 twolame_options *glopts,
<a name="l00277"></a>00277 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer,
<a name="l00278"></a>00278 <span class="keywordtype">int</span> mp2buffer_size);
<a name="l00279"></a>00279
<a name="l00280"></a>00280
<a name="l00290"></a>00290 DLL_EXPORT <span class="keywordtype">void</span> <a class="code" href="twolame_8h.html#5a9adda3b79826aa841471dda5e87e34">twolame_close</a>(twolame_options **glopts);
<a name="l00291"></a>00291
<a name="l00292"></a>00292
<a name="l00293"></a>00293
<a name="l00309"></a>00309 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a98e4d1b7bfdbe4702074f53d7343ac4">twolame_set_verbosity</a>(twolame_options *glopts, <span class="keywordtype">int</span> verbosity);
<a name="l00310"></a>00310
<a name="l00311"></a>00311
<a name="l00317"></a>00317 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#c791c3826717a0c5c580449f1021e0e5">twolame_get_verbosity</a>(twolame_options *glopts);
<a name="l00318"></a>00318
<a name="l00319"></a>00319
<a name="l00330"></a>00330 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ef8212f0d9c29618826274b9685cddf9">twolame_set_mode</a>(twolame_options *glopts, TWOLAME_MPEG_mode mode);
<a name="l00331"></a>00331
<a name="l00332"></a>00332
<a name="l00338"></a>00338 DLL_EXPORT TWOLAME_MPEG_mode <a class="code" href="twolame_8h.html#59ce06e05cfa978689ee3195264190c9">twolame_get_mode</a>(twolame_options *glopts);
<a name="l00339"></a>00339
<a name="l00340"></a>00340
<a name="l00346"></a>00346 DLL_EXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="twolame_8h.html#4b8302f67ce0c691cd0fbd7c08c79729">twolame_get_mode_name</a>(twolame_options *glopts);
<a name="l00347"></a>00347
<a name="l00348"></a>00348
<a name="l00358"></a>00358 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#b6d5accf1b38fa49af75b33415dcd89e">twolame_set_version</a>(twolame_options *glopts, TWOLAME_MPEG_version version);
<a name="l00359"></a>00359
<a name="l00360"></a>00360
<a name="l00366"></a>00366 DLL_EXPORT TWOLAME_MPEG_version <a class="code" href="twolame_8h.html#1d381b8f8b615aa3a98f2ad19668738a">twolame_get_version</a>(twolame_options *glopts);
<a name="l00367"></a>00367
<a name="l00368"></a>00368
<a name="l00374"></a>00374 DLL_EXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="twolame_8h.html#ab4b76e8f09388229cc3e6789ef5979e">twolame_get_version_name</a>( twolame_options *glopts );
<a name="l00375"></a>00375
<a name="l00376"></a>00376
<a name="l00383"></a>00383 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#e6a2eea827688dc46b929536150da3b6">twolame_get_framelength</a>( twolame_options *glopts );
<a name="l00384"></a>00384
<a name="l00385"></a>00385
<a name="l00395"></a>00395 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#3810cbcbf62700685b54083147a27f7b">twolame_set_psymodel</a>(twolame_options *glopts, <span class="keywordtype">int</span> psymodel);
<a name="l00396"></a>00396
<a name="l00397"></a>00397
<a name="l00403"></a>00403 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#101e8c94bd34e64c0c25e65866253c58">twolame_get_psymodel</a>(twolame_options *glopts);
<a name="l00404"></a>00404
<a name="l00405"></a>00405
<a name="l00419"></a>00419 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#0f52f945ac41a45e47555b40e4c29a5f">twolame_set_num_channels</a>(twolame_options* glopts, <span class="keywordtype">int</span> num_channels);
<a name="l00420"></a>00420
<a name="l00421"></a>00421
<a name="l00427"></a>00427 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#c77ec659a0546bd0393b6e317553fc7f">twolame_get_num_channels</a>(twolame_options* glopts);
<a name="l00428"></a>00428
<a name="l00429"></a>00429
<a name="l00441"></a>00441 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a13250b4af52ce46a76f5dfe1a027697">twolame_set_scale</a>(twolame_options* glopts, <span class="keywordtype">float</span> scale);
<a name="l00442"></a>00442
<a name="l00443"></a>00443
<a name="l00449"></a>00449 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#3deeb5e64e08c3347e09205f00d19b97">twolame_get_scale</a>(twolame_options* glopts);
<a name="l00450"></a>00450
<a name="l00462"></a>00462 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#6283594f9de7c332982f34fcf1021e26">twolame_set_scale_left</a>(twolame_options* glopts, <span class="keywordtype">float</span> scale);
<a name="l00463"></a>00463
<a name="l00464"></a>00464
<a name="l00470"></a>00470 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#b33a74b3846656f94da0977bbcb2f151">twolame_get_scale_left</a>(twolame_options* glopts);
<a name="l00471"></a>00471
<a name="l00472"></a>00472
<a name="l00484"></a>00484 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a9233c1b394311ed4779d9ace6916308">twolame_set_scale_right</a>(twolame_options* glopts, <span class="keywordtype">float</span> scale);
<a name="l00485"></a>00485
<a name="l00486"></a>00486
<a name="l00492"></a>00492 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#0750330f1ac29c88dea28a3945e6f953">twolame_get_scale_right</a>(twolame_options* glopts);
<a name="l00493"></a>00493
<a name="l00494"></a>00494
<a name="l00504"></a>00504 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ffb3e7a2d178505aa0993d49a6535ed0">twolame_set_in_samplerate</a>(twolame_options *glopts, <span class="keywordtype">int</span> samplerate);
<a name="l00505"></a>00505
<a name="l00506"></a>00506
<a name="l00512"></a>00512 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#f5005929502db228375bb635b041ed7a">twolame_get_in_samplerate</a>(twolame_options *glopts);
<a name="l00513"></a>00513
<a name="l00514"></a>00514
<a name="l00524"></a>00524 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#5c364e5741f1f9f490c848733f2031df">twolame_set_out_samplerate</a>(twolame_options *glopts, <span class="keywordtype">int</span> samplerate);
<a name="l00525"></a>00525
<a name="l00526"></a>00526
<a name="l00532"></a>00532 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#13be375a082dc802e6b408171dc3bb69">twolame_get_out_samplerate</a>(twolame_options *glopts);
<a name="l00533"></a>00533
<a name="l00534"></a>00534
<a name="l00544"></a>00544 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#544b8b46797b18891eeccaf17e314701">twolame_set_bitrate</a>(twolame_options *glopts, <span class="keywordtype">int</span> bitrate);
<a name="l00545"></a>00545
<a name="l00546"></a>00546
<a name="l00552"></a>00552 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#d86ca8099646d77e86578f879f16beb1">twolame_get_bitrate</a>(twolame_options *glopts);
<a name="l00553"></a>00553
<a name="l00554"></a>00554
<a name="l00559"></a>00559 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#d56fa68b723f3232c7feb162c1142a14">twolame_set_brate</a>(twolame_options *glopts, <span class="keywordtype">int</span> bitrate);
<a name="l00560"></a>00560
<a name="l00561"></a>00561
<a name="l00566"></a>00566 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#961463704f86a2d3f310004be9a3a0b3">twolame_get_brate</a>(twolame_options *glopts);
<a name="l00567"></a>00567
<a name="l00568"></a>00568
<a name="l00580"></a>00580 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#aaa5455a98cbba0fafde73c61d6079be">twolame_set_padding</a>(twolame_options *glopts, TWOLAME_Padding padding);
<a name="l00581"></a>00581
<a name="l00587"></a>00587 DLL_EXPORT TWOLAME_Padding <a class="code" href="twolame_8h.html#9e2ea760fc280da8edd3b06d6b50efbf">twolame_get_padding</a>(twolame_options *glopts);
<a name="l00588"></a>00588
<a name="l00589"></a>00589
<a name="l00607"></a>00607 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#f53c80e3221f2030fceeb9acfb21854b">twolame_set_energy_levels</a>(twolame_options *glopts, <span class="keywordtype">int</span> energylevels );
<a name="l00608"></a>00608
<a name="l00609"></a>00609
<a name="l00615"></a>00615 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#eea27328604d2906772f9f3b7756fe47">twolame_get_energy_levels</a>(twolame_options *glopts);
<a name="l00616"></a>00616
<a name="l00617"></a>00617
<a name="l00627"></a>00627 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#8349b49903299a3bfc4d2ae0b5b0cdbd">twolame_set_num_ancillary_bits</a>(twolame_options *glopts, <span class="keywordtype">int</span> num);
<a name="l00628"></a>00628
<a name="l00629"></a>00629
<a name="l00635"></a>00635 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#2224987bc284c6a6400d485e6dd88351">twolame_get_num_ancillary_bits</a>(twolame_options *glopts);
<a name="l00636"></a>00636
<a name="l00637"></a>00637
<a name="l00638"></a>00638
<a name="l00648"></a>00648 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#f234f350ff569bc8b4d10931d9090957">twolame_set_emphasis</a>(twolame_options *glopts, <a class="code" href="twolame_8h.html#50521fc75f96f949634f8f6536c1be1b">TWOLAME_Emphasis</a> emphasis);
<a name="l00649"></a>00649
<a name="l00650"></a>00650
<a name="l00656"></a>00656 DLL_EXPORT <a class="code" href="twolame_8h.html#50521fc75f96f949634f8f6536c1be1b">TWOLAME_Emphasis</a> <a class="code" href="twolame_8h.html#0fe4a766c951b351bad37d1e642c1018">twolame_get_emphasis</a>(twolame_options *glopts);
<a name="l00657"></a>00657
<a name="l00658"></a>00658
<a name="l00668"></a>00668 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#275b46ca5b225814047bcf145e866ec7">twolame_set_error_protection</a>(twolame_options *glopts, <span class="keywordtype">int</span> err_protection);
<a name="l00669"></a>00669
<a name="l00670"></a>00670
<a name="l00676"></a>00676 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#2daddd047937e29e73e58714a6c5a254">twolame_get_error_protection</a>(twolame_options *glopts);
<a name="l00677"></a>00677
<a name="l00678"></a>00678
<a name="l00690"></a>00690 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#d5b45a13a48abddd5a8f0e2e31f15f18">twolame_set_copyright</a>(twolame_options *glopts, <span class="keywordtype">int</span> copyright);
<a name="l00691"></a>00691
<a name="l00692"></a>00692
<a name="l00698"></a>00698 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#c7f5cd7d52aed6fad33fb96ed7c0e5c9">twolame_get_copyright</a>(twolame_options *glopts);
<a name="l00699"></a>00699
<a name="l00700"></a>00700
<a name="l00710"></a>00710 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#88fcaeb8df0c785fa752cc13b81c811b">twolame_set_original</a>(twolame_options *glopts, <span class="keywordtype">int</span> original);
<a name="l00711"></a>00711
<a name="l00712"></a>00712
<a name="l00718"></a>00718 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#f223fb3fd799175a04f9ba4cb87d578e">twolame_get_original</a>(twolame_options *glopts);
<a name="l00719"></a>00719
<a name="l00720"></a>00720
<a name="l00730"></a>00730 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#d9d4595a2115c6d2d26af0ad35e439e0">twolame_set_VBR</a>(twolame_options *glopts, <span class="keywordtype">int</span> vbr);
<a name="l00731"></a>00731
<a name="l00732"></a>00732
<a name="l00738"></a>00738 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a79c3d628f2ed444d4a1326cd87f125b">twolame_get_VBR</a>(twolame_options *glopts);
<a name="l00739"></a>00739
<a name="l00740"></a>00740
<a name="l00753"></a>00753 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#f220a143ef980c70d7ae17d6113edc20">twolame_set_VBR_level</a>(twolame_options *glopts, <span class="keywordtype">float</span> level);
<a name="l00754"></a>00754
<a name="l00755"></a>00755
<a name="l00761"></a>00761 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#b4914da9988dd0f8f6703eba5882a029">twolame_get_VBR_level</a>(twolame_options *glopts);
<a name="l00762"></a>00762
<a name="l00763"></a>00763
<a name="l00764"></a>00764
<a name="l00765"></a>00765 <span class="comment">/* </span>
<a name="l00766"></a>00766 <span class="comment"> Using the twolame_set_VBR_q()/twolame_get_VBR_q functions </span>
<a name="l00767"></a>00767 <span class="comment"> are deprecated, please use twolame_set_VBR_level() instead.</span>
<a name="l00768"></a>00768 <span class="comment">*/</span>
<a name="l00769"></a>00769 DLL_EXPORT <span class="keywordtype">int</span> twolame_set_VBR_q(twolame_options *glopts, <span class="keywordtype">float</span> level);
<a name="l00770"></a>00770 DLL_EXPORT <span class="keywordtype">float</span> twolame_get_VBR_q(twolame_options *glopts);
<a name="l00771"></a>00771
<a name="l00772"></a>00772
<a name="l00773"></a>00773
<a name="l00783"></a>00783 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#979fdde10d7ac22a7767412427f18b01">twolame_set_ATH_level</a>(twolame_options *glopts, <span class="keywordtype">float</span> level);
<a name="l00784"></a>00784
<a name="l00785"></a>00785
<a name="l00791"></a>00791 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#d524505da0eabb3f8d84ac1d1157e2ee">twolame_get_ATH_level</a>(twolame_options *glopts);
<a name="l00792"></a>00792
<a name="l00793"></a>00793
<a name="l00803"></a>00803 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#67ac2fef77dd7853374d9e05ebc46210">twolame_set_VBR_max_bitrate_kbps</a>(twolame_options *glopts, <span class="keywordtype">int</span> bitrate);
<a name="l00804"></a>00804
<a name="l00810"></a>00810 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#1faa386043bb3254e633bfbe27349017">twolame_get_VBR_max_bitrate_kbps</a>(twolame_options *glopts);
<a name="l00811"></a>00811
<a name="l00812"></a>00812
<a name="l00822"></a>00822 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#1093464689803410a5b28eb840d83f4e">twolame_set_quick_mode</a>(twolame_options *glopts, <span class="keywordtype">int</span> quickmode);
<a name="l00823"></a>00823
<a name="l00829"></a>00829 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#95c94c63c625e9bb729a7a5bf1344810">twolame_get_quick_mode</a>(twolame_options *glopts);
<a name="l00830"></a>00830
<a name="l00831"></a>00831
<a name="l00841"></a>00841 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#d15ae6c585352c6f4285b4353b005f40">twolame_set_quick_count</a>(twolame_options *glopts, <span class="keywordtype">int</span> quickcount );
<a name="l00842"></a>00842
<a name="l00848"></a>00848 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#d09819bcdf05f5d68bddd614d6f85496">twolame_get_quick_count</a>(twolame_options *glopts);
<a name="l00849"></a>00849
<a name="l00850"></a>00850
<a name="l00851"></a>00851
<a name="l00852"></a>00852
<a name="l00853"></a>00853
<a name="l00854"></a>00854
<a name="l00855"></a>00855
<a name="l00856"></a>00856 <span class="comment">/* WARNING: DAB support is currently broken */</span>
<a name="l00857"></a>00857
<a name="l00858"></a>00858
<a name="l00859"></a>00859
<a name="l00860"></a>00860
<a name="l00861"></a>00861
<a name="l00871"></a>00871 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#e344176895eb7922a05a003d0ae2f911">twolame_set_DAB</a>(twolame_options *glopts, <span class="keywordtype">int</span> dab);
<a name="l00872"></a>00872
<a name="l00878"></a>00878 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#130b6c716477dab5500097337a41299a">twolame_get_DAB</a>(twolame_options *glopts);
<a name="l00879"></a>00879
<a name="l00880"></a>00880
<a name="l00890"></a>00890 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#621a6efe085aac5ea36ff70ef719a4cc">twolame_set_DAB_xpad_length</a>(twolame_options *glopts, <span class="keywordtype">int</span> length);
<a name="l00891"></a>00891
<a name="l00892"></a>00892
<a name="l00898"></a>00898 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#8a9c2b288b674e4b331922cbe66254c0">twolame_get_DAB_xpad_length</a>(twolame_options *glopts);
<a name="l00899"></a>00899
<a name="l00900"></a>00900
<a name="l00910"></a>00910 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#168ceb98ea672ce2f461f5d681041be6">twolame_set_DAB_crc_length</a>(twolame_options *glopts, <span class="keywordtype">int</span> length);
<a name="l00911"></a>00911
<a name="l00912"></a>00912
<a name="l00918"></a>00918 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#da5cb510aa1a32eb9921140b72a9189a">twolame_get_DAB_crc_length</a>(twolame_options *glopts);
<a name="l00919"></a>00919
<a name="l00920"></a>00920
<a name="l00921"></a>00921
<a name="l00922"></a>00922 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00923"></a>00923 <span class="preprocessor"></span>}
<a name="l00924"></a>00924 <span class="preprocessor">#endif</span>
<a name="l00925"></a>00925 <span class="preprocessor"></span>
<a name="l00926"></a>00926 <span class="preprocessor">#endif </span><span class="comment">/* _TWOLAME_H_ */</span>
<a name="l00927"></a>00927
<a name="l00928"></a>00928
<a name="l00929"></a>00929 <span class="comment">// vim:ts=4:sw=4:nowrap:</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Jan 9 11:45:15 2008 for libtwolame by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,387 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>twolame: twolame.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">twolame&#160;<span id="projectnumber">0.3.13</span></div>
<div id="projectbrief">MPEGAudioLayer2encoder</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="header">
<div class="headertitle">
<h1>twolame.h</h1> </div>
</div>
<div class="contents">
<a href="twolame_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * TwoLAME: an optimized MPEG Audio Layer Two encoder</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2001-2004 Michael Cheng</span>
<a name="l00005"></a>00005 <span class="comment"> * Copyright (C) 2004-2006 The TwoLAME Project</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00008"></a>00008 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00009"></a>00009 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00010"></a>00010 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00015"></a>00015 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00018"></a>00018 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00019"></a>00019 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
<a name="l00020"></a>00020 <span class="comment"> *</span>
<a name="l00021"></a>00021 <span class="comment"> * $Id$</span>
<a name="l00022"></a>00022 <span class="comment"> *</span>
<a name="l00023"></a>00023 <span class="comment"> */</span>
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <span class="preprocessor">#ifndef __TWOLAME_H__</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define __TWOLAME_H__</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="comment">/*</span>
<a name="l00035"></a>00035 <span class="comment"> * ATTENTION WIN32 USERS!</span>
<a name="l00036"></a>00036 <span class="comment"> * </span>
<a name="l00037"></a>00037 <span class="comment"> * By default, when you use this header file, it is configured to use</span>
<a name="l00038"></a>00038 <span class="comment"> * symbols from the &quot;twolame.dll&quot; file. If you use the static version of</span>
<a name="l00039"></a>00039 <span class="comment"> * the library, define LIBTWOLAME_STATIC prior to including this header.</span>
<a name="l00040"></a>00040 <span class="comment"> */</span>
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="preprocessor">#ifdef _WIN32</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#ifdef LIBTWOLAME_STATIC</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#define DLL_EXPORT</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#ifdef LIBTWOLAME_DLL_EXPORTS</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define DLL_EXPORT __declspec(dllexport)</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define DLL_EXPORT __declspec(dllimport)</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define DLL_EXPORT</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span>
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="preprocessor">#ifndef TRUE</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define TRUE (1)</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span>
<a name="l00061"></a>00061 <span class="preprocessor">#ifndef FALSE</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define FALSE (0)</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span>
<a name="l00065"></a>00065
<a name="l00067"></a><a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57f">00067</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00068"></a><a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fab0b25df193c4be6b5c7bda71166df264">00068</a> <a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fab0b25df193c4be6b5c7bda71166df264">TWOLAME_AUTO_MODE</a> = -1,
<a name="l00070"></a><a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fa785df1b22ebb296610b938793906f66d">00070</a> <a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fa785df1b22ebb296610b938793906f66d">TWOLAME_STEREO</a> = 0,
<a name="l00071"></a><a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fa944018843ef67ac47d3e680c749b2967">00071</a> <a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fa944018843ef67ac47d3e680c749b2967">TWOLAME_JOINT_STEREO</a>,
<a name="l00073"></a><a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fae054f4dcb5762d5c58c3db92e5338601">00073</a> <a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fae054f4dcb5762d5c58c3db92e5338601">TWOLAME_DUAL_CHANNEL</a>,
<a name="l00075"></a><a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fa482d714be97e4cb21c223850ece06456">00075</a> <a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57fa482d714be97e4cb21c223850ece06456">TWOLAME_MONO</a>,
<a name="l00076"></a>00076 TWOLAME_NOT_SET
<a name="l00077"></a>00077 } <a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57f">TWOLAME_MPEG_mode</a>;
<a name="l00078"></a>00078
<a name="l00079"></a>00079
<a name="l00084"></a><a class="code" href="twolame_8h.html#a0f4e287fec57b8ba38e28395996eb6e3">00084</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00085"></a><a class="code" href="twolame_8h.html#a0f4e287fec57b8ba38e28395996eb6e3a89b91170fa0bb8423f45ff7a1b45b1d8">00085</a> <a class="code" href="twolame_8h.html#a0f4e287fec57b8ba38e28395996eb6e3a89b91170fa0bb8423f45ff7a1b45b1d8">TWOLAME_MPEG2</a> = 0,
<a name="l00087"></a><a class="code" href="twolame_8h.html#a0f4e287fec57b8ba38e28395996eb6e3ae8dc89cc37c6203400e64768eb6b59d5">00087</a> <a class="code" href="twolame_8h.html#a0f4e287fec57b8ba38e28395996eb6e3ae8dc89cc37c6203400e64768eb6b59d5">TWOLAME_MPEG1</a>
<a name="l00088"></a>00088 } <a class="code" href="twolame_8h.html#a0f4e287fec57b8ba38e28395996eb6e3">TWOLAME_MPEG_version</a>;
<a name="l00089"></a>00089
<a name="l00090"></a>00090
<a name="l00092"></a><a class="code" href="twolame_8h.html#af83f4f73e4c57db45269667b4421730e">00092</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00093"></a><a class="code" href="twolame_8h.html#af83f4f73e4c57db45269667b4421730eab2dd0f81e433f7f708622c96466dbff3">00093</a> <a class="code" href="twolame_8h.html#af83f4f73e4c57db45269667b4421730eab2dd0f81e433f7f708622c96466dbff3">TWOLAME_PAD_NO</a> = 0,
<a name="l00094"></a><a class="code" href="twolame_8h.html#af83f4f73e4c57db45269667b4421730eaecf832eac6e75140fc9397b621e590a8">00094</a> <a class="code" href="twolame_8h.html#af83f4f73e4c57db45269667b4421730eaecf832eac6e75140fc9397b621e590a8">TWOLAME_PAD_ALL</a>
<a name="l00095"></a>00095 <span class="comment">// TWOLAME_PAD_ADJUST // unsupported by twolame</span>
<a name="l00096"></a>00096 } <a class="code" href="twolame_8h.html#af83f4f73e4c57db45269667b4421730e">TWOLAME_Padding</a>;
<a name="l00097"></a>00097
<a name="l00099"></a><a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1b">00099</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00100"></a><a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1ba73eced6173758db8e4186d07ee510dd1">00100</a> <a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1ba73eced6173758db8e4186d07ee510dd1">TWOLAME_EMPHASIS_N</a> = 0,
<a name="l00102"></a><a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1baeca80cfc79ece58fd01e06f974394c6e">00102</a> <a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1baeca80cfc79ece58fd01e06f974394c6e">TWOLAME_EMPHASIS_5</a> = 1,
<a name="l00104"></a>00104 <span class="comment">// reserved</span>
<a name="l00105"></a><a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1ba038be927e1993710372565262a73e62d">00105</a> <a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1ba038be927e1993710372565262a73e62d">TWOLAME_EMPHASIS_C</a> = 3
<a name="l00107"></a>00107 } <a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1b">TWOLAME_Emphasis</a>;
<a name="l00108"></a>00108
<a name="l00109"></a>00109
<a name="l00111"></a><a class="code" href="twolame_8h.html#a09bd4a4970ba3c49e9f1327daefeb8c1">00111</a> <span class="preprocessor">#define TWOLAME_SAMPLES_PER_FRAME (1152)</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span>
<a name="l00113"></a>00113
<a name="l00115"></a>00115 <span class="keyword">struct </span>twolame_options_struct;
<a name="l00116"></a>00116
<a name="l00118"></a><a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">00118</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>twolame_options_struct <a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a>;
<a name="l00119"></a>00119
<a name="l00120"></a>00120
<a name="l00121"></a>00121
<a name="l00122"></a>00122
<a name="l00123"></a>00123
<a name="l00129"></a>00129 DLL_EXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="twolame_8h.html#ac73aa5af9bd007a90ec39fc2d463f486">get_twolame_version</a>(<span class="keywordtype">void</span>);
<a name="l00130"></a>00130
<a name="l00131"></a>00131
<a name="l00137"></a>00137 DLL_EXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="twolame_8h.html#a3e82f14e8b2973a4621dd7f599ba6702">get_twolame_url</a>(<span class="keywordtype">void</span>);
<a name="l00138"></a>00138
<a name="l00139"></a>00139
<a name="l00150"></a>00150 DLL_EXPORT <span class="keywordtype">void</span> <a class="code" href="twolame_8h.html#a3a0793a526503a0833736287a38722d3">twolame_print_config</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00151"></a>00151
<a name="l00152"></a>00152
<a name="l00162"></a>00162 DLL_EXPORT <a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> *<a class="code" href="twolame_8h.html#ac4cdab0d6542badab38bb4ddf96957fb">twolame_init</a>(<span class="keywordtype">void</span>);
<a name="l00163"></a>00163
<a name="l00164"></a>00164
<a name="l00176"></a>00176 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a479229b288016a4b7b1dd696e4000257">twolame_init_params</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00177"></a>00177
<a name="l00178"></a>00178
<a name="l00193"></a>00193 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a7656283020d9b131790bf5a99af055c4">twolame_encode_buffer</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts,
<a name="l00194"></a>00194 <span class="keyword">const</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> leftpcm[],
<a name="l00195"></a>00195 <span class="keyword">const</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> rightpcm[],
<a name="l00196"></a>00196 <span class="keywordtype">int</span> num_samples,
<a name="l00197"></a>00197 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer, <span class="keywordtype">int</span> mp2buffer_size);
<a name="l00198"></a>00198
<a name="l00199"></a>00199
<a name="l00213"></a>00213 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a578b70ad7abfcc2bbed09ecf661fd66e">twolame_encode_buffer_interleaved</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts,
<a name="l00214"></a>00214 <span class="keyword">const</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> pcm[],
<a name="l00215"></a>00215 <span class="keywordtype">int</span> num_samples,
<a name="l00216"></a>00216 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer, <span class="keywordtype">int</span> mp2buffer_size);
<a name="l00217"></a>00217
<a name="l00218"></a>00218
<a name="l00236"></a>00236 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a8e77eb0f22479f8ec1bd4f1b042f9cd9">twolame_encode_buffer_float32</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts,
<a name="l00237"></a>00237 <span class="keyword">const</span> <span class="keywordtype">float</span> leftpcm[],
<a name="l00238"></a>00238 <span class="keyword">const</span> <span class="keywordtype">float</span> rightpcm[],
<a name="l00239"></a>00239 <span class="keywordtype">int</span> num_samples,
<a name="l00240"></a>00240 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer, <span class="keywordtype">int</span> mp2buffer_size);
<a name="l00241"></a>00241
<a name="l00242"></a>00242
<a name="l00256"></a>00256 <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#aca716bf42f767e889c0505206c3f1160">twolame_encode_buffer_float32_interleaved</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts,
<a name="l00257"></a>00257 <span class="keyword">const</span> <span class="keywordtype">float</span> pcm[],
<a name="l00258"></a>00258 <span class="keywordtype">int</span> num_samples,
<a name="l00259"></a>00259 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer, <span class="keywordtype">int</span> mp2buffer_size);
<a name="l00260"></a>00260
<a name="l00261"></a>00261
<a name="l00274"></a>00274 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a3903ae20e7e99b7774c527e3e9ed3ab3">twolame_encode_flush</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts,
<a name="l00275"></a>00275 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *mp2buffer, <span class="keywordtype">int</span> mp2buffer_size);
<a name="l00276"></a>00276
<a name="l00277"></a>00277
<a name="l00287"></a>00287 DLL_EXPORT <span class="keywordtype">void</span> <a class="code" href="twolame_8h.html#a5a9adda3b79826aa841471dda5e87e34">twolame_close</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> ** glopts);
<a name="l00288"></a>00288
<a name="l00289"></a>00289
<a name="l00290"></a>00290
<a name="l00306"></a>00306 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#aa98e4d1b7bfdbe4702074f53d7343ac4">twolame_set_verbosity</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> verbosity);
<a name="l00307"></a>00307
<a name="l00308"></a>00308
<a name="l00314"></a>00314 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ac791c3826717a0c5c580449f1021e0e5">twolame_get_verbosity</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00315"></a>00315
<a name="l00316"></a>00316
<a name="l00327"></a>00327 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#aef8212f0d9c29618826274b9685cddf9">twolame_set_mode</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57f">TWOLAME_MPEG_mode</a> mode);
<a name="l00328"></a>00328
<a name="l00329"></a>00329
<a name="l00335"></a>00335 DLL_EXPORT <a class="code" href="twolame_8h.html#a91879045676d9146c9bfcb8b0a30b57f">TWOLAME_MPEG_mode</a> <a class="code" href="twolame_8h.html#a59ce06e05cfa978689ee3195264190c9">twolame_get_mode</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00336"></a>00336
<a name="l00337"></a>00337
<a name="l00343"></a>00343 DLL_EXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="twolame_8h.html#a4b8302f67ce0c691cd0fbd7c08c79729">twolame_get_mode_name</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00344"></a>00344
<a name="l00345"></a>00345
<a name="l00355"></a>00355 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ab6d5accf1b38fa49af75b33415dcd89e">twolame_set_version</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <a class="code" href="twolame_8h.html#a0f4e287fec57b8ba38e28395996eb6e3">TWOLAME_MPEG_version</a> version);
<a name="l00356"></a>00356
<a name="l00357"></a>00357
<a name="l00363"></a>00363 DLL_EXPORT <a class="code" href="twolame_8h.html#a0f4e287fec57b8ba38e28395996eb6e3">TWOLAME_MPEG_version</a> <a class="code" href="twolame_8h.html#a1d381b8f8b615aa3a98f2ad19668738a">twolame_get_version</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00364"></a>00364
<a name="l00365"></a>00365
<a name="l00371"></a>00371 DLL_EXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="twolame_8h.html#aab4b76e8f09388229cc3e6789ef5979e">twolame_get_version_name</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00372"></a>00372
<a name="l00373"></a>00373
<a name="l00380"></a>00380 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ae6a2eea827688dc46b929536150da3b6">twolame_get_framelength</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00381"></a>00381
<a name="l00382"></a>00382
<a name="l00392"></a>00392 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a3810cbcbf62700685b54083147a27f7b">twolame_set_psymodel</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> psymodel);
<a name="l00393"></a>00393
<a name="l00394"></a>00394
<a name="l00400"></a>00400 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a101e8c94bd34e64c0c25e65866253c58">twolame_get_psymodel</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00401"></a>00401
<a name="l00402"></a>00402
<a name="l00416"></a>00416 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a0f52f945ac41a45e47555b40e4c29a5f">twolame_set_num_channels</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> num_channels);
<a name="l00417"></a>00417
<a name="l00418"></a>00418
<a name="l00424"></a>00424 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ac77ec659a0546bd0393b6e317553fc7f">twolame_get_num_channels</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00425"></a>00425
<a name="l00426"></a>00426
<a name="l00438"></a>00438 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#aa13250b4af52ce46a76f5dfe1a027697">twolame_set_scale</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">float</span> scale);
<a name="l00439"></a>00439
<a name="l00440"></a>00440
<a name="l00446"></a>00446 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#a3deeb5e64e08c3347e09205f00d19b97">twolame_get_scale</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00447"></a>00447
<a name="l00459"></a>00459 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a6283594f9de7c332982f34fcf1021e26">twolame_set_scale_left</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">float</span> scale);
<a name="l00460"></a>00460
<a name="l00461"></a>00461
<a name="l00467"></a>00467 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#ab33a74b3846656f94da0977bbcb2f151">twolame_get_scale_left</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00468"></a>00468
<a name="l00469"></a>00469
<a name="l00481"></a>00481 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#aa9233c1b394311ed4779d9ace6916308">twolame_set_scale_right</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">float</span> scale);
<a name="l00482"></a>00482
<a name="l00483"></a>00483
<a name="l00489"></a>00489 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#a0750330f1ac29c88dea28a3945e6f953">twolame_get_scale_right</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00490"></a>00490
<a name="l00491"></a>00491
<a name="l00501"></a>00501 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#affb3e7a2d178505aa0993d49a6535ed0">twolame_set_in_samplerate</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> samplerate);
<a name="l00502"></a>00502
<a name="l00503"></a>00503
<a name="l00509"></a>00509 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#af5005929502db228375bb635b041ed7a">twolame_get_in_samplerate</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00510"></a>00510
<a name="l00511"></a>00511
<a name="l00521"></a>00521 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a5c364e5741f1f9f490c848733f2031df">twolame_set_out_samplerate</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> samplerate);
<a name="l00522"></a>00522
<a name="l00523"></a>00523
<a name="l00529"></a>00529 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a13be375a082dc802e6b408171dc3bb69">twolame_get_out_samplerate</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00530"></a>00530
<a name="l00531"></a>00531
<a name="l00541"></a>00541 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a544b8b46797b18891eeccaf17e314701">twolame_set_bitrate</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> bitrate);
<a name="l00542"></a>00542
<a name="l00543"></a>00543
<a name="l00549"></a>00549 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ad86ca8099646d77e86578f879f16beb1">twolame_get_bitrate</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00550"></a>00550
<a name="l00551"></a>00551
<a name="l00556"></a>00556 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ad56fa68b723f3232c7feb162c1142a14">twolame_set_brate</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> bitrate);
<a name="l00557"></a>00557
<a name="l00558"></a>00558
<a name="l00563"></a>00563 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a961463704f86a2d3f310004be9a3a0b3">twolame_get_brate</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00564"></a>00564
<a name="l00565"></a>00565
<a name="l00577"></a>00577 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#aaaa5455a98cbba0fafde73c61d6079be">twolame_set_padding</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <a class="code" href="twolame_8h.html#af83f4f73e4c57db45269667b4421730e">TWOLAME_Padding</a> padding);
<a name="l00578"></a>00578
<a name="l00584"></a>00584 DLL_EXPORT <a class="code" href="twolame_8h.html#af83f4f73e4c57db45269667b4421730e">TWOLAME_Padding</a> <a class="code" href="twolame_8h.html#a9e2ea760fc280da8edd3b06d6b50efbf">twolame_get_padding</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00585"></a>00585
<a name="l00586"></a>00586
<a name="l00604"></a>00604 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#af53c80e3221f2030fceeb9acfb21854b">twolame_set_energy_levels</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> energylevels);
<a name="l00605"></a>00605
<a name="l00606"></a>00606
<a name="l00612"></a>00612 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#aeea27328604d2906772f9f3b7756fe47">twolame_get_energy_levels</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00613"></a>00613
<a name="l00614"></a>00614
<a name="l00624"></a>00624 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a8349b49903299a3bfc4d2ae0b5b0cdbd">twolame_set_num_ancillary_bits</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> num);
<a name="l00625"></a>00625
<a name="l00626"></a>00626
<a name="l00632"></a>00632 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a2224987bc284c6a6400d485e6dd88351">twolame_get_num_ancillary_bits</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00633"></a>00633
<a name="l00634"></a>00634
<a name="l00635"></a>00635
<a name="l00645"></a>00645 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#af234f350ff569bc8b4d10931d9090957">twolame_set_emphasis</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1b">TWOLAME_Emphasis</a> emphasis);
<a name="l00646"></a>00646
<a name="l00647"></a>00647
<a name="l00653"></a>00653 DLL_EXPORT <a class="code" href="twolame_8h.html#a50521fc75f96f949634f8f6536c1be1b">TWOLAME_Emphasis</a> <a class="code" href="twolame_8h.html#a0fe4a766c951b351bad37d1e642c1018">twolame_get_emphasis</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00654"></a>00654
<a name="l00655"></a>00655
<a name="l00665"></a>00665 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a275b46ca5b225814047bcf145e866ec7">twolame_set_error_protection</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> err_protection);
<a name="l00666"></a>00666
<a name="l00667"></a>00667
<a name="l00673"></a>00673 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a2daddd047937e29e73e58714a6c5a254">twolame_get_error_protection</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00674"></a>00674
<a name="l00675"></a>00675
<a name="l00687"></a>00687 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ad5b45a13a48abddd5a8f0e2e31f15f18">twolame_set_copyright</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> copyright);
<a name="l00688"></a>00688
<a name="l00689"></a>00689
<a name="l00695"></a>00695 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ac7f5cd7d52aed6fad33fb96ed7c0e5c9">twolame_get_copyright</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00696"></a>00696
<a name="l00697"></a>00697
<a name="l00707"></a>00707 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a88fcaeb8df0c785fa752cc13b81c811b">twolame_set_original</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> original);
<a name="l00708"></a>00708
<a name="l00709"></a>00709
<a name="l00715"></a>00715 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#af223fb3fd799175a04f9ba4cb87d578e">twolame_get_original</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00716"></a>00716
<a name="l00717"></a>00717
<a name="l00727"></a>00727 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ad9d4595a2115c6d2d26af0ad35e439e0">twolame_set_VBR</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> vbr);
<a name="l00728"></a>00728
<a name="l00729"></a>00729
<a name="l00735"></a>00735 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#aa79c3d628f2ed444d4a1326cd87f125b">twolame_get_VBR</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00736"></a>00736
<a name="l00737"></a>00737
<a name="l00750"></a>00750 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#af220a143ef980c70d7ae17d6113edc20">twolame_set_VBR_level</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">float</span> level);
<a name="l00751"></a>00751
<a name="l00752"></a>00752
<a name="l00758"></a>00758 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#ab4914da9988dd0f8f6703eba5882a029">twolame_get_VBR_level</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00759"></a>00759
<a name="l00760"></a>00760
<a name="l00761"></a>00761
<a name="l00762"></a>00762 <span class="comment">/* </span>
<a name="l00763"></a>00763 <span class="comment"> Using the twolame_set_VBR_q()/twolame_get_VBR_q functions </span>
<a name="l00764"></a>00764 <span class="comment"> are deprecated, please use twolame_set_VBR_level() instead.</span>
<a name="l00765"></a>00765 <span class="comment">*/</span>
<a name="l00766"></a>00766 DLL_EXPORT <span class="keywordtype">int</span> twolame_set_VBR_q(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">float</span> level);
<a name="l00767"></a>00767 DLL_EXPORT <span class="keywordtype">float</span> twolame_get_VBR_q(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00768"></a>00768
<a name="l00769"></a>00769
<a name="l00770"></a>00770
<a name="l00780"></a>00780 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a979fdde10d7ac22a7767412427f18b01">twolame_set_ATH_level</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">float</span> level);
<a name="l00781"></a>00781
<a name="l00782"></a>00782
<a name="l00788"></a>00788 DLL_EXPORT <span class="keywordtype">float</span> <a class="code" href="twolame_8h.html#ad524505da0eabb3f8d84ac1d1157e2ee">twolame_get_ATH_level</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00789"></a>00789
<a name="l00790"></a>00790
<a name="l00800"></a>00800 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a67ac2fef77dd7853374d9e05ebc46210">twolame_set_VBR_max_bitrate_kbps</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> bitrate);
<a name="l00801"></a>00801
<a name="l00807"></a>00807 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a1faa386043bb3254e633bfbe27349017">twolame_get_VBR_max_bitrate_kbps</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00808"></a>00808
<a name="l00809"></a>00809
<a name="l00819"></a>00819 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a1093464689803410a5b28eb840d83f4e">twolame_set_quick_mode</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> quickmode);
<a name="l00820"></a>00820
<a name="l00826"></a>00826 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a95c94c63c625e9bb729a7a5bf1344810">twolame_get_quick_mode</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00827"></a>00827
<a name="l00828"></a>00828
<a name="l00838"></a>00838 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ad15ae6c585352c6f4285b4353b005f40">twolame_set_quick_count</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> quickcount);
<a name="l00839"></a>00839
<a name="l00845"></a>00845 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ad09819bcdf05f5d68bddd614d6f85496">twolame_get_quick_count</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00846"></a>00846
<a name="l00847"></a>00847
<a name="l00848"></a>00848
<a name="l00849"></a>00849
<a name="l00850"></a>00850
<a name="l00851"></a>00851
<a name="l00852"></a>00852
<a name="l00853"></a>00853 <span class="comment">/* WARNING: DAB support is currently broken */</span>
<a name="l00854"></a>00854
<a name="l00855"></a>00855
<a name="l00856"></a>00856
<a name="l00857"></a>00857
<a name="l00858"></a>00858
<a name="l00868"></a>00868 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ae344176895eb7922a05a003d0ae2f911">twolame_set_DAB</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> dab);
<a name="l00869"></a>00869
<a name="l00875"></a>00875 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a130b6c716477dab5500097337a41299a">twolame_get_DAB</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00876"></a>00876
<a name="l00877"></a>00877
<a name="l00887"></a>00887 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a621a6efe085aac5ea36ff70ef719a4cc">twolame_set_DAB_xpad_length</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> length);
<a name="l00888"></a>00888
<a name="l00889"></a>00889
<a name="l00895"></a>00895 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a8a9c2b288b674e4b331922cbe66254c0">twolame_get_DAB_xpad_length</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00896"></a>00896
<a name="l00897"></a>00897
<a name="l00907"></a>00907 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#a168ceb98ea672ce2f461f5d681041be6">twolame_set_DAB_crc_length</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts, <span class="keywordtype">int</span> length);
<a name="l00908"></a>00908
<a name="l00909"></a>00909
<a name="l00915"></a>00915 DLL_EXPORT <span class="keywordtype">int</span> <a class="code" href="twolame_8h.html#ada5cb510aa1a32eb9921140b72a9189a">twolame_get_DAB_crc_length</a>(<a class="code" href="twolame_8h.html#a429c5c35b47d5d7cc34a07e48a82866d">twolame_options</a> * glopts);
<a name="l00916"></a>00916
<a name="l00917"></a>00917
<a name="l00918"></a>00918
<a name="l00919"></a>00919 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00920"></a>00920 <span class="preprocessor"></span>}
<a name="l00921"></a>00921 <span class="preprocessor">#endif</span>
<a name="l00922"></a>00922 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* _TWOLAME_H_ */</span>
<a name="l00923"></a>00923 <span class="comment">// vim:ts=4:sw=4:nowrap:</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 21 2011 18:17:03 for twolame by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>

View File

@ -2,20 +2,27 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<link rel="stylesheet" href="./twolame-quirks.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.3" />
<title>TwoLAME: MPEG Audio Layer II VBR</title>
<link rel="stylesheet" href="./twolame.css" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes();}
/*]]>*/
</script>
<script type="text/javascript" src="./asciidoc-xhtml11.js"></script>
</head>
<body>
<body class="article">
<div id="header">
<h1>TwoLAME: MPEG Audio Layer II VBR</h1>
<span id="revision">version 0.3.11</span>
<span id="revnumber">version 0.3.13</span>
</div>
<h2>Contents</h2>
<div id="content">
<div class="sect1">
<h2 id="_contents">Contents</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
Introduction
@ -33,7 +40,7 @@ Bitrate Ranges for various Sampling frequencies
</li>
<li>
<p>
Why can't the bitrate vary from 32kbps to 384kbps for every file?
Why can&#8217;t the bitrate vary from 32kbps to 384kbps for every file?
</p>
</li>
<li>
@ -51,29 +58,33 @@ Long Answer
Tech Stuff
</p>
</li>
</ul>
</ul></div>
</div>
<h2>Introduction</h2>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<p>VBR mode works by selecting a different bitrate for each frame. Frames
which are harder to encode will be allocated more bits i.e. a higher bitrate.</p>
<p>LayerII VBR is a complete hack - the ISO standard actually says that decoders are not
<div class="paragraph"><p>VBR mode works by selecting a different bitrate for each frame. Frames
which are harder to encode will be allocated more bits i.e. a higher bitrate.</p></div>
<div class="paragraph"><p>LayerII VBR is a complete hack - the ISO standard actually says that decoders are not
required to support it. As a hack, its implementation is a pain to try and understand.
If you're mega-keen to get full range VBR working, either (a) send me money (b) grab the
ISO standard and a C compiler and email me.</p>
If you&#8217;re mega-keen to get full range VBR working, either (a) send me money (b) grab the
ISO standard and a C compiler and email me.</p></div>
</div>
<h2>Usage</h2>
</div>
<div class="sect1">
<h2 id="_usage">Usage</h2>
<div class="sectionbody">
<div class="literalblock">
<div class="content">
<pre><tt>twolame -v [level] inputfile outputfile.</tt></pre>
</div></div>
<p>A level of 5 works very well for me.</p>
<p>The level value can is a measurement of quality - the higher
<div class="paragraph"><p>A level of 5 works very well for me.</p></div>
<div class="paragraph"><p>The level value can is a measurement of quality - the higher
the level the higher the average bitrate of the resultant file.
[See TECH STUFF for a better explanation of what the value does]</p>
<p>The confusing part of my implementation of LayerII VBR is that it's different from MP3 VBR.</p>
<ul>
See TECH STUFF for a better explanation of what the value does.</p></div>
<div class="paragraph"><p>The confusing part of my implementation of LayerII VBR is that it&#8217;s different from MP3 VBR.</p></div>
<div class="ulist"><ul>
<li>
<p>
The range of bitrates used is controlled by the input sampling frequency. (See below "Bitrate ranges")
@ -84,17 +95,19 @@ The range of bitrates used is controlled by the input sampling frequency. (See b
The tendency to use higher bitrates is governed by the &lt;level&gt;.
</p>
</li>
</ul>
<p>E.g. Say you have a 44.1kHz Stereo file. In VBR mode, the bitrate can range from 192 to 384 kbps.</p>
<p>Using "-v -5" will force the encoder to favour the lower bitrate.</p>
<p>Using "-v 5" will force the encoder to favour the upper bitrate.</p>
<p>The value can actually be <strong>any</strong> int. -27, 233, 47. The larger the number, the greater
the bitrate bias.</p>
</ul></div>
<div class="paragraph"><p>E.g. Say you have a 44.1kHz Stereo file. In VBR mode, the bitrate can range from 192 to 384 kbps.</p></div>
<div class="paragraph"><p>Using "-v -5" will force the encoder to favour the lower bitrate.</p></div>
<div class="paragraph"><p>Using "-v 5" will force the encoder to favour the upper bitrate.</p></div>
<div class="paragraph"><p>The value can actually be <strong>any</strong> int. -27, 233, 47. The larger the number, the greater
the bitrate bias.</p></div>
</div>
<h2>Bitrate Ranges</h2>
</div>
<div class="sect1">
<h2 id="_bitrate_ranges">Bitrate Ranges</h2>
<div class="sectionbody">
<p>When making a VBR stream, the bitrate is only allowed to vary within
set limits</p>
<div class="paragraph"><p>When making a VBR stream, the bitrate is only allowed to vary within
set limits</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>48kHz
@ -111,10 +124,12 @@ Stereo: 192-384kbps Mono: 96-192kbps</tt></pre>
Stereo/Mono: 8-160kbps</tt></pre>
</div></div>
</div>
<h2>Why doesn't the VBR mode work the same as MP3VBR? The Short Answer</h2>
</div>
<div class="sect1">
<h2 id="_why_doesn_8217_t_the_vbr_mode_work_the_same_as_mp3vbr_the_short_answer">Why doesn&#8217;t the VBR mode work the same as MP3VBR? The Short Answer</h2>
<div class="sectionbody">
<p><strong>Why can't the bitrate vary from 32kbps to 384kbps for every file?</strong></p>
<p>According to the standard (ISO/IEC 11172-3:1993) Section 2.4.2.3</p>
<div class="paragraph"><p><strong>Why can&#8217;t the bitrate vary from 32kbps to 384kbps for every file?</strong></p></div>
<div class="paragraph"><p>According to the standard (ISO/IEC 11172-3:1993) Section 2.4.2.3</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>"In order to provide the smallest possible delay and complexity, the
@ -130,16 +145,19 @@ Stereo/Mono: 8-160kbps</tt></pre>
<div class="content">
<pre><tt>"For Layer II, not all combinations of total bitrate and mode are allowed."</tt></pre>
</div></div>
<p>Hence, most LayerII coders would not have been written with VBR in mind, and
<div class="paragraph"><p>Hence, most LayerII coders would not have been written with VBR in mind, and
LayerII VBR is a hack. It works for limited cases. Getting it to work to
the same extent as MP3-style VBR will be a major hack.</p>
<p>(If you <strong>really</strong> want better bitrate ranges, read "The Long Answer" and submit your mega-patch.)</p>
the same extent as MP3-style VBR will be a major hack.</p></div>
<div class="paragraph"><p>(If you <strong>really</strong> want better bitrate ranges, read "The Long Answer" and submit your mega-patch.)</p></div>
</div>
<h2>Why doesn't the VBR mode work the same as MP3VBR? The Long Answer</h2>
</div>
<div class="sect1">
<h2 id="_why_doesn_8217_t_the_vbr_mode_work_the_same_as_mp3vbr_the_long_answer">Why doesn&#8217;t the VBR mode work the same as MP3VBR? The Long Answer</h2>
<div class="sectionbody">
<p><strong>Why can't the bitrate vary from 32kbps to 384kbps for every file?</strong></p>
<h3>Reason 1: The standard limits the range</h3>
<p>As quoted above from the standard for 48/44.1/32kHz:</p>
<div class="paragraph"><p><strong>Why can&#8217;t the bitrate vary from 32kbps to 384kbps for every file?</strong></p></div>
<div class="sect2">
<h3 id="_reason_1_the_standard_limits_the_range">Reason 1: The standard limits the range</h3>
<div class="paragraph"><p>As quoted above from the standard for 48/44.1/32kHz:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>"For Layer II, not all combinations of total bitrate and mode are allowed. See
@ -164,22 +182,24 @@ the same extent as MP3-style VBR will be a major hack.</p>
320 stereo only
384 stereo only</tt></pre>
</div></div>
<p>So based upon this table alone, you <strong>could</strong> have VBR stereo encoding which varies
<div class="paragraph"><p>So based upon this table alone, you <strong>could</strong> have VBR stereo encoding which varies
smoothly from 96 to 384kbps. Or you could have have VBR mono encoding which varies from
32 to 192kbps. But since the top and bottom bitrates don't apply to all modes, it would
be impossible to have a stereo file encoded from 32 to 384 kbps.</p>
<p>But this isn't what is really limiting the allowable bitrate range - the bit allocation
tables are the major hurdle.</p>
<h3>Reason 2: The bit allocation tables don't allow it</h3>
<p>From the standard, Section 2.4.3.3.1 "Bit allocation decoding"</p>
32 to 192kbps. But since the top and bottom bitrates don&#8217;t apply to all modes, it would
be impossible to have a stereo file encoded from 32 to 384 kbps.</p></div>
<div class="paragraph"><p>But this isn&#8217;t what is really limiting the allowable bitrate range - the bit allocation
tables are the major hurdle.</p></div>
</div>
<div class="sect2">
<h3 id="_reason_2_the_bit_allocation_tables_don_8217_t_allow_it">Reason 2: The bit allocation tables don&#8217;t allow it</h3>
<div class="paragraph"><p>From the standard, Section 2.4.3.3.1 "Bit allocation decoding"</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>"For different combinations of bitrate and sampling frequency, different bit
allocation tables exist.</tt></pre>
</div></div>
<p>These bit allocation tables are pre-determined tables (in Annex B of the standard) which
indicate</p>
<ul>
<div class="paragraph"><p>These bit allocation tables are pre-determined tables (in Annex B of the standard) which
indicate</p></div>
<div class="ulist"><ul>
<li>
<p>
how many bits to read for the initial data (2,3 or 4)
@ -191,11 +211,11 @@ these bits are then used as an index back into the table to
find the number of quantize levels for the samples in this subband
</p>
</li>
</ul>
<p>But the table used (and hence the number of bits and the calculated index) are different
for different combinations of bitrate and sampling frequency.</p>
<p>I will use TableB.2a as an example.</p>
<p>Table B.2a Applies for the following combinations.</p>
</ul></div>
<div class="paragraph"><p>But the table used (and hence the number of bits and the calculated index) are different
for different combinations of bitrate and sampling frequency.</p></div>
<div class="paragraph"><p>I will use TableB.2a as an example.</p></div>
<div class="paragraph"><p>Table B.2a Applies for the following combinations.</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>Sampling Freq Bitrates in (kbps/channel) [emphasis: this is a PER CHANNEL bitrate]
@ -203,17 +223,17 @@ for different combinations of bitrate and sampling frequency.</p>
44.1 56, 64, 80
32 56, 64, 80</tt></pre>
</div></div>
<p>If we have a STEREO 48kHz input file, and we use this table, then the bitrates
we could calculate from this would be 112, 128, 160, 192, 224, 256, 320 and 384 kbps.</p>
<p>This table contains no information on how to encode stuff at bitrates less than 112kbps
<div class="paragraph"><p>If we have a STEREO 48kHz input file, and we use this table, then the bitrates
we could calculate from this would be 112, 128, 160, 192, 224, 256, 320 and 384 kbps.</p></div>
<div class="paragraph"><p>This table contains no information on how to encode stuff at bitrates less than 112kbps
(for a stereo file). You would have to load allocation table B.2c to encode stereo at
64kbps and 128kbps.</p>
<p>Since it would be a MAJOR piece of hacking to get the different tables shifted in and out
during the encoding process, once an allocation table is loaded <strong>IT IS NOT CHANGED</strong>.</p>
<p>Hence, the best table is picked at the start of the encoding process, and the encoder
is stuck with it for the rest of the encode.</p>
<p>For twolame-02j, I have picked the table it loads for different
sampling frequencies in order to optimize the range of bitrates possible.</p>
64kbps and 128kbps.</p></div>
<div class="paragraph"><p>Since it would be a MAJOR piece of hacking to get the different tables shifted in and out
during the encoding process, once an allocation table is loaded <strong>IT IS NOT CHANGED</strong>.</p></div>
<div class="paragraph"><p>Hence, the best table is picked at the start of the encoding process, and the encoder
is stuck with it for the rest of the encode.</p></div>
<div class="paragraph"><p>For twolame-02j, I have picked the table it loads for different
sampling frequencies in order to optimize the range of bitrates possible.</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>48 kHz - Table B.2a
@ -235,21 +255,26 @@ sampling frequencies in order to optimize the range of bitrates possible.</p>
bitrate over the entire range.</tt></pre>
</div></div>
</div>
<h2>Tech Stuff</h2>
<div class="sectionbody">
<p>The VBR mode is mainly centered around the main_bit_allocation() and
a_bit_allocation() routines in encode.c.</p>
<p>The limited range of VBR is due to my particular implementation which restricts
ranges to within one alloc table (see tables B.2a, B.2b, B.2c and B.2d in ISO 11172).
The VBR range for 32/44.1khz lies within B.2b, and the 48khz VBR lies within table B.2a.</p>
<p>I'm not sure whether it is worth extending these ranges down to lower bitrates.
The work required to switch alloc tables <strong>during</strong> the encoding is major.</p>
<p>In the case of silence, it might be worth doing a quick check for very low signals
and writing a pre-calculated <strong>blank</strong> 32kpbs frame. [probably also a lot of work].</p>
</div>
<h2>How CBR works</h2>
</div>
<div class="sect1">
<h2 id="_tech_stuff">Tech Stuff</h2>
<div class="sectionbody">
<ul>
<div class="paragraph"><p>The VBR mode is mainly centered around the main_bit_allocation() and
a_bit_allocation() routines in encode.c.</p></div>
<div class="paragraph"><p>The limited range of VBR is due to my particular implementation which restricts
ranges to within one alloc table (see tables B.2a, B.2b, B.2c and B.2d in ISO 11172).
The VBR range for 32/44.1khz lies within B.2b, and the 48khz VBR lies within table B.2a.</p></div>
<div class="paragraph"><p>I&#8217;m not sure whether it is worth extending these ranges down to lower bitrates.
The work required to switch alloc tables <strong>during</strong> the encoding is major.</p></div>
<div class="paragraph"><p>In the case of silence, it might be worth doing a quick check for very low signals
and writing a pre-calculated <strong>blank</strong> 32kpbs frame. [probably also a lot of work].</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_how_cbr_works">How CBR works</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Use the psycho model to determine the MNRs for each subband
@ -281,11 +306,13 @@ This mode does not guarentee that all the subbands are without noise
ie there may still be subbands with MNR less than 0.0 (noisy!)
</p>
</li>
</ul>
</ul></div>
</div>
<h2>How VBR works</h2>
</div>
<div class="sect1">
<h2 id="_how_vbr_works">How VBR works</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
pretend we have lots of bits to spare, and work out the bits which would
@ -309,14 +336,16 @@ VBR "guarantees" that all subbands have MNR &gt; VBRLEVEL or that we have
reached the maximum bitrate.
</p>
</li>
</ul>
</ul></div>
</div>
<h2>FUTURE</h2>
</div>
<div class="sect1">
<h2 id="_future">FUTURE</h2>
<div class="sectionbody">
<ul>
<div class="ulist"><ul>
<li>
<p>
with this VBR mode, we know the bits aren't going to run out, so we can
with this VBR mode, we know the bits aren&#8217;t going to run out, so we can
just assign them "greedily".
</p>
</li>
@ -325,12 +354,15 @@ with this VBR mode, we know the bits aren't going to run out, so we can
VBR_a_bit_allocation() is yet to be written :)
</p>
</li>
</ul>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 0.3.11<br />
Last updated 09-Jan-2008 11:45:18 BST
Version 0.3.13<br />
Last updated 2011-01-01 22:51:38 GMT
</div>
</div>
</body>

View File

@ -13,5 +13,5 @@ TwoLAME - an optimized MPEG Audio Layer 2 encoder
- link:vbr.html[VBR Features Overview]
- link:authors.html[The TwoLAME Authors]
twolame homepage: link:http://www.twolame.org[http://www.twolame.org] +
twolame homepage: link:http://www.twolame.org/[http://www.twolame.org/] +
twolame mailing list: link:http://lists.sourceforge.net/lists/listinfo/twolame-discuss[twolame-discuss@lists.sourceforge.net]

View File

@ -1,106 +1,158 @@
'\" t
.\" Title: twolame
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.71.0 <http://docbook.sf.net/>
.\" Date: 01/09/2008
.\" Manual:
.\" Source:
.\" Author: Nicholas J Humfrey <njh@aelius.com>
.\" Generator: DocBook XSL Stylesheets v1.74.3 <http://docbook.sf.net/>
.\" Date: 01/21/2011
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "TWOLAME" "1" "01/09/2008" "" ""
.TH "TWOLAME" "1" "01/21/2011" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
twolame \- an optimised MPEG Audio Layer 2 (MP2) encoder
.SH "SYNOPSIS"
\fItwolame\fR [options] <infile> [outfile].sp
.sp
\fItwolame\fR [options] <infile> [outfile]
.SH "DESCRIPTION"
TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on tooLAME by Mike Cheng, which in turn is based upon the ISO dist10 code and portions of LAME. Encoding is performed by the libtwolame library backend..sp
.sp
TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on tooLAME by Mike Cheng, which in turn is based upon the ISO dist10 code and portions of LAME\&. Encoding is performed by the libtwolame library backend\&.
.SH "OPTIONS"
.SS "Input File"
twolame uses libsndfile for reading the input sound file, so the input file can be in any format supported by libsndfile. To read raw PCM audio from STDIN, then use \- as the input filename..sp
.sp
twolame uses libsndfile for reading the input sound file, so the input file can be in any format supported by libsndfile\&. To read raw PCM audio from STDIN, then use \- as the input filename\&.
.SS "Output File"
If no output filename is specified, then suffix of the input filename is automatically changed to .mp2. To write the encoded audio to STDOUT then use \- as the output filename..sp
.sp
If no output filename is specified, then suffix of the input filename is automatically changed to \&.mp2\&. To write the encoded audio to STDOUT then use \- as the output filename\&.
.SS "Input Options"
.PP
\-r, \-\-raw\-input
.RS 3n
Specifies that input is raw signed PCM audio. If audio is stereo, than audio samples are interleaved between the two channels.
.RS 4
Specifies that input is raw signed PCM audio\&. If audio is stereo, than audio samples are interleaved between the two channels\&.
.RE
.PP
\-x, \-\-byte\-swap
.RS 3n
Force byte\-swapping of the input. Endian detection is performed automatically by libsndfile, so this option shouldn't normally be needed.
.RS 4
Force byte\-swapping of the input\&. Endian detection is performed automatically by libsndfile, so this option shouldn\(cqt normally be needed\&.
.RE
.PP
\-s, \-\-samplerate <int>
.RS 3n
If inputting raw PCM sound, you must specify the sample rate of the audio in Hz. Valid sample rates: 16000, 22050, 24000, 32000, 44100, 48000Hz. Default sample rate is 44100Hz.
.RS 4
If inputting raw PCM sound, you must specify the sample rate of the audio in Hz\&. Valid sample rates: 16000, 22050, 24000, 32000, 44100, 48000Hz\&. Default sample rate is 44100Hz\&.
.RE
.PP
\-\-samplesize <int>
.RS 3n
Specifies the sample size (in bits) of the raw PCM audio. Valid sample sizes: 8, 16, 24, 32. Default sample size is 16\-bit.
.RS 4
Specifies the sample size (in bits) of the raw PCM audio\&. Valid sample sizes: 8, 16, 24, 32\&. Default sample size is 16\-bit\&.
.RE
.PP
\-N, \-\-channels <int>
.RS 3n
If inputting raw PCM sound, you must specify the number of channels in the input audio. Default number of channels is 2.
.RS 4
If inputting raw PCM sound, you must specify the number of channels in the input audio\&. Default number of channels is 2\&.
.RE
.PP
\-g, \-\-swap\-channels
.RS 3n
Swap the Left and Right channels of a stereo input file.
.RS 4
Swap the Left and Right channels of a stereo input file\&.
.RE
.PP
\-\-scale <float>
.RS 3n
Scale the input audio prior to encoding. All of the input audio is multiplied by specified value. Value between 0 and 1 will reduce the audio gain, and a value above 1 will increase the gain of the audio.
.RS 4
Scale the input audio prior to encoding\&. All of the input audio is multiplied by specified value\&. Value between 0 and 1 will reduce the audio gain, and a value above 1 will increase the gain of the audio\&.
.RE
.PP
\-\-scale\-l <float>
.RS 3n
Same as \-\-scale, but only affects the left channel.
.RS 4
Same as \-\-scale, but only affects the left channel\&.
.RE
.PP
\-\-scale\-r <float>
.RS 3n
Same as \-\-scale, but only affects the right channel.
.RS 4
Same as \-\-scale, but only affects the right channel\&.
.RE
.SS "Output Options"
.PP
\-m, \-\-mode <char>
.RS 3n
Choose the mode of the resulting audio. Default is auto.
.RS 3n
.TP 3n
\(bu
.RS 4
Choose the mode of the resulting audio\&. Default is auto\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
"a" auto \- choose mode automatically based on the input
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
"s" stereo
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
"d" dual channel
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
"j" joint stereo
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
"m" mono
.RE
.RE
.PP
\-a, \-\-downmix
.RS 3n
If the input file is stereo then, downmix the left and right input channels into a single mono channel.
.RS 4
If the input file is stereo then, downmix the left and right input channels into a single mono channel\&.
.RE
.PP
\-b, \-\-bitrate <int>
.RS 3n
Sets the total bitrate (in kbps) for the output file. The default bitrate depends on the number of input channels and samplerate.
.RS 4
Sets the total bitrate (in kbps) for the output file\&. The default bitrate depends on the number of input channels and samplerate\&.
.sp
.RS 3n
.if n \{\
.RS 4
.\}
.nf
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
Sample Rate Mono Stereo
@ -113,173 +165,275 @@ Sample Rate Mono Stereo
16000 32 64
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
.fi
.if n \{\
.RE
.\}
.RE
.PP
\-P, \-\-psyc\-mode <int>
.RS 3n
Choose the psycho\-acoustic model to use (\-1 to 4). Model number \-1 is turns off psycho\-acoustic modelling and uses fixed default values instead. Please see the file
.RS 4
Choose the psycho\-acoustic model to use (\-1 to 4)\&. Model number \-1 is turns off psycho\-acoustic modelling and uses fixed default values instead\&. Please see the file
\fIpsycho\fR
for a full description of each of the models available. Default model is 3.
for a full description of each of the models available\&. Default model is 3\&.
.RE
.PP
\-v, \-\-vbr
.RS 3n
Enable VBR mode. See
.RS 4
Enable VBR mode\&. See
\fIvbr\fR
documentation file for details. Default VBR level is 5.0.
documentation file for details\&. Default VBR level is 5\&.0\&.
.RE
.PP
\-v, \-\-vbr\-level <float>
.RS 3n
Enable VBR mode and set quality level. The higher the number the better the quality. Maximum range is \-50 to 50 but useful range is \-10 to 10. See
\-V, \-\-vbr\-level <float>
.RS 4
Enable VBR mode and set quality level\&. The higher the number the better the quality\&. Maximum range is \-50 to 50 but useful range is \-10 to 10\&. See
\fIvbr\fR
documentation file for details.
documentation file for details\&.
.RE
.PP
\-l, \-\-ath <float>
.RS 3n
Set the ATH level. Default level is 0.0.
.RS 4
Set the ATH level\&. Default level is 0\&.0\&.
.RE
.PP
\-q, \-\-quick <int>
.RS 3n
Enable quick mode. Only re\-calculate psycho\-acoustic model every specified number of frames.
.RS 4
Enable quick mode\&. Only re\-calculate psycho\-acoustic model every specified number of frames\&.
.RE
.PP
\-S, \-\-single\-frame
.RS 3n
Enables single frame mode: only a single frame of MPEG audio is output and then the program terminates.
.RS 4
Enables single frame mode: only a single frame of MPEG audio is output and then the program terminates\&.
.RE
.SS "Miscellaneous Options"
.PP
\-c, \-\-copyright
.RS 3n
Turn on Copyright flag in output bitstream.
.RS 4
Turn on Copyright flag in output bitstream\&.
.RE
.PP
\-o, \-\-non\-original
.RS 3n
Turn off Original flag in output bitstream.
.RS 4
Turn off Original flag in output bitstream\&.
.RE
.PP
\-\-original
.RS 3n
Turn on Original flag in output bitstream.
.RS 4
Turn on Original flag in output bitstream\&.
.RE
.PP
\-p, \-\-protect
.RS 3n
Enable CRC error protection in output bitstream. An extra 16\-bit checksum is added to frames.
.RS 4
Enable CRC error protection in output bitstream\&. An extra 16\-bit checksum is added to frames\&.
.RE
.PP
\-d, \-\-padding
.RS 3n
Turn on padding in output bitstream.
.RS 4
Turn on padding in output bitstream\&.
.RE
.PP
\-R, \-\-reserve <int>
.RS 3n
Reserve specified number of bits in the each from of the output bitstream.
.RS 4
Reserve specified number of bits in the each from of the output bitstream\&.
.RE
.PP
\-e, \-\-deemphasis <char>
.RS 3n
Set the de\-emphasis type (n/c/5). Default is none.
.RS 4
Set the de\-emphasis type (n/c/5)\&. Default is none\&.
.RE
.PP
\-E, \-\-energy
.RS 3n
Turn on energy level extensions.
.RS 4
Turn on energy level extensions\&.
.RE
.SS "Verbosity Options"
.PP
\-t, \-\-talkativity <int>
.RS 3n
Set the amount of information to be displayed on stderr (0 to 10). Default is 2.
.RS 4
Set the amount of information to be displayed on stderr (0 to 10)\&. Default is 2\&.
.RE
.PP
\-\-quiet
.RS 3n
Don't send any messages to stderr, unless there is an error. (Same as \-\-talkativity=0)
.RS 4
Don\(cqt send any messages to stderr, unless there is an error\&. (Same as \-\-talkativity=0)
.RE
.PP
\-\-brief
.RS 3n
Only display a minimal number of messages while encoding. This setting is quieter than the default talkativity setting. (Same as \-\-talkativity=1)
.RS 4
Only display a minimal number of messages while encoding\&. This setting is quieter than the default talkativity setting\&. (Same as \-\-talkativity=1)
.RE
.PP
\-\-verbose
.RS 3n
Display an increased number of messages on stderr. This setting is useful to diagnose problems. (Same as \-\-talkativity=4)
.RS 4
Display an increased number of messages on stderr\&. This setting is useful to diagnose problems\&. (Same as \-\-talkativity=4)
.RE
.SH "RETURN CODES"
If encoding completes successfully, then twolame will return 0. However if encoding is not successful, then it will return one of the following codes..sp
.TP 3n
\(bu
.sp
If encoding completes successfully, then twolame will return 0\&. However if encoding is not successful, then it will return one of the following codes\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
1 (No encoding performed)
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
2 (Error opening input file)
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
4 (Error opening output file)
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
6 (Error allocating memory)
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
8 (Error in chosen encoding parameters)
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
10 (Error reading input audio)
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
12 (Error occured while encoding)
.TP 3n
\(bu
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
14 (Error writing output audio)
.RE
.SH "EXAMPLES"
This will encode sound.wav to sound.mp2 using the default constant bitrate of 192 kbps and using the default psycho\-acoustic model (model 3):.sp
.sp
.RS 3n
.nf
twolame sound.wav
.fi
.RE
Constant bitrate of 160kbps and joint stereo encoding, saved to file sound_160.mp2:.sp
This will encode sound\&.wav to sound\&.mp2 using the default constant bitrate of 192 kbps and using the default psycho\-acoustic model (model 3):
.sp
.RS 3n
.if n \{\
.RS 4
.\}
.nf
twolame \-b 160 \-m j sound.aiff sound_160.mp2
twolame sound\&.wav
.fi
.if n \{\
.RE
Encode sound.wav to newfile.mp2 using psycho\-acoustic model 2 and encoding with variable bitrate:.sp
.\}
.sp
.RS 3n
.nf
twolame \-P 2 \-v sound.wav newfile.mp2
.fi
.RE
Same as example above, except that the negative value of the "\-V" argument means that the lower bitrates will be favoured over the higher ones:.sp
Constant bitrate of 160kbps and joint stereo encoding, saved to file sound_160\&.mp2:
.sp
.RS 3n
.if n \{\
.RS 4
.\}
.nf
twolame \-P 2 \-V \-5 sound.wav newfile.mp2
twolame \-b 160 \-m j sound\&.aiff sound_160\&.mp2
.fi
.if n \{\
.RE
Resample audio file using sox and pipe straight through twolame:.sp
.\}
.sp
.RS 3n
Encode sound\&.wav to newfile\&.mp2 using psycho\-acoustic model 2 and encoding with variable bitrate:
.sp
.if n \{\
.RS 4
.\}
.nf
sox sound_11025.aiff \-t raw \-r 16000 | twolame \-r \-s 16000 \- \- > out.mp2
twolame \-P 2 \-v sound\&.wav newfile\&.mp2
.fi
.if n \{\
.RE
.\}
.sp
Same as example above, except that the negative value of the "\-V" argument means that the lower bitrates will be favoured over the higher ones:
.sp
.if n \{\
.RS 4
.\}
.nf
twolame \-P 2 \-V \-5 sound\&.wav newfile\&.mp2
.fi
.if n \{\
.RE
.\}
.sp
Resample audio file using sox and pipe straight through twolame:
.sp
.if n \{\
.RS 4
.\}
.nf
sox sound_11025\&.aiff \-t raw \-r 16000 | twolame \-r \-s 16000 \- \- > out\&.mp2
.fi
.if n \{\
.RE
.\}
.SH "AUTHORS"
The twolame frontend was (re)written by Nicholas J Humfrey. The libtwolame library is based on toolame by Mike Cheng. For a full list of authors, please see the AUTHORS file..sp
.sp
The twolame frontend was (re)written by Nicholas J Humfrey\&. The libtwolame library is based on toolame by Mike Cheng\&. For a full list of authors, please see the AUTHORS file\&.
.SH "RESOURCES"
TwoLAME web site: http://www.twolame.org/.sp
.sp
TwoLAME web site: \m[blue]\fBhttp://www\&.twolame\&.org/\fR\m[]
.SH "SEE ALSO"
lame(1), mpg123(1), madplay(1), sox(1).sp
.sp
lame(1), mpg123(1), madplay(1), sox(1)
.SH "COPYING"
Copyright \(co 2004\-2006 The TwoLAME Project. Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL)..sp
.sp
Copyright \(co 2004\-2006 The TwoLAME Project\&. Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL)\&.
.SH "AUTHOR"
.PP
\fBNicholas J Humfrey\fR <\&njh@aelius\&.com\&>
.RS 4
Author.
.RE

View File

@ -1,7 +1,7 @@
TWOLAME(1)
==========
Nicholas J Humfrey <njh@ecs.soton.ac.uk>
Nicholas J Humfrey <njh@aelius.com>
NAME
@ -123,7 +123,7 @@ Output Options
Enable VBR mode. See 'vbr' documentation file for details.
Default VBR level is 5.0.
-v, --vbr-level <float>::
-V, --vbr-level <float>::
Enable VBR mode and set quality level.
The higher the number the better the quality.
Maximum range is -50 to 50 but useful range is -10 to 10.

View File

@ -1,524 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<refentry>
<refmeta>
<refentrytitle>twolame</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>twolame</refname>
<refpurpose>an optimised MPEG Audio Layer 2 (MP2) encoder</refpurpose>
</refnamediv>
<refsynopsisdiv>
<simpara><emphasis>twolame</emphasis> [options] &lt;infile&gt; [outfile]</simpara>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<simpara>TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on tooLAME by
Mike Cheng, which in turn is based upon the ISO dist10 code and portions of
LAME. Encoding is performed by the libtwolame library backend.</simpara>
</refsect1>
<refsect1>
<title>OPTIONS</title>
<refsect2>
<title>Input File</title>
<simpara>twolame uses libsndfile for reading the input sound file, so
the input file can be in any format supported by libsndfile.
To read raw PCM audio from STDIN, then use - as the input filename.</simpara>
</refsect2>
<refsect2>
<title>Output File</title>
<simpara>If no output filename is specified, then suffix of the input filename
is automatically changed to .mp2. To write the encoded audio to STDOUT
then use - as the output filename.</simpara>
</refsect2>
<refsect2>
<title>Input Options</title>
<variablelist>
<varlistentry>
<term>
-r, --raw-input
</term>
<listitem>
<simpara>
Specifies that input is raw signed PCM audio.
If audio is stereo, than audio samples are interleaved
between the two channels.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-x, --byte-swap
</term>
<listitem>
<simpara>
Force byte-swapping of the input. Endian detection is performed
automatically by libsndfile, so this option shouldn't
normally be needed.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-s, --samplerate &lt;int&gt;
</term>
<listitem>
<simpara>
If inputting raw PCM sound, you must specify the sample rate of
the audio in Hz.
Valid sample rates: 16000, 22050, 24000, 32000, 44100, 48000Hz.
Default sample rate is 44100Hz.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--samplesize &lt;int&gt;
</term>
<listitem>
<simpara>
Specifies the sample size (in bits) of the raw PCM audio.
Valid sample sizes: 8, 16, 24, 32.
Default sample size is 16-bit.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-N, --channels &lt;int&gt;
</term>
<listitem>
<simpara>
If inputting raw PCM sound, you must specify the number of channels
in the input audio. Default number of channels is 2.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-g, --swap-channels
</term>
<listitem>
<simpara>
Swap the Left and Right channels of a stereo input file.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--scale &lt;float&gt;
</term>
<listitem>
<simpara>
Scale the input audio prior to encoding.
All of the input audio is multiplied by specified value.
Value between 0 and 1 will reduce the audio gain, and a value
above 1 will increase the gain of the audio.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--scale-l &lt;float&gt;
</term>
<listitem>
<simpara>
Same as --scale, but only affects the left channel.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--scale-r &lt;float&gt;
</term>
<listitem>
<simpara>
Same as --scale, but only affects the right channel.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
<title>Output Options</title>
<variablelist>
<varlistentry>
<term>
-m, --mode &lt;char&gt;
</term>
<listitem>
<simpara>
Choose the mode of the resulting audio. Default is auto.
</simpara>
<itemizedlist>
<listitem>
<simpara>
"a" auto - choose mode automatically based on the input
</simpara>
</listitem>
<listitem>
<simpara>
"s" stereo
</simpara>
</listitem>
<listitem>
<simpara>
"d" dual channel
</simpara>
</listitem>
<listitem>
<simpara>
"j" joint stereo
</simpara>
</listitem>
<listitem>
<simpara>
"m" mono
</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>
-a, --downmix
</term>
<listitem>
<simpara>
If the input file is stereo then, downmix the left and right
input channels into a single mono channel.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-b, --bitrate &lt;int&gt;
</term>
<listitem>
<simpara>
Sets the total bitrate (in kbps) for the output file.
The default bitrate depends on the number of
input channels and samplerate.
</simpara>
<literallayout class="monospaced">------------------------------
Sample Rate Mono Stereo
------------------------------
48000 96 192
44100 96 192
32000 80 160
24000 48 96
22050 48 96
16000 32 64
------------------------------</literallayout>
</listitem>
</varlistentry>
<varlistentry>
<term>
-P, --psyc-mode &lt;int&gt;
</term>
<listitem>
<simpara>
Choose the psycho-acoustic model to use (-1 to 4).
Model number -1 is turns off psycho-acoustic modelling and
uses fixed default values instead.
Please see the file <emphasis>psycho</emphasis> for a full description of
each of the models available.
Default model is 3.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-v, --vbr
</term>
<listitem>
<simpara>
Enable VBR mode. See <emphasis>vbr</emphasis> documentation file for details.
Default VBR level is 5.0.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-v, --vbr-level &lt;float&gt;
</term>
<listitem>
<simpara>
Enable VBR mode and set quality level.
The higher the number the better the quality.
Maximum range is -50 to 50 but useful range is -10 to 10.
See <emphasis>vbr</emphasis> documentation file for details.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-l, --ath &lt;float&gt;
</term>
<listitem>
<simpara>
Set the ATH level. Default level is 0.0.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-q, --quick &lt;int&gt;
</term>
<listitem>
<simpara>
Enable quick mode. Only re-calculate psycho-acoustic
model every specified number of frames.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-S, --single-frame
</term>
<listitem>
<simpara>
Enables single frame mode: only a single frame of MPEG audio
is output and then the program terminates.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
<title>Miscellaneous Options</title>
<variablelist>
<varlistentry>
<term>
-c, --copyright
</term>
<listitem>
<simpara>
Turn on Copyright flag in output bitstream.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-o, --non-original
</term>
<listitem>
<simpara>
Turn off Original flag in output bitstream.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--original
</term>
<listitem>
<simpara>
Turn on Original flag in output bitstream.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-p, --protect
</term>
<listitem>
<simpara>
Enable CRC error protection in output bitstream.
An extra 16-bit checksum is added to frames.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-d, --padding
</term>
<listitem>
<simpara>
Turn on padding in output bitstream.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-R, --reserve &lt;int&gt;
</term>
<listitem>
<simpara>
Reserve specified number of bits in the each from of the
output bitstream.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-e, --deemphasis &lt;char&gt;
</term>
<listitem>
<simpara>
Set the de-emphasis type (n/c/5). Default is none.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-E, --energy
</term>
<listitem>
<simpara>
Turn on energy level extensions.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
<title>Verbosity Options</title>
<variablelist>
<varlistentry>
<term>
-t, --talkativity &lt;int&gt;
</term>
<listitem>
<simpara>
Set the amount of information to be displayed on stderr (0 to 10).
Default is 2.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--quiet
</term>
<listitem>
<simpara>
Don't send any messages to stderr, unless there is an error.
(Same as --talkativity=0)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--brief
</term>
<listitem>
<simpara>
Only display a minimal number of messages while encoding.
This setting is quieter than the default talkativity setting.
(Same as --talkativity=1)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--verbose
</term>
<listitem>
<simpara>
Display an increased number of messages on stderr.
This setting is useful to diagnose problems.
(Same as --talkativity=4)
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsect1>
<refsect1>
<title>Return Codes</title>
<simpara>If encoding completes successfully, then twolame will return 0.
However if encoding is not successful, then it will return one of the following codes.</simpara>
<itemizedlist>
<listitem>
<simpara>
1 (No encoding performed)
</simpara>
</listitem>
<listitem>
<simpara>
2 (Error opening input file)
</simpara>
</listitem>
<listitem>
<simpara>
4 (Error opening output file)
</simpara>
</listitem>
<listitem>
<simpara>
6 (Error allocating memory)
</simpara>
</listitem>
<listitem>
<simpara>
8 (Error in chosen encoding parameters)
</simpara>
</listitem>
<listitem>
<simpara>
10 (Error reading input audio)
</simpara>
</listitem>
<listitem>
<simpara>
12 (Error occured while encoding)
</simpara>
</listitem>
<listitem>
<simpara>
14 (Error writing output audio)
</simpara>
</listitem>
</itemizedlist>
</refsect1>
<refsect1>
<title>EXAMPLES</title>
<simpara>This will encode sound.wav to sound.mp2 using the default constant bitrate of 192 kbps
and using the default psycho-acoustic model (model 3):</simpara>
<literallayout class="monospaced">twolame sound.wav</literallayout>
<simpara>Constant bitrate of 160kbps and joint stereo encoding, saved to file sound_160.mp2:</simpara>
<literallayout class="monospaced">twolame -b 160 -m j sound.aiff sound_160.mp2</literallayout>
<simpara>Encode sound.wav to newfile.mp2 using psycho-acoustic model 2 and encoding
with variable bitrate:</simpara>
<literallayout class="monospaced">twolame -P 2 -v sound.wav newfile.mp2</literallayout>
<simpara>Same as example above, except that the negative value of the "-V" argument
means that the lower bitrates will be favoured over the higher ones:</simpara>
<literallayout class="monospaced">twolame -P 2 -V -5 sound.wav newfile.mp2</literallayout>
<simpara>Resample audio file using sox and pipe straight through twolame:</simpara>
<literallayout class="monospaced">sox sound_11025.aiff -t raw -r 16000 | twolame -r -s 16000 - - &gt; out.mp2</literallayout>
</refsect1>
<refsect1>
<title>AUTHORS</title>
<simpara>The twolame frontend was (re)written by Nicholas J Humfrey.
The libtwolame library is based on toolame by Mike Cheng.
For a full list of authors, please see the AUTHORS file.</simpara>
</refsect1>
<refsect1>
<title>RESOURCES</title>
<simpara>TwoLAME web site: http://www.twolame.org/</simpara>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<simpara>lame(1), mpg123(1), madplay(1), sox(1)</simpara>
</refsect1>
<refsect1>
<title>COPYING</title>
<simpara>Copyright &#169; 2004-2006 The TwoLAME Project. Free use of this software is
granted under the terms of the GNU Lesser General Public License (LGPL).</simpara>
</refsect1>
</refentry>

View File

@ -34,7 +34,7 @@ A level of 5 works very well for me.
The level value can is a measurement of quality - the higher
the level the higher the average bitrate of the resultant file.
[See TECH STUFF for a better explanation of what the value does]
See TECH STUFF for a better explanation of what the value does.
The confusing part of my implementation of LayerII VBR is that it's different from MP3 VBR.

View File

@ -1,10 +1,9 @@
AM_CFLAGS = -I$(top_srcdir)/build/ -I$(top_srcdir)/libtwolame/ @SNDFILE_CFLAGS@
AM_LDFLAGS = @SNDFILE_LIBS@
AM_CFLAGS = -I$(top_srcdir)/build/ -I$(top_srcdir)/libtwolame/ $(SNDFILE_CFLAGS) $(WARNING_CFLAGS)
AM_LDFLAGS = $(SNDFILE_LIBS)
bin_PROGRAMS = @TWOLAME_BIN@
EXTRA_PROGRAMS = twolame
twolame_SOURCES = frontend.c frontend.h audioin_raw.c audioin_sndfile.c
twolame_LDADD = $(top_srcdir)/libtwolame/libtwolame.la
twolame_LDADD = $(top_builddir)/libtwolame/libtwolame.la

View File

@ -32,17 +32,20 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
EXTRA_PROGRAMS = twolame$(EXEEXT)
subdir = frontend
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/build/m4/libtool.m4 \
$(top_srcdir)/build/m4/pkg.m4 $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/build-scripts/libtool.m4 \
$(top_srcdir)/build-scripts/ltoptions.m4 \
$(top_srcdir)/build-scripts/ltsugar.m4 \
$(top_srcdir)/build-scripts/ltversion.m4 \
$(top_srcdir)/build-scripts/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/build/config.h
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/libtwolame/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
@ -50,9 +53,9 @@ PROGRAMS = $(bin_PROGRAMS)
am_twolame_OBJECTS = frontend.$(OBJEXT) audioin_raw.$(OBJEXT) \
audioin_sndfile.$(OBJEXT)
twolame_OBJECTS = $(am_twolame_OBJECTS)
twolame_DEPENDENCIES = $(top_srcdir)/libtwolame/libtwolame.la
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/build
depcomp = $(SHELL) $(top_srcdir)/build/depcomp
twolame_DEPENDENCIES = $(top_builddir)/libtwolame/libtwolame.la
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtwolame
depcomp = $(SHELL) $(top_srcdir)/build-scripts/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -80,46 +83,53 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_ASCIIDOC = @PATH_ASCIIDOC@
PATH_DOXYGEN = @PATH_DOXYGEN@
PATH_SEPARATOR = @PATH_SEPARATOR@
PATH_XMLTO = @PATH_XMLTO@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
@ -128,17 +138,17 @@ SHELL = @SHELL@
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
SNDFILE_LIBS = @SNDFILE_LIBS@
STRIP = @STRIP@
STWOLAME_BIN = @STWOLAME_BIN@
TWOLAME_BIN = @TWOLAME_BIN@
TWOLAME_SO_VERSION = @TWOLAME_SO_VERSION@
VERSION = @VERSION@
WARNING_CFLAGS = @WARNING_CFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@ -180,19 +190,15 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = -I$(top_srcdir)/build/ -I$(top_srcdir)/libtwolame/ @SNDFILE_CFLAGS@
AM_LDFLAGS = @SNDFILE_LIBS@
AM_CFLAGS = -I$(top_srcdir)/build/ -I$(top_srcdir)/libtwolame/ $(SNDFILE_CFLAGS) $(WARNING_CFLAGS)
AM_LDFLAGS = $(SNDFILE_LIBS)
bin_PROGRAMS = @TWOLAME_BIN@
twolame_SOURCES = frontend.c frontend.h audioin_raw.c audioin_sndfile.c
twolame_LDADD = $(top_srcdir)/libtwolame/libtwolame.la
twolame_LDADD = $(top_builddir)/libtwolame/libtwolame.la
all: all-am
.SUFFIXES:

View File

@ -17,7 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: audioin_raw.c,v 1.1 2008-02-01 19:44:25 richardash1981 Exp $
* $Id: frontend.h 156 2007-03-20 23:57:35Z nhumfrey $
*
*/
@ -31,86 +31,86 @@
/* We still use libsndfiles' SF_INFO structure for convenience */
static void print_info_raw(struct audioin_s *audioin )
static void print_info_raw(struct audioin_s *audioin)
{
fprintf(stderr, "Raw input format: %d channels, %d-bit, %d Hz\n",
audioin->sfinfo->channels, audioin->samplesize, audioin->sfinfo->samplerate );
fprintf(stderr, "Raw input format: %d channels, %d-bit, %d Hz\n",
audioin->sfinfo->channels, audioin->samplesize, audioin->sfinfo->samplerate);
}
/* Read in some audio samples into buffer */
static int read_raw( audioin_t* audioin, short *buffer, int samples)
static int read_raw(audioin_t * audioin, short *buffer, int samples)
{
FILE* file = audioin->file;
if (audioin->samplesize==16) {
return fread( buffer, 2, samples, file );
} else {
fprintf(stderr, "Error: sorry %d-bit samples are not supported at the moment.\n", audioin->samplesize);
}
// Error
return -1;
FILE *file = audioin->file;
if (audioin->samplesize == 16) {
return fread(buffer, 2, samples, file);
} else {
fprintf(stderr, "Error: sorry %d-bit samples are not supported at the moment.\n",
audioin->samplesize);
}
// Error
return -1;
}
/* Return error string (or NULL) */
static const char* error_str_raw( audioin_t* audioin )
static const char *error_str_raw(audioin_t * audioin)
{
FILE* file = audioin->file;
int error = ferror( file );
if (error==0) return NULL;
return strerror(error);
FILE *file = audioin->file;
int error = ferror(file);
if (error == 0)
return NULL;
return strerror(error);
}
static int close_raw( audioin_t* audioin )
static int close_raw(audioin_t * audioin)
{
FILE* file = audioin->file;
FILE *file = audioin->file;
free( audioin );
return fclose( file );
free(audioin);
return fclose(file);
}
audioin_t* open_audioin_raw( char* filename, SF_INFO *sfinfo, int samplesize )
audioin_t *open_audioin_raw(char *filename, SF_INFO * sfinfo, int samplesize)
{
audioin_t* audioin = NULL;
audioin_t *audioin = NULL;
// Allocate memory for structure
audioin = malloc( sizeof( audioin_t ) );
if (audioin==NULL) {
fprintf(stderr, "Failed to allocate memory for audioin_t structure.\n");
exit(ERR_MEM_ALLOC);
}
// Open the input file by filename
if (strcmp(filename, "-") == 0) {
// Use STDIN
audioin->file = stdin;
} else {
audioin->file = fopen(filename, "rb");
}
// Allocate memory for structure
audioin = malloc(sizeof(audioin_t));
if (audioin == NULL) {
fprintf(stderr, "Failed to allocate memory for audioin_t structure.\n");
exit(ERR_MEM_ALLOC);
}
// Open the input file by filename
if (strcmp(filename, "-") == 0) {
// Use STDIN
audioin->file = stdin;
} else {
audioin->file = fopen(filename, "rb");
}
// Check for errors
if (audioin->file == NULL) {
fprintf(stderr, "Failed to open input file (%s):\n", filename);
fprintf(stderr, " %s\n", strerror(errno));
exit(ERR_OPENING_INPUT);
}
// Fill-in data structure
audioin->samplesize = samplesize;
audioin->sfinfo = sfinfo;
audioin->print_info = print_info_raw;
audioin->read = read_raw;
audioin->error_str = error_str_raw;
audioin->close = close_raw;
// Check for errors
if (audioin->file == NULL) {
fprintf(stderr, "Failed to open input file (%s):\n", filename);
fprintf(stderr, " %s\n", strerror(errno));
exit(ERR_OPENING_INPUT);
}
// Fill-in data structure
audioin->samplesize = samplesize;
audioin->sfinfo = sfinfo;
audioin->print_info = print_info_raw;
audioin->read = read_raw;
audioin->error_str = error_str_raw;
audioin->close = close_raw;
return audioin;
return audioin;
}

View File

@ -17,7 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: audioin_sndfile.c,v 1.1 2008-02-01 19:44:26 richardash1981 Exp $
* $Id: frontend.h 156 2007-03-20 23:57:35Z nhumfrey $
*
*/
@ -33,26 +33,31 @@
format_duration_string()
Create human readable duration string from libsndfile info
*/
static char* format_duration_string( SF_INFO *sfinfo )
static char *format_duration_string(SF_INFO * sfinfo)
{
float seconds;
int minutes;
char * string = malloc( MAX_NAME_SIZE );
if (sfinfo->frames==0 || sfinfo->samplerate==0) {
snprintf( string, MAX_NAME_SIZE, "Unknown" );
return string;
}
// Calculate the number of minutes and seconds
seconds = sfinfo->frames / sfinfo->samplerate;
minutes = (seconds / 60 );
seconds -= (minutes * 60);
float seconds = 0.0f;
char *string = NULL;
int minutes = 0;
string = malloc(MAX_NAME_SIZE);
if (!string) {
return NULL;
}
// Create a string out of it
snprintf( string, MAX_NAME_SIZE, "%imin %1.1fsec", minutes, seconds);
if (sfinfo->frames == 0 || sfinfo->samplerate == 0) {
snprintf(string, MAX_NAME_SIZE, "Unknown");
return string;
}
return string;
// Calculate the number of minutes and seconds
seconds = sfinfo->frames / sfinfo->samplerate;
minutes = (seconds / 60);
seconds -= (minutes * 60);
// Create a string out of it
snprintf(string, MAX_NAME_SIZE, "%imin %1.1fsec", minutes, seconds);
return string;
}
@ -61,97 +66,95 @@ static char* format_duration_string( SF_INFO *sfinfo )
print_info_sndfile()
Display information about input file
*/
static void print_info_sndfile(struct audioin_s *audioin )
static void print_info_sndfile(struct audioin_s *audioin)
{
SNDFILE* file = audioin->file;
SF_FORMAT_INFO format_info;
SF_FORMAT_INFO subformat_info;
char sndlibver[128];
char *duration = NULL;
// Get the format
format_info.format = audioin->sfinfo->format & SF_FORMAT_TYPEMASK;
sf_command (file, SFC_GET_FORMAT_INFO, &format_info, sizeof(format_info)) ;
SNDFILE *file = audioin->file;
SF_FORMAT_INFO format_info;
SF_FORMAT_INFO subformat_info;
char sndlibver[128];
char *duration = NULL;
// Get the sub-format info
subformat_info.format = audioin->sfinfo->format & SF_FORMAT_SUBMASK;
sf_command (file, SFC_GET_FORMAT_INFO, &subformat_info, sizeof(subformat_info)) ;
// Get the format
format_info.format = audioin->sfinfo->format & SF_FORMAT_TYPEMASK;
sf_command(file, SFC_GET_FORMAT_INFO, &format_info, sizeof(format_info));
// Get the version of libsndfile
sf_command (file, SFC_GET_LIB_VERSION, sndlibver, sizeof(sndlibver));
// Get the sub-format info
subformat_info.format = audioin->sfinfo->format & SF_FORMAT_SUBMASK;
sf_command(file, SFC_GET_FORMAT_INFO, &subformat_info, sizeof(subformat_info));
// Get human readable duration of the input file
duration = format_duration_string( audioin->sfinfo );
// Get the version of libsndfile
sf_command(file, SFC_GET_LIB_VERSION, sndlibver, sizeof(sndlibver));
fprintf(stderr, "Input Format: %s, %s\n", format_info.name, subformat_info.name );
fprintf(stderr, "Input Duration: %s\n", duration );
fprintf(stderr, "Input Library: %s\n", sndlibver);
free( duration );
// Get human readable duration of the input file
duration = format_duration_string(audioin->sfinfo);
fprintf(stderr, "Input Format: %s, %s\n", format_info.name, subformat_info.name);
fprintf(stderr, "Input Duration: %s\n", duration);
fprintf(stderr, "Input Library: %s\n", sndlibver);
free(duration);
}
/* Read in some audio samples into buffer */
static int read_sndfile( audioin_t* audioin, short *buffer, int samples)
static int read_sndfile(audioin_t * audioin, short *buffer, int samples)
{
SNDFILE* file = audioin->file;
return sf_read_short( file, buffer, samples );
SNDFILE *file = audioin->file;
return sf_read_short(file, buffer, samples);
}
/* Return error string (or NULL) */
static const char* error_str_sndfile( audioin_t* audioin )
static const char *error_str_sndfile(audioin_t * audioin)
{
SNDFILE* file = audioin->file;
if (sf_error(file) == SF_ERR_NO_ERROR) {
// No error
return NULL;
} else {
// Return error string
return sf_strerror( file );
}
SNDFILE *file = audioin->file;
if (sf_error(file) == SF_ERR_NO_ERROR) {
// No error
return NULL;
} else {
// Return error string
return sf_strerror(file);
}
}
static int close_sndfile( audioin_t* audioin )
static int close_sndfile(audioin_t * audioin)
{
SNDFILE* file = audioin->file;
SNDFILE *file = audioin->file;
free( audioin );
return sf_close( file );
free(audioin);
return sf_close(file);
}
audioin_t* open_audioin_sndfile( char* filename, SF_INFO *sfinfo )
audioin_t *open_audioin_sndfile(char *filename, SF_INFO * sfinfo)
{
audioin_t* audioin = NULL;
audioin_t *audioin = NULL;
// Allocate memory for structure
audioin = malloc( sizeof( audioin_t ) );
if (audioin==NULL) {
fprintf(stderr, "Failed to allocate memory for audioin_t structure.\n");
exit(ERR_MEM_ALLOC);
}
// Open the input file by filename
audioin->file = sf_open(filename, SFM_READ, sfinfo);
// Allocate memory for structure
audioin = malloc(sizeof(audioin_t));
if (audioin == NULL) {
fprintf(stderr, "Failed to allocate memory for audioin_t structure.\n");
exit(ERR_MEM_ALLOC);
}
// Open the input file by filename
audioin->file = sf_open(filename, SFM_READ, sfinfo);
// Check for errors
if (audioin->file == NULL) {
fprintf(stderr, "Failed to open input file (%s):\n", filename);
fprintf(stderr, " %s\n", sf_strerror(NULL));
exit(ERR_OPENING_INPUT);
}
// Fill-in data structure
audioin->samplesize = 0;
audioin->sfinfo = sfinfo;
audioin->print_info = print_info_sndfile;
audioin->read = read_sndfile;
audioin->error_str = error_str_sndfile;
audioin->close = close_sndfile;
// Check for errors
if (audioin->file == NULL) {
fprintf(stderr, "Failed to open input file (%s):\n", filename);
fprintf(stderr, " %s\n", sf_strerror(NULL));
exit(ERR_OPENING_INPUT);
}
// Fill-in data structure
audioin->samplesize = 0;
audioin->sfinfo = sfinfo;
audioin->print_info = print_info_sndfile;
audioin->read = read_sndfile;
audioin->error_str = error_str_sndfile;
audioin->close = close_sndfile;
return audioin;
return audioin;
}

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: frontend.h,v 1.1 2008-02-01 19:44:26 richardash1981 Exp $
* $Id: frontend.h 156 2007-03-20 23:57:35Z nhumfrey $
*
*/
@ -38,48 +38,47 @@
/*
Result codes
*/
#define ERR_NO_ERROR (0) // No Error (encoded ok)
#define ERR_NO_ENCODE (1) // No Error (no encoding performed)
#define ERR_OPENING_INPUT (2) // Error opening input file
#define ERR_OPENING_OUTPUT (4) // Error opening output file
#define ERR_MEM_ALLOC (6) // Error allocating memory
#define ERR_INVALID_PARAM (8) // Error in chosen encoding parameters
#define ERR_READING_INPUT (10) // Error reading input
#define ERR_ENCODING (12) // Error occured during encoding
#define ERR_WRITING_OUTPUT (14) // Error occured writing to output file
#define ERR_NO_ERROR (0) // No Error (encoded ok)
#define ERR_NO_ENCODE (1) // No Error (no encoding performed)
#define ERR_OPENING_INPUT (2) // Error opening input file
#define ERR_OPENING_OUTPUT (4) // Error opening output file
#define ERR_MEM_ALLOC (6) // Error allocating memory
#define ERR_INVALID_PARAM (8) // Error in chosen encoding parameters
#define ERR_READING_INPUT (10) // Error reading input
#define ERR_ENCODING (12) // Error occured during encoding
#define ERR_WRITING_OUTPUT (14) // Error occured writing to output file
typedef struct audioin_s {
// Display information about input stream
void (*print_info)(struct audioin_s *);
// Display information about input stream
void (*print_info) (struct audioin_s *);
// Read in some audio
int (*read)(struct audioin_s *, short *buffer, int samples);
// Return error string (if any)
const char* (*error_str)(struct audioin_s *);
// Close the inout stream
int (*close)(struct audioin_s *);
// Read in some audio
int (*read) (struct audioin_s *, short *buffer, int samples);
// Return error string (if any)
const char *(*error_str) (struct audioin_s *);
// Close the inout stream
int (*close) (struct audioin_s *);
// Pointer to file / input stream
void* file;
// Pointer to linsndfile info structure
SF_INFO* sfinfo;
// Size of the samples (in bits)
int samplesize;
// Pointer to file / input stream
void *file;
// Pointer to linsndfile info structure
SF_INFO *sfinfo;
// Size of the samples (in bits)
int samplesize;
} audioin_t;
/* Initialisers */
audioin_t* open_audioin_sndfile( char* filename, SF_INFO *sfinfo );
audioin_t* open_audioin_raw( char* filename, SF_INFO *sfinfo, int samplesize);
audioin_t *open_audioin_sndfile(char *filename, SF_INFO * sfinfo);
audioin_t *open_audioin_raw(char *filename, SF_INFO * sfinfo, int samplesize);

View File

@ -1,4 +1,4 @@
AM_CFLAGS = -I ../build/
AM_CFLAGS = -I ../build/ $(WARNING_CFLAGS)
lib_LTLIBRARIES = libtwolame.la
include_HEADERS = twolame.h
@ -11,6 +11,7 @@ libtwolame_la_SOURCES = \
availbits.h \
bitbuffer.c \
bitbuffer.h \
bitbuffer_inline.h \
common.h \
crc.c \
crc.h \

View File

@ -33,17 +33,20 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = libtwolame
DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
$(srcdir)/Makefile.in $(srcdir)/config.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/build/m4/libtool.m4 \
$(top_srcdir)/build/m4/pkg.m4 $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/build-scripts/libtool.m4 \
$(top_srcdir)/build-scripts/ltoptions.m4 \
$(top_srcdir)/build-scripts/ltsugar.m4 \
$(top_srcdir)/build-scripts/ltversion.m4 \
$(top_srcdir)/build-scripts/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/build/config.h
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@ -63,8 +66,8 @@ libtwolame_la_OBJECTS = $(am_libtwolame_la_OBJECTS)
libtwolame_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libtwolame_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/build
depcomp = $(SHELL) $(top_srcdir)/build/depcomp
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/build-scripts/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -94,46 +97,53 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_ASCIIDOC = @PATH_ASCIIDOC@
PATH_DOXYGEN = @PATH_DOXYGEN@
PATH_SEPARATOR = @PATH_SEPARATOR@
PATH_XMLTO = @PATH_XMLTO@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
@ -142,17 +152,17 @@ SHELL = @SHELL@
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
SNDFILE_LIBS = @SNDFILE_LIBS@
STRIP = @STRIP@
STWOLAME_BIN = @STWOLAME_BIN@
TWOLAME_BIN = @TWOLAME_BIN@
TWOLAME_SO_VERSION = @TWOLAME_SO_VERSION@
VERSION = @VERSION@
WARNING_CFLAGS = @WARNING_CFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@ -194,15 +204,11 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = -I ../build/
AM_CFLAGS = -I ../build/ $(WARNING_CFLAGS)
lib_LTLIBRARIES = libtwolame.la
include_HEADERS = twolame.h
libtwolame_la_LDFLAGS = -export-dynamic -version-info @TWOLAME_SO_VERSION@
@ -213,6 +219,7 @@ libtwolame_la_SOURCES = \
availbits.h \
bitbuffer.c \
bitbuffer.h \
bitbuffer_inline.h \
common.h \
crc.c \
crc.h \
@ -249,7 +256,8 @@ libtwolame_la_SOURCES = \
util.c \
util.h
all: all-am
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
@ -282,6 +290,23 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status libtwolame/config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@ -392,11 +417,11 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
@ -408,10 +433,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
@ -457,7 +482,7 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
@ -495,7 +520,7 @@ distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
distclean-hdr distclean-tags
dvi: dvi-am
@ -549,14 +574,15 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
distclean-compile distclean-generic distclean-hdr \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am \
install-includeHEADERS install-info install-info-am \
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-includeHEADERS \

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: ath.c,v 1.3 2008-02-01 19:44:27 richardash1981 Exp $
* $Id$
*
*/
@ -34,68 +34,57 @@
/* freq in hz */
FLOAT ath_db(FLOAT f, FLOAT value)
{
/* from Painter & Spanias
modified by Gabriel Bouvigne to better fit the reality
ath = 3.640 * pow(f,-0.8)
- 6.800 * exp(-0.6*pow(f-3.4,2.0))
+ 6.000 * exp(-0.15*pow(f-8.7,2.0))
+ 0.6* 0.001 * pow(f,4.0);
In the past LAME was using the Painter &Spanias formula.
But we had some recurrent problems with HF content.
We measured real ATH values, and found the older formula
to be inacurate in the higher part. So we made this new
formula and this solved most of HF problematic testcases.
The tradeoff is that in VBR mode it increases a lot the
bitrate.*/
/* from Painter & Spanias modified by Gabriel Bouvigne to better fit the reality ath = 3.640 *
pow(f,-0.8) - 6.800 * exp(-0.6*pow(f-3.4,2.0)) + 6.000 * exp(-0.15*pow(f-8.7,2.0)) + 0.6*
0.001 * pow(f,4.0);
/*this curve can be udjusted according to the VBR scale:
it adjusts from something close to Painter & Spanias
on V9 up to Bouvigne's formula for V0. This way the VBR
bitrate is more balanced according to the -V value.*/
In the past LAME was using the Painter &Spanias formula. But we had some recurrent problems
with HF content. We measured real ATH values, and found the older formula to be inacurate in
the higher part. So we made this new formula and this solved most of HF problematic
testcases. The tradeoff is that in VBR mode it increases a lot the bitrate. */
FLOAT ath;
FLOAT valueold = 0.0;
if (f < -.3)
f=3410;
f /= 1000; // convert to khz
f = MAX(0.01, f);
f = MIN(18.0, f);
ath = 3.640 * pow(f,-0.8)
- 6.800 * exp(-0.6*pow(f-3.4,2.0))
+ 6.000 * exp(-0.15*pow(f-8.7,2.0))
+ (0.6+0.04*valueold)* 0.001 * pow(f,4.0);
/* MFC Feb 2003
I've changed the fudge technique on the code.
The "-l [float]" value raises/lowers the ATH by this many dB */
return (ath + value);
/* this curve can be udjusted according to the VBR scale: it adjusts from something close to
Painter & Spanias on V9 up to Bouvigne's formula for V0. This way the VBR bitrate is more
balanced according to the -V value. */
FLOAT ath;
FLOAT valueold = 0.0;
if (f < -.3)
f = 3410;
f /= 1000; // convert to khz
f = MAX(0.01, f);
f = MIN(18.0, f);
ath = 3.640 * pow(f, -0.8)
- 6.800 * exp(-0.6 * pow(f - 3.4, 2.0))
+ 6.000 * exp(-0.15 * pow(f - 8.7, 2.0))
+ (0.6 + 0.04 * valueold) * 0.001 * pow(f, 4.0);
/* MFC Feb 2003 I've changed the fudge technique on the code. The "-l [float]" value
raises/lowers the ATH by this many dB */
return (ath + value);
}
/* Convert ATH values from dB into energy values as required by the psycho model */
FLOAT ath_energy(FLOAT freq, FLOAT value)
{
FLOAT db;
db = ath_db(freq, 0) + value; // Originally: ath_db(freq,value)
/* The values in the standard, and from the ATH formula are in dB.
In the psycho model we are working in the energy domain. Hence the values that
are in the absthr_X tables are not in dB. This function converts from dB into the energy domain.
As noted on the LAME mailing list from years ago (MFC FIX find the reference), the
absolute threhsold of hearing values in the tables in the standard are dodgy - the
ATH in the tables do not correspond to any previously known values of the ATH.
From ISO 11172 Tables D.4.x
"A value of 0dB represents a level in the absolute threshold calculation of
96dB below the energy of a sine wave of amplitude 32760."
But I still don't know why the factor of 41.837375 is the value that it is.
MFC Feb 2003
*/
return(pow(10.0, (db+41.837375)*0.1));
FLOAT db;
db = ath_db(freq, 0) + value; // Originally: ath_db(freq,value)
/* The values in the standard, and from the ATH formula are in dB. In the psycho model we are
working in the energy domain. Hence the values that are in the absthr_X tables are not in
dB. This function converts from dB into the energy domain. As noted on the LAME mailing list
from years ago (MFC FIX find the reference), the absolute threhsold of hearing values in the
tables in the standard are dodgy - the ATH in the tables do not correspond to any previously
known values of the ATH. From ISO 11172 Tables D.4.x "A value of 0dB represents a level in
the absolute threshold calculation of 96dB below the energy of a sine wave of amplitude
32760." But I still don't know why the factor of 41.837375 is the value that it is. MFC Feb
2003 */
return (pow(10.0, (db + 41.837375) * 0.1));
}
@ -104,9 +93,10 @@ FLOAT ath_energy(FLOAT freq, FLOAT value)
see for example "Zwicker: Psychoakustik, 1982; ISBN 3-540-11401-7 */
FLOAT ath_freq2bark(FLOAT freq)
{
if (freq<0) freq=0;
freq = freq * 0.001;
return 13.0*atan(.76*freq) + 3.5*atan(freq*freq/(7.5*7.5));
if (freq < 0)
freq = 0;
freq = freq * 0.001;
return 13.0 * atan(.76 * freq) + 3.5 * atan(freq * freq / (7.5 * 7.5));
}
// vim:ts=4:sw=4:nowrap:

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: ath.h,v 1.3 2008-02-01 19:44:27 richardash1981 Exp $
* $Id$
*
*/

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: availbits.c,v 1.3 2008-02-01 19:44:27 richardash1981 Exp $
* $Id$
*
*/
@ -31,48 +31,47 @@
struct slotinfo {
FLOAT average;
FLOAT frac;
int whole;
FLOAT lag;
int extra;
FLOAT average;
FLOAT frac;
int whole;
FLOAT lag;
int extra;
} slots;
/* function returns the number of available bits */
int available_bits ( twolame_options * glopts )
int available_bits(twolame_options * glopts)
{
frame_header *header = &glopts->header;
int adb;
slots.extra = 0; /* be default, no extra slots */
slots.average =
(1152.0/ ((FLOAT)glopts->samplerate_out/1000.0) )
* ((FLOAT)glopts->bitrate / 8.0);
//fprintf(stdout,"availbits says: sampling freq is %i. version %i. bitrateindex %i slots %f\n",header->sampling_frequency, header->version, header->bitrate_index, slots.average);
slots.whole = (int) slots.average;
slots.frac = slots.average - (FLOAT) slots.whole;
/* never allow padding for a VBR frame.
Don't ask me why, I've forgotten why I set this */
if (slots.frac != 0 && glopts->padding && glopts->vbr == FALSE) {
if (slots.lag > (slots.frac - 1.0)) { /* no padding for this frame */
slots.lag -= slots.frac;
slots.extra = 0;
header->padding = 0;
} else { /* padding */
slots.extra = 1;
header->padding = 1;
slots.lag += (1 - slots.frac);
}
}
adb = (slots.whole + slots.extra) * 8;
return adb;
frame_header *header = &glopts->header;
int adb;
slots.extra = 0; /* be default, no extra slots */
slots.average = (1152.0 / ((FLOAT) glopts->samplerate_out / 1000.0))
* ((FLOAT) glopts->bitrate / 8.0);
// fprintf(stderr,"availbits says: sampling freq is %i. version %i. bitrateindex %i slots
// %f\n",header->sampling_frequency, header->version, header->bitrate_index, slots.average);
slots.whole = (int) slots.average;
slots.frac = slots.average - (FLOAT) slots.whole;
/* never allow padding for a VBR frame. Don't ask me why, I've forgotten why I set this */
if (slots.frac != 0 && glopts->padding && glopts->vbr == FALSE) {
if (slots.lag > (slots.frac - 1.0)) { /* no padding for this frame */
slots.lag -= slots.frac;
slots.extra = 0;
header->padding = 0;
} else { /* padding */
slots.extra = 1;
header->padding = 1;
slots.lag += (1 - slots.frac);
}
}
adb = (slots.whole + slots.extra) * 8;
return adb;
}

View File

@ -18,14 +18,14 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: availbits.h,v 1.3 2008-02-01 19:44:27 richardash1981 Exp $
* $Id$
*
*/
#ifndef _AVAILBITS_H_
#define _AVAILBITS_H_
int available_bits ( twolame_options * glopts );
int available_bits(twolame_options * glopts);
#endif

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: bitbuffer.c,v 1.3 2008-02-01 19:44:27 richardash1981 Exp $
* $Id$
*
*/
@ -33,82 +33,31 @@
/*create bit buffer*/
bit_stream* buffer_init( unsigned char *buffer, int buffer_size )
bit_stream *buffer_init(unsigned char *buffer, int buffer_size)
{
bit_stream* bs = (bit_stream *)TWOLAME_MALLOC( sizeof(bit_stream) );
bs->buf = buffer;
bs->buf_size = buffer_size;
bs->buf_byte_idx = 0;
bs->buf_bit_idx = 8;
bs->totbit = 0;
bs->eob = FALSE;
bs->eobs = FALSE;
return bs;
bit_stream *bs = (bit_stream *) TWOLAME_MALLOC(sizeof(bit_stream));
bs->buf = buffer;
bs->buf_size = buffer_size;
bs->buf_byte_idx = 0;
bs->buf_bit_idx = 8;
bs->totbit = 0;
bs->eob = FALSE;
bs->eobs = FALSE;
return bs;
}
/* Dellocate bit buffer */
void buffer_deinit( bit_stream **bs )
void buffer_deinit(bit_stream ** bs)
{
if (bs==NULL||*bs==NULL) return;
if (bs == NULL || *bs == NULL)
return;
TWOLAME_FREE( *bs );
TWOLAME_FREE(*bs);
}
/*write 1 bit from the bit stream */
void buffer_put1bit (bit_stream * bs, int bit)
{
bs->totbit++;
bs->buf[bs->buf_byte_idx] |= (bit & 0x1) << (bs->buf_bit_idx - 1);
bs->buf_bit_idx--;
if (!bs->buf_bit_idx) {
bs->buf_bit_idx = 8;
bs->buf_byte_idx++;
if (bs->buf_byte_idx >= bs->buf_size) {
//empty_buffer (bs, minimum);
fprintf(stdout,"buffer_put1bit: error. bit_stream buffer needs to be bigger\n");
exit(99);
}
bs->buf[bs->buf_byte_idx] = 0;
}
}
/*write N bits into the bit stream */
void buffer_putbits (bit_stream * bs, unsigned int val, int N)
{
static const int putmask[9] = { 0x0, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff };
register int j = N;
register int k, tmp;
bs->totbit += N;
while (j > 0) {
k = MIN (j, bs->buf_bit_idx);
tmp = val >> (j - k);
bs->buf[bs->buf_byte_idx] |= (tmp & putmask[k]) << (bs->buf_bit_idx - k);
bs->buf_bit_idx -= k;
if (!bs->buf_bit_idx) {
bs->buf_bit_idx = 8;
bs->buf_byte_idx++;
if (bs->buf_byte_idx >= bs->buf_size) {
//empty_buffer (bs, minimum);
fprintf(stdout,"buffer_putbits: error. bit_stream buffer needs to be bigger\n");
exit(99);
}
bs->buf[bs->buf_byte_idx] = 0;
}
j -= k;
}
}
/*return the current bit stream length (in bits)*/
unsigned long buffer_sstell (bit_stream * bs)
{
return (bs->totbit);
}
// vim:ts=4:sw=4:nowrap:

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: bitbuffer.h,v 1.3 2008-02-01 19:44:27 richardash1981 Exp $
* $Id$
*
*/
@ -29,22 +29,21 @@
/* bit stream structure */
typedef struct bit_stream_struc {
unsigned char *buf; /* bit stream buffer */
int buf_size; /* size of buffer (in number of bytes) */
long totbit; /* bit counter of bit stream */
int buf_byte_idx; /* pointer to top byte in buffer */
int buf_bit_idx; /* pointer to top bit of top byte in buffer */
int eob; /* end of buffer index */
int eobs; /* end of bit stream flag */
unsigned char *buf; /* bit stream buffer */
int buf_size; /* size of buffer (in number of bytes) */
long totbit; /* bit counter of bit stream */
int buf_byte_idx; /* pointer to top byte in buffer */
int buf_bit_idx; /* pointer to top bit of top byte in buffer */
int eob; /* end of buffer index */
int eobs; /* end of bit stream flag */
} bit_stream;
bit_stream * buffer_init( unsigned char *buffer, int buffer_size );
void buffer_deinit( bit_stream **bs );
bit_stream *buffer_init(unsigned char *buffer, int buffer_size);
void buffer_deinit(bit_stream ** bs);
NO_DLL_INLINE void buffer_put1bit (bit_stream *, int);
NO_DLL_INLINE void buffer_putbits (bit_stream *, unsigned int, int);
NO_DLL_INLINE unsigned long buffer_sstell (bit_stream *);
/*return the current bit stream length (in bits)*/
#define buffer_sstell(bs) (bs->totbit)
#endif

View File

@ -0,0 +1,72 @@
/*
* TwoLAME: an optimized MPEG Audio Layer Two encoder
*
* Copyright (C) 2001-2004 Michael Cheng
* Copyright (C) 2004-2006 The TwoLAME Project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id$
*
*/
/* write 1 bit from the bit stream */
static inline void buffer_put1bit(bit_stream * bs, int bit)
{
bs->totbit++;
bs->buf[bs->buf_byte_idx] |= (bit & 0x1) << (bs->buf_bit_idx - 1);
bs->buf_bit_idx--;
if (!bs->buf_bit_idx) {
bs->buf_bit_idx = 8;
bs->buf_byte_idx++;
if (bs->buf_byte_idx >= bs->buf_size) {
// empty_buffer (bs, minimum);
fprintf(stderr, "buffer_put1bit: error. bit_stream buffer needs to be bigger\n");
return;
}
bs->buf[bs->buf_byte_idx] = 0;
}
}
/* write N bits into the bit stream */
static inline void buffer_putbits(bit_stream * bs, unsigned int val, int N)
{
static const int putmask[9] = { 0x0, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff };
register int j = N;
register int k, tmp;
bs->totbit += N;
while (j > 0) {
k = MIN(j, bs->buf_bit_idx);
tmp = val >> (j - k);
bs->buf[bs->buf_byte_idx] |= (tmp & putmask[k]) << (bs->buf_bit_idx - k);
bs->buf_bit_idx -= k;
if (!bs->buf_bit_idx) {
bs->buf_bit_idx = 8;
bs->buf_byte_idx++;
if (bs->buf_byte_idx >= bs->buf_size) {
// empty_buffer (bs, minimum);
fprintf(stderr, "buffer_putbits: error. bit_stream buffer needs to be bigger\n");
return;
}
bs->buf[bs->buf_byte_idx] = 0;
}
j -= k;
}
}
// vim:ts=4:sw=4:nowrap:

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: common.h,v 1.4 2008-02-01 19:44:28 richardash1981 Exp $
* $Id$
*
*/
@ -28,28 +28,10 @@
#ifdef _WIN32
# include "../win32/configwin.h"
/*
* When building as a Win32 DLL, some functions are not allowed to be inlined,
* otherwise the Microsoft Visual Studio 2005 linker will complain
*/
# define NO_DLL_INLINE
#else
# include "config.h"
/*
* When building shared libraries, some functions can't be inlined otherwise
* link errors will occur. In a new enough GCC version they can be declared
* extern inline. This fix appears earlier in Apple GCC than in main-line GCC
*/
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
#define NO_DLL_INLINE extern inline
#elif (__APPLE_CC__ >= 5465)
#define NO_DLL_INLINE extern inline
# else
# define NO_DLL_INLINE extern inline
# endif
#endif
#include "twolame.h"
@ -124,7 +106,7 @@ psycho 0 mem struct
****************************************************************************************/
typedef struct psycho_0_mem_struct {
FLOAT ath_min[SBLIMIT];
FLOAT ath_min[SBLIMIT];
} psycho_0_mem;
@ -135,24 +117,24 @@ psycho 1 mem struct
#define DBTAB 1000
typedef struct {
int line;
FLOAT bark, hear, x;
int line;
FLOAT bark, hear, x;
} g_thres, *g_ptr;
typedef struct {
FLOAT x;
int type, next, map;
FLOAT x;
int type, next, map;
} mask, *mask_ptr;
typedef struct psycho_1_mem_struct {
int off[2];
FLOAT fft_buf[2][1408];
int *cbound;
int crit_band;
int sub_size;
mask_ptr power;
g_ptr ltg;
FLOAT dbtable[DBTAB];
int off[2];
FLOAT fft_buf[2][1408];
int *cbound;
int crit_band;
int sub_size;
mask_ptr power;
g_ptr ltg;
FLOAT dbtable[DBTAB];
} psycho_1_mem;
@ -163,17 +145,16 @@ Psycho3 memory structure
#define HBLKSIZE 513
#define SUBSIZE 136
typedef struct psycho_3_mem_struct{
int off[2];
int freq_subset[SUBSIZE];
FLOAT bark[HBLKSIZE];
FLOAT ath[HBLKSIZE];
FLOAT fft_buf[2][1408];
#define CRITBANDMAX 32 /* this is much higher than it needs to be. really only about 24 */
int cbands; /* How many critical bands there really are */
int cbandindex[CRITBANDMAX]; /* The spectral line index of the start of
each critical band */
FLOAT dbtable[DBTAB];
typedef struct psycho_3_mem_struct {
int off[2];
int freq_subset[SUBSIZE];
FLOAT bark[HBLKSIZE];
FLOAT ath[HBLKSIZE];
FLOAT fft_buf[2][1408];
#define CRITBANDMAX 32 /* this is much higher than it needs to be. really only about 24 */
int cbands; /* How many critical bands there really are */
int cbandindex[CRITBANDMAX]; /* The spectral line index of the start of each critical band */
FLOAT dbtable[DBTAB];
} psycho_3_mem;
@ -201,34 +182,34 @@ typedef FLOAT F22HBLK[2][2][HBLKSIZE];
typedef FLOAT DCB[CBANDS];
typedef struct psycho_4_mem_struct {
int new;
int old;
int oldest;
int flush;
int sync_flush;
int syncsize;
FLOAT grouped_c[CBANDS];
FLOAT grouped_e[CBANDS];
FLOAT nb[CBANDS];
FLOAT cb[CBANDS];
FLOAT tb[CBANDS];
FLOAT ecb[CBANDS];
FLOAT bc[CBANDS];
FLOAT cbval[CBANDS];
FLOAT rnorm[CBANDS];
FLOAT wsamp_r[BLKSIZE], phi[BLKSIZE], energy[BLKSIZE], window[BLKSIZE];
FLOAT ath[HBLKSIZE], thr[HBLKSIZE], c[HBLKSIZE];
FLOAT fthr[HBLKSIZE], absthr[HBLKSIZE]; // psy2 only
int numlines[CBANDS];
int partition[HBLKSIZE];
FLOAT *tmn;
FCB *s;
FHBLK *lthr;
F2HBLK *r, *phi_sav;
FLOAT snrtmp[2][32];
FLOAT cos_table[TRIGTABLESIZE];
int new;
int old;
int oldest;
int flush;
int sync_flush;
int syncsize;
FLOAT grouped_c[CBANDS];
FLOAT grouped_e[CBANDS];
FLOAT nb[CBANDS];
FLOAT cb[CBANDS];
FLOAT tb[CBANDS];
FLOAT ecb[CBANDS];
FLOAT bc[CBANDS];
FLOAT cbval[CBANDS];
FLOAT rnorm[CBANDS];
FLOAT wsamp_r[BLKSIZE], phi[BLKSIZE], energy[BLKSIZE], window[BLKSIZE];
FLOAT ath[HBLKSIZE], thr[HBLKSIZE], c[HBLKSIZE];
FLOAT fthr[HBLKSIZE], absthr[HBLKSIZE]; // psy2 only
int numlines[CBANDS];
int partition[HBLKSIZE];
FLOAT *tmn;
FCB *s;
FHBLK *lthr;
F2HBLK *r, *phi_sav;
FLOAT snrtmp[2][32];
FLOAT cos_table[TRIGTABLESIZE];
} psycho_4_mem, psycho_2_mem;
@ -237,10 +218,10 @@ typedef struct psycho_4_mem_struct {
****************************************************************************************/
typedef struct subband_mem_struct {
FLOAT x[2][512];
FLOAT m[16][32];
int off[2];
int half[2];
FLOAT x[2][512];
FLOAT m[16][32];
int off[2];
int half[2];
} subband_mem;
@ -251,18 +232,18 @@ typedef struct subband_mem_struct {
/* Raw Header Information Structure */
typedef struct {
int version;
int lay;
int error_protection;
int bitrate_index;
int samplerate_idx;
int padding;
int private_bit;
int mode;
int mode_ext;
int copyright;
int original;
int emphasis;
int version;
int lay;
int error_protection;
int bitrate_index;
int samplerate_idx;
int padding;
int private_bit;
int mode;
int mode_ext;
int copyright;
int original;
int emphasis;
} frame_header;
@ -278,114 +259,117 @@ typedef FLOAT sb_sample_t[2][3][SCALE_BLOCK][SBLIMIT];
Defaults shown in []
++ means it is an advanced option. Only use it if you know what you're doing.
****************************************************************************************/
struct twolame_options_struct
{
// Input PCM audio File Information
int samplerate_in; // mpeg1: 32000 [44100] 48000
// mpeg2: 16000 22050 24000
int samplerate_out;
int num_channels_in; // Number of channels on the input stream
int num_channels_out; // Number of channels on the output stream
// Output MP2 File Information
TWOLAME_MPEG_version version; // 0 mpeg2 [1] mpeg1
int bitrate; // for mpeg1:32, 48, 56, 64, 80, 96,112,128,160,[192], 224, 256, 320, 384
// for mpeg2: 8, 16, 24, 32, 40, 48, 56, 64, 80, [96], 112, 128, 144, 160
TWOLAME_MPEG_mode mode;
TWOLAME_Padding padding; // [PAD_NO]
int do_energy_levels; // Write energy level information into the end of the frame [FALSE]
int num_ancillary_bits; // Number of reserved ancillary bits [0] (Currently only available for non-VBR modes)
// Psychoacoustic Model options
int psymodel; // -1, 0, 1, 2, [3], 4 Psy model number
FLOAT athlevel; // Adjust the Absolute Threshold of Hearing curve by [0] dB
int quickmode; // Only calculate psy model ever X frames [FALSE]
int quickcount; // Only calculate psy model every [10] frames
// VBR Options
int vbr; // turn on VBR mode TRUE [FALSE]
int vbr_upper_index; // ++ [0] means no upper bitrate set for VBR mode. valid 1-15 depending on mode
int vbr_max_bitrate;
FLOAT vbrlevel; // Set VBR quality. [0.0] (sensible range -10.0 -> 10.0)
// Miscellaneous Options That Nobody Ever Uses
TWOLAME_Emphasis emphasis; // [n]one, 5(50/15 microseconds), c(ccitt j.17)
int copyright; // [FALSE]
int original; // [FALSE]
int private_bit; // [0] Your very own bit in the header.
int error_protection; // [FALSE]
// Digital Audio Broadcasting Extensions
unsigned int do_dab; // Allocate space for the DigitalAudioBroadcasting info [FALSE]
unsigned int dab_crc_len; // Number of CRC bytes for DAB [2], 4
unsigned int dab_crc[4]; // DAB CRC bytes are inserted here. User must insert them in frame
unsigned int dab_xpad_len; // Number of bytes in the XPAD
// Processing Options
int verbosity; // Verbosity of output 0(never output a thing) [2] 100(output everything)
// Scaling
FLOAT scale;
FLOAT scale_left;
FLOAT scale_right;
// Bit allocation stuff
int lower_index;
int upper_index;
int bitrateindextobits[15];
int vbr_frame_count; // Used for debugging VBR
// Used by twolame_encode_frame
int twolame_init;
short int buffer[2][TWOLAME_SAMPLES_PER_FRAME]; // Sample buffer
unsigned int samples_in_buffer; // Number of samples currently in buffer
unsigned int psycount;
unsigned int num_crc_bits; // Number of bits CRC is calculated on
unsigned int bit_alloc[2][SBLIMIT];
unsigned int scfsi[2][SBLIMIT];
unsigned int scalar[2][3][SBLIMIT];
unsigned int j_scale[3][SBLIMIT];
FLOAT smrdef[2][32];
FLOAT smr[2][SBLIMIT];
FLOAT max_sc[2][SBLIMIT];
subband_t *subband;
jsb_sample_t *j_sample;
sb_sample_t *sb_sample;
/* Resampling stuff */
FLOAT resample_ratio;
void* resample_handle[2];
// memory for psycho models
psycho_0_mem *p0mem;
psycho_1_mem *p1mem;
psycho_2_mem *p2mem;
psycho_3_mem *p3mem;
psycho_4_mem *p4mem;
// memory for subband
subband_mem smem;
// Frame info
frame_header header;
int jsbound; // first band of joint stereo coding
int sblimit; // total number of sub bands
int tablenum;
int vbrstats[15];
struct twolame_options_struct {
// Input PCM audio File Information
int samplerate_in; // mpeg1: 32000 [44100] 48000
// mpeg2: 16000 22050 24000
int samplerate_out;
int num_channels_in; // Number of channels on the input stream
int num_channels_out; // Number of channels on the output stream
// Output MP2 File Information
TWOLAME_MPEG_version version; // 0 mpeg2 [1] mpeg1
int bitrate; // for mpeg1:32, 48, 56, 64, 80, 96,112,128,160,[192], 224, 256,
// 320, 384
// for mpeg2: 8, 16, 24, 32, 40, 48, 56, 64, 80, [96], 112, 128, 144, 160
TWOLAME_MPEG_mode mode;
TWOLAME_Padding padding; // [PAD_NO]
int do_energy_levels; // Write energy level information into the end of the frame [FALSE]
int num_ancillary_bits; // Number of reserved ancillary bits [0] (Currently only available
// for non-VBR modes)
// Psychoacoustic Model options
int psymodel; // -1, 0, 1, 2, [3], 4 Psy model number
FLOAT athlevel; // Adjust the Absolute Threshold of Hearing curve by [0] dB
int quickmode; // Only calculate psy model ever X frames [FALSE]
int quickcount; // Only calculate psy model every [10] frames
// VBR Options
int vbr; // turn on VBR mode TRUE [FALSE]
int vbr_upper_index; // ++ [0] means no upper bitrate set for VBR mode. valid 1-15
// depending on mode
int vbr_max_bitrate;
FLOAT vbrlevel; // Set VBR quality. [0.0] (sensible range -10.0 -> 10.0)
// Miscellaneous Options That Nobody Ever Uses
TWOLAME_Emphasis emphasis; // [n]one, 5(50/15 microseconds), c(ccitt j.17)
int copyright; // [FALSE]
int original; // [FALSE]
int private_bit; // [0] Your very own bit in the header.
int error_protection; // [FALSE]
// Digital Audio Broadcasting Extensions
unsigned int do_dab; // Allocate space for the DigitalAudioBroadcasting info [FALSE]
unsigned int dab_crc_len; // Number of CRC bytes for DAB [2], 4
unsigned int dab_crc[4]; // DAB CRC bytes are inserted here. User must insert them in frame
unsigned int dab_xpad_len; // Number of bytes in the XPAD
// Processing Options
int verbosity; // Verbosity of output 0(never output a thing) [2] 100(output
// everything)
// Scaling
FLOAT scale;
FLOAT scale_left;
FLOAT scale_right;
// Bit allocation stuff
int lower_index;
int upper_index;
int bitrateindextobits[15];
int vbr_frame_count; // Used for debugging VBR
// Used by twolame_encode_frame
int twolame_init;
short int buffer[2][TWOLAME_SAMPLES_PER_FRAME]; // Sample buffer
unsigned int samples_in_buffer; // Number of samples currently in buffer
unsigned int psycount;
unsigned int num_crc_bits; // Number of bits CRC is calculated on
unsigned int bit_alloc[2][SBLIMIT];
unsigned int scfsi[2][SBLIMIT];
unsigned int scalar[2][3][SBLIMIT];
unsigned int j_scale[3][SBLIMIT];
FLOAT smrdef[2][32];
FLOAT smr[2][SBLIMIT];
FLOAT max_sc[2][SBLIMIT];
subband_t *subband;
jsb_sample_t *j_sample;
sb_sample_t *sb_sample;
/* Resampling stuff */
FLOAT resample_ratio;
void *resample_handle[2];
// memory for psycho models
psycho_0_mem *p0mem;
psycho_1_mem *p1mem;
psycho_2_mem *p2mem;
psycho_3_mem *p3mem;
psycho_4_mem *p4mem;
// memory for subband
subband_mem smem;
// Frame info
frame_header header;
int jsbound; // first band of joint stereo coding
int sblimit; // total number of sub bands
int tablenum;
int vbrstats[15];
};
#endif // _COMMON_H
#endif // _COMMON_H
// vim:ts=4:sw=4:nowrap:

View File

@ -1,11 +1,8 @@
/* build/config.h.in. Generated from configure.ac by autoheader. */
/* libtwolame/config.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Define if debugging is enabled. */
#undef DEBUG
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
@ -48,6 +45,10 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
@ -63,6 +64,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@ -90,6 +94,9 @@
# endif
#endif
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: crc.c,v 1.3 2008-02-01 19:44:31 richardash1981 Exp $
* $Id$
*
*/
@ -36,16 +36,16 @@
static unsigned int crc_update(unsigned int value, unsigned int crc, unsigned int nbBit)
{
int i;
value <<= 8;
for (i = 0; i < nbBit; i++) {
value <<= 1;
crc <<= 1;
if (((crc ^ value) & 0x10000))
crc ^= CRC16_POLYNOMIAL;
}
return crc;
int i;
value <<= 8;
for (i = 0; i < nbBit; i++) {
value <<= 1;
crc <<= 1;
if (((crc ^ value) & 0x10000))
crc ^= CRC16_POLYNOMIAL;
}
return crc;
}
@ -54,32 +54,29 @@ static unsigned int crc_update(unsigned int value, unsigned int crc, unsigned in
* The CRC is based on the second two bytes of the MPEG audio header
* and then the bits up and until the scale-factor bits.
*/
void crc_writeheader( unsigned char *bitstream, int bit_count )
void crc_writeheader(unsigned char *bitstream, int bit_count)
{
unsigned int crc = 0xffff; /* (jo) init crc16 for error_protection */
int whole_bytes = (bit_count>>3);
int byte;
// Calculate the CRC on the second two bytes of the header
crc = crc_update(bitstream[2], crc, 8);
crc = crc_update(bitstream[3], crc, 8);
// Calculate CRC on whole bytes after CRC
for(byte=6; byte<(whole_bytes+6); byte++)
{
crc = crc_update(bitstream[byte], crc, 8);
}
// Calculate CRC on remaining bits
if(bit_count & 7)
{
crc = crc_update(bitstream[byte], crc, bit_count&7);
}
// Insert the CRC into the 16-bits after the header
bitstream[4] = crc >> 8;
bitstream[5] = crc & 0xFF;
unsigned int crc = 0xffff; /* (jo) init crc16 for error_protection */
int whole_bytes = (bit_count >> 3);
int byte;
// Calculate the CRC on the second two bytes of the header
crc = crc_update(bitstream[2], crc, 8);
crc = crc_update(bitstream[3], crc, 8);
// Calculate CRC on whole bytes after CRC
for (byte = 6; byte < (whole_bytes + 6); byte++) {
crc = crc_update(bitstream[byte], crc, 8);
}
// Calculate CRC on remaining bits
if (bit_count & 7) {
crc = crc_update(bitstream[byte], crc, bit_count & 7);
}
// Insert the CRC into the 16-bits after the header
bitstream[4] = crc >> 8;
bitstream[5] = crc & 0xFF;
}

View File

@ -18,14 +18,14 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: crc.h,v 1.3 2008-02-01 19:44:31 richardash1981 Exp $
* $Id$
*
*/
#ifndef _CRC_H_
#define _CRC_H_
void crc_writeheader( unsigned char *bitstream, int bit_count );
void crc_writeheader(unsigned char *bitstream, int bit_count);
#endif

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: dab.c,v 1.3 2008-02-01 19:44:31 richardash1981 Exp $
* $Id$
*
*/
@ -32,61 +32,59 @@
void
dab_crc_calc ( twolame_options *glopts,
unsigned int bit_alloc[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT],
unsigned int scalar[2][3][SBLIMIT],
unsigned int *crc,
int packed)
dab_crc_calc(twolame_options * glopts,
unsigned int bit_alloc[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT],
unsigned int scalar[2][3][SBLIMIT], unsigned int *crc, int packed)
{
int i, j, k;
int nch = glopts->num_channels_out;
int nb_scalar;
int f[5] = { 0, 4, 8, 16, 30 };
int first, last;
first = f[packed];
last = f[packed + 1];
if (last > glopts->sblimit)
last = glopts->sblimit;
nb_scalar = 0;
*crc = 0x0;
for (i = first; i < last; i++)
for (k = 0; k < nch; k++)
if (bit_alloc[k][i]) /* above jsbound, bit_alloc[0][i] == ba[1][i] */
switch (scfsi[k][i]) {
case 0:
for (j = 0; j < 3; j++) {
nb_scalar++;
dab_crc_update (scalar[k][j][i] >> 3, 3, crc);
}
break;
case 1:
case 3:
nb_scalar += 2;
dab_crc_update (scalar[k][0][i] >> 3, 3, crc);
dab_crc_update (scalar[k][2][i] >> 3, 3, crc);
break;
case 2:
nb_scalar++;
dab_crc_update (scalar[k][0][i] >> 3, 3, crc);
}
int i, j, k;
int nch = glopts->num_channels_out;
int nb_scalar;
int f[5] = { 0, 4, 8, 16, 30 };
int first, last;
first = f[packed];
last = f[packed + 1];
if (last > glopts->sblimit)
last = glopts->sblimit;
nb_scalar = 0;
*crc = 0x0;
for (i = first; i < last; i++)
for (k = 0; k < nch; k++)
if (bit_alloc[k][i]) /* above jsbound, bit_alloc[0][i] == ba[1][i] */
switch (scfsi[k][i]) {
case 0:
for (j = 0; j < 3; j++) {
nb_scalar++;
dab_crc_update(scalar[k][j][i] >> 3, 3, crc);
}
break;
case 1:
case 3:
nb_scalar += 2;
dab_crc_update(scalar[k][0][i] >> 3, 3, crc);
dab_crc_update(scalar[k][2][i] >> 3, 3, crc);
break;
case 2:
nb_scalar++;
dab_crc_update(scalar[k][0][i] >> 3, 3, crc);
}
}
void dab_crc_update (unsigned int data, unsigned int length, unsigned int *crc)
void dab_crc_update(unsigned int data, unsigned int length, unsigned int *crc)
{
unsigned int masking, carry;
masking = 1 << length;
while ((masking >>= 1)) {
carry = *crc & 0x80;
*crc <<= 1;
if (!carry ^ !(data & masking))
*crc ^= CRC8_POLYNOMIAL;
}
*crc &= 0xff;
unsigned int masking, carry;
masking = 1 << length;
while ((masking >>= 1)) {
carry = *crc & 0x80;
*crc <<= 1;
if (!carry ^ !(data & masking))
*crc ^= CRC8_POLYNOMIAL;
}
*crc &= 0xff;
}
@ -108,39 +106,38 @@ void dab_crc_update (unsigned int data, unsigned int length, unsigned int *crc)
allocated some bits for the DAB stuff
*/
if (header.dab_extension) {
/* in 24 kHz we always have 4 bytes */
if (header.sampling_frequency == 1)
header.dab_extension = 4;
/* You must have one frame in memory if you are in DAB mode */
/* in conformity of the norme ETS 300 401 http://www.etsi.org */
/* see bitstream.c */
if (frameNum == 1) minimum = lg_frame + MINIMUM;
adb -= header.dab_extension * 8 + header.dab_length * 8 + 16;
}
if (header.dab_extension) {
/* in 24 kHz we always have 4 bytes */
if (header.sampling_frequency == 1)
header.dab_extension = 4;
/* You must have one frame in memory if you are in DAB mode */
/* in conformity of the norme ETS 300 401 http://www.etsi.org */
/* see bitstream.c */
if (frameNum == 1)
minimum = lg_frame + MINIMUM;
adb -= header.dab_extension * 8 + header.dab_length * 8 + 16;
}
/*
Just after we finishing padding up to the number of ADB
Put the extension stuff in (ancillary data, right at the end)
*/
if (header.dab_extension) {
/* Reserve some bytes for X-PAD in DAB mode */
putbits (mybs, 0, header.dab_length * 8);
for (i = header.dab_extension - 1; i >= 0; i--) {
CRC_calcDAB (&frame, bit_alloc, scfsi, scalar, &crc, i);
/* this crc is for the previous frame in DAB mode */
if (mybs->buf_byte_idx + lg_frame < mybs->buf_size)
mybs->buf[mybs->buf_byte_idx + lg_frame] = crc;
/* reserved 2 bytes for F-PAD in DAB mode */
putbits (mybs, crc, 8);
}
putbits (mybs, 0, 16);
}
if (header.dab_extension) {
/* Reserve some bytes for X-PAD in DAB mode */
putbits(mybs, 0, header.dab_length * 8);
for (i = header.dab_extension - 1; i >= 0; i--) {
CRC_calcDAB(&frame, bit_alloc, scfsi, scalar, &crc, i);
/* this crc is for the previous frame in DAB mode */
if (mybs->buf_byte_idx + lg_frame < mybs->buf_size)
mybs->buf[mybs->buf_byte_idx + lg_frame] = crc;
/* reserved 2 bytes for F-PAD in DAB mode */
putbits(mybs, crc, 8);
}
putbits(mybs, 0, 16);
}
#endif
// vim:ts=4:sw=4:nowrap:

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: dab.h,v 1.3 2008-02-01 19:44:32 richardash1981 Exp $
* $Id$
*
*/
@ -26,13 +26,12 @@
#ifndef _DAB_H_
#define _DAB_H_
void dab_crc_calc (twolame_options *glopts,
unsigned int bit_alloc[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT],
unsigned int scalar[2][3][SBLIMIT],
unsigned int *crc, int i);
void dab_crc_calc(twolame_options * glopts,
unsigned int bit_alloc[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT],
unsigned int scalar[2][3][SBLIMIT], unsigned int *crc, int i);
void dab_crc_update (unsigned int, unsigned int, unsigned int *);
void dab_crc_update(unsigned int, unsigned int, unsigned int *);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: encode.h,v 1.3 2008-02-01 19:44:32 richardash1981 Exp $
* $Id$
*
*/
@ -26,72 +26,65 @@
#ifndef _ENCODE_H_
#define _ENCODE_H_
int encode_init(twolame_options *glopts);
int encode_init(twolame_options * glopts);
void scalefactor_calc (FLOAT sb_sample[][3][SCALE_BLOCK][SBLIMIT],
unsigned int scalar[][3][SBLIMIT], int nch,
int sblimit);
void scalefactor_calc(FLOAT sb_sample[][3][SCALE_BLOCK][SBLIMIT],
unsigned int scalar[][3][SBLIMIT], int nch, int sblimit);
void combine_lr (FLOAT sb_sample[2][3][SCALE_BLOCK][SBLIMIT],
FLOAT joint_sample[3][SCALE_BLOCK][SBLIMIT], int sblimit);
void combine_lr(FLOAT sb_sample[2][3][SCALE_BLOCK][SBLIMIT],
FLOAT joint_sample[3][SCALE_BLOCK][SBLIMIT], int sblimit);
void find_sf_max (twolame_options *glopts,
unsigned int sf_index[2][3][SBLIMIT],
FLOAT sf_max[2][SBLIMIT]);
void find_sf_max(twolame_options * glopts,
unsigned int sf_index[2][3][SBLIMIT], FLOAT sf_max[2][SBLIMIT]);
void sf_transmission_pattern (twolame_options *glopts,
unsigned int sf_index[2][3][SBLIMIT],
unsigned int sf_selectinfo[2][SBLIMIT]);
void sf_transmission_pattern(twolame_options * glopts,
unsigned int sf_index[2][3][SBLIMIT],
unsigned int sf_selectinfo[2][SBLIMIT]);
void write_header (twolame_options *glopts, bit_stream * bs);
void write_header(twolame_options * glopts, bit_stream * bs);
void write_bit_alloc (twolame_options *glopts,
unsigned int bit_alloc[2][SBLIMIT],
bit_stream * bs);
void write_bit_alloc(twolame_options * glopts, unsigned int bit_alloc[2][SBLIMIT], bit_stream * bs);
void write_scalefactors (twolame_options *glopts,
unsigned int bit_alloc[2][SBLIMIT],
unsigned int sf_selectinfo[2][SBLIMIT],
unsigned int scalar[2][3][SBLIMIT],
bit_stream * bs);
void write_scalefactors(twolame_options * glopts,
unsigned int bit_alloc[2][SBLIMIT],
unsigned int sf_selectinfo[2][SBLIMIT],
unsigned int scalar[2][3][SBLIMIT], bit_stream * bs);
void subband_quantization (twolame_options *glopts,
unsigned int sf_index[2][3][SBLIMIT],
FLOAT sb_samples[2][3][SCALE_BLOCK][SBLIMIT],
unsigned int j_scale[3][SBLIMIT],
FLOAT j_samps[3][SCALE_BLOCK][SBLIMIT],
unsigned int bit_alloc[2][SBLIMIT],
unsigned int sbband[2][3][SCALE_BLOCK][SBLIMIT]);
void subband_quantization(twolame_options * glopts,
unsigned int sf_index[2][3][SBLIMIT],
FLOAT sb_samples[2][3][SCALE_BLOCK][SBLIMIT],
unsigned int j_scale[3][SBLIMIT],
FLOAT j_samps[3][SCALE_BLOCK][SBLIMIT],
unsigned int bit_alloc[2][SBLIMIT],
unsigned int sbband[2][3][SCALE_BLOCK][SBLIMIT]);
void write_samples (twolame_options *glopts,
unsigned int sbband[2][3][SCALE_BLOCK][SBLIMIT],
unsigned int bit_alloc[2][SBLIMIT], bit_stream * bs);
void write_samples(twolame_options * glopts,
unsigned int sbband[2][3][SCALE_BLOCK][SBLIMIT],
unsigned int bit_alloc[2][SBLIMIT], bit_stream * bs);
/*******************************************************
Bit Allocation Stuff
******************************************************/
int bits_for_nonoise (twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT], FLOAT min_mnr,
unsigned int bit_alloc[2][SBLIMIT]);
int bits_for_nonoise(twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT], FLOAT min_mnr,
unsigned int bit_alloc[2][SBLIMIT]);
int init_bit_allocation( twolame_options * glopts );
int init_bit_allocation(twolame_options * glopts);
void main_bit_allocation (twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT],
unsigned int bit_alloc[2][SBLIMIT], int *adb );
void main_bit_allocation(twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT],
unsigned int bit_alloc[2][SBLIMIT], int *adb);
int vbr_bit_allocation (twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT],
unsigned int bit_alloc[2][SBLIMIT], int *adb);
int vbr_bit_allocation(twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT],
unsigned int bit_alloc[2][SBLIMIT], int *adb);
int a_bit_allocation (twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT],
unsigned int bit_alloc[2][SBLIMIT], int *adb );
int a_bit_allocation(twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
unsigned int scfsi[2][SBLIMIT], unsigned int bit_alloc[2][SBLIMIT], int *adb);
#endif
// vim:ts=4:sw=4:nowrap:

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: energy.c,v 1.3 2008-02-01 19:44:32 richardash1981 Exp $
* $Id$
*
*/
@ -35,92 +35,89 @@
// Returns the desired number of ancillary bits to be
// reserved at the end of the frame
int get_required_energy_bits( twolame_options *glopts )
int get_required_energy_bits(twolame_options * glopts)
{
if (glopts->mode==TWOLAME_MONO) {
// only 2 bytes + zero at n-3 needed for energy level for mono channel
return 24;
if (glopts->mode == TWOLAME_MONO) {
// only 2 bytes + zero at n-3 needed for energy level for mono channel
return 24;
} else {
// 5 bytes for the stereo energy info
return 40;
}
} else {
// 5 bytes for the stereo energy info
return 40;
}
}
// Calculates the energy levels of current frame and
// inserts it into the end of the frame
void do_energy_levels(twolame_options *glopts, bit_stream *bs)
void do_energy_levels(twolame_options * glopts, bit_stream * bs)
{
/* Reference:
Using the BWF Energy Levels in AudioScience Bitstreams
http://www.audioscience.com/internet/download/notes/note0001_MPEG_energy.pdf
Specification of the Broadcast Wave Format: Supplement 1 - MPEG audio
http://www.ebu.ch/CMSimages/en/tec_doc_t3285_s1_tcm6-10545.pdf
http://www.sr.se/utveckling/tu/bwf/
The absolute peak of the PCM file for the left and right
channel in this frame are written into the last 5 bytes of the frame.
The last 5 bytes *must* be reserved for this to work correctly (otherwise
you'll be overwriting mpeg audio data)
*/
/* Reference: Using the BWF Energy Levels in AudioScience Bitstreams
http://www.audioscience.com/internet/download/notes/note0001_MPEG_energy.pdf
short int *leftpcm = glopts->buffer[0];
short int *rightpcm = glopts->buffer[1];
int i, leftMax, rightMax;
unsigned char rhibyte, rlobyte, lhibyte, llobyte;
Specification of the Broadcast Wave Format: Supplement 1 - MPEG audio
http://www.ebu.ch/CMSimages/en/tec_doc_t3285_s1_tcm6-10545.pdf
http://www.sr.se/utveckling/tu/bwf/
// Get the position (in butes) of the end of the mpeg audio frame
int frameEnd = buffer_sstell(bs)/8;
The absolute peak of the PCM file for the left and right channel in this frame are written
into the last 5 bytes of the frame.
// find the maximum in the left and right channels
leftMax = rightMax = -1;
for (i=0; i<TWOLAME_SAMPLES_PER_FRAME; i++) {
if (abs(leftpcm[i])>leftMax)
leftMax = abs(leftpcm[i]);
if (abs(rightpcm[i])>rightMax)
rightMax = abs(rightpcm[i]);
}
// fix any overflows
if (leftMax > 32767)
leftMax = 32767;
if (rightMax > 32767)
rightMax = 32767;
The last 5 bytes *must* be reserved for this to work correctly (otherwise you'll be
overwriting mpeg audio data) */
// convert max value to hi/lo bytes and write into buffer
lhibyte = leftMax/256;
llobyte = leftMax - 256*lhibyte;
short int *leftpcm = glopts->buffer[0];
short int *rightpcm = glopts->buffer[1];
int i, leftMax, rightMax;
unsigned char rhibyte, rlobyte, lhibyte, llobyte;
// Get the position (in butes) of the end of the mpeg audio frame
int frameEnd = buffer_sstell(bs) / 8;
// find the maximum in the left and right channels
leftMax = rightMax = -1;
for (i = 0; i < TWOLAME_SAMPLES_PER_FRAME; i++) {
if (abs(leftpcm[i]) > leftMax)
leftMax = abs(leftpcm[i]);
if (abs(rightpcm[i]) > rightMax)
rightMax = abs(rightpcm[i]);
}
// fix any overflows
if (leftMax > 32767)
leftMax = 32767;
if (rightMax > 32767)
rightMax = 32767;
// convert max value to hi/lo bytes and write into buffer
lhibyte = leftMax / 256;
llobyte = leftMax - 256 * lhibyte;
// Write the left channel into the last two bytes of the frame
bs->buf[frameEnd - 1] = llobyte;
bs->buf[frameEnd - 2] = lhibyte;
bs->buf[frameEnd - 3] = 0;
// Only write the right channel energy info
// if we're in stereo mode.
if (glopts->mode != TWOLAME_MONO) {
rhibyte = rightMax / 256;
rlobyte = rightMax - 256 * rhibyte;
bs->buf[frameEnd - 4] = rlobyte;
bs->buf[frameEnd - 5] = rhibyte;
}
// Write the left channel into the last two bytes of the frame
bs->buf[frameEnd-1] = llobyte;
bs->buf[frameEnd-2] = lhibyte;
bs->buf[frameEnd-3] = 0;
// Only write the right channel energy info
// if we're in stereo mode.
if (glopts->mode!=TWOLAME_MONO) {
rhibyte = rightMax/256;
rlobyte = rightMax - 256*rhibyte;
bs->buf[frameEnd-4] = rlobyte;
bs->buf[frameEnd-5] = rhibyte;
}
}
// vim:ts=4:sw=4:nowrap:

View File

@ -19,7 +19,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: energy.h,v 1.3 2008-02-01 19:44:32 richardash1981 Exp $
* $Id$
*
*/
@ -27,8 +27,8 @@
#ifndef _ENERGY_H_
#define _ENERGY_H_
int get_required_energy_bits( twolame_options *glopts );
void do_energy_levels(twolame_options *glopts, bit_stream *bs);
int get_required_energy_bits(twolame_options * glopts);
void do_energy_levels(twolame_options * glopts, bit_stream * bs);
#endif

View File

@ -18,98 +18,98 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: enwindow.h,v 1.3 2008-02-01 19:44:32 richardash1981 Exp $
* $Id$
*
*/
static const FLOAT enwindow[512] = { 0.000000000,
-0.000000477, -0.000000477, -0.000000477, -0.000000477, -0.000000477, -0.000000477,
-0.000000954, -0.000000954, -0.000000954, -0.000000954, -0.000001431, -0.000001431,
-0.000001907, -0.000001907, -0.000002384, -0.000002384, -0.000002861, -0.000003338,
-0.000003338, -0.000003815, -0.000004292, -0.000004768, -0.000005245, -0.000006199,
-0.000006676, -0.000007629, -0.000008106, -0.000009060, -0.000010014, -0.000011444,
-0.000012398, -0.000013828, -0.000014782, -0.000016689, -0.000018120, -0.000019550,
-0.000021458, -0.000023365, -0.000025272, -0.000027657, -0.000030041, -0.000032425,
-0.000034809, -0.000037670, -0.000040531, -0.000043392, -0.000046253, -0.000049591,
-0.000052929, -0.000055790, -0.000059605, -0.000062943, -0.000066280, -0.000070095,
-0.000073433, -0.000076771, -0.000080585, -0.000083923, -0.000087261, -0.000090599,
-0.000093460, -0.000096321, -0.000099182, 0.000101566, 0.000103951, 0.000105858,
0.000107288, 0.000108242, 0.000108719, 0.000108719, 0.000108242, 0.000106812,
0.000105381, 0.000102520, 0.000099182, 0.000095367, 0.000090122, 0.000084400,
0.000077724, 0.000069618, 0.000060558, 0.000050545, 0.000039577, 0.000027180,
0.000013828, -0.000000954, -0.000017166, -0.000034332, -0.000052929, -0.000072956,
-0.000093937, -0.000116348, -0.000140190, -0.000165462, -0.000191212, -0.000218868,
-0.000247478, -0.000277042, -0.000307560, -0.000339031, -0.000371456, -0.000404358,
-0.000438213, -0.000472546, -0.000507355, -0.000542164, -0.000576973, -0.000611782,
-0.000646591, -0.000680923, -0.000714302, -0.000747204, -0.000779152, -0.000809669,
-0.000838757, -0.000866413, -0.000891685, -0.000915051, -0.000935555, -0.000954151,
-0.000968933, -0.000980854, -0.000989437, -0.000994205, -0.000995159, -0.000991821,
-0.000983715, 0.000971317, 0.000953674, 0.000930786, 0.000902653, 0.000868797,
0.000829220, 0.000783920, 0.000731945, 0.000674248, 0.000610352, 0.000539303,
0.000462532, 0.000378609, 0.000288486, 0.000191689, 0.000088215, -0.000021458,
-0.000137329, -0.000259876, -0.000388145, -0.000522137, -0.000661850, -0.000806808,
-0.000956535, -0.001111031, -0.001269817, -0.001432419, -0.001597881, -0.001766682,
-0.001937389, -0.002110004, -0.002283096, -0.002457142, -0.002630711, -0.002803326,
-0.002974033, -0.003141880, -0.003306866, -0.003467083, -0.003622532, -0.003771782,
-0.003914356, -0.004048824, -0.004174709, -0.004290581, -0.004395962, -0.004489899,
-0.004570484, -0.004638195, -0.004691124, -0.004728317, -0.004748821, -0.004752159,
-0.004737377, -0.004703045, -0.004649162, -0.004573822, -0.004477024, -0.004357815,
-0.004215240, -0.004049301, -0.003858566, -0.003643036, -0.003401756, 0.003134727,
0.002841473, 0.002521515, 0.002174854, 0.001800537, 0.001399517, 0.000971317,
0.000515938, 0.000033379, -0.000475883, -0.001011848, -0.001573563, -0.002161503,
-0.002774239, -0.003411293, -0.004072189, -0.004756451, -0.005462170, -0.006189346,
-0.006937027, -0.007703304, -0.008487225, -0.009287834, -0.010103703, -0.010933399,
-0.011775017, -0.012627602, -0.013489246, -0.014358521, -0.015233517, -0.016112804,
-0.016994476, -0.017876148, -0.018756866, -0.019634247, -0.020506859, -0.021372318,
-0.022228718, -0.023074150, -0.023907185, -0.024725437, -0.025527000, -0.026310921,
-0.027073860, -0.027815342, -0.028532982, -0.029224873, -0.029890060, -0.030526638,
-0.031132698, -0.031706810, -0.032248020, -0.032754898, -0.033225536, -0.033659935,
-0.034055710, -0.034412861, -0.034730434, -0.035007000, -0.035242081, -0.035435200,
-0.035586357, -0.035694122, -0.035758972, 0.035780907, 0.035758972, 0.035694122,
0.035586357, 0.035435200, 0.035242081, 0.035007000, 0.034730434, 0.034412861,
0.034055710, 0.033659935, 0.033225536, 0.032754898, 0.032248020, 0.031706810,
0.031132698, 0.030526638, 0.029890060, 0.029224873, 0.028532982, 0.027815342,
0.027073860, 0.026310921, 0.025527000, 0.024725437, 0.023907185, 0.023074150,
0.022228718, 0.021372318, 0.020506859, 0.019634247, 0.018756866, 0.017876148,
0.016994476, 0.016112804, 0.015233517, 0.014358521, 0.013489246, 0.012627602,
0.011775017, 0.010933399, 0.010103703, 0.009287834, 0.008487225, 0.007703304,
0.006937027, 0.006189346, 0.005462170, 0.004756451, 0.004072189, 0.003411293,
0.002774239, 0.002161503, 0.001573563, 0.001011848, 0.000475883, -0.000033379,
-0.000515938, -0.000971317, -0.001399517, -0.001800537, -0.002174854, -0.002521515,
-0.002841473, 0.003134727, 0.003401756, 0.003643036, 0.003858566, 0.004049301,
0.004215240, 0.004357815, 0.004477024, 0.004573822, 0.004649162, 0.004703045,
0.004737377, 0.004752159, 0.004748821, 0.004728317, 0.004691124, 0.004638195,
0.004570484, 0.004489899, 0.004395962, 0.004290581, 0.004174709, 0.004048824,
0.003914356, 0.003771782, 0.003622532, 0.003467083, 0.003306866, 0.003141880,
0.002974033, 0.002803326, 0.002630711, 0.002457142, 0.002283096, 0.002110004,
0.001937389, 0.001766682, 0.001597881, 0.001432419, 0.001269817, 0.001111031,
0.000956535, 0.000806808, 0.000661850, 0.000522137, 0.000388145, 0.000259876,
0.000137329, 0.000021458, -0.000088215, -0.000191689, -0.000288486, -0.000378609,
-0.000462532, -0.000539303, -0.000610352, -0.000674248, -0.000731945, -0.000783920,
-0.000829220, -0.000868797, -0.000902653, -0.000930786, -0.000953674, 0.000971317,
0.000983715, 0.000991821, 0.000995159, 0.000994205, 0.000989437, 0.000980854,
0.000968933, 0.000954151, 0.000935555, 0.000915051, 0.000891685, 0.000866413,
0.000838757, 0.000809669, 0.000779152, 0.000747204, 0.000714302, 0.000680923,
0.000646591, 0.000611782, 0.000576973, 0.000542164, 0.000507355, 0.000472546,
0.000438213, 0.000404358, 0.000371456, 0.000339031, 0.000307560, 0.000277042,
0.000247478, 0.000218868, 0.000191212, 0.000165462, 0.000140190, 0.000116348,
0.000093937, 0.000072956, 0.000052929, 0.000034332, 0.000017166, 0.000000954,
-0.000013828, -0.000027180, -0.000039577, -0.000050545, -0.000060558, -0.000069618,
-0.000077724, -0.000084400, -0.000090122, -0.000095367, -0.000099182, -0.000102520,
-0.000105381, -0.000106812, -0.000108242, -0.000108719, -0.000108719, -0.000108242,
-0.000107288, -0.000105858, -0.000103951, 0.000101566, 0.000099182, 0.000096321,
0.000093460, 0.000090599, 0.000087261, 0.000083923, 0.000080585, 0.000076771,
0.000073433, 0.000070095, 0.000066280, 0.000062943, 0.000059605, 0.000055790,
0.000052929, 0.000049591, 0.000046253, 0.000043392, 0.000040531, 0.000037670,
0.000034809, 0.000032425, 0.000030041, 0.000027657, 0.000025272, 0.000023365,
0.000021458, 0.000019550, 0.000018120, 0.000016689, 0.000014782, 0.000013828,
0.000012398, 0.000011444, 0.000010014, 0.000009060, 0.000008106, 0.000007629,
0.000006676, 0.000006199, 0.000005245, 0.000004768, 0.000004292, 0.000003815,
0.000003338, 0.000003338, 0.000002861, 0.000002384, 0.000002384, 0.000001907,
0.000001907, 0.000001431, 0.000001431, 0.000000954, 0.000000954, 0.000000954,
0.000000954, 0.000000477, 0.000000477, 0.000000477, 0.000000477, 0.000000477,
0.000000477
-0.000000477, -0.000000477, -0.000000477, -0.000000477, -0.000000477, -0.000000477,
-0.000000954, -0.000000954, -0.000000954, -0.000000954, -0.000001431, -0.000001431,
-0.000001907, -0.000001907, -0.000002384, -0.000002384, -0.000002861, -0.000003338,
-0.000003338, -0.000003815, -0.000004292, -0.000004768, -0.000005245, -0.000006199,
-0.000006676, -0.000007629, -0.000008106, -0.000009060, -0.000010014, -0.000011444,
-0.000012398, -0.000013828, -0.000014782, -0.000016689, -0.000018120, -0.000019550,
-0.000021458, -0.000023365, -0.000025272, -0.000027657, -0.000030041, -0.000032425,
-0.000034809, -0.000037670, -0.000040531, -0.000043392, -0.000046253, -0.000049591,
-0.000052929, -0.000055790, -0.000059605, -0.000062943, -0.000066280, -0.000070095,
-0.000073433, -0.000076771, -0.000080585, -0.000083923, -0.000087261, -0.000090599,
-0.000093460, -0.000096321, -0.000099182, 0.000101566, 0.000103951, 0.000105858,
0.000107288, 0.000108242, 0.000108719, 0.000108719, 0.000108242, 0.000106812,
0.000105381, 0.000102520, 0.000099182, 0.000095367, 0.000090122, 0.000084400,
0.000077724, 0.000069618, 0.000060558, 0.000050545, 0.000039577, 0.000027180,
0.000013828, -0.000000954, -0.000017166, -0.000034332, -0.000052929, -0.000072956,
-0.000093937, -0.000116348, -0.000140190, -0.000165462, -0.000191212, -0.000218868,
-0.000247478, -0.000277042, -0.000307560, -0.000339031, -0.000371456, -0.000404358,
-0.000438213, -0.000472546, -0.000507355, -0.000542164, -0.000576973, -0.000611782,
-0.000646591, -0.000680923, -0.000714302, -0.000747204, -0.000779152, -0.000809669,
-0.000838757, -0.000866413, -0.000891685, -0.000915051, -0.000935555, -0.000954151,
-0.000968933, -0.000980854, -0.000989437, -0.000994205, -0.000995159, -0.000991821,
-0.000983715, 0.000971317, 0.000953674, 0.000930786, 0.000902653, 0.000868797,
0.000829220, 0.000783920, 0.000731945, 0.000674248, 0.000610352, 0.000539303,
0.000462532, 0.000378609, 0.000288486, 0.000191689, 0.000088215, -0.000021458,
-0.000137329, -0.000259876, -0.000388145, -0.000522137, -0.000661850, -0.000806808,
-0.000956535, -0.001111031, -0.001269817, -0.001432419, -0.001597881, -0.001766682,
-0.001937389, -0.002110004, -0.002283096, -0.002457142, -0.002630711, -0.002803326,
-0.002974033, -0.003141880, -0.003306866, -0.003467083, -0.003622532, -0.003771782,
-0.003914356, -0.004048824, -0.004174709, -0.004290581, -0.004395962, -0.004489899,
-0.004570484, -0.004638195, -0.004691124, -0.004728317, -0.004748821, -0.004752159,
-0.004737377, -0.004703045, -0.004649162, -0.004573822, -0.004477024, -0.004357815,
-0.004215240, -0.004049301, -0.003858566, -0.003643036, -0.003401756, 0.003134727,
0.002841473, 0.002521515, 0.002174854, 0.001800537, 0.001399517, 0.000971317,
0.000515938, 0.000033379, -0.000475883, -0.001011848, -0.001573563, -0.002161503,
-0.002774239, -0.003411293, -0.004072189, -0.004756451, -0.005462170, -0.006189346,
-0.006937027, -0.007703304, -0.008487225, -0.009287834, -0.010103703, -0.010933399,
-0.011775017, -0.012627602, -0.013489246, -0.014358521, -0.015233517, -0.016112804,
-0.016994476, -0.017876148, -0.018756866, -0.019634247, -0.020506859, -0.021372318,
-0.022228718, -0.023074150, -0.023907185, -0.024725437, -0.025527000, -0.026310921,
-0.027073860, -0.027815342, -0.028532982, -0.029224873, -0.029890060, -0.030526638,
-0.031132698, -0.031706810, -0.032248020, -0.032754898, -0.033225536, -0.033659935,
-0.034055710, -0.034412861, -0.034730434, -0.035007000, -0.035242081, -0.035435200,
-0.035586357, -0.035694122, -0.035758972, 0.035780907, 0.035758972, 0.035694122,
0.035586357, 0.035435200, 0.035242081, 0.035007000, 0.034730434, 0.034412861,
0.034055710, 0.033659935, 0.033225536, 0.032754898, 0.032248020, 0.031706810,
0.031132698, 0.030526638, 0.029890060, 0.029224873, 0.028532982, 0.027815342,
0.027073860, 0.026310921, 0.025527000, 0.024725437, 0.023907185, 0.023074150,
0.022228718, 0.021372318, 0.020506859, 0.019634247, 0.018756866, 0.017876148,
0.016994476, 0.016112804, 0.015233517, 0.014358521, 0.013489246, 0.012627602,
0.011775017, 0.010933399, 0.010103703, 0.009287834, 0.008487225, 0.007703304,
0.006937027, 0.006189346, 0.005462170, 0.004756451, 0.004072189, 0.003411293,
0.002774239, 0.002161503, 0.001573563, 0.001011848, 0.000475883, -0.000033379,
-0.000515938, -0.000971317, -0.001399517, -0.001800537, -0.002174854, -0.002521515,
-0.002841473, 0.003134727, 0.003401756, 0.003643036, 0.003858566, 0.004049301,
0.004215240, 0.004357815, 0.004477024, 0.004573822, 0.004649162, 0.004703045,
0.004737377, 0.004752159, 0.004748821, 0.004728317, 0.004691124, 0.004638195,
0.004570484, 0.004489899, 0.004395962, 0.004290581, 0.004174709, 0.004048824,
0.003914356, 0.003771782, 0.003622532, 0.003467083, 0.003306866, 0.003141880,
0.002974033, 0.002803326, 0.002630711, 0.002457142, 0.002283096, 0.002110004,
0.001937389, 0.001766682, 0.001597881, 0.001432419, 0.001269817, 0.001111031,
0.000956535, 0.000806808, 0.000661850, 0.000522137, 0.000388145, 0.000259876,
0.000137329, 0.000021458, -0.000088215, -0.000191689, -0.000288486, -0.000378609,
-0.000462532, -0.000539303, -0.000610352, -0.000674248, -0.000731945, -0.000783920,
-0.000829220, -0.000868797, -0.000902653, -0.000930786, -0.000953674, 0.000971317,
0.000983715, 0.000991821, 0.000995159, 0.000994205, 0.000989437, 0.000980854,
0.000968933, 0.000954151, 0.000935555, 0.000915051, 0.000891685, 0.000866413,
0.000838757, 0.000809669, 0.000779152, 0.000747204, 0.000714302, 0.000680923,
0.000646591, 0.000611782, 0.000576973, 0.000542164, 0.000507355, 0.000472546,
0.000438213, 0.000404358, 0.000371456, 0.000339031, 0.000307560, 0.000277042,
0.000247478, 0.000218868, 0.000191212, 0.000165462, 0.000140190, 0.000116348,
0.000093937, 0.000072956, 0.000052929, 0.000034332, 0.000017166, 0.000000954,
-0.000013828, -0.000027180, -0.000039577, -0.000050545, -0.000060558, -0.000069618,
-0.000077724, -0.000084400, -0.000090122, -0.000095367, -0.000099182, -0.000102520,
-0.000105381, -0.000106812, -0.000108242, -0.000108719, -0.000108719, -0.000108242,
-0.000107288, -0.000105858, -0.000103951, 0.000101566, 0.000099182, 0.000096321,
0.000093460, 0.000090599, 0.000087261, 0.000083923, 0.000080585, 0.000076771,
0.000073433, 0.000070095, 0.000066280, 0.000062943, 0.000059605, 0.000055790,
0.000052929, 0.000049591, 0.000046253, 0.000043392, 0.000040531, 0.000037670,
0.000034809, 0.000032425, 0.000030041, 0.000027657, 0.000025272, 0.000023365,
0.000021458, 0.000019550, 0.000018120, 0.000016689, 0.000014782, 0.000013828,
0.000012398, 0.000011444, 0.000010014, 0.000009060, 0.000008106, 0.000007629,
0.000006676, 0.000006199, 0.000005245, 0.000004768, 0.000004292, 0.000003815,
0.000003338, 0.000003338, 0.000002861, 0.000002384, 0.000002384, 0.000001907,
0.000001907, 0.000001431, 0.000001431, 0.000000954, 0.000000954, 0.000000954,
0.000000954, 0.000000477, 0.000000477, 0.000000477, 0.000000477, 0.000000477,
0.000000477
};

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: fft.h,v 1.3 2008-02-01 19:44:33 richardash1981 Exp $
* $Id$
*
*/
@ -28,8 +28,8 @@
//void fft (FLOAT[BLKSIZE], FLOAT[BLKSIZE], FLOAT[BLKSIZE], FLOAT[BLKSIZE], int);
void psycho_2_fft (FLOAT * x_real, FLOAT * energy, FLOAT * phi);
void psycho_1_fft (FLOAT * x_real, FLOAT * energy, int N);
void psycho_2_fft(FLOAT * x_real, FLOAT * energy, FLOAT * phi);
void psycho_1_fft(FLOAT * x_real, FLOAT * energy, int N);
#endif

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: get_set.c,v 1.3 2008-02-01 19:44:33 richardash1981 Exp $
* $Id$
*
*/
@ -39,377 +39,376 @@
/*********************************************/
int twolame_set_mode (twolame_options *glopts, TWOLAME_MPEG_mode mode)
int twolame_set_mode(twolame_options * glopts, TWOLAME_MPEG_mode mode)
{
if (mode<TWOLAME_AUTO_MODE || mode>TWOLAME_MONO)
{
fprintf(stderr,"invalid mode %i\n",mode);
return(-1);
}
glopts->mode = mode;
return(0);
if (mode < TWOLAME_AUTO_MODE || mode > TWOLAME_MONO) {
fprintf(stderr, "invalid mode %i\n", mode);
return (-1);
}
glopts->mode = mode;
return (0);
}
TWOLAME_MPEG_mode twolame_get_mode (twolame_options *glopts)
TWOLAME_MPEG_mode twolame_get_mode(twolame_options * glopts)
{
return(glopts->mode);
return (glopts->mode);
}
const char *twolame_get_mode_name(twolame_options *glopts)
const char *twolame_get_mode_name(twolame_options * glopts)
{
static const char *mode_name[6] = { "Auto", "Stereo", "J-Stereo", "Dual-Channel", "Mono", "Illegal Mode"};
int mode = glopts->mode;
if (mode>=TWOLAME_AUTO_MODE && mode<=TWOLAME_MONO)
return (mode_name[mode+1]);
else
return (mode_name[5]);
static const char *mode_name[6] =
{ "Auto", "Stereo", "J-Stereo", "Dual-Channel", "Mono", "Illegal Mode" };
int mode = glopts->mode;
if (mode >= TWOLAME_AUTO_MODE && mode <= TWOLAME_MONO)
return (mode_name[mode + 1]);
else
return (mode_name[5]);
}
int twolame_set_psymodel (twolame_options *glopts, int psymodel)
int twolame_set_psymodel(twolame_options * glopts, int psymodel)
{
glopts->psymodel = psymodel;
return(0);
glopts->psymodel = psymodel;
return (0);
}
int twolame_get_psymodel (twolame_options *glopts)
int twolame_get_psymodel(twolame_options * glopts)
{
return(glopts->psymodel);
return (glopts->psymodel);
}
/* number of channels on the input stream */
int twolame_set_num_channels(twolame_options* glopts, int num_channels)
int twolame_set_num_channels(twolame_options * glopts, int num_channels)
{
glopts->num_channels_in = num_channels;
return 0;
glopts->num_channels_in = num_channels;
return 0;
}
int twolame_get_num_channels(twolame_options* glopts)
int twolame_get_num_channels(twolame_options * glopts)
{
return(glopts->num_channels_in);
return (glopts->num_channels_in);
}
int twolame_set_scale(twolame_options* glopts, float scale)
int twolame_set_scale(twolame_options * glopts, float scale)
{
if (scale<0)
{
fprintf(stderr,"invalid scaling amount %f\n",scale);
return(-1);
}
glopts->scale = scale;
return 0;
if (scale < 0) {
fprintf(stderr, "invalid scaling amount %f\n", scale);
return (-1);
}
glopts->scale = scale;
return 0;
}
float twolame_get_scale(twolame_options* glopts)
float twolame_get_scale(twolame_options * glopts)
{
return(glopts->scale);
return (glopts->scale);
}
int twolame_set_scale_left(twolame_options* glopts, float scale)
int twolame_set_scale_left(twolame_options * glopts, float scale)
{
if (scale<0)
{
fprintf(stderr,"invalid scaling amount %f\n",scale);
return(-1);
}
glopts->scale_left = scale;
return 0;
if (scale < 0) {
fprintf(stderr, "invalid scaling amount %f\n", scale);
return (-1);
}
glopts->scale_left = scale;
return 0;
}
float twolame_get_scale_left(twolame_options* glopts)
float twolame_get_scale_left(twolame_options * glopts)
{
return(glopts->scale_left);
return (glopts->scale_left);
}
int twolame_set_scale_right(twolame_options* glopts, float scale)
int twolame_set_scale_right(twolame_options * glopts, float scale)
{
if (scale<0)
{
fprintf(stderr,"invalid scaling amount %f\n",scale);
return(-1);
}
glopts->scale_right = scale;
return 0;
if (scale < 0) {
fprintf(stderr, "invalid scaling amount %f\n", scale);
return (-1);
}
glopts->scale_right = scale;
return 0;
}
float twolame_get_scale_right(twolame_options* glopts)
float twolame_get_scale_right(twolame_options * glopts)
{
return(glopts->scale_right);
return (glopts->scale_right);
}
int twolame_set_in_samplerate (twolame_options *glopts, int samplerate)
{
glopts->samplerate_in = samplerate;
return(0);
}
int twolame_get_in_samplerate (twolame_options *glopts)
int twolame_set_in_samplerate(twolame_options * glopts, int samplerate)
{
return(glopts->samplerate_in);
glopts->samplerate_in = samplerate;
return (0);
}
int twolame_set_out_samplerate (twolame_options *glopts, int samplerate)
{
glopts->samplerate_out = samplerate;
return(0);
}
int twolame_get_out_samplerate (twolame_options *glopts)
int twolame_get_in_samplerate(twolame_options * glopts)
{
return(glopts->samplerate_out);
return (glopts->samplerate_in);
}
int twolame_set_brate (twolame_options *glopts, int bitrate)
int twolame_set_out_samplerate(twolame_options * glopts, int samplerate)
{
glopts->bitrate = bitrate;
return(0);
glopts->samplerate_out = samplerate;
return (0);
}
int twolame_get_brate (twolame_options *glopts)
int twolame_get_out_samplerate(twolame_options * glopts)
{
return(glopts->bitrate);
return (glopts->samplerate_out);
}
int twolame_set_brate(twolame_options * glopts, int bitrate)
{
glopts->bitrate = bitrate;
return (0);
}
int twolame_get_brate(twolame_options * glopts)
{
return (glopts->bitrate);
}
/* Because the LAME API isn't always the best way ;) */
int twolame_set_bitrate (twolame_options *glopts, int bitrate)
int twolame_set_bitrate(twolame_options * glopts, int bitrate)
{
glopts->bitrate = bitrate;
return(0);
glopts->bitrate = bitrate;
return (0);
}
int twolame_get_bitrate (twolame_options *glopts)
int twolame_get_bitrate(twolame_options * glopts)
{
return(glopts->bitrate);
return (glopts->bitrate);
}
int twolame_set_emphasis (twolame_options *glopts, TWOLAME_Emphasis emphasis)
int twolame_set_emphasis(twolame_options * glopts, TWOLAME_Emphasis emphasis)
{
if (emphasis!=TWOLAME_EMPHASIS_N &&
emphasis!=TWOLAME_EMPHASIS_5 &&
emphasis!=TWOLAME_EMPHASIS_C) return(-1);
glopts->emphasis = emphasis;
return(0);
if (emphasis != TWOLAME_EMPHASIS_N &&
emphasis != TWOLAME_EMPHASIS_5 && emphasis != TWOLAME_EMPHASIS_C)
return (-1);
glopts->emphasis = emphasis;
return (0);
}
TWOLAME_Emphasis twolame_get_emphasis (twolame_options *glopts)
TWOLAME_Emphasis twolame_get_emphasis(twolame_options * glopts)
{
return(glopts->emphasis);
return (glopts->emphasis);
}
int twolame_set_error_protection (twolame_options *glopts, int error_protection)
int twolame_set_error_protection(twolame_options * glopts, int error_protection)
{
if (error_protection)
glopts->error_protection = TRUE;
else
error_protection = FALSE;
return(0);
if (error_protection)
glopts->error_protection = TRUE;
else
error_protection = FALSE;
return (0);
}
int twolame_get_error_protection (twolame_options *glopts)
int twolame_get_error_protection(twolame_options * glopts)
{
return(glopts->error_protection);
return (glopts->error_protection);
}
int twolame_set_copyright (twolame_options *glopts, int copyright)
int twolame_set_copyright(twolame_options * glopts, int copyright)
{
if (copyright)
glopts->copyright = TRUE;
else
glopts->copyright = FALSE;
return(0);
}
int twolame_get_copyright (twolame_options *glopts)
{
return(glopts->copyright);
if (copyright)
glopts->copyright = TRUE;
else
glopts->copyright = FALSE;
return (0);
}
int twolame_set_original (twolame_options *glopts, int original)
int twolame_get_copyright(twolame_options * glopts)
{
if (original)
glopts->original = TRUE;
else
glopts->original = FALSE;
return(0);
}
int twolame_get_original (twolame_options *glopts)
{
return(glopts->original);
return (glopts->copyright);
}
int twolame_set_padding (twolame_options *glopts, TWOLAME_Padding padding)
int twolame_set_original(twolame_options * glopts, int original)
{
if (padding)
glopts->padding = TRUE;
else
glopts->padding = FALSE;
return(0);
if (original)
glopts->original = TRUE;
else
glopts->original = FALSE;
return (0);
}
TWOLAME_Padding twolame_get_padding (twolame_options *glopts)
int twolame_get_original(twolame_options * glopts)
{
return(glopts->padding);
return (glopts->original);
}
int twolame_set_VBR (twolame_options *glopts, int vbr)
int twolame_set_padding(twolame_options * glopts, TWOLAME_Padding padding)
{
if (vbr)
glopts->vbr = TRUE;
else
glopts->vbr = FALSE;
return(0);
if (padding)
glopts->padding = TRUE;
else
glopts->padding = FALSE;
return (0);
}
int twolame_get_VBR (twolame_options *glopts)
TWOLAME_Padding twolame_get_padding(twolame_options * glopts)
{
return(glopts->vbr);
return (glopts->padding);
}
int twolame_set_VBR_level (twolame_options *glopts, float level)
int twolame_set_VBR(twolame_options * glopts, int vbr)
{
// Limit is -50 to 50, but useful range is -10 to 10
if (fabs(level)>50.0)
return(-1);
else
glopts->vbrlevel = level;
return(0);
if (vbr)
glopts->vbr = TRUE;
else
glopts->vbr = FALSE;
return (0);
}
float twolame_get_VBR_level (twolame_options *glopts)
int twolame_get_VBR(twolame_options * glopts)
{
return(glopts->vbrlevel);
return (glopts->vbr);
}
int twolame_set_VBR_level(twolame_options * glopts, float level)
{
// Limit is -50 to 50, but useful range is -10 to 10
if (fabs(level) > 50.0)
return (-1);
else
glopts->vbrlevel = level;
return (0);
}
float twolame_get_VBR_level(twolame_options * glopts)
{
return (glopts->vbrlevel);
}
// Deprecated:
int twolame_set_VBR_q (twolame_options *glopts, float level)
int twolame_set_VBR_q(twolame_options * glopts, float level)
{
// Limit is -50 to 50, but useful range is -10 to 10
if (fabs(level)>50.0)
return(-1);
else
glopts->vbrlevel = level;
return(0);
// Limit is -50 to 50, but useful range is -10 to 10
if (fabs(level) > 50.0)
return (-1);
else
glopts->vbrlevel = level;
return (0);
}
// Deprecated:
float twolame_get_VBR_q (twolame_options *glopts)
float twolame_get_VBR_q(twolame_options * glopts)
{
return(glopts->vbrlevel);
return (glopts->vbrlevel);
}
int twolame_set_ATH_level (twolame_options *glopts, float level)
int twolame_set_ATH_level(twolame_options * glopts, float level)
{
glopts->athlevel = level;
return(0);
glopts->athlevel = level;
return (0);
}
float twolame_get_ATH_level (twolame_options *glopts)
float twolame_get_ATH_level(twolame_options * glopts)
{
return(glopts->athlevel);
return (glopts->athlevel);
}
int twolame_set_quick_mode (twolame_options *glopts, int quickmode)
int twolame_set_quick_mode(twolame_options * glopts, int quickmode)
{
if (quickmode)
glopts->quickmode = TRUE;
else
glopts->quickmode = FALSE;
return(0);
if (quickmode)
glopts->quickmode = TRUE;
else
glopts->quickmode = FALSE;
return (0);
}
int twolame_get_quick_mode (twolame_options *glopts)
int twolame_get_quick_mode(twolame_options * glopts)
{
return(glopts->quickmode);
return (glopts->quickmode);
}
int twolame_set_quick_count (twolame_options *glopts, int quickcount )
int twolame_set_quick_count(twolame_options * glopts, int quickcount)
{
glopts->quickcount = quickcount;
return(0);
glopts->quickcount = quickcount;
return (0);
}
int twolame_get_quick_count (twolame_options *glopts)
int twolame_get_quick_count(twolame_options * glopts)
{
return(glopts->quickcount);
return (glopts->quickcount);
}
int twolame_set_verbosity (twolame_options *glopts, int verbosity)
int twolame_set_verbosity(twolame_options * glopts, int verbosity)
{
if (verbosity<0 || verbosity>10)
{
fprintf(stderr,"invalid verbosity level %i\n",verbosity);
return(-1);
}
glopts->verbosity = verbosity;
return(0);
if (verbosity < 0 || verbosity > 10) {
fprintf(stderr, "invalid verbosity level %i\n", verbosity);
return (-1);
}
glopts->verbosity = verbosity;
return (0);
}
int twolame_get_verbosity (twolame_options *glopts)
int twolame_get_verbosity(twolame_options * glopts)
{
return(glopts->verbosity);
return (glopts->verbosity);
}
int twolame_set_VBR_max_bitrate_kbps (twolame_options *glopts, int bitrate)
int twolame_set_VBR_max_bitrate_kbps(twolame_options * glopts, int bitrate)
{
glopts->vbr_max_bitrate = bitrate;
return(0);
glopts->vbr_max_bitrate = bitrate;
return (0);
}
int twolame_get_VBR_max_bitrate_kbps (twolame_options *glopts)
int twolame_get_VBR_max_bitrate_kbps(twolame_options * glopts)
{
return(glopts->vbr_max_bitrate);
return (glopts->vbr_max_bitrate);
}
int twolame_set_num_ancillary_bits (twolame_options *glopts, int num)
int twolame_set_num_ancillary_bits(twolame_options * glopts, int num)
{
if (num<0)
return(-1);
glopts->num_ancillary_bits = num;
return(0);
}
int twolame_get_num_ancillary_bits (twolame_options *glopts)
{
return(glopts->num_ancillary_bits);
if (num < 0)
return (-1);
glopts->num_ancillary_bits = num;
return (0);
}
int twolame_set_energy_levels (twolame_options *glopts, int energylevels )
int twolame_get_num_ancillary_bits(twolame_options * glopts)
{
if (energylevels) {
glopts->do_energy_levels = TRUE;
} else {
glopts->do_energy_levels = FALSE;
}
return(0);
return (glopts->num_ancillary_bits);
}
int twolame_set_energy_levels(twolame_options * glopts, int energylevels)
{
if (energylevels) {
glopts->do_energy_levels = TRUE;
} else {
glopts->do_energy_levels = FALSE;
}
return (0);
}
int twolame_get_energy_levels (twolame_options *glopts)
int twolame_get_energy_levels(twolame_options * glopts)
{
return(glopts->do_energy_levels);
return (glopts->do_energy_levels);
}
int twolame_set_version (twolame_options *glopts, TWOLAME_MPEG_version version)
int twolame_set_version(twolame_options * glopts, TWOLAME_MPEG_version version)
{
if (version!=0 && version!=1)
return(-1);
glopts->version = version;
return(0);
if (version != 0 && version != 1)
return (-1);
glopts->version = version;
return (0);
}
TWOLAME_MPEG_version twolame_get_version (twolame_options *glopts)
TWOLAME_MPEG_version twolame_get_version(twolame_options * glopts)
{
return(glopts->version);
return (glopts->version);
}
const char *twolame_get_version_name(twolame_options *glopts)
const char *twolame_get_version_name(twolame_options * glopts)
{
return twolame_mpeg_version_name( glopts->version );
return twolame_mpeg_version_name(glopts->version);
}
@ -419,47 +418,48 @@ const char *twolame_get_version_name(twolame_options *glopts)
/* WARNING: DAB support is currently broken */
int twolame_set_DAB (twolame_options *glopts, int dab)
int twolame_set_DAB(twolame_options * glopts, int dab)
{
fprintf(stderr,"Warning: DAB support is currently broken in this version of TwoLAME.\n");
if (dab)
glopts->do_dab = TRUE;
else
glopts->do_dab = FALSE;
return(0);
fprintf(stderr, "Warning: DAB support is currently broken in this version of TwoLAME.\n");
if (dab)
glopts->do_dab = TRUE;
else
glopts->do_dab = FALSE;
return (0);
}
int twolame_get_DAB (twolame_options *glopts)
int twolame_get_DAB(twolame_options * glopts)
{
return(glopts->do_dab);
return (glopts->do_dab);
}
int twolame_set_DAB_xpad_length (twolame_options *glopts, int length)
int twolame_set_DAB_xpad_length(twolame_options * glopts, int length)
{
if (length<0) return(-1);
glopts->dab_xpad_len = length;
return(0);
if (length < 0)
return (-1);
glopts->dab_xpad_len = length;
return (0);
}
int twolame_get_DAB_xpad_length (twolame_options *glopts)
int twolame_get_DAB_xpad_length(twolame_options * glopts)
{
return(glopts->dab_xpad_len);
return (glopts->dab_xpad_len);
}
int twolame_set_DAB_crc_length (twolame_options *glopts, int length)
int twolame_set_DAB_crc_length(twolame_options * glopts, int length)
{
if (length<0)
return(-1);
else
glopts->dab_crc_len = length;
return(0);
if (length < 0)
return (-1);
else
glopts->dab_crc_len = length;
return (0);
}
int twolame_get_DAB_crc_length (twolame_options *glopts)
int twolame_get_DAB_crc_length(twolame_options * glopts)
{
return(glopts->dab_crc_len);
return (glopts->dab_crc_len);
}

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: mem.c,v 1.3 2008-02-01 19:44:33 richardash1981 Exp $
* $Id$
*
*/
@ -33,18 +33,18 @@
*
*******************************************************************************/
void *twolame_malloc (size_t size, int line, char *file)
void *twolame_malloc(size_t size, int line, char *file)
{
void *ptr = (void *)malloc(size);
if (ptr != NULL) {
memset (ptr, 0, size);
} else {
fprintf (stderr, "Unable to allocate %d bytes at line %d of %s\n", (int)size, line, file);
return NULL;
}
return (ptr);
void *ptr = (void *) malloc(size);
if (ptr != NULL) {
memset(ptr, 0, size);
} else {
fprintf(stderr, "Unable to allocate %d bytes at line %d of %s\n", (int) size, line, file);
return NULL;
}
return (ptr);
}

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: mem.h,v 1.3 2008-02-01 19:44:33 richardash1981 Exp $
* $Id$
*
*/
@ -46,7 +46,7 @@
#define TWOLAME_FREE(ptr) if(ptr!=NULL) { free(ptr); ptr=NULL; }
// Functions
void *twolame_malloc (size_t size, int line, char *file);
void *twolame_malloc(size_t size, int line, char *file);
#endif

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: psycho_0.c,v 1.3 2008-02-01 19:44:33 richardash1981 Exp $
* $Id$
*
*/
@ -52,81 +52,80 @@
logs, whatever. Fiddle with the numbers until we get a good SMR output */
static psycho_0_mem *psycho_0_init (twolame_options *glopts, int sfreq)
static psycho_0_mem *psycho_0_init(twolame_options * glopts, int sfreq)
{
FLOAT freqperline = (FLOAT)sfreq/1024.0;
psycho_0_mem *mem = (psycho_0_mem *)TWOLAME_MALLOC(sizeof(psycho_0_mem));
int sb, i;
for (sb=0;sb<SBLIMIT;sb++) {
mem->ath_min[sb] = 1000; /* set it huge */
}
FLOAT freqperline = (FLOAT) sfreq / 1024.0;
psycho_0_mem *mem = (psycho_0_mem *) TWOLAME_MALLOC(sizeof(psycho_0_mem));
int sb, i;
/* Find the minimum ATH in each subband */
for (i=0;i<512;i++) {
FLOAT thisfreq = i * freqperline;
FLOAT ath_val = ath_db(thisfreq, 0);
if (ath_val < mem->ath_min[i>>4])
mem->ath_min[i>>4] = ath_val;
}
for (sb = 0; sb < SBLIMIT; sb++) {
mem->ath_min[sb] = 1000; /* set it huge */
}
return mem;
/* Find the minimum ATH in each subband */
for (i = 0; i < 512; i++) {
FLOAT thisfreq = i * freqperline;
FLOAT ath_val = ath_db(thisfreq, 0);
if (ath_val < mem->ath_min[i >> 4])
mem->ath_min[i >> 4] = ath_val;
}
return mem;
}
void psycho_0(twolame_options *glopts, FLOAT SMR[2][SBLIMIT], unsigned int scalar[2][3][SBLIMIT])
void psycho_0(twolame_options * glopts, FLOAT SMR[2][SBLIMIT], unsigned int scalar[2][3][SBLIMIT])
{
psycho_0_mem *mem;
int nch = glopts->num_channels_out;
int sfreq = glopts->samplerate_out;
int ch, sb, gr;
unsigned int minscaleindex[2][SBLIMIT]; /* Smaller scale indexes mean bigger scalefactors */
psycho_0_mem *mem;
int nch = glopts->num_channels_out;
int sfreq = glopts->samplerate_out;
int ch, sb, gr;
unsigned int minscaleindex[2][SBLIMIT]; /* Smaller scale indexes mean bigger scalefactors */
if (!glopts->p0mem) {
glopts->p0mem = psycho_0_init(glopts, sfreq);
}
mem = glopts->p0mem;
if (!glopts->p0mem) {
glopts->p0mem = psycho_0_init(glopts, sfreq);
}
mem = glopts->p0mem;
/* call functions for critical boundaries, freq. */
if (!glopts->p0mem) { /* bands, bark values, and mapping */
} else {
mem = glopts->p0mem;
}
/* call functions for critical boundaries, freq. */
if (!glopts->p0mem) { /* bands, bark values, and mapping */
} else {
mem = glopts->p0mem;
}
/* Find the minimum scalefactor index for each ch/sb */
for (ch=0;ch<nch;ch++)
for (sb=0;sb<SBLIMIT;sb++)
minscaleindex[ch][sb] = scalar[ch][0][sb];
/* Find the minimum scalefactor index for each ch/sb */
for (ch = 0; ch < nch; ch++)
for (sb = 0; sb < SBLIMIT; sb++)
minscaleindex[ch][sb] = scalar[ch][0][sb];
for (ch=0;ch<nch;ch++)
for (gr=1;gr<3;gr++)
for (sb=0;sb<SBLIMIT;sb++)
if (minscaleindex[ch][sb] > scalar[ch][gr][sb])
minscaleindex[ch][sb] = scalar[ch][gr][sb];
for (ch = 0; ch < nch; ch++)
for (gr = 1; gr < 3; gr++)
for (sb = 0; sb < SBLIMIT; sb++)
if (minscaleindex[ch][sb] > scalar[ch][gr][sb])
minscaleindex[ch][sb] = scalar[ch][gr][sb];
/* Oh yeah. Fudge the hell out of the SMR calculations
by combining the scalefactor table index and the min ATH in that subband
There are probably more elegant/correct ways of combining these values,
but who cares? It works pretty well
MFC Mar 03 */
for (ch=0;ch<nch;ch++)
for (sb=0;sb<SBLIMIT;sb++)
SMR[ch][sb] = 2.0 * (30.0 - minscaleindex[ch][sb]) - mem->ath_min[sb];
/* Oh yeah. Fudge the hell out of the SMR calculations by combining the scalefactor table index
and the min ATH in that subband There are probably more elegant/correct ways of combining
these values, but who cares? It works pretty well MFC Mar 03 */
for (ch = 0; ch < nch; ch++)
for (sb = 0; sb < SBLIMIT; sb++)
SMR[ch][sb] = 2.0 * (30.0 - minscaleindex[ch][sb]) - mem->ath_min[sb];
}
void psycho_0_deinit(psycho_0_mem **mem)
void psycho_0_deinit(psycho_0_mem ** mem)
{
if (mem==NULL||*mem==NULL) return;
if (mem == NULL || *mem == NULL)
return;
TWOLAME_FREE( *mem );
TWOLAME_FREE(*mem);
}

View File

@ -18,15 +18,15 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: psycho_0.h,v 1.3 2008-02-01 19:44:33 richardash1981 Exp $
* $Id$
*
*/
#ifndef _PSYCHO_0_H_
#define _PSYCHO_0_H_
void psycho_0(twolame_options *glopts, FLOAT SMR[2][SBLIMIT], unsigned int scalar[2][3][SBLIMIT]);
void psycho_0_deinit(psycho_0_mem **mem);
void psycho_0(twolame_options * glopts, FLOAT SMR[2][SBLIMIT], unsigned int scalar[2][3][SBLIMIT]);
void psycho_0_deinit(psycho_0_mem ** mem);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -18,15 +18,16 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: psycho_1.h,v 1.3 2008-02-01 19:44:33 richardash1981 Exp $
* $Id$
*
*/
#ifndef _PSYCHO_1_H_
#define _PSYCHO_1_H_
void psycho_1 (twolame_options *glopts, short int buffer[2][1152], FLOAT scale[2][32], FLOAT ltmin[2][32]);
void psycho_1_deinit(psycho_1_mem **mem);
void psycho_1(twolame_options * glopts, short int buffer[2][1152], FLOAT scale[2][32],
FLOAT ltmin[2][32]);
void psycho_1_deinit(psycho_1_mem ** mem);
#endif

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: psycho_1_critband.h,v 1.3 2008-02-01 19:44:34 richardash1981 Exp $
* $Id$
*
*/
@ -27,183 +27,183 @@
#define _CRITBAND_H_
static const int SecondCriticalBand[7][28] = {
{
/* 2cb0, 27 entries */
27,
1,
2,
3,
5,
7,
10,
13,
16,
19,
22,
26,
30,
35,
40,
46,
54,
64,
76,
90,
104,
124,
148,
176,
216,
264,
360,
464 },
{
/* 2cb1, 27 entries */
27,
1,
2,
3,
5,
7,
9,
12,
14,
17,
20,
24,
27,
32,
37,
42,
50,
58,
70,
82,
100,
116,
136,
164,
200,
248,
328,
432 },
{
/* 2cb2, 25 entries */
25,
1,
3,
6,
10,
13,
17,
21,
25,
30,
35,
41,
47,
54,
64,
74,
88,
104,
124,
148,
176,
208,
248,
296,
368,
480,
0, 0},
{
/* 2cb3, 0 entries (all dummies) */
0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0},
{
/* 2cb4, 24 entries */
24,
1,
5,
9,
14,
19,
25,
30,
36,
43,
50,
58,
68,
78,
92,
108,
124,
148,
176,
208,
248,
296,
352,
424,
480,
0, 0, 0},
{
/* 2cb5, 24 entries */
24,
1,
4,
9,
13,
18,
23,
28,
33,
39,
46,
54,
62,
72,
84,
100,
116,
136,
164,
192,
232,
272,
328,
392,
480,
0, 0, 0},
{
/* 2cb6, 22 entries */
22,
1,
6,
13,
20,
27,
34,
42,
50,
60,
70,
80,
94,
108,
124,
148,
172,
208,
248,
288,
344,
408,
480,
0, 0, 0, 0, 0}
{
/* 2cb0, 27 entries */
27,
1,
2,
3,
5,
7,
10,
13,
16,
19,
22,
26,
30,
35,
40,
46,
54,
64,
76,
90,
104,
124,
148,
176,
216,
264,
360,
464},
{
/* 2cb1, 27 entries */
27,
1,
2,
3,
5,
7,
9,
12,
14,
17,
20,
24,
27,
32,
37,
42,
50,
58,
70,
82,
100,
116,
136,
164,
200,
248,
328,
432},
{
/* 2cb2, 25 entries */
25,
1,
3,
6,
10,
13,
17,
21,
25,
30,
35,
41,
47,
54,
64,
74,
88,
104,
124,
148,
176,
208,
248,
296,
368,
480,
0, 0},
{
/* 2cb3, 0 entries (all dummies) */
0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0},
{
/* 2cb4, 24 entries */
24,
1,
5,
9,
14,
19,
25,
30,
36,
43,
50,
58,
68,
78,
92,
108,
124,
148,
176,
208,
248,
296,
352,
424,
480,
0, 0, 0},
{
/* 2cb5, 24 entries */
24,
1,
4,
9,
13,
18,
23,
28,
33,
39,
46,
54,
62,
72,
84,
100,
116,
136,
164,
192,
232,
272,
328,
392,
480,
0, 0, 0},
{
/* 2cb6, 22 entries */
22,
1,
6,
13,
20,
27,
34,
42,
50,
60,
70,
80,
94,
108,
124,
148,
172,
208,
248,
288,
344,
408,
480,
0, 0, 0, 0, 0}
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: psycho_2.c,v 1.3 2008-02-01 19:44:34 richardash1981 Exp $
* $Id$
*
*/
@ -45,121 +45,122 @@
static const FLOAT nmt = 5.5;
static const FLOAT crit_band[27] = { 0, 100, 200, 300, 400, 510, 630, 770,
920, 1080, 1270, 1480, 1720, 2000, 2320, 2700,
3150, 3700, 4400, 5300, 6400, 7700, 9500, 12000,
15500, 25000, 30000
920, 1080, 1270, 1480, 1720, 2000, 2320, 2700,
3150, 3700, 4400, 5300, 6400, 7700, 9500, 12000,
15500, 25000, 30000
};
static const FLOAT bmax[27] = { 20.0, 20.0, 20.0, 20.0, 20.0, 17.0, 15.0,
10.0, 7.0, 4.4, 4.5, 4.5, 4.5, 4.5,
4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5,
4.5, 4.5, 4.5, 3.5, 3.5, 3.5
10.0, 7.0, 4.4, 4.5, 4.5, 4.5, 4.5,
4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5,
4.5, 4.5, 4.5, 3.5, 3.5, 3.5
};
static void psycho_2_read_absthr (absthr, table)
FLOAT *absthr;
int table;
static void psycho_2_read_absthr(absthr, table)
FLOAT *absthr;
int table;
{
int j;
int j;
#include "psycho_2_absthr.h"
if ((table < 0) || (table > 3)) {
printf ("internal error: wrong table number");
return;
}
if ((table < 0) || (table > 3)) {
fprintf(stderr, "internal error: wrong table number");
return;
}
for (j = 0; j < HBLKSIZE; j++) {
absthr[j] = absthr_table[table][j];
}
return;
for (j = 0; j < HBLKSIZE; j++) {
absthr[j] = absthr_table[table][j];
}
return;
}
/********************************
* init psycho model 2
********************************/
psycho_2_mem *psycho_2_init (twolame_options *glopts, int sfreq)
psycho_2_mem *psycho_2_init(twolame_options * glopts, int sfreq)
{
psycho_2_mem *mem;
FLOAT *cbval, *rnorm;
FLOAT *window;
FLOAT *ath;
int *numlines;
int *partition;
FCB *s;
FLOAT *tmn;
psycho_2_mem *mem;
FLOAT *cbval, *rnorm;
FLOAT *window;
FLOAT *ath;
int *numlines;
int *partition;
FCB *s;
FLOAT *tmn;
int i, j, itemp2;
FLOAT freq_mult;
FLOAT temp1, ftemp2, temp3;
FLOAT bval_lo, *fthr;
int i, j, itemp2;
FLOAT freq_mult;
FLOAT temp1, ftemp2, temp3;
FLOAT bval_lo, *fthr;
int sfreq_idx;
int sfreq_idx;
{
mem = (psycho_2_mem *)TWOLAME_MALLOC(sizeof(psycho_2_mem));
if (!mem) return NULL;
mem->tmn = (FLOAT *) TWOLAME_MALLOC(sizeof (DCB));
mem->s = (FCB *) TWOLAME_MALLOC(sizeof (FCBCB));
mem->lthr = (FHBLK *) TWOLAME_MALLOC(sizeof (F2HBLK));
mem->r = (F2HBLK *) TWOLAME_MALLOC(sizeof (F22HBLK));
mem->phi_sav = (F2HBLK *) TWOLAME_MALLOC(sizeof (F22HBLK));
{
mem = (psycho_2_mem *) TWOLAME_MALLOC(sizeof(psycho_2_mem));
if (!mem)
return NULL;
//static int new = 0, old = 1, oldest = 0;
mem->new=0;
mem->old=1;
mem->oldest=0;
mem->flush = (int) (384 * 3.0 / 2.0);
mem->syncsize = 1056;
mem->sync_flush = mem->syncsize - mem->flush;
}
mem->tmn = (FLOAT *) TWOLAME_MALLOC(sizeof(DCB));
mem->s = (FCB *) TWOLAME_MALLOC(sizeof(FCBCB));
mem->lthr = (FHBLK *) TWOLAME_MALLOC(sizeof(F2HBLK));
mem->r = (F2HBLK *) TWOLAME_MALLOC(sizeof(F22HBLK));
mem->phi_sav = (F2HBLK *) TWOLAME_MALLOC(sizeof(F22HBLK));
{
cbval = mem->cbval;
rnorm = mem->rnorm;
window = mem->window;
ath = mem->ath;
numlines = mem->numlines;
partition = mem->numlines;
s = mem->s;
tmn = mem->tmn;
fthr = mem->fthr;
}
// static int new = 0, old = 1, oldest = 0;
mem->new = 0;
mem->old = 1;
mem->oldest = 0;
switch (sfreq) {
case 32000:
case 16000:
sfreq_idx = 0;
break;
case 44100:
case 22050:
sfreq_idx = 1;
break;
case 48000:
case 24000:
sfreq_idx = 2;
break;
default:
fprintf (stderr, "error, invalid sampling frequency: %d Hz\n", sfreq);
return NULL;
}
fprintf (stderr, "absthr[][] sampling frequency index: %d\n", sfreq_idx);
psycho_2_read_absthr (mem->absthr, sfreq_idx);
mem->flush = (int) (384 * 3.0 / 2.0);
mem->syncsize = 1056;
mem->sync_flush = mem->syncsize - mem->flush;
}
{
cbval = mem->cbval;
rnorm = mem->rnorm;
window = mem->window;
ath = mem->ath;
numlines = mem->numlines;
partition = mem->partition;
s = mem->s;
tmn = mem->tmn;
fthr = mem->fthr;
}
switch (sfreq) {
case 32000:
case 16000:
sfreq_idx = 0;
break;
case 44100:
case 22050:
sfreq_idx = 1;
break;
case 48000:
case 24000:
sfreq_idx = 2;
break;
default:
fprintf(stderr, "error, invalid sampling frequency: %d Hz\n", sfreq);
return NULL;
}
fprintf(stderr, "absthr[][] sampling frequency index: %d\n", sfreq_idx);
psycho_2_read_absthr(mem->absthr, sfreq_idx);
/* calculate HANN window coefficients */
/* for(i=0;i<BLKSIZE;i++)window[i]=0.5*(1-cos(2.0*PI*i/(BLKSIZE-1.0))); */
for (i = 0; i < BLKSIZE; i++)
window[i] = 0.5 * (1 - cos (2.0 * PI * (i - 0.5) / BLKSIZE));
/* reset states used in unpredictability measure */
for (i = 0; i < HBLKSIZE; i++) {
mem->r[0][0][i] = mem->r[1][0][i] = mem->r[0][1][i] = mem->r[1][1][i] = 0;
mem->phi_sav[0][0][i] = mem->phi_sav[1][0][i] = 0;
mem->phi_sav[0][1][i] = mem->phi_sav[1][1][i] = 0;
mem->lthr[0][i] = 60802371420160.0;
mem->lthr[1][i] = 60802371420160.0;
}
/* calculate HANN window coefficients */
/* for(i=0;i<BLKSIZE;i++)window[i]=0.5*(1-cos(2.0*PI*i/(BLKSIZE-1.0))); */
for (i = 0; i < BLKSIZE; i++)
window[i] = 0.5 * (1 - cos(2.0 * PI * (i - 0.5) / BLKSIZE));
/* reset states used in unpredictability measure */
for (i = 0; i < HBLKSIZE; i++) {
mem->r[0][0][i] = mem->r[1][0][i] = mem->r[0][1][i] = mem->r[1][1][i] = 0;
mem->phi_sav[0][0][i] = mem->phi_sav[1][0][i] = 0;
mem->phi_sav[0][1][i] = mem->phi_sav[1][1][i] = 0;
mem->lthr[0][i] = 60802371420160.0;
mem->lthr[1][i] = 60802371420160.0;
}
/*****************************************************************************
* Initialization: Compute the following constants for use later *
* partition[HBLKSIZE] = the partition number associated with each *
@ -169,161 +170,157 @@ psycho_2_mem *psycho_2_init (twolame_options *glopts, int sfreq)
* numlines[CBANDS] = the number of frequency lines in each partition *
* tmn[CBANDS] = tone masking noise *
*****************************************************************************/
/* compute fft frequency multiplicand */
freq_mult = (FLOAT)sfreq / (FLOAT)BLKSIZE;
/* compute fft frequency multiplicand */
freq_mult = (FLOAT) sfreq / (FLOAT) BLKSIZE;
/* calculate fft frequency, then bval of each line (use fthr[] as tmp storage) */
for (i = 0; i < HBLKSIZE; i++) {
temp1 = i * freq_mult;
j = 1;
while (temp1 > crit_band[j])
j++;
fthr[i] =
j - 1 + (temp1 - crit_band[j - 1]) / (crit_band[j] - crit_band[j - 1]);
}
partition[0] = 0;
/* temp2 is the counter of the number of frequency lines in each partition */
itemp2 = 1;
cbval[0] = fthr[0];
bval_lo = fthr[0];
for (i = 1; i < HBLKSIZE; i++) {
if ((fthr[i] - bval_lo) > 0.33) {
partition[i] = partition[i - 1] + 1;
cbval[partition[i - 1]] = cbval[partition[i - 1]] / itemp2;
cbval[partition[i]] = fthr[i];
bval_lo = fthr[i];
numlines[partition[i - 1]] = itemp2;
itemp2 = 1;
} else {
partition[i] = partition[i - 1];
cbval[partition[i]] += fthr[i];
itemp2++;
}
}
numlines[partition[i - 1]] = itemp2;
cbval[partition[i - 1]] = cbval[partition[i - 1]] / itemp2;
/* calculate fft frequency, then bval of each line (use fthr[] as tmp storage) */
for (i = 0; i < HBLKSIZE; i++) {
temp1 = i * freq_mult;
j = 1;
while (temp1 > crit_band[j])
j++;
fthr[i] = j - 1 + (temp1 - crit_band[j - 1]) / (crit_band[j] - crit_band[j - 1]);
}
partition[0] = 0;
/* temp2 is the counter of the number of frequency lines in each partition */
itemp2 = 1;
cbval[0] = fthr[0];
bval_lo = fthr[0];
for (i = 1; i < HBLKSIZE; i++) {
if ((fthr[i] - bval_lo) > 0.33) {
partition[i] = partition[i - 1] + 1;
cbval[partition[i - 1]] = cbval[partition[i - 1]] / itemp2;
cbval[partition[i]] = fthr[i];
bval_lo = fthr[i];
numlines[partition[i - 1]] = itemp2;
itemp2 = 1;
} else {
partition[i] = partition[i - 1];
cbval[partition[i]] += fthr[i];
itemp2++;
}
}
numlines[partition[i - 1]] = itemp2;
cbval[partition[i - 1]] = cbval[partition[i - 1]] / itemp2;
/************************************************************************
* Now compute the spreading function, s[j][i], the value of the spread-*
* ing function, centered at band j, for band i, store for later use *
************************************************************************/
for (j = 0; j < CBANDS; j++) {
for (i = 0; i < CBANDS; i++) {
temp1 = (cbval[i] - cbval[j]) * 1.05;
if (temp1 >= 0.5 && temp1 <= 2.5) {
ftemp2 = temp1 - 0.5;
ftemp2 = 8.0 * (ftemp2 * ftemp2 - 2.0 * ftemp2);
} else
ftemp2 = 0.0;
temp1 += 0.474;
temp3 =
15.811389 + 7.5 * temp1 -
17.5 * sqrt ((FLOAT) (1.0 + temp1 * temp1));
if (temp3 <= -100)
s[i][j] = 0;
else {
temp3 = (ftemp2 + temp3) * LN_TO_LOG10;
s[i][j] = exp (temp3);
}
}
}
for (j = 0; j < CBANDS; j++) {
for (i = 0; i < CBANDS; i++) {
temp1 = (cbval[i] - cbval[j]) * 1.05;
if (temp1 >= 0.5 && temp1 <= 2.5) {
ftemp2 = temp1 - 0.5;
ftemp2 = 8.0 * (ftemp2 * ftemp2 - 2.0 * ftemp2);
} else
ftemp2 = 0.0;
temp1 += 0.474;
temp3 = 15.811389 + 7.5 * temp1 - 17.5 * sqrt((FLOAT) (1.0 + temp1 * temp1));
if (temp3 <= -100)
s[i][j] = 0;
else {
temp3 = (ftemp2 + temp3) * LN_TO_LOG10;
s[i][j] = exp(temp3);
}
}
}
/* Calculate Tone Masking Noise values */
for (j = 0; j < CBANDS; j++) {
temp1 = 15.5 + cbval[j];
tmn[j] = (temp1 > 24.5) ? temp1 : 24.5;
/* Calculate normalization factors for the net spreading functions */
rnorm[j] = 0;
for (i = 0; i < CBANDS; i++) {
rnorm[j] += s[j][i];
}
}
/* Calculate Tone Masking Noise values */
for (j = 0; j < CBANDS; j++) {
temp1 = 15.5 + cbval[j];
tmn[j] = (temp1 > 24.5) ? temp1 : 24.5;
/* Calculate normalization factors for the net spreading functions */
rnorm[j] = 0;
for (i = 0; i < CBANDS; i++) {
rnorm[j] += s[j][i];
}
}
if (glopts->verbosity > 5){
/* Dump All the Values to STDOUT and exit */
int wlow, whigh=0;
fprintf(stdout,"psy model 2 init\n");
fprintf(stdout,"index \tnlines \twlow \twhigh \tbval \tminval \ttmn\n");
for (i=0;i<CBANDS;i++) {
wlow = whigh+1;
whigh = wlow + numlines[i] - 1;
fprintf(stdout,"%i \t%i \t%i \t%i \t%5.2f \t%4.2f \t%4.2f\n",i+1, numlines[i],wlow, whigh, cbval[i],bmax[(int)(cbval[i]+0.5)],tmn[i]);
}
exit(0);
}
if (glopts->verbosity > 5) {
/* Dump All the Values to stderr and exit */
int wlow, whigh = 0;
fprintf(stderr, "psy model 2 init\n");
fprintf(stderr, "index \tnlines \twlow \twhigh \tbval \tminval \ttmn\n");
for (i = 0; i < CBANDS; i++) {
wlow = whigh + 1;
whigh = wlow + numlines[i] - 1;
fprintf(stderr, "%i \t%i \t%i \t%i \t%5.2f \t%4.2f \t%4.2f\n", i + 1, numlines[i], wlow,
whigh, cbval[i], bmax[(int) (cbval[i] + 0.5)], tmn[i]);
}
}
return(mem);
return (mem);
}
void psycho_2 (twolame_options *glopts, short int buffer[2][1152],
short int savebuf[2][1056],
FLOAT smr[2][32])
void psycho_2(twolame_options * glopts, short int buffer[2][1152],
short int savebuf[2][1056], FLOAT smr[2][32])
{
psycho_2_mem *mem;
unsigned int i, j, k, ch;
int new, old, oldest;
FLOAT r_prime, phi_prime;
FLOAT minthres, sum_energy;
FLOAT tb, temp1, temp2, temp3;
FLOAT *grouped_c, *grouped_e;
FLOAT *nb, *cb, *ecb, *bc;
FLOAT *cbval, *rnorm;
FLOAT *wsamp_r, *phi, *energy, *window;
FLOAT *ath, *thr, *c;
FLOAT *fthr;
psycho_2_mem *mem;
unsigned int i, j, k, ch;
int new, old, oldest;
FLOAT r_prime, phi_prime;
FLOAT minthres, sum_energy;
FLOAT tb, temp1, temp2, temp3;
FLOAT *grouped_c, *grouped_e;
FLOAT *nb, *cb, *ecb, *bc;
FLOAT *cbval, *rnorm;
FLOAT *wsamp_r, *phi, *energy, *window;
FLOAT *ath, *thr, *c;
FLOAT *fthr;
FLOAT *snrtmp[2];
int *numlines;
int *partition;
FLOAT *tmn;
FCB *s;
FHBLK *lthr;
F2HBLK *r, *phi_sav;
FLOAT *absthr;
int nch = glopts->num_channels_out;
int sfreq = glopts->samplerate_out;
FLOAT *snrtmp[2];
int *numlines;
int *partition;
FLOAT *tmn;
FCB *s;
FHBLK *lthr;
F2HBLK *r, *phi_sav;
FLOAT *absthr;
int nch = glopts->num_channels_out;
int sfreq = glopts->samplerate_out;
if (!glopts->p2mem) {
glopts->p2mem = psycho_2_init (glopts, sfreq);
}
mem = glopts->p2mem;
{
grouped_c = mem->grouped_c;
grouped_e = mem->grouped_e;
nb = mem->nb;
cb = mem->cb;
ecb = mem->ecb;
bc = mem->bc;
rnorm = mem->rnorm;
cbval = mem->cbval;
wsamp_r = mem->wsamp_r;
phi = mem->phi;
energy = mem->energy;
window = mem->window;
ath = mem->ath;
thr = mem->thr;
c = mem->c;
if (!glopts->p2mem) {
glopts->p2mem = psycho_2_init(glopts, sfreq);
}
mem = glopts->p2mem;
{
grouped_c = mem->grouped_c;
grouped_e = mem->grouped_e;
nb = mem->nb;
cb = mem->cb;
ecb = mem->ecb;
bc = mem->bc;
rnorm = mem->rnorm;
cbval = mem->cbval;
wsamp_r = mem->wsamp_r;
phi = mem->phi;
energy = mem->energy;
window = mem->window;
ath = mem->ath;
thr = mem->thr;
c = mem->c;
snrtmp[0] = mem->snrtmp[0];
snrtmp[1] = mem->snrtmp[1];
snrtmp[0] = mem->snrtmp[0];
snrtmp[1] = mem->snrtmp[1];
numlines = mem->numlines;
partition = mem->partition;
tmn = mem->tmn;
s = mem->s;
lthr = mem->lthr;
r = mem->r;
phi_sav = mem->phi_sav;
fthr = mem->fthr;
absthr = mem->absthr;
}
numlines = mem->numlines;
partition = mem->partition;
tmn = mem->tmn;
s = mem->s;
lthr = mem->lthr;
r = mem->r;
phi_sav = mem->phi_sav;
fthr = mem->fthr;
absthr = mem->absthr;
}
for (ch=0; ch < nch; ch++) {
for (i = 0; i < 2; i++) {
/*****************************************************************************
for (ch = 0; ch < nch; ch++) {
for (i = 0; i < 2; i++) {
/*****************************************************************************
* Net offset is 480 samples (1056-576) for layer 2; this is because one must*
* stagger input data by 256 samples to synchronize psychoacoustic model with*
* filter bank outputs, then stagger so that center of 1024 FFT window lines *
@ -334,206 +331,204 @@ void psycho_2 (twolame_options *glopts, short int buffer[2][1152],
sync_flush = syncsize - flush; 480
BLKSIZE = 1024
*****************************************************************************/
{
short int *bufferp = buffer[ch];
for (j = 0; j < 480; j++) {
savebuf[ch][j] = savebuf[ch][j + mem->flush];
wsamp_r[j] = window[j] * ((FLOAT) savebuf[ch][j]);
}
for (; j < 1024; j++) {
savebuf[ch][j] = *bufferp++;
wsamp_r[j] = window[j] * ((FLOAT) savebuf[ch][j]);
}
for (; j < 1056; j++)
savebuf[ch][j] = *bufferp++;
}
/**Compute FFT****************************************************************/
psycho_2_fft (wsamp_r, energy, phi);
/*****************************************************************************
{
short int *bufferp = buffer[ch];
for (j = 0; j < 480; j++) {
savebuf[ch][j] = savebuf[ch][j + mem->flush];
wsamp_r[j] = window[j] * ((FLOAT) savebuf[ch][j]);
}
for (; j < 1024; j++) {
savebuf[ch][j] = *bufferp++;
wsamp_r[j] = window[j] * ((FLOAT) savebuf[ch][j]);
}
for (; j < 1056; j++)
savebuf[ch][j] = *bufferp++;
}
/**Compute FFT****************************************************************/
psycho_2_fft(wsamp_r, energy, phi);
/*****************************************************************************
* calculate the unpredictability measure, given energy[f] and phi[f] *
*****************************************************************************/
/*only update data "age" pointers after you are done with both channels */
/*for layer 1 computations, for the layer 2 FLOAT computations, the pointers */
/*are reset automatically on the second pass */
{
if (mem->new == 0) {
mem->new = 1;
mem->oldest = 1;
} else {
mem->new = 0;
mem->oldest = 0;
}
if (mem->old == 0)
mem->old = 1;
else
mem->old = 0;
/* only update data "age" pointers after you are done with both channels */
/* for layer 1 computations, for the layer 2 FLOAT computations, the pointers */
/* are reset automatically on the second pass */
{
if (mem->new == 0) {
mem->new = 1;
mem->oldest = 1;
} else {
mem->new = 0;
mem->oldest = 0;
}
if (mem->old == 0)
mem->old = 1;
else
mem->old = 0;
new = mem->new;
old = mem->old;
oldest = mem->oldest;
}
new = mem->new;
old = mem->old;
oldest = mem->oldest;
}
for (j = 0; j < HBLKSIZE; j++) {
r_prime = 2.0 * r[ch][old][j] - r[ch][oldest][j];
phi_prime = 2.0 * phi_sav[ch][old][j] - phi_sav[ch][oldest][j];
r[ch][new][j] = sqrt ((FLOAT) energy[j]);
phi_sav[ch][new][j] = phi[j];
for (j = 0; j < HBLKSIZE; j++) {
r_prime = 2.0 * r[ch][old][j] - r[ch][oldest][j];
phi_prime = 2.0 * phi_sav[ch][old][j] - phi_sav[ch][oldest][j];
r[ch][new][j] = sqrt((FLOAT) energy[j]);
phi_sav[ch][new][j] = phi[j];
#ifdef SINCOS
{
// 12% faster
//#warning "Use __sincos"
FLOAT sphi, cphi, sprime, cprime;
__sincos ((FLOAT) phi[j], &sphi, &cphi);
__sincos ((FLOAT) phi_prime, &sprime, &cprime);
temp1 = r[chn][new][j] * cphi - r_prime * cprime;
temp2 = r[chn][new][j] * sphi - r_prime * sprime;
}
{
// 12% faster
// #warning "Use __sincos"
FLOAT sphi, cphi, sprime, cprime;
__sincos((FLOAT) phi[j], &sphi, &cphi);
__sincos((FLOAT) phi_prime, &sprime, &cprime);
temp1 = r[chn][new][j] * cphi - r_prime * cprime;
temp2 = r[chn][new][j] * sphi - r_prime * sprime;
}
#else
temp1 =
r[ch][new][j] * cos ((FLOAT) phi[j]) -
r_prime * cos ((FLOAT) phi_prime);
temp2 =
r[ch][new][j] * sin ((FLOAT) phi[j]) -
r_prime * sin ((FLOAT) phi_prime);
temp1 = r[ch][new][j] * cos((FLOAT) phi[j]) - r_prime * cos((FLOAT) phi_prime);
temp2 = r[ch][new][j] * sin((FLOAT) phi[j]) - r_prime * sin((FLOAT) phi_prime);
#endif
temp3 = r[ch][new][j] + fabs ((FLOAT) r_prime);
if (temp3 != 0)
c[j] = sqrt (temp1 * temp1 + temp2 * temp2) / temp3;
else
c[j] = 0;
}
/*****************************************************************************
temp3 = r[ch][new][j] + fabs((FLOAT) r_prime);
if (temp3 != 0)
c[j] = sqrt(temp1 * temp1 + temp2 * temp2) / temp3;
else
c[j] = 0;
}
/*****************************************************************************
* Calculate the grouped, energy-weighted, unpredictability measure, *
* grouped_c[], and the grouped energy. grouped_e[] *
*****************************************************************************/
for (j = 1; j < CBANDS; j++) {
grouped_e[j] = 0;
grouped_c[j] = 0;
}
grouped_e[0] = energy[0];
grouped_c[0] = energy[0] * c[0];
for (j = 1; j < HBLKSIZE; j++) {
grouped_e[partition[j]] += energy[j];
grouped_c[partition[j]] += energy[j] * c[j];
}
/*****************************************************************************
for (j = 1; j < CBANDS; j++) {
grouped_e[j] = 0;
grouped_c[j] = 0;
}
grouped_e[0] = energy[0];
grouped_c[0] = energy[0] * c[0];
for (j = 1; j < HBLKSIZE; j++) {
grouped_e[partition[j]] += energy[j];
grouped_c[partition[j]] += energy[j] * c[j];
}
/*****************************************************************************
* convolve the grouped energy-weighted unpredictability measure *
* and the grouped energy with the spreading function, s[j][k] *
*****************************************************************************/
for (j = 0; j < CBANDS; j++) {
ecb[j] = 0;
cb[j] = 0;
for (k = 0; k < CBANDS; k++) {
if (s[j][k] != 0.0) {
ecb[j] += s[j][k] * grouped_e[k];
cb[j] += s[j][k] * grouped_c[k];
}
}
if (ecb[j] != 0)
cb[j] = cb[j] / ecb[j];
else
cb[j] = 0;
}
/*****************************************************************************
for (j = 0; j < CBANDS; j++) {
ecb[j] = 0;
cb[j] = 0;
for (k = 0; k < CBANDS; k++) {
if (s[j][k] != 0.0) {
ecb[j] += s[j][k] * grouped_e[k];
cb[j] += s[j][k] * grouped_c[k];
}
}
if (ecb[j] != 0)
cb[j] = cb[j] / ecb[j];
else
cb[j] = 0;
}
/*****************************************************************************
* Calculate the required SNR for each of the frequency partitions *
* this whole section can be accomplished by a table lookup *
*****************************************************************************/
for (j = 0; j < CBANDS; j++) {
if (cb[j] < .05)
cb[j] = 0.05;
else if (cb[j] > .5)
cb[j] = 0.5;
tb = -0.434294482 * log ((FLOAT) cb[j]) - 0.301029996;
cb[j] = tb;
bc[j] = tmn[j] * tb + nmt * (1.0 - tb);
k = (int) (cbval[j] + 0.5);
bc[j] = (bc[j] > bmax[k]) ? bc[j] : bmax[k];
bc[j] = exp ((FLOAT) -bc[j] * LN_TO_LOG10);
}
/*****************************************************************************
for (j = 0; j < CBANDS; j++) {
if (cb[j] < .05)
cb[j] = 0.05;
else if (cb[j] > .5)
cb[j] = 0.5;
tb = -0.434294482 * log((FLOAT) cb[j]) - 0.301029996;
cb[j] = tb;
bc[j] = tmn[j] * tb + nmt * (1.0 - tb);
k = (int) (cbval[j] + 0.5);
bc[j] = (bc[j] > bmax[k]) ? bc[j] : bmax[k];
bc[j] = exp((FLOAT) - bc[j] * LN_TO_LOG10);
}
/*****************************************************************************
* Calculate the permissible noise energy level in each of the frequency *
* partitions. Include absolute threshold and pre-echo controls *
* this whole section can be accomplished by a table lookup *
*****************************************************************************/
for (j = 0; j < CBANDS; j++)
if (rnorm[j] && numlines[j])
nb[j] = ecb[j] * bc[j] / (rnorm[j] * numlines[j]);
else
nb[j] = 0;
for (j = 0; j < HBLKSIZE; j++) {
/*temp1 is the preliminary threshold */
temp1 = nb[partition[j]];
temp1 = (temp1 > absthr[j]) ? temp1 : absthr[j];
for (j = 0; j < CBANDS; j++)
if (rnorm[j] && numlines[j])
nb[j] = ecb[j] * bc[j] / (rnorm[j] * numlines[j]);
else
nb[j] = 0;
for (j = 0; j < HBLKSIZE; j++) {
/* temp1 is the preliminary threshold */
temp1 = nb[partition[j]];
temp1 = (temp1 > absthr[j]) ? temp1 : absthr[j];
#ifdef LAYERI
/*do not use pre-echo control for layer 2 because it may do bad things to the */
/* MUSICAM bit allocation algorithm */
if (lay == 1) {
fthr[j] = (temp1 < lthr[ch][j]) ? temp1 : lthr[ch][j];
temp2 = temp1 * 0.00316;
fthr[j] = (temp2 > fthr[j]) ? temp2 : fthr[j];
} else
fthr[j] = temp1;
lthr[ch][j] = LXMIN * temp1;
/* do not use pre-echo control for layer 2 because it may do bad things to the */
/* MUSICAM bit allocation algorithm */
if (lay == 1) {
fthr[j] = (temp1 < lthr[ch][j]) ? temp1 : lthr[ch][j];
temp2 = temp1 * 0.00316;
fthr[j] = (temp2 > fthr[j]) ? temp2 : fthr[j];
} else
fthr[j] = temp1;
lthr[ch][j] = LXMIN * temp1;
#else
fthr[j] = temp1;
lthr[ch][j] = LXMIN * temp1;
fthr[j] = temp1;
lthr[ch][j] = LXMIN * temp1;
#endif
}
/*****************************************************************************
}
/*****************************************************************************
* Translate the 512 threshold values to the 32 filter bands of the coder *
*****************************************************************************/
for (j = 0; j < 193; j += 16) {
minthres = 60802371420160.0;
sum_energy = 0.0;
for (k = 0; k < 17; k++) {
if (minthres > fthr[j + k])
minthres = fthr[j + k];
sum_energy += energy[j + k];
}
snrtmp[i][j / 16] = sum_energy / (minthres * 17.0);
snrtmp[i][j / 16] = 4.342944819 * log ((FLOAT) snrtmp[i][j / 16]);
}
for (j = 208; j < (HBLKSIZE - 1); j += 16) {
minthres = 0.0;
sum_energy = 0.0;
for (k = 0; k < 17; k++) {
minthres += fthr[j + k];
sum_energy += energy[j + k];
}
snrtmp[i][j / 16] = sum_energy / minthres;
snrtmp[i][j / 16] = 4.342944819 * log ((FLOAT) snrtmp[i][j / 16]);
}
/*****************************************************************************
for (j = 0; j < 193; j += 16) {
minthres = 60802371420160.0;
sum_energy = 0.0;
for (k = 0; k < 17; k++) {
if (minthres > fthr[j + k])
minthres = fthr[j + k];
sum_energy += energy[j + k];
}
snrtmp[i][j / 16] = sum_energy / (minthres * 17.0);
snrtmp[i][j / 16] = 4.342944819 * log((FLOAT) snrtmp[i][j / 16]);
}
for (j = 208; j < (HBLKSIZE - 1); j += 16) {
minthres = 0.0;
sum_energy = 0.0;
for (k = 0; k < 17; k++) {
minthres += fthr[j + k];
sum_energy += energy[j + k];
}
snrtmp[i][j / 16] = sum_energy / minthres;
snrtmp[i][j / 16] = 4.342944819 * log((FLOAT) snrtmp[i][j / 16]);
}
/*****************************************************************************
* End of Psychoacuostic calculation loop *
*****************************************************************************/
}
for (i = 0; i < 32; i++) {
smr[ch][i] = (snrtmp[0][i] > snrtmp[1][i]) ? snrtmp[0][i] : snrtmp[1][i];
}
}
for (i = 0; i < 32; i++) {
smr[ch][i] = (snrtmp[0][i] > snrtmp[1][i]) ? snrtmp[0][i] : snrtmp[1][i];
}
} // next channel
} // next channel
}
void psycho_2_deinit(psycho_2_mem **mem) {
void psycho_2_deinit(psycho_2_mem ** mem)
{
if (mem==NULL||*mem==NULL) return;
if (mem == NULL || *mem == NULL)
return;
TWOLAME_FREE( (*mem)->tmn );
TWOLAME_FREE( (*mem)->s );
TWOLAME_FREE( (*mem)->lthr );
TWOLAME_FREE( (*mem)->r );
TWOLAME_FREE( (*mem)->phi_sav );
TWOLAME_FREE( (*mem) );
TWOLAME_FREE((*mem)->tmn);
TWOLAME_FREE((*mem)->s);
TWOLAME_FREE((*mem)->lthr);
TWOLAME_FREE((*mem)->r);
TWOLAME_FREE((*mem)->phi_sav);
TWOLAME_FREE((*mem));
}

View File

@ -18,15 +18,17 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: psycho_2.h,v 1.3 2008-02-01 19:44:34 richardash1981 Exp $
* $Id$
*
*/
#ifndef _PSYCHO_2_H_
#define _PSYCHO_2_H_
void psycho_2 (twolame_options *glopts, short int buffer[2][1152], short int savebuf[2][1056], FLOAT smr[2][32]);
void psycho_2_deinit(psycho_2_mem **mem);
psycho_2_mem *psycho_2_init(twolame_options * glopts, int sfreq);
void psycho_2(twolame_options * glopts, short int buffer[2][1152], short int savebuf[2][1056],
FLOAT smr[2][32]);
void psycho_2_deinit(psycho_2_mem ** mem);
#endif

Some files were not shown because too many files have changed in this diff Show More