1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-27 15:53:49 +01:00

Remove mpglib as it's not needed

And slower than libmad
This commit is contained in:
Leland Lucius
2020-05-26 01:44:58 -05:00
parent 4f78874978
commit d738d35a7b
30 changed files with 0 additions and 8794 deletions

View File

@@ -12,7 +12,6 @@ list( APPEND SOURCES
${TARGET_ROOT}/../libmp3lame/gain_analysis.c
${TARGET_ROOT}/../libmp3lame/id3tag.c
${TARGET_ROOT}/../libmp3lame/lame.c
${TARGET_ROOT}/../libmp3lame/mpglib_interface.c
${TARGET_ROOT}/../libmp3lame/newmdct.c
${TARGET_ROOT}/../libmp3lame/presets.c
${TARGET_ROOT}/../libmp3lame/psymodel.c
@@ -27,23 +26,12 @@ list( APPEND SOURCES
${TARGET_ROOT}/../libmp3lame/VbrTag.c
${TARGET_ROOT}/../libmp3lame/version.c
${TARGET_ROOT}/../libmp3lame/vector/xmm_quantize_sub.c
# mpglib
${TARGET_ROOT}/../mpglib/common.c
${TARGET_ROOT}/../mpglib/dct64_i386.c
${TARGET_ROOT}/../mpglib/decode_i386.c
${TARGET_ROOT}/../mpglib/interface.c
${TARGET_ROOT}/../mpglib/layer1.c
${TARGET_ROOT}/../mpglib/layer2.c
${TARGET_ROOT}/../mpglib/layer3.c
${TARGET_ROOT}/../mpglib/tabinit.c
)
list( APPEND INCLUDES
PRIVATE
${_PRVDIR}
${TARGET_ROOT}/../libmp3lame
${TARGET_ROOT}/../mpglib
PUBLIC
${_PUBDIR}
)
@@ -83,8 +71,6 @@ elseif( SIZEOF_LONG_LONG EQUAL 8 )
set( A_INT64_T long long )
endif()
set( DECODE_ON_THE_FLY 1 )
set( HAVE_MPGLIB 1 )
set( TAKEHIRO_IEEE754_HACK 1 )
set( USE_FAST_LOG 1 )
if( ${CMakeDetermineASM_NASMCompiler} )

View File

@@ -1,16 +0,0 @@
Michael Hipp <mh@mpg123.de> Author of orignal mpglib version 0.2a.
Albert L. Faber <afaber@users.sf.net>
Aleksander Korzynski <olcios@users.sf.net>
Alexander Leidinger <aleidinger@users.sf.net>
Frank Klemm <pfk@users.sf.net>
Gabriel Bouvigne <bouvigne@users.sf.net>
Leigh Smith <leighsmith@users.sf.net>
Mark Taylor <markt@users.sf.net>
Myers Carpenter <myers@users.sf.net>
Naoki Shibata <shibatch@users.sf.net>
Robert Hegemann <robert@users.sf.net>
Sigbjorn Skjaeret <cisc@users.sf.net>
Stefan Bellon <sbellon@users.sf.net>
Steve Lhomme <robux4@users.sf.net>
Takehiro TOMINAGA <takehiro@users.sf.net>

View File

@@ -1,55 +0,0 @@
## $Id: Makefile.am,v 1.18 2010/10/30 13:21:02 robert Exp $
include $(top_srcdir)/Makefile.am.global
INCLUDES = @INCLUDES@ -I$(top_srcdir)/libmp3lame -I$(top_builddir)
EXTRA_DIST = \
AUTHORS \
README
DEFS = @DEFS@ @CONFIG_DEFS@
noinst_LTLIBRARIES = libmpgdecoder.la
libmpgdecoder_la_SOURCES = common.c \
dct64_i386.c \
decode_i386.c \
interface.c \
layer1.c \
layer2.c \
layer3.c \
tabinit.c
noinst_HEADERS = common.h \
dct64_i386.h \
decode_i386.h \
huffman.h \
interface.h \
l2tables.h \
layer1.h \
layer2.h \
layer3.h \
mpg123.h \
mpglib.h \
tabinit.h
LCLINTFLAGS= \
+posixlib \
+showsummary \
+showalluses \
+whichlib \
+forcehints \
-fixedformalarray \
+matchanyintegral \
-Dlint
lclint.txt: ${libmpgdecoder_la_SOURCES} ${noinst_HEADERS}
@lclint ${LCLINTFLAGS} ${INCLUDES} ${DEFS} ${libmpgdecoder_la_SOURCES} 2>&1 >lclint.txt || true
lclint: lclint.txt
more lclint.txt
#$(OBJECTS): libtool
#libtool: $(LIBTOOL_DEPS)
# $(SHELL) $(top_builddir)/config.status --recheck

View File

@@ -1,675 +0,0 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 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@
# global section for every Makefile.am
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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 = mpglib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libmpgdecoder_la_LIBADD =
am_libmpgdecoder_la_OBJECTS = common.lo dct64_i386.lo decode_i386.lo \
interface.lo layer1.lo layer2.lo layer3.lo tabinit.lo
libmpgdecoder_la_OBJECTS = $(am_libmpgdecoder_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libmpgdecoder_la_SOURCES)
DIST_SOURCES = $(libmpgdecoder_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/Makefile.am.global $(top_srcdir)/depcomp AUTHORS \
README depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIG_DEFS = @CONFIG_DEFS@
CONFIG_MATH_LIB = @CONFIG_MATH_LIB@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPUCCODE = @CPUCCODE@
CPUTYPE = @CPUTYPE@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@ @CONFIG_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@
FRONTEND_CFLAGS = @FRONTEND_CFLAGS@
FRONTEND_LDADD = @FRONTEND_LDADD@
FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@
GREP = @GREP@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_CONFIG = @GTK_CONFIG@
GTK_LIBS = @GTK_LIBS@
INCLUDES = @INCLUDES@ -I$(top_srcdir)/libmp3lame -I$(top_builddir)
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDADD = @LDADD@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@
LIB_MINOR_VERSION = @LIB_MINOR_VERSION@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEDEP = @MAKEDEP@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NASM = @NASM@
NASM_FORMAT = @NASM_FORMAT@
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_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
RM_F = @RM_F@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
SNDFILE_LIBS = @SNDFILE_LIBS@
STRIP = @STRIP@
VERSION = @VERSION@
WITH_FRONTEND = @WITH_FRONTEND@
WITH_MP3RTP = @WITH_MP3RTP@
WITH_MP3X = @WITH_MP3X@
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@
AUTOMAKE_OPTIONS = 1.15 foreign
EXTRA_DIST = \
AUTHORS \
README
noinst_LTLIBRARIES = libmpgdecoder.la
libmpgdecoder_la_SOURCES = common.c \
dct64_i386.c \
decode_i386.c \
interface.c \
layer1.c \
layer2.c \
layer3.c \
tabinit.c
noinst_HEADERS = common.h \
dct64_i386.h \
decode_i386.h \
huffman.h \
interface.h \
l2tables.h \
layer1.h \
layer2.h \
layer3.h \
mpg123.h \
mpglib.h \
tabinit.h
LCLINTFLAGS = \
+posixlib \
+showsummary \
+showalluses \
+whichlib \
+forcehints \
-fixedformalarray \
+matchanyintegral \
-Dlint
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(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) --foreign mpglib/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign mpglib/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_srcdir)/Makefile.am.global $(am__empty):
$(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
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libmpgdecoder.la: $(libmpgdecoder_la_OBJECTS) $(libmpgdecoder_la_DEPENDENCIES) $(EXTRA_libmpgdecoder_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(libmpgdecoder_la_OBJECTS) $(libmpgdecoder_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_i386.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decode_i386.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabinit.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$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 $(LTLIBRARIES) $(HEADERS)
installdirs:
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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
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
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
ctags-am 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-info \
install-info-am 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 tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# end global section
lclint.txt: ${libmpgdecoder_la_SOURCES} ${noinst_HEADERS}
@lclint ${LCLINTFLAGS} ${INCLUDES} ${DEFS} ${libmpgdecoder_la_SOURCES} 2>&1 >lclint.txt || true
lclint: lclint.txt
more lclint.txt
#$(OBJECTS): libtool
#libtool: $(LIBTOOL_DEPS)
# $(SHELL) $(top_builddir)/config.status --recheck
# 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,26 +0,0 @@
hip - Hip Isn't a Player
A LGPLed mpeg audio decoding library.
Based off of Michael Hipp's mpglib 0.2a <http://www.mpg123.de/>, with many
improvements by the lame development team (see AUTHORS).
The interface to the library is based off of vorbisfile. If you add mp3
support to your app using this library it should be a snap to add Ogg Vorbis
support as well.
This isn't as fast as mpg123 will be for decoding as none of it is in
assmbler.
Seeking currently isn't implemented.
From mpglib's orginal README:
=============================
PLEASE NOTE: This software may contain patented algorithms (at least
patented in some countries). It may be not allowed to sell/use products
based on this source code in these countries. Check this out first!
COPYRIGHT of MP3 music:
Please note, that the duplicating of copyrighted music without explicit
permission violates the rights of the owner.

View File

@@ -1,364 +0,0 @@
/*
* common.c: some common bitstream operations
*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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: common.c,v 1.42 2017/08/19 14:20:27 robert Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <ctype.h>
#include <stdlib.h>
#include <signal.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef macintosh
#include <types.h>
#include <stat.h>
#else
#include <sys/types.h>
#include <sys/stat.h>
#endif
#include <assert.h>
#include "common.h"
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
/* In C++ the array first must be prototyped, why ? */
/* *INDENT-OFF* */
const int tabsel_123 [2] [3] [16] = {
{ {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,},
{0,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,},
{0,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,} },
{ {0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,},
{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,},
{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,} }
};
const long freqs[9] = { 44100, 48000, 32000,
22050, 24000, 16000,
11025, 12000, 8000 };
/* *INDENT-ON* */
real muls[27][64];
#if 0
static void
get_II_stuff(struct frame *fr)
{
/* *INDENT-OFF* */
static const int translate [3] [2] [16] = /* char ? */
{ { { 0,2,2,2,2,2,2,0,0,0,1,1,1,1,1,0 } ,
{ 0,2,2,0,0,0,1,1,1,1,1,1,1,1,1,0 } } ,
{ { 0,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0 } ,
{ 0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0 } } ,
{ { 0,3,3,3,3,3,3,0,0,0,1,1,1,1,1,0 } ,
{ 0,3,3,0,0,0,1,1,1,1,1,1,1,1,1,0 } } };
/* *INDENT-ON* */
int table, sblim;
static const struct al_table2 *tables[5] = { alloc_0, alloc_1, alloc_2, alloc_3, alloc_4 };
static int sblims[5] = { 27, 30, 8, 12, 30 };
if (fr->lsf)
table = 4;
else
table = translate[fr->sampling_frequency][2 - fr->stereo][fr->bitrate_index];
sblim = sblims[table];
fr->alloc = tables[table];
fr->II_sblimit = sblim;
}
#endif
#define HDRCMPMASK 0xfffffd00
#define MAX_INPUT_FRAMESIZE 4096
int
head_check(unsigned long head, int check_layer)
{
/*
look for a valid header.
if check_layer > 0, then require that
nLayer = check_layer.
*/
/* bits 13-14 = layer 3 */
int nLayer = 4 - ((head >> 17) & 3);
if ((head & 0xffe00000) != 0xffe00000) {
/* syncword */
return FALSE;
}
if (nLayer == 4)
return FALSE;
if (check_layer > 0 && nLayer != check_layer)
return FALSE;
if (((head >> 12) & 0xf) == 0xf) {
/* bits 16,17,18,19 = 1111 invalid bitrate */
return FALSE;
}
if (((head >> 10) & 0x3) == 0x3) {
/* bits 20,21 = 11 invalid sampling freq */
return FALSE;
}
if ((head & 0x3) == 0x2)
/* invalid emphasis */
return FALSE;
return TRUE;
}
#if 0
static void
print_header(PMPSTR mp, struct frame *fr)
{
static const char *modes[4] = { "Stereo", "Joint-Stereo", "Dual-Channel", "Single-Channel" };
static const char *layers[4] = { "Unknown", "I", "II", "III" };
lame_report_fnc(mp->report_msg, "MPEG %s, Layer: %s, Freq: %ld, mode: %s, modext: %d, BPF : %d\n",
fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
layers[fr->lay], freqs[fr->sampling_frequency],
modes[fr->mode], fr->mode_ext, fr->framesize + 4);
lame_report_fnc(mp->report_msg, "Channels: %d, copyright: %s, original: %s, CRC: %s, emphasis: %d.\n",
fr->stereo, fr->copyright ? "Yes" : "No",
fr->original ? "Yes" : "No", fr->error_protection ? "Yes" : "No", fr->emphasis);
lame_report_fnc(mp->report_msg, "Bitrate: %d Kbits/s, Extension value: %d\n",
tabsel_123[fr->lsf][fr->lay - 1][fr->bitrate_index], fr->extension);
}
static void
print_header_compact(PMPSTR mp, struct frame *fr)
{
static const char *modes[4] = { "stereo", "joint-stereo", "dual-channel", "mono" };
static const char *layers[4] = { "Unknown", "I", "II", "III" };
lame_report_fnc(mp->report_err, "MPEG %s layer %s, %d kbit/s, %ld Hz %s\n",
fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
layers[fr->lay],
tabsel_123[fr->lsf][fr->lay - 1][fr->bitrate_index],
freqs[fr->sampling_frequency], modes[fr->mode]);
}
#endif
/*
* decode a header and write the information
* into the frame structure
*/
int
decode_header(PMPSTR mp, struct frame *fr, unsigned long newhead)
{
if (newhead & (1 << 20)) {
fr->lsf = (newhead & (1 << 19)) ? 0x0 : 0x1;
fr->mpeg25 = 0;
}
else {
fr->lsf = 1;
fr->mpeg25 = 1;
}
fr->lay = 4 - ((newhead >> 17) & 3);
if (fr->lay != 3 && fr->mpeg25) {
lame_report_fnc(mp->report_err, "MPEG-2.5 is supported by Layer3 only\n");
return 0;
}
if (((newhead >> 10) & 0x3) == 0x3) {
lame_report_fnc(mp->report_err, "Stream error\n");
return 0;
}
if (fr->mpeg25) {
fr->sampling_frequency = 6 + ((newhead >> 10) & 0x3);
}
else
fr->sampling_frequency = ((newhead >> 10) & 0x3) + (fr->lsf * 3);
fr->error_protection = ((newhead >> 16) & 0x1) ^ 0x1;
if (fr->mpeg25) /* allow Bitrate change for 2.5 ... */
fr->bitrate_index = ((newhead >> 12) & 0xf);
fr->bitrate_index = ((newhead >> 12) & 0xf);
fr->padding = ((newhead >> 9) & 0x1);
fr->extension = ((newhead >> 8) & 0x1);
fr->mode = ((newhead >> 6) & 0x3);
fr->mode_ext = ((newhead >> 4) & 0x3);
fr->copyright = ((newhead >> 3) & 0x1);
fr->original = ((newhead >> 2) & 0x1);
fr->emphasis = newhead & 0x3;
fr->stereo = (fr->mode == MPG_MD_MONO) ? 1 : 2;
switch (fr->lay) {
case 1:
fr->framesize = (long) tabsel_123[fr->lsf][0][fr->bitrate_index] * 12000;
fr->framesize /= freqs[fr->sampling_frequency];
fr->framesize = ((fr->framesize + fr->padding) << 2) - 4;
fr->down_sample = 0;
fr->down_sample_sblimit = SBLIMIT >> (fr->down_sample);
break;
case 2:
fr->framesize = (long) tabsel_123[fr->lsf][1][fr->bitrate_index] * 144000;
fr->framesize /= freqs[fr->sampling_frequency];
fr->framesize += fr->padding - 4;
fr->down_sample = 0;
fr->down_sample_sblimit = SBLIMIT >> (fr->down_sample);
break;
case 3:
#if 0
fr->do_layer = do_layer3;
if (fr->lsf)
ssize = (fr->stereo == 1) ? 9 : 17;
else
ssize = (fr->stereo == 1) ? 17 : 32;
#endif
#if 0
if (fr->error_protection)
ssize += 2;
#endif
if (fr->framesize > MAX_INPUT_FRAMESIZE) {
lame_report_fnc(mp->report_err, "Frame size too big.\n");
fr->framesize = MAX_INPUT_FRAMESIZE;
return (0);
}
if (fr->bitrate_index == 0)
fr->framesize = 0;
else {
fr->framesize = (long) tabsel_123[fr->lsf][2][fr->bitrate_index] * 144000;
fr->framesize /= freqs[fr->sampling_frequency] << (fr->lsf);
fr->framesize = fr->framesize + fr->padding - 4;
}
break;
default:
lame_report_fnc(mp->report_err, "Sorry, layer %d not supported\n", fr->lay);
return (0);
}
/* print_header(mp, fr); */
return 1;
}
unsigned int
getbits(PMPSTR mp, int number_of_bits)
{
unsigned long rval;
if (number_of_bits <= 0 || !mp->wordpointer)
return 0;
{
rval = mp->wordpointer[0];
rval <<= 8;
rval |= mp->wordpointer[1];
rval <<= 8;
rval |= mp->wordpointer[2];
rval <<= mp->bitindex;
rval &= 0xffffff;
mp->bitindex += number_of_bits;
rval >>= (24 - number_of_bits);
mp->wordpointer += (mp->bitindex >> 3);
mp->bitindex &= 7;
}
return rval;
}
unsigned int
getbits_fast(PMPSTR mp, int number_of_bits)
{
unsigned long rval;
{
rval = mp->wordpointer[0];
rval <<= 8;
rval |= mp->wordpointer[1];
rval <<= mp->bitindex;
rval &= 0xffff;
mp->bitindex += number_of_bits;
rval >>= (16 - number_of_bits);
mp->wordpointer += (mp->bitindex >> 3);
mp->bitindex &= 7;
}
return rval;
}
unsigned char
get_leq_8_bits(PMPSTR mp, unsigned int number_of_bits)
{
assert(number_of_bits <= 8);
return (unsigned char) getbits_fast(mp, number_of_bits);
}
unsigned short
get_leq_16_bits(PMPSTR mp, unsigned int number_of_bits)
{
assert(number_of_bits <= 16);
return (unsigned short) getbits_fast(mp, number_of_bits);
}
int
set_pointer(PMPSTR mp, long backstep)
{
unsigned char *bsbufold;
if (mp->fsizeold < 0 && backstep > 0) {
lame_report_fnc(mp->report_err, "hip: Can't step back %ld bytes!\n", backstep);
return MP3_ERR;
}
bsbufold = mp->bsspace[1 - mp->bsnum] + 512;
mp->wordpointer -= backstep;
if (backstep)
memcpy(mp->wordpointer, bsbufold + mp->fsizeold - backstep, (size_t) backstep);
mp->bitindex = 0;
return MP3_OK;
}

View File

@@ -1,43 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef COMMON_H_INCLUDED
#define COMMON_H_INCLUDED
#include "mpg123.h"
#include "mpglib.h"
extern const int tabsel_123[2][3][16];
extern const long freqs[9];
extern real muls[27][64];
int head_check(unsigned long head, int check_layer);
int decode_header(PMPSTR mp, struct frame *fr, unsigned long newhead);
unsigned int getbits(PMPSTR mp, int number_of_bits);
unsigned int getbits_fast(PMPSTR mp, int number_of_bits);
unsigned char get_leq_8_bits(PMPSTR mp, unsigned int number_of_bits);
unsigned short get_leq_16_bits(PMPSTR mp, unsigned int number_of_bits);
int set_pointer(PMPSTR mp, long backstep);
#endif

View File

@@ -1,130 +0,0 @@
#ifndef CONFIGMS_H_INCLUDED
#define CONFIGMS_H_INCLUDED
/*#if defined(_MSC_VER)*/
#if 0
/* The number of bytes in a double. */
#define SIZEOF_DOUBLE 8
/* The number of bytes in a float. */
#define SIZEOF_FLOAT 4
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/* The number of bytes in a long double. */
#define SIZEOF_LONG_DOUBLE 12
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
/* The number of bytes in a unsigned int. */
#define SIZEOF_UNSIGNED_INT 4
/* The number of bytes in a unsigned long. */
#define SIZEOF_UNSIGNED_LONG 4
/* The number of bytes in a unsigned short. */
#define SIZEOF_UNSIGNED_SHORT 2
#endif
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS
/* Define if you have the <errno.h> header file. */
#define HAVE_ERRNO_H
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H
/* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H
/* Name of package */
#define PACKAGE "lame"
/* Define if compiler has function prototypes */
#define PROTOTYPES 1
/* faster log implementation with less but enough precission */
#define USE_FAST_LOG 1
#define HAVE_STRCHR
#define HAVE_MEMCPY
#if defined(_MSC_VER) || defined(__BORLANDC__)
#pragma warning( disable : 4305 )
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
typedef float float32_t;
typedef double float64_t;
#elif defined(STDC_HEADERS)
#include <stdlib.h>
typedef u_int8_t uint8_t;
typedef u_int16_t uint16_t;
typedef u_int32_t uint32_t;
#elif defined (__GNUC__)
#define __int8_t_defined
#define uint8_t unsigned char
#define uint16_t unsigned short
#define uint32_t unsigned int
#define uint64_t unsigned long long
#define int8_t signed char
#define int16_t signed short
#define int32_t signed int
#define int64_t signed long long
#endif
typedef long double ieee854_float80_t;
typedef double ieee754_float64_t;
typedef float ieee754_float32_t;
#ifdef HAVE_MPGLIB
# define DECODE_ON_THE_FLY 1
#endif
#ifdef LAME_ACM
/* memory hacking for driver purposes */
#define calloc(x,y) acm_Calloc(x,y)
#define free(x) acm_Free(x)
#define malloc(x) acm_Malloc(x)
#include <stddef.h>
void *acm_Calloc( size_t num, size_t size );
void *acm_Malloc( size_t size );
void acm_Free( void * mem);
#endif /* LAME_ACM */
#define LAME_LIBRARY_BUILD
#ifdef HAVE_NASM
#if (defined(__ICL) && (__ICL >= 450))
#define HAVE_XMMINTRIN_H
#elif defined(_MSC_VER)
#include <malloc.h>
#ifdef _mm_malloc
#define HAVE_XMMINTRIN_H
#endif
#endif
#endif
#if defined(_M_X64) && !defined(HAVE_XMMINTRIN_H)
#define HAVE_XMMINTRIN_H
#endif
#endif

View File

@@ -1,348 +0,0 @@
/*
* dct64_i368.c
*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*
*
* Discrete Cosine Tansform (DCT) for subband synthesis
* optimized for machines with no auto-increment.
* The performance is highly compiler dependend. Maybe
* the dct64.c version for 'normal' processor may be faster
* even for Intel processors.
*/
/* $Id: dct64_i386.c,v 1.14 2010/03/22 14:30:19 robert Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "dct64_i386.h"
#include "tabinit.h"
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
static void
dct64_1(real * out0, real * out1, real * b1, real * b2, real * samples)
{
{
real *costab = pnts[0];
b1[0x00] = samples[0x00] + samples[0x1F];
b1[0x1F] = (samples[0x00] - samples[0x1F]) * costab[0x0];
b1[0x01] = samples[0x01] + samples[0x1E];
b1[0x1E] = (samples[0x01] - samples[0x1E]) * costab[0x1];
b1[0x02] = samples[0x02] + samples[0x1D];
b1[0x1D] = (samples[0x02] - samples[0x1D]) * costab[0x2];
b1[0x03] = samples[0x03] + samples[0x1C];
b1[0x1C] = (samples[0x03] - samples[0x1C]) * costab[0x3];
b1[0x04] = samples[0x04] + samples[0x1B];
b1[0x1B] = (samples[0x04] - samples[0x1B]) * costab[0x4];
b1[0x05] = samples[0x05] + samples[0x1A];
b1[0x1A] = (samples[0x05] - samples[0x1A]) * costab[0x5];
b1[0x06] = samples[0x06] + samples[0x19];
b1[0x19] = (samples[0x06] - samples[0x19]) * costab[0x6];
b1[0x07] = samples[0x07] + samples[0x18];
b1[0x18] = (samples[0x07] - samples[0x18]) * costab[0x7];
b1[0x08] = samples[0x08] + samples[0x17];
b1[0x17] = (samples[0x08] - samples[0x17]) * costab[0x8];
b1[0x09] = samples[0x09] + samples[0x16];
b1[0x16] = (samples[0x09] - samples[0x16]) * costab[0x9];
b1[0x0A] = samples[0x0A] + samples[0x15];
b1[0x15] = (samples[0x0A] - samples[0x15]) * costab[0xA];
b1[0x0B] = samples[0x0B] + samples[0x14];
b1[0x14] = (samples[0x0B] - samples[0x14]) * costab[0xB];
b1[0x0C] = samples[0x0C] + samples[0x13];
b1[0x13] = (samples[0x0C] - samples[0x13]) * costab[0xC];
b1[0x0D] = samples[0x0D] + samples[0x12];
b1[0x12] = (samples[0x0D] - samples[0x12]) * costab[0xD];
b1[0x0E] = samples[0x0E] + samples[0x11];
b1[0x11] = (samples[0x0E] - samples[0x11]) * costab[0xE];
b1[0x0F] = samples[0x0F] + samples[0x10];
b1[0x10] = (samples[0x0F] - samples[0x10]) * costab[0xF];
}
{
real *costab = pnts[1];
b2[0x00] = b1[0x00] + b1[0x0F];
b2[0x0F] = (b1[0x00] - b1[0x0F]) * costab[0];
b2[0x01] = b1[0x01] + b1[0x0E];
b2[0x0E] = (b1[0x01] - b1[0x0E]) * costab[1];
b2[0x02] = b1[0x02] + b1[0x0D];
b2[0x0D] = (b1[0x02] - b1[0x0D]) * costab[2];
b2[0x03] = b1[0x03] + b1[0x0C];
b2[0x0C] = (b1[0x03] - b1[0x0C]) * costab[3];
b2[0x04] = b1[0x04] + b1[0x0B];
b2[0x0B] = (b1[0x04] - b1[0x0B]) * costab[4];
b2[0x05] = b1[0x05] + b1[0x0A];
b2[0x0A] = (b1[0x05] - b1[0x0A]) * costab[5];
b2[0x06] = b1[0x06] + b1[0x09];
b2[0x09] = (b1[0x06] - b1[0x09]) * costab[6];
b2[0x07] = b1[0x07] + b1[0x08];
b2[0x08] = (b1[0x07] - b1[0x08]) * costab[7];
b2[0x10] = b1[0x10] + b1[0x1F];
b2[0x1F] = (b1[0x1F] - b1[0x10]) * costab[0];
b2[0x11] = b1[0x11] + b1[0x1E];
b2[0x1E] = (b1[0x1E] - b1[0x11]) * costab[1];
b2[0x12] = b1[0x12] + b1[0x1D];
b2[0x1D] = (b1[0x1D] - b1[0x12]) * costab[2];
b2[0x13] = b1[0x13] + b1[0x1C];
b2[0x1C] = (b1[0x1C] - b1[0x13]) * costab[3];
b2[0x14] = b1[0x14] + b1[0x1B];
b2[0x1B] = (b1[0x1B] - b1[0x14]) * costab[4];
b2[0x15] = b1[0x15] + b1[0x1A];
b2[0x1A] = (b1[0x1A] - b1[0x15]) * costab[5];
b2[0x16] = b1[0x16] + b1[0x19];
b2[0x19] = (b1[0x19] - b1[0x16]) * costab[6];
b2[0x17] = b1[0x17] + b1[0x18];
b2[0x18] = (b1[0x18] - b1[0x17]) * costab[7];
}
{
real *costab = pnts[2];
b1[0x00] = b2[0x00] + b2[0x07];
b1[0x07] = (b2[0x00] - b2[0x07]) * costab[0];
b1[0x01] = b2[0x01] + b2[0x06];
b1[0x06] = (b2[0x01] - b2[0x06]) * costab[1];
b1[0x02] = b2[0x02] + b2[0x05];
b1[0x05] = (b2[0x02] - b2[0x05]) * costab[2];
b1[0x03] = b2[0x03] + b2[0x04];
b1[0x04] = (b2[0x03] - b2[0x04]) * costab[3];
b1[0x08] = b2[0x08] + b2[0x0F];
b1[0x0F] = (b2[0x0F] - b2[0x08]) * costab[0];
b1[0x09] = b2[0x09] + b2[0x0E];
b1[0x0E] = (b2[0x0E] - b2[0x09]) * costab[1];
b1[0x0A] = b2[0x0A] + b2[0x0D];
b1[0x0D] = (b2[0x0D] - b2[0x0A]) * costab[2];
b1[0x0B] = b2[0x0B] + b2[0x0C];
b1[0x0C] = (b2[0x0C] - b2[0x0B]) * costab[3];
b1[0x10] = b2[0x10] + b2[0x17];
b1[0x17] = (b2[0x10] - b2[0x17]) * costab[0];
b1[0x11] = b2[0x11] + b2[0x16];
b1[0x16] = (b2[0x11] - b2[0x16]) * costab[1];
b1[0x12] = b2[0x12] + b2[0x15];
b1[0x15] = (b2[0x12] - b2[0x15]) * costab[2];
b1[0x13] = b2[0x13] + b2[0x14];
b1[0x14] = (b2[0x13] - b2[0x14]) * costab[3];
b1[0x18] = b2[0x18] + b2[0x1F];
b1[0x1F] = (b2[0x1F] - b2[0x18]) * costab[0];
b1[0x19] = b2[0x19] + b2[0x1E];
b1[0x1E] = (b2[0x1E] - b2[0x19]) * costab[1];
b1[0x1A] = b2[0x1A] + b2[0x1D];
b1[0x1D] = (b2[0x1D] - b2[0x1A]) * costab[2];
b1[0x1B] = b2[0x1B] + b2[0x1C];
b1[0x1C] = (b2[0x1C] - b2[0x1B]) * costab[3];
}
{
real const cos0 = pnts[3][0];
real const cos1 = pnts[3][1];
b2[0x00] = b1[0x00] + b1[0x03];
b2[0x03] = (b1[0x00] - b1[0x03]) * cos0;
b2[0x01] = b1[0x01] + b1[0x02];
b2[0x02] = (b1[0x01] - b1[0x02]) * cos1;
b2[0x04] = b1[0x04] + b1[0x07];
b2[0x07] = (b1[0x07] - b1[0x04]) * cos0;
b2[0x05] = b1[0x05] + b1[0x06];
b2[0x06] = (b1[0x06] - b1[0x05]) * cos1;
b2[0x08] = b1[0x08] + b1[0x0B];
b2[0x0B] = (b1[0x08] - b1[0x0B]) * cos0;
b2[0x09] = b1[0x09] + b1[0x0A];
b2[0x0A] = (b1[0x09] - b1[0x0A]) * cos1;
b2[0x0C] = b1[0x0C] + b1[0x0F];
b2[0x0F] = (b1[0x0F] - b1[0x0C]) * cos0;
b2[0x0D] = b1[0x0D] + b1[0x0E];
b2[0x0E] = (b1[0x0E] - b1[0x0D]) * cos1;
b2[0x10] = b1[0x10] + b1[0x13];
b2[0x13] = (b1[0x10] - b1[0x13]) * cos0;
b2[0x11] = b1[0x11] + b1[0x12];
b2[0x12] = (b1[0x11] - b1[0x12]) * cos1;
b2[0x14] = b1[0x14] + b1[0x17];
b2[0x17] = (b1[0x17] - b1[0x14]) * cos0;
b2[0x15] = b1[0x15] + b1[0x16];
b2[0x16] = (b1[0x16] - b1[0x15]) * cos1;
b2[0x18] = b1[0x18] + b1[0x1B];
b2[0x1B] = (b1[0x18] - b1[0x1B]) * cos0;
b2[0x19] = b1[0x19] + b1[0x1A];
b2[0x1A] = (b1[0x19] - b1[0x1A]) * cos1;
b2[0x1C] = b1[0x1C] + b1[0x1F];
b2[0x1F] = (b1[0x1F] - b1[0x1C]) * cos0;
b2[0x1D] = b1[0x1D] + b1[0x1E];
b2[0x1E] = (b1[0x1E] - b1[0x1D]) * cos1;
}
{
real const cos0 = pnts[4][0];
b1[0x00] = b2[0x00] + b2[0x01];
b1[0x01] = (b2[0x00] - b2[0x01]) * cos0;
b1[0x02] = b2[0x02] + b2[0x03];
b1[0x03] = (b2[0x03] - b2[0x02]) * cos0;
b1[0x02] += b1[0x03];
b1[0x04] = b2[0x04] + b2[0x05];
b1[0x05] = (b2[0x04] - b2[0x05]) * cos0;
b1[0x06] = b2[0x06] + b2[0x07];
b1[0x07] = (b2[0x07] - b2[0x06]) * cos0;
b1[0x06] += b1[0x07];
b1[0x04] += b1[0x06];
b1[0x06] += b1[0x05];
b1[0x05] += b1[0x07];
b1[0x08] = b2[0x08] + b2[0x09];
b1[0x09] = (b2[0x08] - b2[0x09]) * cos0;
b1[0x0A] = b2[0x0A] + b2[0x0B];
b1[0x0B] = (b2[0x0B] - b2[0x0A]) * cos0;
b1[0x0A] += b1[0x0B];
b1[0x0C] = b2[0x0C] + b2[0x0D];
b1[0x0D] = (b2[0x0C] - b2[0x0D]) * cos0;
b1[0x0E] = b2[0x0E] + b2[0x0F];
b1[0x0F] = (b2[0x0F] - b2[0x0E]) * cos0;
b1[0x0E] += b1[0x0F];
b1[0x0C] += b1[0x0E];
b1[0x0E] += b1[0x0D];
b1[0x0D] += b1[0x0F];
b1[0x10] = b2[0x10] + b2[0x11];
b1[0x11] = (b2[0x10] - b2[0x11]) * cos0;
b1[0x12] = b2[0x12] + b2[0x13];
b1[0x13] = (b2[0x13] - b2[0x12]) * cos0;
b1[0x12] += b1[0x13];
b1[0x14] = b2[0x14] + b2[0x15];
b1[0x15] = (b2[0x14] - b2[0x15]) * cos0;
b1[0x16] = b2[0x16] + b2[0x17];
b1[0x17] = (b2[0x17] - b2[0x16]) * cos0;
b1[0x16] += b1[0x17];
b1[0x14] += b1[0x16];
b1[0x16] += b1[0x15];
b1[0x15] += b1[0x17];
b1[0x18] = b2[0x18] + b2[0x19];
b1[0x19] = (b2[0x18] - b2[0x19]) * cos0;
b1[0x1A] = b2[0x1A] + b2[0x1B];
b1[0x1B] = (b2[0x1B] - b2[0x1A]) * cos0;
b1[0x1A] += b1[0x1B];
b1[0x1C] = b2[0x1C] + b2[0x1D];
b1[0x1D] = (b2[0x1C] - b2[0x1D]) * cos0;
b1[0x1E] = b2[0x1E] + b2[0x1F];
b1[0x1F] = (b2[0x1F] - b2[0x1E]) * cos0;
b1[0x1E] += b1[0x1F];
b1[0x1C] += b1[0x1E];
b1[0x1E] += b1[0x1D];
b1[0x1D] += b1[0x1F];
}
out0[0x10 * 16] = b1[0x00];
out0[0x10 * 12] = b1[0x04];
out0[0x10 * 8] = b1[0x02];
out0[0x10 * 4] = b1[0x06];
out0[0x10 * 0] = b1[0x01];
out1[0x10 * 0] = b1[0x01];
out1[0x10 * 4] = b1[0x05];
out1[0x10 * 8] = b1[0x03];
out1[0x10 * 12] = b1[0x07];
b1[0x08] += b1[0x0C];
out0[0x10 * 14] = b1[0x08];
b1[0x0C] += b1[0x0a];
out0[0x10 * 10] = b1[0x0C];
b1[0x0A] += b1[0x0E];
out0[0x10 * 6] = b1[0x0A];
b1[0x0E] += b1[0x09];
out0[0x10 * 2] = b1[0x0E];
b1[0x09] += b1[0x0D];
out1[0x10 * 2] = b1[0x09];
b1[0x0D] += b1[0x0B];
out1[0x10 * 6] = b1[0x0D];
b1[0x0B] += b1[0x0F];
out1[0x10 * 10] = b1[0x0B];
out1[0x10 * 14] = b1[0x0F];
b1[0x18] += b1[0x1C];
out0[0x10 * 15] = b1[0x10] + b1[0x18];
out0[0x10 * 13] = b1[0x18] + b1[0x14];
b1[0x1C] += b1[0x1a];
out0[0x10 * 11] = b1[0x14] + b1[0x1C];
out0[0x10 * 9] = b1[0x1C] + b1[0x12];
b1[0x1A] += b1[0x1E];
out0[0x10 * 7] = b1[0x12] + b1[0x1A];
out0[0x10 * 5] = b1[0x1A] + b1[0x16];
b1[0x1E] += b1[0x19];
out0[0x10 * 3] = b1[0x16] + b1[0x1E];
out0[0x10 * 1] = b1[0x1E] + b1[0x11];
b1[0x19] += b1[0x1D];
out1[0x10 * 1] = b1[0x11] + b1[0x19];
out1[0x10 * 3] = b1[0x19] + b1[0x15];
b1[0x1D] += b1[0x1B];
out1[0x10 * 5] = b1[0x15] + b1[0x1D];
out1[0x10 * 7] = b1[0x1D] + b1[0x13];
b1[0x1B] += b1[0x1F];
out1[0x10 * 9] = b1[0x13] + b1[0x1B];
out1[0x10 * 11] = b1[0x1B] + b1[0x17];
out1[0x10 * 13] = b1[0x17] + b1[0x1F];
out1[0x10 * 15] = b1[0x1F];
}
/*
* the call via dct64 is a trick to force GCC to use
* (new) registers for the b1,b2 pointer to the bufs[xx] field
*/
void
dct64(real * a, real * b, real * c)
{
real bufs[0x40];
dct64_1(a, b, bufs, bufs + 0x20, c);
}

View File

@@ -1,30 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef MPGLIB_DCT64_I386_H_INCLUDED
#define MPGLIB_DCT64_I386_H_INCLUDED
#include "common.h"
void dct64(real * a, real * b, real * c);
#endif

View File

@@ -1,224 +0,0 @@
/*
* decode_i396.c: Mpeg Layer-1,2,3 audio decoder
*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*
*
* Slighlty optimized for machines without autoincrement/decrement.
* The performance is highly compiler dependend. Maybe
* the decode.c version for 'normal' processor may be faster
* even for Intel processors.
*/
/* $Id: decode_i386.c,v 1.22 2010/03/22 14:30:19 robert Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <string.h>
#else
# ifndef HAVE_STRCHR
# define strchr index
# define strrchr rindex
# endif
char *strchr(), *strrchr();
# ifndef HAVE_MEMCPY
# define memcpy(d, s, n) bcopy ((s), (d), (n))
# define memmove(d, s, n) bcopy ((s), (d), (n))
# endif
#endif
#if defined(__riscos__) && defined(FPA10)
#include "ymath.h"
#else
#include <math.h>
#endif
#include "decode_i386.h"
#include "dct64_i386.h"
#include "tabinit.h"
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
/* old WRITE_SAMPLE_CLIPPED */
#define WRITE_SAMPLE_CLIPPED(TYPE,samples,sum,clip) \
if( (sum) > 32767.0) { *(samples) = 0x7fff; (clip)++; } \
else if( (sum) < -32768.0) { *(samples) = -0x8000; (clip)++; } \
else { *(samples) = (TYPE)((sum)>0 ? (sum)+0.5 : (sum)-0.5) ; }
#define WRITE_SAMPLE_UNCLIPPED(TYPE,samples,sum,clip) \
*samples = (TYPE)sum;
/* *INDENT-OFF* */
/* versions: clipped (when TYPE == short) and unclipped (when TYPE == real) of synth_1to1_mono* functions */
#define SYNTH_1TO1_MONO_CLIPCHOICE(TYPE,SYNTH_1TO1) \
TYPE samples_tmp[64]; \
TYPE *tmp1 = samples_tmp; \
int i,ret; \
int pnt1 = 0; \
\
ret = SYNTH_1TO1 (mp,bandPtr,0,(unsigned char *) samples_tmp,&pnt1); \
out += *pnt; \
\
for(i=0;i<32;i++) { \
*( (TYPE *) out) = *tmp1; \
out += sizeof(TYPE); \
tmp1 += 2; \
} \
*pnt += 32*sizeof(TYPE); \
\
return ret;
/* *INDENT-ON* */
int
synth_1to1_mono(PMPSTR mp, real * bandPtr, unsigned char *out, int *pnt)
{
SYNTH_1TO1_MONO_CLIPCHOICE(short, synth_1to1)
} int
synth_1to1_mono_unclipped(PMPSTR mp, real * bandPtr, unsigned char *out, int *pnt)
{
SYNTH_1TO1_MONO_CLIPCHOICE(real, synth_1to1_unclipped)
}
/* *INDENT-OFF* */
/* versions: clipped (when TYPE == short) and unclipped (when TYPE == real) of synth_1to1* functions */
#define SYNTH_1TO1_CLIPCHOICE(TYPE,WRITE_SAMPLE) \
static const int step = 2; \
int bo; \
TYPE *samples = (TYPE *) (out + *pnt); \
\
real *b0,(*buf)[0x110]; \
int clip = 0; \
int bo1; \
\
bo = mp->synth_bo; \
\
if(!channel) { \
bo--; \
bo &= 0xf; \
buf = mp->synth_buffs[0]; \
} \
else { \
samples++; \
buf = mp->synth_buffs[1]; \
} \
\
if(bo & 0x1) { \
b0 = buf[0]; \
bo1 = bo; \
dct64(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr); \
} \
else { \
b0 = buf[1]; \
bo1 = bo+1; \
dct64(buf[0]+bo,buf[1]+bo+1,bandPtr); \
} \
\
mp->synth_bo = bo; \
\
{ \
int j; \
real *window = decwin + 16 - bo1; \
\
for (j=16;j;j--,b0+=0x10,window+=0x20,samples+=step) \
{ \
real sum; \
sum = window[0x0] * b0[0x0]; \
sum -= window[0x1] * b0[0x1]; \
sum += window[0x2] * b0[0x2]; \
sum -= window[0x3] * b0[0x3]; \
sum += window[0x4] * b0[0x4]; \
sum -= window[0x5] * b0[0x5]; \
sum += window[0x6] * b0[0x6]; \
sum -= window[0x7] * b0[0x7]; \
sum += window[0x8] * b0[0x8]; \
sum -= window[0x9] * b0[0x9]; \
sum += window[0xA] * b0[0xA]; \
sum -= window[0xB] * b0[0xB]; \
sum += window[0xC] * b0[0xC]; \
sum -= window[0xD] * b0[0xD]; \
sum += window[0xE] * b0[0xE]; \
sum -= window[0xF] * b0[0xF]; \
\
WRITE_SAMPLE (TYPE,samples,sum,clip); \
} \
\
{ \
real sum; \
sum = window[0x0] * b0[0x0]; \
sum += window[0x2] * b0[0x2]; \
sum += window[0x4] * b0[0x4]; \
sum += window[0x6] * b0[0x6]; \
sum += window[0x8] * b0[0x8]; \
sum += window[0xA] * b0[0xA]; \
sum += window[0xC] * b0[0xC]; \
sum += window[0xE] * b0[0xE]; \
WRITE_SAMPLE (TYPE,samples,sum,clip); \
b0-=0x10,window-=0x20,samples+=step; \
} \
window += bo1<<1; \
\
for (j=15;j;j--,b0-=0x10,window-=0x20,samples+=step) \
{ \
real sum; \
sum = -window[-0x1] * b0[0x0]; \
sum -= window[-0x2] * b0[0x1]; \
sum -= window[-0x3] * b0[0x2]; \
sum -= window[-0x4] * b0[0x3]; \
sum -= window[-0x5] * b0[0x4]; \
sum -= window[-0x6] * b0[0x5]; \
sum -= window[-0x7] * b0[0x6]; \
sum -= window[-0x8] * b0[0x7]; \
sum -= window[-0x9] * b0[0x8]; \
sum -= window[-0xA] * b0[0x9]; \
sum -= window[-0xB] * b0[0xA]; \
sum -= window[-0xC] * b0[0xB]; \
sum -= window[-0xD] * b0[0xC]; \
sum -= window[-0xE] * b0[0xD]; \
sum -= window[-0xF] * b0[0xE]; \
sum -= window[-0x0] * b0[0xF]; \
\
WRITE_SAMPLE (TYPE,samples,sum,clip); \
} \
} \
*pnt += 64*sizeof(TYPE); \
\
return clip;
/* *INDENT-ON* */
int
synth_1to1(PMPSTR mp, real * bandPtr, int channel, unsigned char *out, int *pnt)
{
SYNTH_1TO1_CLIPCHOICE(short, WRITE_SAMPLE_CLIPPED)
} int
synth_1to1_unclipped(PMPSTR mp, real * bandPtr, int channel, unsigned char *out, int *pnt)
{
SYNTH_1TO1_CLIPCHOICE(real, WRITE_SAMPLE_UNCLIPPED)
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef DECODE_I386_H_INCLUDED
#define DECODE_I386_H_INCLUDED
#include "common.h"
int synth_1to1_mono(PMPSTR mp, real * bandPtr, unsigned char *out, int *pnt);
int synth_1to1(PMPSTR mp, real * bandPtr, int channel, unsigned char *out, int *pnt);
int synth_1to1_mono_unclipped(PMPSTR mp, real * bandPtr, unsigned char *out, int *pnt);
int synth_1to1_unclipped(PMPSTR mp, real * bandPtr, int channel, unsigned char *out, int *pnt);
#endif

View File

@@ -1,791 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2016-01-11.22; # UTC
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
# 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, 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, see <http://www.gnu.org/licenses/>.
# 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.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# 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.
set_dir_from "$object"
set_base_from "$object"
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 $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -1,353 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*
* huffman tables ... recalcualted to work with my optimzed
* decoder scheme (MH)
*
* probably we could save a few bytes of memory, because the
* smaller tables are often the part of a bigger table
*/
/* *INDENT-OFF* */
struct newhuff
{
const unsigned int linbits;
const short * const table;
};
static const short tab0[] =
{
0
};
static const short tab1[] =
{
-5, -3, -1, 17, 1, 16, 0
};
static const short tab2[] =
{
-15, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 17, -1, 1, 16, 0
};
static const short tab3[] =
{
-13, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 16, 17, -1,
1, 0
};
static const short tab5[] =
{
-29, -25, -23, -15, -7, -5, -3, -1, 51, 35, 50, 49, -3, -1, 19,
3, -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, 17, -1, 1, 16,
0
};
static const short tab6[] =
{
-25, -19, -13, -9, -5, -3, -1, 51, 3, 35, -1, 50, 48, -1, 19,
49, -3, -1, 34, 2, 18, -3, -1, 33, 32, 1, -1, 17, -1, 16,
0
};
static const short tab7[] =
{
-69, -65, -57, -39, -29, -17, -11, -7, -3, -1, 85, 69, -1, 84, 83,
-1, 53, 68, -3, -1, 37, 82, 21, -5, -1, 81, -1, 5, 52, -1,
80, -1, 67, 51, -5, -3, -1, 36, 66, 20, -1, 65, 64, -11, -7,
-3, -1, 4, 35, -1, 50, 3, -1, 19, 49, -3, -1, 48, 34, 18,
-5, -1, 33, -1, 2, 32, 17, -1, 1, 16, 0
};
static const short tab8[] =
{
-65, -63, -59, -45, -31, -19, -13, -7, -5, -3, -1, 85, 84, 69, 83,
-3, -1, 53, 68, 37, -3, -1, 82, 5, 21, -5, -1, 81, -1, 52,
67, -3, -1, 80, 51, 36, -5, -3, -1, 66, 20, 65, -3, -1, 4,
64, -1, 35, 50, -9, -7, -3, -1, 19, 49, -1, 3, 48, 34, -1,
2, 32, -1, 18, 33, 17, -3, -1, 1, 16, 0
};
static const short tab9[] =
{
-63, -53, -41, -29, -19, -11, -5, -3, -1, 85, 69, 53, -1, 83, -1,
84, 5, -3, -1, 68, 37, -1, 82, 21, -3, -1, 81, 52, -1, 67,
-1, 80, 4, -7, -3, -1, 36, 66, -1, 51, 64, -1, 20, 65, -5,
-3, -1, 35, 50, 19, -1, 49, -1, 3, 48, -5, -3, -1, 34, 2,
18, -1, 33, 32, -3, -1, 17, 1, -1, 16, 0
};
static const short tab10[] =
{
-125,-121,-111, -83, -55, -35, -21, -13, -7, -3, -1, 119, 103, -1, 118,
87, -3, -1, 117, 102, 71, -3, -1, 116, 86, -1, 101, 55, -9, -3,
-1, 115, 70, -3, -1, 85, 84, 99, -1, 39, 114, -11, -5, -3, -1,
100, 7, 112, -1, 98, -1, 69, 53, -5, -1, 6, -1, 83, 68, 23,
-17, -5, -1, 113, -1, 54, 38, -5, -3, -1, 37, 82, 21, -1, 81,
-1, 52, 67, -3, -1, 22, 97, -1, 96, -1, 5, 80, -19, -11, -7,
-3, -1, 36, 66, -1, 51, 4, -1, 20, 65, -3, -1, 64, 35, -1,
50, 3, -3, -1, 19, 49, -1, 48, 34, -7, -3, -1, 18, 33, -1,
2, 32, 17, -1, 1, 16, 0
};
static const short tab11[] =
{
-121,-113, -89, -59, -43, -27, -17, -7, -3, -1, 119, 103, -1, 118, 117,
-3, -1, 102, 71, -1, 116, -1, 87, 85, -5, -3, -1, 86, 101, 55,
-1, 115, 70, -9, -7, -3, -1, 69, 84, -1, 53, 83, 39, -1, 114,
-1, 100, 7, -5, -1, 113, -1, 23, 112, -3, -1, 54, 99, -1, 96,
-1, 68, 37, -13, -7, -5, -3, -1, 82, 5, 21, 98, -3, -1, 38,
6, 22, -5, -1, 97, -1, 81, 52, -5, -1, 80, -1, 67, 51, -1,
36, 66, -15, -11, -7, -3, -1, 20, 65, -1, 4, 64, -1, 35, 50,
-1, 19, 49, -5, -3, -1, 3, 48, 34, 33, -5, -1, 18, -1, 2,
32, 17, -3, -1, 1, 16, 0
};
static const short tab12[] =
{
-115, -99, -73, -45, -27, -17, -9, -5, -3, -1, 119, 103, 118, -1, 87,
117, -3, -1, 102, 71, -1, 116, 101, -3, -1, 86, 55, -3, -1, 115,
85, 39, -7, -3, -1, 114, 70, -1, 100, 23, -5, -1, 113, -1, 7,
112, -1, 54, 99, -13, -9, -3, -1, 69, 84, -1, 68, -1, 6, 5,
-1, 38, 98, -5, -1, 97, -1, 22, 96, -3, -1, 53, 83, -1, 37,
82, -17, -7, -3, -1, 21, 81, -1, 52, 67, -5, -3, -1, 80, 4,
36, -1, 66, 20, -3, -1, 51, 65, -1, 35, 50, -11, -7, -5, -3,
-1, 64, 3, 48, 19, -1, 49, 34, -1, 18, 33, -7, -5, -3, -1,
2, 32, 0, 17, -1, 1, 16
};
static const short tab13[] =
{
-509,-503,-475,-405,-333,-265,-205,-153,-115, -83, -53, -35, -21, -13, -9,
-7, -5, -3, -1, 254, 252, 253, 237, 255, -1, 239, 223, -3, -1, 238,
207, -1, 222, 191, -9, -3, -1, 251, 206, -1, 220, -1, 175, 233, -1,
236, 221, -9, -5, -3, -1, 250, 205, 190, -1, 235, 159, -3, -1, 249,
234, -1, 189, 219, -17, -9, -3, -1, 143, 248, -1, 204, -1, 174, 158,
-5, -1, 142, -1, 127, 126, 247, -5, -1, 218, -1, 173, 188, -3, -1,
203, 246, 111, -15, -7, -3, -1, 232, 95, -1, 157, 217, -3, -1, 245,
231, -1, 172, 187, -9, -3, -1, 79, 244, -3, -1, 202, 230, 243, -1,
63, -1, 141, 216, -21, -9, -3, -1, 47, 242, -3, -1, 110, 156, 15,
-5, -3, -1, 201, 94, 171, -3, -1, 125, 215, 78, -11, -5, -3, -1,
200, 214, 62, -1, 185, -1, 155, 170, -1, 31, 241, -23, -13, -5, -1,
240, -1, 186, 229, -3, -1, 228, 140, -1, 109, 227, -5, -1, 226, -1,
46, 14, -1, 30, 225, -15, -7, -3, -1, 224, 93, -1, 213, 124, -3,
-1, 199, 77, -1, 139, 184, -7, -3, -1, 212, 154, -1, 169, 108, -1,
198, 61, -37, -21, -9, -5, -3, -1, 211, 123, 45, -1, 210, 29, -5,
-1, 183, -1, 92, 197, -3, -1, 153, 122, 195, -7, -5, -3, -1, 167,
151, 75, 209, -3, -1, 13, 208, -1, 138, 168, -11, -7, -3, -1, 76,
196, -1, 107, 182, -1, 60, 44, -3, -1, 194, 91, -3, -1, 181, 137,
28, -43, -23, -11, -5, -1, 193, -1, 152, 12, -1, 192, -1, 180, 106,
-5, -3, -1, 166, 121, 59, -1, 179, -1, 136, 90, -11, -5, -1, 43,
-1, 165, 105, -1, 164, -1, 120, 135, -5, -1, 148, -1, 119, 118, 178,
-11, -3, -1, 27, 177, -3, -1, 11, 176, -1, 150, 74, -7, -3, -1,
58, 163, -1, 89, 149, -1, 42, 162, -47, -23, -9, -3, -1, 26, 161,
-3, -1, 10, 104, 160, -5, -3, -1, 134, 73, 147, -3, -1, 57, 88,
-1, 133, 103, -9, -3, -1, 41, 146, -3, -1, 87, 117, 56, -5, -1,
131, -1, 102, 71, -3, -1, 116, 86, -1, 101, 115, -11, -3, -1, 25,
145, -3, -1, 9, 144, -1, 72, 132, -7, -5, -1, 114, -1, 70, 100,
40, -1, 130, 24, -41, -27, -11, -5, -3, -1, 55, 39, 23, -1, 113,
-1, 85, 7, -7, -3, -1, 112, 54, -1, 99, 69, -3, -1, 84, 38,
-1, 98, 53, -5, -1, 129, -1, 8, 128, -3, -1, 22, 97, -1, 6,
96, -13, -9, -5, -3, -1, 83, 68, 37, -1, 82, 5, -1, 21, 81,
-7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, -19, -11,
-5, -1, 65, -1, 4, 64, -3, -1, 35, 50, 19, -3, -1, 49, 3,
-1, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16,
0
};
static const short tab15[] =
{
-495,-445,-355,-263,-183,-115, -77, -43, -27, -13, -7, -3, -1, 255, 239,
-1, 254, 223, -1, 238, -1, 253, 207, -7, -3, -1, 252, 222, -1, 237,
191, -1, 251, -1, 206, 236, -7, -3, -1, 221, 175, -1, 250, 190, -3,
-1, 235, 205, -1, 220, 159, -15, -7, -3, -1, 249, 234, -1, 189, 219,
-3, -1, 143, 248, -1, 204, 158, -7, -3, -1, 233, 127, -1, 247, 173,
-3, -1, 218, 188, -1, 111, -1, 174, 15, -19, -11, -3, -1, 203, 246,
-3, -1, 142, 232, -1, 95, 157, -3, -1, 245, 126, -1, 231, 172, -9,
-3, -1, 202, 187, -3, -1, 217, 141, 79, -3, -1, 244, 63, -1, 243,
216, -33, -17, -9, -3, -1, 230, 47, -1, 242, -1, 110, 240, -3, -1,
31, 241, -1, 156, 201, -7, -3, -1, 94, 171, -1, 186, 229, -3, -1,
125, 215, -1, 78, 228, -15, -7, -3, -1, 140, 200, -1, 62, 109, -3,
-1, 214, 227, -1, 155, 185, -7, -3, -1, 46, 170, -1, 226, 30, -5,
-1, 225, -1, 14, 224, -1, 93, 213, -45, -25, -13, -7, -3, -1, 124,
199, -1, 77, 139, -1, 212, -1, 184, 154, -7, -3, -1, 169, 108, -1,
198, 61, -1, 211, 210, -9, -5, -3, -1, 45, 13, 29, -1, 123, 183,
-5, -1, 209, -1, 92, 208, -1, 197, 138, -17, -7, -3, -1, 168, 76,
-1, 196, 107, -5, -1, 182, -1, 153, 12, -1, 60, 195, -9, -3, -1,
122, 167, -1, 166, -1, 192, 11, -1, 194, -1, 44, 91, -55, -29, -15,
-7, -3, -1, 181, 28, -1, 137, 152, -3, -1, 193, 75, -1, 180, 106,
-5, -3, -1, 59, 121, 179, -3, -1, 151, 136, -1, 43, 90, -11, -5,
-1, 178, -1, 165, 27, -1, 177, -1, 176, 105, -7, -3, -1, 150, 74,
-1, 164, 120, -3, -1, 135, 58, 163, -17, -7, -3, -1, 89, 149, -1,
42, 162, -3, -1, 26, 161, -3, -1, 10, 160, 104, -7, -3, -1, 134,
73, -1, 148, 57, -5, -1, 147, -1, 119, 9, -1, 88, 133, -53, -29,
-13, -7, -3, -1, 41, 103, -1, 118, 146, -1, 145, -1, 25, 144, -7,
-3, -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 71, -7,
-3, -1, 40, 130, -1, 24, 129, -7, -3, -1, 116, 8, -1, 128, 86,
-3, -1, 101, 55, -1, 115, 70, -17, -7, -3, -1, 39, 114, -1, 100,
23, -3, -1, 85, 113, -3, -1, 7, 112, 54, -7, -3, -1, 99, 69,
-1, 84, 38, -3, -1, 98, 22, -3, -1, 6, 96, 53, -33, -19, -9,
-5, -1, 97, -1, 83, 68, -1, 37, 82, -3, -1, 21, 81, -3, -1,
5, 80, 52, -7, -3, -1, 67, 36, -1, 66, 51, -1, 65, -1, 20,
4, -9, -3, -1, 35, 50, -3, -1, 64, 3, 19, -3, -1, 49, 48,
34, -9, -7, -3, -1, 18, 33, -1, 2, 32, 17, -3, -1, 1, 16,
0
};
static const short tab16[] =
{
-509,-503,-461,-323,-103, -37, -27, -15, -7, -3, -1, 239, 254, -1, 223,
253, -3, -1, 207, 252, -1, 191, 251, -5, -1, 175, -1, 250, 159, -3,
-1, 249, 248, 143, -7, -3, -1, 127, 247, -1, 111, 246, 255, -9, -5,
-3, -1, 95, 245, 79, -1, 244, 243, -53, -1, 240, -1, 63, -29, -19,
-13, -7, -5, -1, 206, -1, 236, 221, 222, -1, 233, -1, 234, 217, -1,
238, -1, 237, 235, -3, -1, 190, 205, -3, -1, 220, 219, 174, -11, -5,
-1, 204, -1, 173, 218, -3, -1, 126, 172, 202, -5, -3, -1, 201, 125,
94, 189, 242, -93, -5, -3, -1, 47, 15, 31, -1, 241, -49, -25, -13,
-5, -1, 158, -1, 188, 203, -3, -1, 142, 232, -1, 157, 231, -7, -3,
-1, 187, 141, -1, 216, 110, -1, 230, 156, -13, -7, -3, -1, 171, 186,
-1, 229, 215, -1, 78, -1, 228, 140, -3, -1, 200, 62, -1, 109, -1,
214, 155, -19, -11, -5, -3, -1, 185, 170, 225, -1, 212, -1, 184, 169,
-5, -1, 123, -1, 183, 208, 227, -7, -3, -1, 14, 224, -1, 93, 213,
-3, -1, 124, 199, -1, 77, 139, -75, -45, -27, -13, -7, -3, -1, 154,
108, -1, 198, 61, -3, -1, 92, 197, 13, -7, -3, -1, 138, 168, -1,
153, 76, -3, -1, 182, 122, 60, -11, -5, -3, -1, 91, 137, 28, -1,
192, -1, 152, 121, -1, 226, -1, 46, 30, -15, -7, -3, -1, 211, 45,
-1, 210, 209, -5, -1, 59, -1, 151, 136, 29, -7, -3, -1, 196, 107,
-1, 195, 167, -1, 44, -1, 194, 181, -23, -13, -7, -3, -1, 193, 12,
-1, 75, 180, -3, -1, 106, 166, 179, -5, -3, -1, 90, 165, 43, -1,
178, 27, -13, -5, -1, 177, -1, 11, 176, -3, -1, 105, 150, -1, 74,
164, -5, -3, -1, 120, 135, 163, -3, -1, 58, 89, 42, -97, -57, -33,
-19, -11, -5, -3, -1, 149, 104, 161, -3, -1, 134, 119, 148, -5, -3,
-1, 73, 87, 103, 162, -5, -1, 26, -1, 10, 160, -3, -1, 57, 147,
-1, 88, 133, -9, -3, -1, 41, 146, -3, -1, 118, 9, 25, -5, -1,
145, -1, 144, 72, -3, -1, 132, 117, -1, 56, 131, -21, -11, -5, -3,
-1, 102, 40, 130, -3, -1, 71, 116, 24, -3, -1, 129, 128, -3, -1,
8, 86, 55, -9, -5, -1, 115, -1, 101, 70, -1, 39, 114, -5, -3,
-1, 100, 85, 7, 23, -23, -13, -5, -1, 113, -1, 112, 54, -3, -1,
99, 69, -1, 84, 38, -3, -1, 98, 22, -1, 97, -1, 6, 96, -9,
-5, -1, 83, -1, 53, 68, -1, 37, 82, -1, 81, -1, 21, 5, -33,
-23, -13, -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20,
-5, -1, 65, -1, 4, 64, -1, 35, 50, -3, -1, 19, 49, -3, -1,
3, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16,
0
};
static const short tab24[] =
{
-451,-117, -43, -25, -15, -7, -3, -1, 239, 254, -1, 223, 253, -3, -1,
207, 252, -1, 191, 251, -5, -1, 250, -1, 175, 159, -1, 249, 248, -9,
-5, -3, -1, 143, 127, 247, -1, 111, 246, -3, -1, 95, 245, -1, 79,
244, -71, -7, -3, -1, 63, 243, -1, 47, 242, -5, -1, 241, -1, 31,
240, -25, -9, -1, 15, -3, -1, 238, 222, -1, 237, 206, -7, -3, -1,
236, 221, -1, 190, 235, -3, -1, 205, 220, -1, 174, 234, -15, -7, -3,
-1, 189, 219, -1, 204, 158, -3, -1, 233, 173, -1, 218, 188, -7, -3,
-1, 203, 142, -1, 232, 157, -3, -1, 217, 126, -1, 231, 172, 255,-235,
-143, -77, -45, -25, -15, -7, -3, -1, 202, 187, -1, 141, 216, -5, -3,
-1, 14, 224, 13, 230, -5, -3, -1, 110, 156, 201, -1, 94, 186, -9,
-5, -1, 229, -1, 171, 125, -1, 215, 228, -3, -1, 140, 200, -3, -1,
78, 46, 62, -15, -7, -3, -1, 109, 214, -1, 227, 155, -3, -1, 185,
170, -1, 226, 30, -7, -3, -1, 225, 93, -1, 213, 124, -3, -1, 199,
77, -1, 139, 184, -31, -15, -7, -3, -1, 212, 154, -1, 169, 108, -3,
-1, 198, 61, -1, 211, 45, -7, -3, -1, 210, 29, -1, 123, 183, -3,
-1, 209, 92, -1, 197, 138, -17, -7, -3, -1, 168, 153, -1, 76, 196,
-3, -1, 107, 182, -3, -1, 208, 12, 60, -7, -3, -1, 195, 122, -1,
167, 44, -3, -1, 194, 91, -1, 181, 28, -57, -35, -19, -7, -3, -1,
137, 152, -1, 193, 75, -5, -3, -1, 192, 11, 59, -3, -1, 176, 10,
26, -5, -1, 180, -1, 106, 166, -3, -1, 121, 151, -3, -1, 160, 9,
144, -9, -3, -1, 179, 136, -3, -1, 43, 90, 178, -7, -3, -1, 165,
27, -1, 177, 105, -1, 150, 164, -17, -9, -5, -3, -1, 74, 120, 135,
-1, 58, 163, -3, -1, 89, 149, -1, 42, 162, -7, -3, -1, 161, 104,
-1, 134, 119, -3, -1, 73, 148, -1, 57, 147, -63, -31, -15, -7, -3,
-1, 88, 133, -1, 41, 103, -3, -1, 118, 146, -1, 25, 145, -7, -3,
-1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 40, -17, -7,
-3, -1, 130, 24, -1, 71, 116, -5, -1, 129, -1, 8, 128, -1, 86,
101, -7, -5, -1, 23, -1, 7, 112, 115, -3, -1, 55, 39, 114, -15,
-7, -3, -1, 70, 100, -1, 85, 113, -3, -1, 54, 99, -1, 69, 84,
-7, -3, -1, 38, 98, -1, 22, 97, -5, -3, -1, 6, 96, 53, -1,
83, 68, -51, -37, -23, -15, -9, -3, -1, 37, 82, -1, 21, -1, 5,
80, -1, 81, -1, 52, 67, -3, -1, 36, 66, -1, 51, 20, -9, -5,
-1, 65, -1, 4, 64, -1, 35, 50, -1, 19, 49, -7, -5, -3, -1,
3, 48, 34, 18, -1, 33, -1, 2, 32, -3, -1, 17, 1, -1, 16,
0
};
static const short tab_c0[] =
{
-29, -21, -13, -7, -3, -1, 11, 15, -1, 13, 14, -3, -1, 7, 5,
9, -3, -1, 6, 3, -1, 10, 12, -3, -1, 2, 1, -1, 4, 8,
0
};
static const short tab_c1[] =
{
-15, -7, -3, -1, 15, 14, -1, 13, 12, -3, -1, 11, 10, -1, 9,
8, -7, -3, -1, 7, 6, -1, 5, 4, -3, -1, 3, 2, -1, 1,
0
};
static const struct newhuff ht[] =
{
{ /* 0 */ 0 , tab0 } ,
{ /* 2 */ 0 , tab1 } ,
{ /* 3 */ 0 , tab2 } ,
{ /* 3 */ 0 , tab3 } ,
{ /* 0 */ 0 , tab0 } ,
{ /* 4 */ 0 , tab5 } ,
{ /* 4 */ 0 , tab6 } ,
{ /* 6 */ 0 , tab7 } ,
{ /* 6 */ 0 , tab8 } ,
{ /* 6 */ 0 , tab9 } ,
{ /* 8 */ 0 , tab10 } ,
{ /* 8 */ 0 , tab11 } ,
{ /* 8 */ 0 , tab12 } ,
{ /* 16 */ 0 , tab13 } ,
{ /* 0 */ 0 , tab0 } ,
{ /* 16 */ 0 , tab15 } ,
{ /* 16 */ 1 , tab16 } ,
{ /* 16 */ 2 , tab16 } ,
{ /* 16 */ 3 , tab16 } ,
{ /* 16 */ 4 , tab16 } ,
{ /* 16 */ 6 , tab16 } ,
{ /* 16 */ 8 , tab16 } ,
{ /* 16 */ 10, tab16 } ,
{ /* 16 */ 13, tab16 } ,
{ /* 16 */ 4 , tab24 } ,
{ /* 16 */ 5 , tab24 } ,
{ /* 16 */ 6 , tab24 } ,
{ /* 16 */ 7 , tab24 } ,
{ /* 16 */ 8 , tab24 } ,
{ /* 16 */ 9 , tab24 } ,
{ /* 16 */ 11, tab24 } ,
{ /* 16 */ 13, tab24 }
};
static const struct newhuff htc[] =
{
{ /* 1 , 1 , */ 0 , tab_c0 } ,
{ /* 1 , 1 , */ 0 , tab_c1 }
};
/* *INDENT-ON* */

View File

@@ -1,718 +0,0 @@
/*
* interface.c
*
* Copyright (C) 1999-2012 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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: interface.c,v 1.69 2017/09/06 15:07:30 robert Exp $ */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include "common.h"
#include "interface.h"
#include "tabinit.h"
#include "layer3.h"
#include "lame.h"
#include "machine.h"
#include "VbrTag.h"
#include "decode_i386.h"
#include "layer1.h"
#include "layer2.h"
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
extern void lame_report_def(const char* format, va_list args);
/* #define HIP_DEBUG */
int
InitMP3(PMPSTR mp)
{
hip_init_tables_layer1();
hip_init_tables_layer2();
hip_init_tables_layer3();
if (mp) {
memset(mp, 0, sizeof(MPSTR));
mp->framesize = 0;
mp->num_frames = 0;
mp->enc_delay = -1;
mp->enc_padding = -1;
mp->vbr_header = 0;
mp->header_parsed = 0;
mp->side_parsed = 0;
mp->data_parsed = 0;
mp->free_format = 0;
mp->old_free_format = 0;
mp->ssize = 0;
mp->dsize = 0;
mp->fsizeold = -1;
mp->bsize = 0;
mp->head = mp->tail = NULL;
mp->fr.single = -1;
mp->bsnum = 0;
mp->wordpointer = mp->bsspace[mp->bsnum] + 512;
mp->bitindex = 0;
mp->synth_bo = 1;
mp->sync_bitstream = 1;
mp->report_dbg = &lame_report_def;
mp->report_err = &lame_report_def;
mp->report_msg = &lame_report_def;
}
make_decode_tables(32767);
return 1;
}
void
ExitMP3(PMPSTR mp)
{
if (mp) {
struct buf *b, *bn;
b = mp->tail;
while (b) {
free(b->pnt);
bn = b->next;
free(b);
b = bn;
}
}
}
static struct buf *
addbuf(PMPSTR mp, unsigned char *buf, int size)
{
struct buf *nbuf;
nbuf = (struct buf *) malloc(sizeof(struct buf));
if (!nbuf) {
lame_report_fnc(mp->report_err, "hip: addbuf() Out of memory!\n");
return NULL;
}
nbuf->pnt = (unsigned char *) malloc((size_t) size);
if (!nbuf->pnt) {
free(nbuf);
return NULL;
}
nbuf->size = size;
memcpy(nbuf->pnt, buf, (size_t) size);
nbuf->next = NULL;
nbuf->prev = mp->head;
nbuf->pos = 0;
if (!mp->tail) {
mp->tail = nbuf;
}
else {
mp->head->next = nbuf;
}
mp->head = nbuf;
mp->bsize += size;
return nbuf;
}
void
remove_buf(PMPSTR mp)
{
struct buf *buf = mp->tail;
mp->tail = buf->next;
if (mp->tail)
mp->tail->prev = NULL;
else {
mp->tail = mp->head = NULL;
}
free(buf->pnt);
free(buf);
}
static int
read_buf_byte(PMPSTR mp)
{
unsigned int b;
int pos;
pos = mp->tail->pos;
while (pos >= mp->tail->size) {
remove_buf(mp);
if (!mp->tail) {
lame_report_fnc(mp->report_err, "hip: Fatal error! tried to read past mp buffer\n");
exit(1);
}
pos = mp->tail->pos;
}
b = mp->tail->pnt[pos];
mp->bsize--;
mp->tail->pos++;
return b;
}
static void
read_head(PMPSTR mp)
{
unsigned long head;
head = read_buf_byte(mp);
head <<= 8;
head |= read_buf_byte(mp);
head <<= 8;
head |= read_buf_byte(mp);
head <<= 8;
head |= read_buf_byte(mp);
mp->header = head;
}
static void
copy_mp(PMPSTR mp, int size, unsigned char *ptr)
{
int len = 0;
while (len < size && mp->tail) {
int nlen;
int blen = mp->tail->size - mp->tail->pos;
if ((size - len) <= blen) {
nlen = size - len;
}
else {
nlen = blen;
}
memcpy(ptr + len, mp->tail->pnt + mp->tail->pos, (size_t) nlen);
len += nlen;
mp->tail->pos += nlen;
mp->bsize -= nlen;
if (mp->tail->pos == mp->tail->size) {
remove_buf(mp);
}
}
}
/* number of bytes needed by GetVbrTag to parse header */
#define XING_HEADER_SIZE 194
/*
traverse mp data structure without changing it
(just like sync_buffer)
pull out Xing bytes
call vbr header check code from LAME
if we find a header, parse it and also compute the VBR header size
if no header, do nothing.
bytes = number of bytes before MPEG header. skip this many bytes
before starting to read
return value: number of bytes in VBR header, including syncword
*/
static int
check_vbr_header(PMPSTR mp, int bytes)
{
int i, pos;
struct buf *buf = mp->tail;
unsigned char xing[XING_HEADER_SIZE];
VBRTAGDATA pTagData;
pos = buf->pos;
/* skip to valid header */
for (i = 0; i < bytes; ++i) {
while (pos >= buf->size) {
buf = buf->next;
if (!buf)
return -1; /* fatal error */
pos = buf->pos;
}
++pos;
}
/* now read header */
for (i = 0; i < XING_HEADER_SIZE; ++i) {
while (pos >= buf->size) {
buf = buf->next;
if (!buf)
return -1; /* fatal error */
pos = buf->pos;
}
xing[i] = buf->pnt[pos];
++pos;
}
/* check first bytes for Xing header */
mp->vbr_header = GetVbrTag(&pTagData, xing);
if (mp->vbr_header) {
mp->num_frames = pTagData.frames;
mp->enc_delay = pTagData.enc_delay;
mp->enc_padding = pTagData.enc_padding;
/* lame_report_fnc(mp->report_msg,"hip: delays: %i %i \n",mp->enc_delay,mp->enc_padding); */
/* lame_report_fnc(mp->report_msg,"hip: Xing VBR header dectected. MP3 file has %i frames\n", pTagData.frames); */
if (pTagData.headersize < 1)
return 1;
return pTagData.headersize;
}
return 0;
}
static int
sync_buffer(PMPSTR mp, int free_match)
{
/* traverse mp structure without modifying pointers, looking
* for a frame valid header.
* if free_format, valid header must also have the same
* samplerate.
* return number of bytes in mp, before the header
* return -1 if header is not found
*/
unsigned int b[4] = { 0, 0, 0, 0 };
int i, h, pos;
struct buf *buf = mp->tail;
if (!buf)
return -1;
pos = buf->pos;
for (i = 0; i < mp->bsize; i++) {
/* get 4 bytes */
b[0] = b[1];
b[1] = b[2];
b[2] = b[3];
while (pos >= buf->size) {
buf = buf->next;
if (!buf) {
return -1;
/* not enough data to read 4 bytes */
}
pos = buf->pos;
}
b[3] = buf->pnt[pos];
++pos;
if (i >= 3) {
struct frame *fr = &mp->fr;
unsigned long head;
head = b[0];
head <<= 8;
head |= b[1];
head <<= 8;
head |= b[2];
head <<= 8;
head |= b[3];
h = head_check(head, fr->lay);
if (h && free_match) {
/* just to be even more thorough, match the sample rate */
int mode, stereo, sampling_frequency, mpeg25, lsf;
if (head & (1 << 20)) {
lsf = (head & (1 << 19)) ? 0x0 : 0x1;
mpeg25 = 0;
}
else {
lsf = 1;
mpeg25 = 1;
}
mode = ((head >> 6) & 0x3);
stereo = (mode == MPG_MD_MONO) ? 1 : 2;
if (mpeg25)
sampling_frequency = 6 + ((head >> 10) & 0x3);
else
sampling_frequency = ((head >> 10) & 0x3) + (lsf * 3);
h = ((stereo == fr->stereo) && (lsf == fr->lsf) && (mpeg25 == fr->mpeg25) &&
(sampling_frequency == fr->sampling_frequency));
}
if (h) {
return i - 3;
}
}
}
return -1;
}
void
decode_reset(PMPSTR mp)
{
#if 0
remove_buf(mp);
/* start looking for next frame */
/* mp->fsizeold = mp->framesize; */
mp->fsizeold = -1;
mp->old_free_format = mp->free_format;
mp->framesize = 0;
mp->header_parsed = 0;
mp->side_parsed = 0;
mp->data_parsed = 0;
mp->sync_bitstream = 1; /* TODO check if this is right */
#else
InitMP3(mp); /* Less error prone to just to reinitialise. */
#endif
}
int
audiodata_precedesframes(PMPSTR mp)
{
if (mp->fr.lay == 3)
return layer3_audiodata_precedesframes(mp);
else
return 0; /* For Layer 1 & 2 the audio data starts at the frame that describes it, so no audio data precedes. */
}
static int
decodeMP3_clipchoice(PMPSTR mp, unsigned char *in, int isize, char *out, int *done,
int (*synth_1to1_mono_ptr) (PMPSTR, real *, unsigned char *, int *),
int (*synth_1to1_ptr) (PMPSTR, real *, int, unsigned char *, int *))
{
int i, iret, bits, bytes;
if (in && isize && addbuf(mp, in, isize) == NULL)
return MP3_ERR;
/* First decode header */
if (!mp->header_parsed) {
if (mp->fsizeold == -1 || mp->sync_bitstream) {
int vbrbytes;
mp->sync_bitstream = 0;
/* This is the very first call. sync with anything */
/* bytes= number of bytes before header */
bytes = sync_buffer(mp, 0);
/* now look for Xing VBR header */
if (mp->bsize >= bytes + XING_HEADER_SIZE) {
/* vbrbytes = number of bytes in entire vbr header */
vbrbytes = check_vbr_header(mp, bytes);
}
else {
/* not enough data to look for Xing header */
#ifdef HIP_DEBUG
lame_report_fnc(mp->report_dbg, "hip: not enough data to look for Xing header\n");
#endif
return MP3_NEED_MORE;
}
if (mp->vbr_header) {
/* do we have enough data to parse entire Xing header? */
if (bytes + vbrbytes > mp->bsize) {
/* lame_report_fnc(mp->report_err,"hip: not enough data to parse entire Xing header\n"); */
return MP3_NEED_MORE;
}
/* read in Xing header. Buffer data in case it
* is used by a non zero main_data_begin for the next
* frame, but otherwise dont decode Xing header */
#ifdef HIP_DEBUG
lame_report_fnc(mp->report_dbg, "hip: found xing header, skipping %i bytes\n", vbrbytes + bytes);
#endif
for (i = 0; i < vbrbytes + bytes; ++i)
read_buf_byte(mp);
/* now we need to find another syncword */
/* just return and make user send in more data */
return MP3_NEED_MORE;
}
}
else {
/* match channels, samplerate, etc, when syncing */
bytes = sync_buffer(mp, 1);
}
/* buffer now synchronized */
if (bytes < 0) {
/* lame_report_fnc(mp->report_err,"hip: need more bytes %d\n", bytes); */
return MP3_NEED_MORE;
}
if (bytes > 0) {
/* there were some extra bytes in front of header.
* bitstream problem, but we are now resynced
* should try to buffer previous data in case new
* frame has nonzero main_data_begin, but we need
* to make sure we do not overflow buffer
*/
int size;
if (mp->fsizeold != -1) {
lame_report_fnc(mp->report_err, "hip: bitstream problem, resyncing skipping %d bytes...\n", bytes);
}
mp->old_free_format = 0;
#if 1
/* FIXME: correct ??? */
mp->sync_bitstream = 1;
#endif
/* skip some bytes, buffer the rest */
size = (int) (mp->wordpointer - (mp->bsspace[mp->bsnum] + 512));
if (size > MAXFRAMESIZE) {
/* wordpointer buffer is trashed. probably cant recover, but try anyway */
lame_report_fnc(mp->report_err, "hip: wordpointer trashed. size=%i (%i) bytes=%i \n",
size, MAXFRAMESIZE, bytes);
size = 0;
mp->wordpointer = mp->bsspace[mp->bsnum] + 512;
}
/* buffer contains 'size' data right now
we want to add 'bytes' worth of data, but do not
exceed MAXFRAMESIZE, so we through away 'i' bytes */
i = (size + bytes) - MAXFRAMESIZE;
for (; i > 0; --i) {
--bytes;
read_buf_byte(mp);
}
copy_mp(mp, bytes, mp->wordpointer);
mp->fsizeold += bytes;
}
read_head(mp);
if (!decode_header(mp, &mp->fr, mp->header))
return MP3_ERR;
mp->header_parsed = 1;
mp->framesize = mp->fr.framesize;
mp->free_format = (mp->framesize == 0);
if (mp->fr.lsf)
mp->ssize = (mp->fr.stereo == 1) ? 9 : 17;
else
mp->ssize = (mp->fr.stereo == 1) ? 17 : 32;
if (mp->fr.error_protection)
mp->ssize += 2;
mp->bsnum = 1 - mp->bsnum; /* toggle buffer */
mp->wordpointer = mp->bsspace[mp->bsnum] + 512;
mp->bitindex = 0;
/* for very first header, never parse rest of data */
if (mp->fsizeold == -1) {
#ifdef HIP_DEBUG
lame_report_fnc(mp->report_dbg, "hip: not parsing the rest of the data of the first header\n");
#endif
return MP3_NEED_MORE;
}
} /* end of header parsing block */
/* now decode side information */
if (!mp->side_parsed) {
/* Layer 3 only */
if (mp->fr.lay == 3) {
if (mp->bsize < mp->ssize)
return MP3_NEED_MORE;
copy_mp(mp, mp->ssize, mp->wordpointer);
if (mp->fr.error_protection)
getbits(mp, 16);
bits = decode_layer3_sideinfo(mp);
/* bits = actual number of bits needed to parse this frame */
/* can be negative, if all bits needed are in the reservoir */
if (bits < 0)
bits = 0;
/* read just as many bytes as necessary before decoding */
mp->dsize = (bits + 7) / 8;
if (!mp->free_format) {
/* do not read more than framsize data */
int framesize = mp->fr.framesize - mp->ssize;
if (mp->dsize > framesize) {
lame_report_fnc(mp->report_err,
"hip: error audio data exceeds framesize by %d bytes\n",
mp->dsize - framesize);
mp->dsize = framesize;
}
}
#ifdef HIP_DEBUG
lame_report_fnc(mp->report_dbg,
"hip: %d bits needed to parse layer III frame, number of bytes to read before decoding dsize = %d\n",
bits, mp->dsize);
#endif
/* this will force mpglib to read entire frame before decoding */
/* mp->dsize= mp->framesize - mp->ssize; */
}
else {
/* Layers 1 and 2 */
/* check if there is enough input data */
if (mp->fr.framesize > mp->bsize)
return MP3_NEED_MORE;
/* takes care that the right amount of data is copied into wordpointer */
mp->dsize = mp->fr.framesize;
mp->ssize = 0;
}
mp->side_parsed = 1;
}
/* now decode main data */
iret = MP3_NEED_MORE;
if (!mp->data_parsed) {
if (mp->dsize > mp->bsize) {
return MP3_NEED_MORE;
}
copy_mp(mp, mp->dsize, mp->wordpointer);
*done = 0;
/*do_layer3(&mp->fr,(unsigned char *) out,done); */
switch (mp->fr.lay) {
case 1:
if (mp->fr.error_protection)
getbits(mp, 16);
if (decode_layer1_frame(mp, (unsigned char *) out, done) < 0)
return MP3_ERR;
break;
case 2:
if (mp->fr.error_protection)
getbits(mp, 16);
decode_layer2_frame(mp, (unsigned char *) out, done);
break;
case 3:
decode_layer3_frame(mp, (unsigned char *) out, done, synth_1to1_mono_ptr, synth_1to1_ptr);
break;
default:
lame_report_fnc(mp->report_err, "hip: invalid layer %d\n", mp->fr.lay);
}
mp->wordpointer = mp->bsspace[mp->bsnum] + 512 + mp->ssize + mp->dsize;
mp->data_parsed = 1;
iret = MP3_OK;
}
/* remaining bits are ancillary data, or reservoir for next frame
* If free format, scan stream looking for next frame to determine
* mp->framesize */
if (mp->free_format) {
if (mp->old_free_format) {
/* free format. bitrate must not vary */
mp->framesize = mp->fsizeold_nopadding + (mp->fr.padding);
}
else {
bytes = sync_buffer(mp, 1);
if (bytes < 0)
return iret;
mp->framesize = bytes + mp->ssize + mp->dsize;
mp->fsizeold_nopadding = mp->framesize - mp->fr.padding;
#if 0
lame_report_fnc(mp->report_dbg,"hip: freeformat bitstream: estimated bitrate=%ikbs \n",
8*(4+mp->framesize)*freqs[mp->fr.sampling_frequency]/
(1000*576*(2-mp->fr.lsf)));
#endif
}
}
/* buffer the ancillary data and reservoir for next frame */
bytes = mp->framesize - (mp->ssize + mp->dsize);
if (bytes > mp->bsize) {
return iret;
}
if (bytes > 0) {
int size;
#if 1
/* FIXME: while loop OK ??? */
while (bytes > 512) {
read_buf_byte(mp);
bytes--;
mp->framesize--;
}
#endif
copy_mp(mp, bytes, mp->wordpointer);
mp->wordpointer += bytes;
size = (int) (mp->wordpointer - (mp->bsspace[mp->bsnum] + 512));
if (size > MAXFRAMESIZE) {
lame_report_fnc(mp->report_err, "hip: fatal error. MAXFRAMESIZE not large enough.\n");
}
}
/* the above frame is completely parsed. start looking for next frame */
mp->fsizeold = mp->framesize;
mp->old_free_format = mp->free_format;
mp->framesize = 0;
mp->header_parsed = 0;
mp->side_parsed = 0;
mp->data_parsed = 0;
return iret;
}
int
decodeMP3(PMPSTR mp, unsigned char *in, int isize, char *out, int osize, int *done)
{
if (osize < 4608) {
lame_report_fnc(mp->report_err, "hip: Insufficient memory for decoding buffer %d\n", osize);
return MP3_ERR;
}
/* passing pointers to the functions which clip the samples */
return decodeMP3_clipchoice(mp, in, isize, out, done, synth_1to1_mono, synth_1to1);
}
int
decodeMP3_unclipped(PMPSTR mp, unsigned char *in, int isize, char *out, int osize, int *done)
{
/* we forbid input with more than 1152 samples per channel for output in unclipped mode */
if (osize < (int) (1152 * 2 * sizeof(real))) {
lame_report_fnc(mp->report_err, "hip: out space too small for unclipped mode\n");
return MP3_ERR;
}
/* passing pointers to the functions which don't clip the samples */
return decodeMP3_clipchoice(mp, in, isize, out, done, synth_1to1_mono_unclipped,
synth_1to1_unclipped);
}

View File

@@ -1,56 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef INTERFACE_H_INCLUDED
#define INTERFACE_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#include "common.h"
int InitMP3(PMPSTR mp);
int decodeMP3(PMPSTR mp, unsigned char *inmemory, int inmemsize, char *outmemory,
int outmemsize, int *done);
void ExitMP3(PMPSTR mp);
/* added decodeMP3_unclipped to support returning raw floating-point values of samples. The representation
of the floating-point numbers is defined in mpg123.h as #define real. It is 64-bit double by default.
No more than 1152 samples per channel are allowed. */
int decodeMP3_unclipped(PMPSTR mp, unsigned char *inmemory, int inmemsize, char *outmemory,
int outmemsize, int *done);
/* added remove_buf to support mpglib seeking */
void remove_buf(PMPSTR mp);
/* added audiodata_precedesframes to return the number of bitstream frames the audio data will precede the
current frame by for Layer 3 data. Aids seeking.
*/
int audiodata_precedesframes(PMPSTR mp);
/* Resets decoding. Aids seeking. */
void decode_reset(PMPSTR mp);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,189 +0,0 @@
/*
* Machine dependent defines/includes for LAME.
*
* Copyright (c) 1999 A.L. Faber
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef LAME_MACHINE_H
#define LAME_MACHINE_H
#include "version.h"
#include <stdio.h>
#include <assert.h>
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <string.h>
#else
# ifndef HAVE_STRCHR
# define strchr index
# define strrchr rindex
# endif
char *strchr(), *strrchr();
# ifndef HAVE_MEMCPY
# define memcpy(d, s, n) bcopy ((s), (d), (n))
# define memmove(d, s, n) bcopy ((s), (d), (n))
# endif
#endif
#if defined(__riscos__) && defined(FPA10)
# include "ymath.h"
#else
# include <math.h>
#endif
#include <limits.h>
#include <ctype.h>
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#if defined(macintosh)
# include <types.h>
# include <stat.h>
#else
# include <sys/types.h>
# include <sys/stat.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#else
# ifdef HAVE_STDINT_H
# include <stdint.h>
# endif
#endif
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
/*
* 3 different types of pow() functions:
* - table lookup
* - pow()
* - exp() on some machines this is claimed to be faster than pow()
*/
#define POW20(x) (assert(0 <= (x+Q_MAX2) && x < Q_MAX), pow20[x+Q_MAX2])
/*#define POW20(x) pow(2.0,((double)(x)-210)*.25) */
/*#define POW20(x) exp( ((double)(x)-210)*(.25*LOG2) ) */
#define IPOW20(x) (assert(0 <= x && x < Q_MAX), ipow20[x])
/*#define IPOW20(x) exp( -((double)(x)-210)*.1875*LOG2 ) */
/*#define IPOW20(x) pow(2.0,-((double)(x)-210)*.1875) */
/* in case this is used without configure */
#ifndef inline
# define inline
#endif
#if defined(_MSC_VER)
# undef inline
# define inline _inline
#elif defined(__SASC) || defined(__GNUC__) || defined(__ICC) || defined(__ECC)
/* if __GNUC__ we always want to inline, not only if the user requests it */
# undef inline
# define inline __inline
#endif
#if defined(_MSC_VER)
# pragma warning( disable : 4244 )
/*# pragma warning( disable : 4305 ) */
#endif
/*
* FLOAT for variables which require at least 32 bits
* FLOAT8 for variables which require at least 64 bits
*
* On some machines, 64 bit will be faster than 32 bit. Also, some math
* routines require 64 bit float, so setting FLOAT=float will result in a
* lot of conversions.
*/
#if ( defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) )
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <float.h>
# define FLOAT_MAX FLT_MAX
#else
# ifndef FLOAT
typedef float FLOAT;
# ifdef FLT_MAX
# define FLOAT_MAX FLT_MAX
# else
# define FLOAT_MAX 1e37 /* approx */
# endif
# endif
#endif
#ifndef FLOAT8
typedef double FLOAT8;
# ifdef DBL_MAX
# define FLOAT8_MAX DBL_MAX
# else
# define FLOAT8_MAX 1e99 /* approx */
# endif
#else
# ifdef FLT_MAX
# define FLOAT8_MAX FLT_MAX
# else
# define FLOAT8_MAX 1e37 /* approx */
# endif
#endif
/* sample_t must be floating point, at least 32 bits */
typedef FLOAT sample_t;
#define dimension_of(array) (sizeof(array)/sizeof(array[0]))
#define beyond(array) (array+dimension_of(array))
#define compiletime_assert(expression) enum{static_assert_##FILE##_##LINE = 1/((expression)?1:0)}
#define lame_calloc(TYPE, COUNT) ((TYPE*)calloc(COUNT, sizeof(TYPE)))
#define multiple_of(CHUNK, COUNT) (\
( (COUNT) < 1 || (CHUNK) < 1 || (COUNT) % (CHUNK) == 0 ) \
? (COUNT) \
: ((COUNT) + (CHUNK) - (COUNT) % (CHUNK)) \
)
#if 1
#define EQ(a,b) (\
(fabs(a) > fabs(b)) \
? (fabs((a)-(b)) <= (fabs(a) * 1e-6f)) \
: (fabs((a)-(b)) <= (fabs(b) * 1e-6f)))
#else
#define EQ(a,b) (fabs((a)-(b))<1E-37)
#endif
#define NEQ(a,b) (!EQ(a,b))
#ifdef _MSC_VER
# if _MSC_VER < 1400
# define fabsf fabs
# define powf pow
# define log10f log10
# endif
#endif
#endif
/* end of machine.h */

View File

@@ -1,68 +0,0 @@
/*
* Version numbering for LAME.
*
* Copyright (c) 1999 A.L. Faber
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef LAME_VERSION_H
#define LAME_VERSION_H
/*
* To make a string from a token, use the # operator:
*/
#ifndef STR
# define __STR(x) #x
# define STR(x) __STR(x)
#endif
# define LAME_URL "http://lame.sf.net"
# define LAME_MAJOR_VERSION 3 /* Major version number */
# define LAME_MINOR_VERSION 100 /* Minor version number */
# define LAME_TYPE_VERSION 2 /* 0:alpha 1:beta 2:release */
# define LAME_PATCH_VERSION 0 /* Patch level */
# define LAME_ALPHA_VERSION (LAME_TYPE_VERSION==0)
# define LAME_BETA_VERSION (LAME_TYPE_VERSION==1)
# define LAME_RELEASE_VERSION (LAME_TYPE_VERSION==2)
# define PSY_MAJOR_VERSION 1 /* Major version number */
# define PSY_MINOR_VERSION 0 /* Minor version number */
# define PSY_ALPHA_VERSION 0 /* Set number if this is an alpha version, otherwise zero */
# define PSY_BETA_VERSION 0 /* Set number if this is a beta version, otherwise zero */
#if LAME_ALPHA_VERSION
#define LAME_PATCH_LEVEL_STRING " alpha " STR(LAME_PATCH_VERSION)
#endif
#if LAME_BETA_VERSION
#define LAME_PATCH_LEVEL_STRING " beta " STR(LAME_PATCH_VERSION)
#endif
#if LAME_RELEASE_VERSION
#if LAME_PATCH_VERSION
#define LAME_PATCH_LEVEL_STRING " release " STR(LAME_PATCH_VERSION)
#else
#define LAME_PATCH_LEVEL_STRING ""
#endif
#endif
# define LAME_VERSION_STRING STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) LAME_PATCH_LEVEL_STRING
#endif /* LAME_VERSION_H */
/* End of version.h */

View File

@@ -1,183 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*
* Layer 2 Alloc tables ..
* most other tables are calculated on program start (which is (of course)
* not ISO-conform) ..
* Layer-3 huffman table is in huffman.h
*/
const struct al_table2 alloc_0[] = {
{4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10,
-511},
{11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767},
{4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10,
-511},
{11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767},
{4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10,
-511},
{11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767}
};
const struct al_table2 alloc_1[] = {
{4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10,
-511},
{11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767},
{4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10,
-511},
{11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767},
{4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10,
-511},
{11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767},
{2, 0}, {5, 3}, {7, 5}, {16, -32767}
};
const struct al_table2 alloc_2[] = {
{4, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255},
{10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383},
{4, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255},
{10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}
};
const struct al_table2 alloc_3[] = {
{4, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255},
{10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383},
{4, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255},
{10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}
};
const struct al_table2 alloc_4[] = {
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191},
{4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127},
{9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9},
{2, 0}, {5, 3}, {7, 5}, {10, 9}
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,232 +0,0 @@
/*
* layer1.c: Mpeg Layer-1 audio decoder
*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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: layer1.c,v 1.31 2017/08/23 13:22:23 robert Exp $ */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <assert.h>
#include "common.h"
#include "decode_i386.h"
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
#include "layer1.h"
static int gd_are_hip_tables_layer1_initialized = 0;
void
hip_init_tables_layer1(void)
{
if (gd_are_hip_tables_layer1_initialized) {
return;
}
gd_are_hip_tables_layer1_initialized = 1;
}
typedef struct sideinfo_layer_I_struct
{
unsigned char allocation[SBLIMIT][2];
unsigned char scalefactor[SBLIMIT][2];
} sideinfo_layer_I;
static int
I_step_one(PMPSTR mp, sideinfo_layer_I* si)
{
struct frame *fr = &(mp->fr);
int jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext << 2) + 4 : 32;
int i;
int illegal_value_detected = 0;
unsigned char const ba15 = 15; /* bit pattern not allowed, looks like sync(?) */
memset(si, 0, sizeof(*si));
assert(fr->stereo == 1 || fr->stereo == 2);
if (fr->stereo == 2) {
for (i = 0; i < jsbound; i++) {
unsigned char b0 = get_leq_8_bits(mp, 4); /* values 0-15 */
unsigned char b1 = get_leq_8_bits(mp, 4); /* values 0-15 */
si->allocation[i][0] = b0;
si->allocation[i][1] = b1;
if (b0 == ba15 || b1 == ba15)
illegal_value_detected = 1;
}
for (i = jsbound; i < SBLIMIT; i++) {
unsigned char b = get_leq_8_bits(mp, 4); /* values 0-15 */
si->allocation[i][0] = b;
si->allocation[i][1] = b;
if (b == ba15)
illegal_value_detected = 1;
}
for (i = 0; i < SBLIMIT; i++) {
unsigned char n0 = si->allocation[i][0];
unsigned char n1 = si->allocation[i][1];
unsigned char b0 = n0 ? get_leq_8_bits(mp, 6) : 0; /* values 0-63 */
unsigned char b1 = n1 ? get_leq_8_bits(mp, 6) : 0; /* values 0-63 */
si->scalefactor[i][0] = b0;
si->scalefactor[i][1] = b1;
}
}
else {
for (i = 0; i < SBLIMIT; i++) {
unsigned char b0 = get_leq_8_bits(mp, 4); /* values 0-15 */
si->allocation[i][0] = b0;
if (b0 == ba15)
illegal_value_detected = 1;
}
for (i = 0; i < SBLIMIT; i++) {
unsigned char n0 = si->allocation[i][0];
unsigned char b0 = n0 ? get_leq_8_bits(mp, 6) : 0; /* values 0-63 */
si->scalefactor[i][0] = b0;
}
}
return illegal_value_detected;
}
static void
I_step_two(PMPSTR mp, sideinfo_layer_I *si, real fraction[2][SBLIMIT])
{
double r0, r1;
struct frame *fr = &(mp->fr);
int ds_limit = fr->down_sample_sblimit;
int i;
assert(fr->stereo == 1 || fr->stereo == 2);
if (fr->stereo == 2) {
int jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext << 2) + 4 : 32;
for (i = 0; i < jsbound; i++) {
unsigned char i0 = si->scalefactor[i][0];
unsigned char i1 = si->scalefactor[i][1];
unsigned char n0 = si->allocation[i][0];
unsigned char n1 = si->allocation[i][1];
assert( i0 < 64 );
assert( i1 < 64 );
assert( n0 < 16 );
assert( n1 < 16 );
if (n0 > 0) {
unsigned short v = get_leq_16_bits(mp, n0 + 1); /* 0-65535 */
r0 = (((-1) << n0) + v + 1) * muls[n0 + 1][i0];
}
else {
r0 = 0;
}
if (n1 > 0) {
unsigned short v = get_leq_16_bits(mp, n1 + 1); /* 0-65535 */
r1 = (((-1) << n1) + v + 1) * muls[n1 + 1][i1];
}
else {
r1 = 0;
}
fraction[0][i] = (real)r0;
fraction[1][i] = (real)r1;
}
for (i = jsbound; i < SBLIMIT; i++) {
unsigned char i0 = si->scalefactor[i][0];
unsigned char i1 = si->scalefactor[i][1];
unsigned char n = si->allocation[i][0];
assert( i0 < 64 );
assert( i1 < 64 );
assert( n < 16 );
if (n > 0) {
unsigned short v = get_leq_16_bits(mp, n + 1); /* 0-65535 */
unsigned int w = (((-1) << n) + v + 1);
r0 = w * muls[n + 1][i0];
r1 = w * muls[n + 1][i1];
}
else {
r0 = r1 = 0;
}
fraction[0][i] = (real)r0;
fraction[1][i] = (real)r1;
}
for (i = ds_limit; i < SBLIMIT; i++) {
fraction[0][i] = 0.0;
fraction[1][i] = 0.0;
}
}
else {
for (i = 0; i < SBLIMIT; i++) {
unsigned char n = si->allocation[i][0];
unsigned char j = si->scalefactor[i][0];
assert( j < 64 );
assert( n < 16 );
if (n > 0) {
unsigned short v = get_leq_16_bits(mp, n + 1);
r0 = (((-1) << n) + v + 1) * muls[n + 1][j];
}
else {
r0 = 0;
}
fraction[0][i] = (real)r0;
}
for (i = ds_limit; i < SBLIMIT; i++) {
fraction[0][i] = 0.0;
}
}
}
int
decode_layer1_sideinfo(PMPSTR mp)
{
(void) mp;
/* FIXME: extract side information and check values */
return 0;
}
int
decode_layer1_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point)
{
real fraction[2][SBLIMIT]; /* FIXME: change real -> double ? */
sideinfo_layer_I si;
struct frame *fr = &(mp->fr);
int single = fr->single;
int i, clip = 0;
if (I_step_one(mp, &si)) {
lame_report_fnc(mp->report_err, "hip: Aborting layer 1 decode, illegal bit allocation value\n");
return -1;
}
if (fr->stereo == 1 || single == 3)
single = 0;
if (single >= 0) {
/* decoding one of possibly two channels */
for (i = 0; i < SCALE_BLOCK; i++) {
I_step_two(mp, &si, fraction);
clip += synth_1to1_mono(mp, (real *) fraction[single], pcm_sample, pcm_point);
}
}
else {
for (i = 0; i < SCALE_BLOCK; i++) {
int p1 = *pcm_point;
I_step_two(mp, &si, fraction);
clip += synth_1to1(mp, (real *) fraction[0], 0, pcm_sample, &p1);
clip += synth_1to1(mp, (real *) fraction[1], 1, pcm_sample, pcm_point);
}
}
return clip;
}

View File

@@ -1,29 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef LAYER1_H_INCLUDED
#define LAYER1_H_INCLUDED
void hip_init_tables_layer1(void);
int decode_layer1_sideinfo(PMPSTR mp);
int decode_layer1_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point);
#endif

View File

@@ -1,403 +0,0 @@
/*
* layer2.c: Mpeg Layer-2 audio decoder
*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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: layer2.c,v 1.34 2017/08/22 23:31:07 robert Exp $ */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "common.h"
#include "layer2.h"
#include "l2tables.h"
#include "decode_i386.h"
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
#include <assert.h>
static int gd_are_hip_tables_layer2_initialized = 0;
static unsigned char grp_3tab[32 * 3] = { 0, }; /* used: 27 */
static unsigned char grp_5tab[128 * 3] = { 0, }; /* used: 125 */
static unsigned char grp_9tab[1024 * 3] = { 0, }; /* used: 729 */
void
hip_init_tables_layer2(void)
{
static const double mulmul[27] = {
0.0, -2.0 / 3.0, 2.0 / 3.0,
2.0 / 7.0, 2.0 / 15.0, 2.0 / 31.0, 2.0 / 63.0, 2.0 / 127.0, 2.0 / 255.0,
2.0 / 511.0, 2.0 / 1023.0, 2.0 / 2047.0, 2.0 / 4095.0, 2.0 / 8191.0,
2.0 / 16383.0, 2.0 / 32767.0, 2.0 / 65535.0,
-4.0 / 5.0, -2.0 / 5.0, 2.0 / 5.0, 4.0 / 5.0,
-8.0 / 9.0, -4.0 / 9.0, -2.0 / 9.0, 2.0 / 9.0, 4.0 / 9.0, 8.0 / 9.0
};
static const unsigned char base[3][9] = {
{1, 0, 2,},
{17, 18, 0, 19, 20,},
{21, 1, 22, 23, 0, 24, 25, 2, 26}
};
int i, j, k, l, len;
real *table;
static const int tablen[3] = { 3, 5, 9 };
static unsigned char *itable, *tables[3] = { grp_3tab, grp_5tab, grp_9tab };
if (gd_are_hip_tables_layer2_initialized) {
return;
}
gd_are_hip_tables_layer2_initialized = 1;
for (i = 0; i < 3; i++) {
itable = tables[i];
len = tablen[i];
for (j = 0; j < len; j++)
for (k = 0; k < len; k++)
for (l = 0; l < len; l++) {
*itable++ = base[i][l];
*itable++ = base[i][k];
*itable++ = base[i][j];
}
}
for (k = 0; k < 27; k++) {
double m = mulmul[k];
table = muls[k];
for (j = 3, i = 0; i < 63; i++, j--)
*table++ = (real) (m * pow(2.0, (double) j / 3.0));
*table++ = 0.0;
}
}
static unsigned char*
grp_table_select(short d1, unsigned int idx)
{
/* RH: it seems to be common, that idx is larger than the table's sizes.
is it OK to return a zero vector in this case? FIXME
/*/
static unsigned char dummy_table[] = { 0,0,0 };
unsigned int x;
switch (d1) {
case 3:
x = 3*3*3;
idx = idx < x ? idx : x;
return &grp_3tab[3 * idx];
case 5:
x = 5*5*5;
idx = idx < x ? idx : x;
return &grp_5tab[3 * idx];
case 9:
x = 9*9*9;
idx = idx < x ? idx : x;
return &grp_9tab[3 * idx];
default:
/* fatal error */
assert(0);
}
return &dummy_table[0];
}
typedef struct sideinfo_layer_II_struct
{
unsigned char allocation[SBLIMIT][2];
unsigned char scalefactor[SBLIMIT][2][3]; /* subband / channel / block */
} sideinfo_layer_II;
static void
II_step_one(PMPSTR mp, sideinfo_layer_II *si, struct frame *fr)
{
int nch = fr->stereo;
int sblimit = fr->II_sblimit;
int jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext << 2) + 4 : fr->II_sblimit;
struct al_table2 const *alloc1 = fr->alloc;
unsigned char scfsi[SBLIMIT][2];
int i, ch;
memset(si, 0, sizeof(*si));
if (jsbound > sblimit)
jsbound = sblimit;
if (nch == 2) {
for (i = 0; i < jsbound; ++i) {
short step = alloc1->bits;
unsigned char b0 = get_leq_8_bits(mp, step);
unsigned char b1 = get_leq_8_bits(mp, step);
alloc1 += ((size_t)1 << step);
si->allocation[i][0] = b0;
si->allocation[i][1] = b1;
}
for (i = jsbound; i < sblimit; ++i) {
short step = alloc1->bits;
unsigned char b0 = get_leq_8_bits(mp, step);
alloc1 += ((size_t)1 << step);
si->allocation[i][0] = b0;
si->allocation[i][1] = b0;
}
for (i = 0; i < sblimit; ++i) {
unsigned char n0 = si->allocation[i][0];
unsigned char n1 = si->allocation[i][1];
unsigned char b0 = n0 ? get_leq_8_bits(mp, 2) : 0;
unsigned char b1 = n1 ? get_leq_8_bits(mp, 2) : 0;
scfsi[i][0] = b0;
scfsi[i][1] = b1;
}
}
else { /* mono */
for (i = 0; i < sblimit; ++i) {
short step = alloc1->bits;
unsigned char b0 = get_leq_8_bits(mp, step);
alloc1 += ((size_t)1 << step);
si->allocation[i][0] = b0;
}
for (i = 0; i < sblimit; ++i) {
unsigned char n0 = si->allocation[i][0];
unsigned char b0 = n0 ? get_leq_8_bits(mp, 2) : 0;
scfsi[i][0] = b0;
}
}
for (i = 0; i < sblimit; ++i) {
for (ch = 0; ch < nch; ++ch) {
unsigned char s0 = 0, s1 = 0, s2 = 0;
if (si->allocation[i][ch]) {
switch (scfsi[i][ch]) {
case 0:
s0 = get_leq_8_bits(mp, 6);
s1 = get_leq_8_bits(mp, 6);
s2 = get_leq_8_bits(mp, 6);
break;
case 1:
s0 = get_leq_8_bits(mp, 6);
s1 = s0;
s2 = get_leq_8_bits(mp, 6);
break;
case 2:
s0 = get_leq_8_bits(mp, 6);
s1 = s0;
s2 = s0;
break;
case 3:
s0 = get_leq_8_bits(mp, 6);
s1 = get_leq_8_bits(mp, 6);
s2 = s1;
break;
default:
assert(0);
}
}
si->scalefactor[i][ch][0] = s0;
si->scalefactor[i][ch][1] = s1;
si->scalefactor[i][ch][2] = s2;
}
}
}
static void
II_step_two(PMPSTR mp, sideinfo_layer_II* si, struct frame *fr, int gr, real fraction[2][4][SBLIMIT])
{
struct al_table2 const *alloc1 = fr->alloc;
int sblimit = fr->II_sblimit;
int jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext << 2) + 4 : fr->II_sblimit;
int i, ch, nch = fr->stereo;
double cm, r0, r1, r2;
if (jsbound > sblimit)
jsbound = sblimit;
for (i = 0; i < jsbound; ++i) {
short step = alloc1->bits;
for (ch = 0; ch < nch; ++ch) {
unsigned char ba = si->allocation[i][ch];
if (ba) {
unsigned char x1 = si->scalefactor[i][ch][gr];
struct al_table2 const *alloc2 = alloc1 + ba;
short k = alloc2->bits;
short d1 = alloc2->d;
assert( k <= 16 );
k = (k <= 16) ? k : 16;
assert( x1 < 64 );
x1 = (x1 < 64) ? x1 : 63;
if (d1 < 0) {
int v0 = getbits(mp, k);
int v1 = getbits(mp, k);
int v2 = getbits(mp, k);
cm = muls[k][x1];
r0 = (v0 + d1) * cm;
r1 = (v1 + d1) * cm;
r2 = (v2 + d1) * cm;
}
else {
unsigned int idx = getbits(mp, k);
unsigned char *tab = grp_table_select(d1, idx);
unsigned char k0 = tab[0];
unsigned char k1 = tab[1];
unsigned char k2 = tab[2];
r0 = muls[k0][x1];
r1 = muls[k1][x1];
r2 = muls[k2][x1];
}
fraction[ch][0][i] = (real) r0;
fraction[ch][1][i] = (real) r1;
fraction[ch][2][i] = (real) r2;
}
else {
fraction[ch][0][i] = fraction[ch][1][i] = fraction[ch][2][i] = 0.0;
}
}
alloc1 += ((size_t)1 << step);
}
for (i = jsbound; i < sblimit; i++) {
short step = alloc1->bits;
unsigned char ba = si->allocation[i][0];
if (ba) {
struct al_table2 const *alloc2 = alloc1 + ba;
short k = alloc2->bits;
short d1 = alloc2->d;
assert( k <= 16 );
k = (k <= 16) ? k : 16;
if (d1 < 0) {
int v0 = getbits(mp, k);
int v1 = getbits(mp, k);
int v2 = getbits(mp, k);
for (ch = 0; ch < nch; ++ch) {
unsigned char x1 = si->scalefactor[i][ch][gr];
assert( x1 < 64 );
x1 = (x1 < 64) ? x1 : 63;
cm = muls[k][x1];
r0 = (v0 + d1) * cm;
r1 = (v1 + d1) * cm;
r2 = (v2 + d1) * cm;
fraction[ch][0][i] = (real) r0;
fraction[ch][1][i] = (real) r1;
fraction[ch][2][i] = (real) r2;
}
}
else {
unsigned int idx = getbits(mp, k);
unsigned char *tab = grp_table_select(d1, idx);
unsigned char k0 = tab[0];
unsigned char k1 = tab[1];
unsigned char k2 = tab[2];
for (ch = 0; ch < nch; ++ch) {
unsigned char x1 = si->scalefactor[i][ch][gr];
assert( x1 < 64 );
x1 = (x1 < 64) ? x1 : 63;
r0 = muls[k0][x1];
r1 = muls[k1][x1];
r2 = muls[k2][x1];
fraction[ch][0][i] = (real) r0;
fraction[ch][1][i] = (real) r1;
fraction[ch][2][i] = (real) r2;
}
}
}
else {
fraction[0][0][i] = fraction[0][1][i] = fraction[0][2][i] = 0.0;
fraction[1][0][i] = fraction[1][1][i] = fraction[1][2][i] = 0.0;
}
alloc1 += ((size_t)1 << step);
}
if (sblimit > fr->down_sample_sblimit) {
sblimit = fr->down_sample_sblimit;
}
for (ch = 0; ch < nch; ++ch) {
for (i = sblimit; i < SBLIMIT; ++i) {
fraction[ch][0][i] = fraction[ch][1][i] = fraction[ch][2][i] = 0.0;
}
}
}
static void
II_select_table(struct frame *fr)
{
/* *INDENT-OFF* */
static const int translate[3][2][16] =
{ { { 0,2,2,2,2,2,2,0,0,0,1,1,1,1,1,0 } ,
{ 0,2,2,0,0,0,1,1,1,1,1,1,1,1,1,0 } } ,
{ { 0,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0 } ,
{ 0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0 } } ,
{ { 0,3,3,3,3,3,3,0,0,0,1,1,1,1,1,0 } ,
{ 0,3,3,0,0,0,1,1,1,1,1,1,1,1,1,0 } } };
/* *INDENT-ON* */
int table, sblim;
static const struct al_table2 *tables[5] = { alloc_0, alloc_1, alloc_2, alloc_3, alloc_4 };
static const int sblims[5] = { 27, 30, 8, 12, 30 };
if (fr->lsf)
table = 4;
else
table = translate[fr->sampling_frequency][2 - fr->stereo][fr->bitrate_index];
sblim = sblims[table];
fr->alloc = (struct al_table2 const *) tables[table];
fr->II_sblimit = sblim;
}
int
decode_layer2_sideinfo(PMPSTR mp)
{
(void) mp;
/* FIXME: extract side information and check values */
return 0;
}
int
decode_layer2_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point)
{
real fraction[2][4][SBLIMIT]; /* pick_table clears unused subbands */
sideinfo_layer_II si;
struct frame *fr = &(mp->fr);
int single = fr->single;
int i, j, clip = 0;
II_select_table(fr);
II_step_one(mp, &si, fr);
if (fr->stereo == 1 || single == 3)
single = 0;
if (single >= 0) {
for (i = 0; i < SCALE_BLOCK; i++) {
II_step_two(mp, &si, fr, i >> 2, fraction);
for (j = 0; j < 3; j++) {
clip += synth_1to1_mono(mp, fraction[single][j], pcm_sample, pcm_point);
}
}
}
else {
for (i = 0; i < SCALE_BLOCK; i++) {
II_step_two(mp, &si, fr, i >> 2, fraction);
for (j = 0; j < 3; j++) {
int p1 = *pcm_point;
clip += synth_1to1(mp, fraction[0][j], 0, pcm_sample, &p1);
clip += synth_1to1(mp, fraction[1][j], 1, pcm_sample, pcm_point);
}
}
}
return clip;
}

View File

@@ -1,39 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef LAYER2_H_INCLUDED
#define LAYER2_H_INCLUDED
struct al_table2 {
short bits;
short d;
};
void hip_init_tables_layer2(void);
int decode_layer2_sideinfo(PMPSTR mp);
int decode_layer2_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,32 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef LAYER3_H_INCLUDED
#define LAYER3_H_INCLUDED
void hip_init_tables_layer3(void);
int decode_layer3_sideinfo(PMPSTR mp);
int decode_layer3_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point,
int (*synth_1to1_mono_ptr) (PMPSTR, real *, unsigned char *, int *),
int (*synth_1to1_ptr) (PMPSTR, real *, int, unsigned char *, int *));
int layer3_audiodata_precedesframes(PMPSTR mp);
#endif

View File

@@ -1,152 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef MPG123_H_INCLUDED
#define MPG123_H_INCLUDED
#include <stdio.h>
#ifdef STDC_HEADERS
# include <string.h>
#else
# ifndef HAVE_STRCHR
# define strchr index
# define strrchr rindex
# endif
char *strchr(), *strrchr();
# ifndef HAVE_MEMCPY
# define memcpy(d, s, n) bcopy ((s), (d), (n))
# define memmove(d, s, n) bcopy ((s), (d), (n))
# endif
#endif
#include <signal.h>
#if defined(__riscos__) && defined(FPA10)
#include "ymath.h"
#else
#include <math.h>
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef M_SQRT2
#define M_SQRT2 1.41421356237309504880
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#undef REAL_IS_FLOAT
#define REAL_IS_FLOAT
#ifdef REAL_IS_FLOAT
# define real float
#elif defined(REAL_IS_LONG_DOUBLE)
# define real long double
#else
# define real double
#endif
#define FALSE 0
#define TRUE 1
#define SBLIMIT 32
#define SSLIMIT 18
#define MPG_MD_STEREO 0
#define MPG_MD_JOINT_STEREO 1
#define MPG_MD_DUAL_CHANNEL 2
#define MPG_MD_MONO 3
#define MAXFRAMESIZE 2880
/* AF: ADDED FOR LAYER1/LAYER2 */
#define SCALE_BLOCK 12
/* Pre Shift fo 16 to 8 bit converter table */
#define AUSHIFT (3)
struct frame {
int stereo;
int single; /* single channel (monophonic) */
int lsf; /* 0 = MPEG-1, 1 = MPEG-2/2.5 */
int mpeg25; /* 1 = MPEG-2.5, 0 = MPEG-1/2 */
int header_change;
int lay; /* Layer */
int error_protection; /* 1 = CRC-16 code following header */
int bitrate_index;
int sampling_frequency; /* sample rate of decompressed audio in Hz */
int padding;
int extension;
int mode;
int mode_ext;
int copyright;
int original;
int emphasis;
int framesize; /* computed framesize */
/* AF: ADDED FOR LAYER1/LAYER2 */
int II_sblimit;
struct al_table2 const *alloc;
int down_sample_sblimit;
int down_sample;
};
struct gr_info_s {
int scfsi;
unsigned part2_3_length;
unsigned big_values;
unsigned scalefac_compress;
unsigned block_type;
unsigned mixed_block_flag;
unsigned table_select[3];
unsigned subblock_gain[3];
unsigned maxband[3];
unsigned maxbandl;
unsigned maxb;
unsigned region1start;
unsigned region2start;
unsigned preflag;
unsigned scalefac_scale;
unsigned count1table_select;
real *full_gain[3];
real *pow2gain;
};
struct III_sideinfo {
unsigned main_data_begin;
unsigned private_bits;
struct {
struct gr_info_s gr[2];
} ch[2];
};
#endif

View File

@@ -1,96 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef _MPGLIB_H_
#define _MPGLIB_H_
#include "lame.h"
#ifndef plotting_data_defined
#define plotting_data_defined
struct plotting_data;
typedef struct plotting_data plotting_data;
#endif
extern void lame_report_fnc(lame_report_function f, const char *format, ...);
struct buf {
unsigned char *pnt;
long size;
long pos;
struct buf *next;
struct buf *prev;
};
struct framebuf {
struct buf *buf;
long pos;
struct frame *next;
struct frame *prev;
};
typedef struct mpstr_tag {
struct buf *head, *tail; /* buffer linked list pointers, tail points to oldest buffer */
int vbr_header; /* 1 if valid Xing vbr header detected */
int num_frames; /* set if vbr header present */
int enc_delay; /* set if vbr header present */
int enc_padding; /* set if vbr header present */
/* header_parsed, side_parsed and data_parsed must be all set 1
before the full frame has been parsed */
int header_parsed; /* 1 = header of current frame has been parsed */
int side_parsed; /* 1 = header of sideinfo of current frame has been parsed */
int data_parsed;
int free_format; /* 1 = free format frame */
int old_free_format; /* 1 = last frame was free format */
int bsize;
int framesize;
int ssize; /* number of bytes used for side information, including 2 bytes for CRC-16 if present */
int dsize;
int fsizeold; /* size of previous frame, -1 for first */
int fsizeold_nopadding;
struct frame fr; /* holds the parameters decoded from the header */
struct III_sideinfo sideinfo;
unsigned char bsspace[2][MAXFRAMESIZE + 1024]; /* bit stream space used ???? */ /* MAXFRAMESIZE */
real hybrid_block[2][2][SBLIMIT * SSLIMIT];
int hybrid_blc[2];
unsigned long header;
int bsnum;
real synth_buffs[2][2][0x110];
int synth_bo;
int sync_bitstream; /* 1 = bitstream is yet to be synchronized */
int bitindex;
unsigned char *wordpointer;
plotting_data *pinfo;
lame_report_function report_msg;
lame_report_function report_dbg;
lame_report_function report_err;
} MPSTR, *PMPSTR;
#define MP3_ERR -1
#define MP3_OK 0
#define MP3_NEED_MORE 1
#endif /* _MPGLIB_H_ */

View File

@@ -1,152 +0,0 @@
/*
* tabinit.c
*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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: tabinit.c,v 1.17 2017/09/06 15:07:30 robert Exp $ */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include "tabinit.h"
#include "mpg123.h"
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
static int table_init_called = 0;
real decwin[512 + 32];
static real cos64[16], cos32[8], cos16[4], cos8[2], cos4[1];
real *pnts[] = { cos64, cos32, cos16, cos8, cos4 };
/* *INDENT-OFF* */
static const double dewin[512] = {
0.000000000,-0.000015259,-0.000015259,-0.000015259,
-0.000015259,-0.000015259,-0.000015259,-0.000030518,
-0.000030518,-0.000030518,-0.000030518,-0.000045776,
-0.000045776,-0.000061035,-0.000061035,-0.000076294,
-0.000076294,-0.000091553,-0.000106812,-0.000106812,
-0.000122070,-0.000137329,-0.000152588,-0.000167847,
-0.000198364,-0.000213623,-0.000244141,-0.000259399,
-0.000289917,-0.000320435,-0.000366211,-0.000396729,
-0.000442505,-0.000473022,-0.000534058,-0.000579834,
-0.000625610,-0.000686646,-0.000747681,-0.000808716,
-0.000885010,-0.000961304,-0.001037598,-0.001113892,
-0.001205444,-0.001296997,-0.001388550,-0.001480103,
-0.001586914,-0.001693726,-0.001785278,-0.001907349,
-0.002014160,-0.002120972,-0.002243042,-0.002349854,
-0.002456665,-0.002578735,-0.002685547,-0.002792358,
-0.002899170,-0.002990723,-0.003082275,-0.003173828,
-0.003250122,-0.003326416,-0.003387451,-0.003433228,
-0.003463745,-0.003479004,-0.003479004,-0.003463745,
-0.003417969,-0.003372192,-0.003280640,-0.003173828,
-0.003051758,-0.002883911,-0.002700806,-0.002487183,
-0.002227783,-0.001937866,-0.001617432,-0.001266479,
-0.000869751,-0.000442505, 0.000030518, 0.000549316,
0.001098633, 0.001693726, 0.002334595, 0.003005981,
0.003723145, 0.004486084, 0.005294800, 0.006118774,
0.007003784, 0.007919312, 0.008865356, 0.009841919,
0.010848999, 0.011886597, 0.012939453, 0.014022827,
0.015121460, 0.016235352, 0.017349243, 0.018463135,
0.019577026, 0.020690918, 0.021789551, 0.022857666,
0.023910522, 0.024932861, 0.025909424, 0.026840210,
0.027725220, 0.028533936, 0.029281616, 0.029937744,
0.030532837, 0.031005859, 0.031387329, 0.031661987,
0.031814575, 0.031845093, 0.031738281, 0.031478882,
0.031082153, 0.030517578, 0.029785156, 0.028884888,
0.027801514, 0.026535034, 0.025085449, 0.023422241,
0.021575928, 0.019531250, 0.017257690, 0.014801025,
0.012115479, 0.009231567, 0.006134033, 0.002822876,
-0.000686646,-0.004394531,-0.008316040,-0.012420654,
-0.016708374,-0.021179199,-0.025817871,-0.030609131,
-0.035552979,-0.040634155,-0.045837402,-0.051132202,
-0.056533813,-0.061996460,-0.067520142,-0.073059082,
-0.078628540,-0.084182739,-0.089706421,-0.095169067,
-0.100540161,-0.105819702,-0.110946655,-0.115921021,
-0.120697021,-0.125259399,-0.129562378,-0.133590698,
-0.137298584,-0.140670776,-0.143676758,-0.146255493,
-0.148422241,-0.150115967,-0.151306152,-0.151962280,
-0.152069092,-0.151596069,-0.150497437,-0.148773193,
-0.146362305,-0.143264771,-0.139450073,-0.134887695,
-0.129577637,-0.123474121,-0.116577148,-0.108856201,
-0.100311279,-0.090927124,-0.080688477,-0.069595337,
-0.057617187,-0.044784546,-0.031082153,-0.016510010,
-0.001068115, 0.015228271, 0.032379150, 0.050354004,
0.069168091, 0.088775635, 0.109161377, 0.130310059,
0.152206421, 0.174789429, 0.198059082, 0.221984863,
0.246505737, 0.271591187, 0.297210693, 0.323318481,
0.349868774, 0.376800537, 0.404083252, 0.431655884,
0.459472656, 0.487472534, 0.515609741, 0.543823242,
0.572036743, 0.600219727, 0.628295898, 0.656219482,
0.683914185, 0.711318970, 0.738372803, 0.765029907,
0.791213989, 0.816864014, 0.841949463, 0.866363525,
0.890090942, 0.913055420, 0.935195923, 0.956481934,
0.976852417, 0.996246338, 1.014617920, 1.031936646,
1.048156738, 1.063217163, 1.077117920, 1.089782715,
1.101211548, 1.111373901, 1.120223999, 1.127746582,
1.133926392, 1.138763428, 1.142211914, 1.144287109,
1.144989014
};
/* *INDENT-ON* */
void
make_decode_tables(long scaleval)
{
int i, j, k, kr, divv;
real *table, *costab;
if (table_init_called)
return;
table_init_called = 1;
for (i = 0; i < 5; i++) {
kr = 0x10 >> i;
divv = 0x40 >> i;
costab = pnts[i];
for (k = 0; k < kr; k++)
costab[k] = (real) (1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv)));
}
table = decwin;
scaleval = -scaleval;
for (i = 0, j = 0; i < 256; i++, j++, table += 32) {
if (table < decwin + 512 + 16)
table[16] = table[0] = (real) (dewin[j] * scaleval);
if (i % 32 == 31)
table -= 1023;
if (i % 64 == 63)
scaleval = -scaleval;
}
for ( /* i=256 */ ; i < 512; i++, j--, table += 32) {
if (table < decwin + 512 + 16)
table[16] = table[0] = (real) (dewin[j] * scaleval);
if (i % 32 == 31)
table -= 1023;
if (i % 64 == 63)
scaleval = -scaleval;
}
}

View File

@@ -1,32 +0,0 @@
/*
* Copyright (C) 1999-2010 The L.A.M.E. project
*
* Initially written by Michael Hipp, see also AUTHORS and README.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef MPGLIB_TABINIT_H_INCLUDED
#define MPGLIB_TABINIT_H_INCLUDED
#include "mpg123.h"
extern real decwin[512 + 32];
extern real *pnts[5];
void make_decode_tables(long scale);
#endif