提交 2d29656b authored 作者: Brian West's avatar Brian West

Adding mod_voipcodecs using Steve Underwoods voipcodecs library. This isn't default yet.

/b



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7555 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 cb7bae8c
......@@ -3,7 +3,7 @@ echo "bootstrap: checking installation..."
BASEDIR=`pwd`;
LIBDIR=${BASEDIR}/libs;
SUBDIRS="codec/g7xx codec/gsm codec/ilbc codec/lpc10 curl iax iksemel voipcodecs \
SUBDIRS="codec/g7xx codec/gsm codec/ilbc curl iax iksemel voipcodecs \
js js/nsprpub libdingaling libedit libresample libsndfile pcre sofia-sip \
speex sqlite srtp xmlrpc-c";
......
......@@ -22,9 +22,9 @@ codecs/mod_amr
codecs/mod_g729
codecs/mod_gsm
#codecs/mod_h26x
#codecs/mod_voipcodecs
codecs/mod_ilbc
codecs/mod_l16
#codecs/mod_lpc10
codecs/mod_speex
#dialplans/mod_dialplan_directory
dialplans/mod_dialplan_xml
......
......@@ -465,7 +465,6 @@ AC_CONFIG_SUBDIRS(libs/codec/g7xx)
AC_CONFIG_SUBDIRS(libs/voipcodecs)
AC_CONFIG_SUBDIRS(libs/codec/gsm)
AC_CONFIG_SUBDIRS(libs/codec/ilbc)
AC_CONFIG_SUBDIRS(libs/codec/lpc10)
AC_CONFIG_SUBDIRS(libs/curl)
AC_CONFIG_SUBDIRS(libs/iax)
AC_CONFIG_SUBDIRS(libs/iksemel)
......
Fri Mar 16 17:14:20 EDT 2007
EXTRA_DIST =
SUBDIRS =
AUTOMAKE_OPTS= gnu
NAME=liblpc10
AM_CFLAGS = $(new_AM_CFLAGS)
AM_CPPFLAGS = $(AM_CFLAGS)
AM_LDFLAGS = $(new_AM_LDFLAGS) -lm
lib_LTLIBRARIES = liblpc10.la
liblpc10_la_SOURCES = src/analys.c src/dcbias.c src/difmag.c src/energy.c src/hp100.c \
src/ivfilt.c src/lpcini.c src/mload.c src/placea.c src/prepro.c src/synths.c \
src/vparms.c src/bsynz.c src/decode.c src/dyptrk.c src/f2clib.c src/invert.c \
src/lpcdec.c src/lpfilt.c src/onset.c src/placev.c src/random.c src/tbdm.c \
src/chanwr.c src/deemp.c src/encode.c src/ham84.c src/irc2pc.c src/lpcenc.c \
src/median.c src/pitsyn.c src/preemp.c src/rcchk.c src/voicin.c
liblpc10_la_CFLAGS = $(AM_CFLAGS)
liblpc10_la_LDFLAGS =
library_includedir = $(prefix)/include
library_include_HEADERS = src/f2c.h src/lpc10.h
Tue Aug 20 16:19:51 CDT 1996
Andy Fingerhut (jaf@arl.wustl.edu)
In release 1.4, there are quite a few hand modifications to the C code
that was automatically created from the Fortran code with f2c. They
are all summarized in change log comments at the beginning of the
changed files. All of the original files from f2c were checked in to
RCS before modification, so it is possible to see exactly what changes
were made, for the extremely curious. That precaution was also for my
benefit, in case I ever recompile the Fortran sources, and want to
make similar changes to that new C source code.
Below is the README file for this directory included with the 1.3
release of the LPC-10 package. A few parts of it are a little out of
date, but it is correct for the most part.
Sun Jul 7 15:30:31 CDT 1996
Andy Fingerhut (jaf@arl.wustl.edu)
To create the LPC-10 library, copy the appropriate makefile to the
proper name for easy use, e.g., for Unix, copy makefile.unx to the
file "Makefile". The file makefile.dos has been used with some
version of the 'nmake' utility that comes with the Microsoft C
compiler (the same one used for Nautilus v1.5a, which I believe
specifies Microsoft C version 7.0 or later).
Then edit the file lpc10.h in the directory above. It should already
be set up to work properly on any Unix compiler for which "int" is 32
bits and "short" is 16 bits, and under the Microsoft C compiler
configured so that "long" is 32 bits and "int" is 16 bits. There must
be a typedef for the two types INT32 and INT16 in that file. You
should choose types that compile to those sizes using your compiler,
because there are places in the LPC-10 code that expect INT16's to
have exactly 16 bits (at least, I *think* they must be no larger), and
INT32's to have exactly 32 bits.
A few notes on how these files were created
-------------------------------------------
(This section is mostly for my benefit, so I can remember what I did.
You don't need to read it if you just want to use this package. It
might be useful to read it if you change the Fortran sources and want
to recreate a usable library of C sources. -- Andy)
These C sources were created automatically from the Fortran sources
using f2c, for the most part. Listed below are the extra
modifications that were made after this automatic conversion. Many of
them were made so that it was not necessary to install f2c in order to
use this LPC-10 coder.
1.
Put all of those files that were necessary for only the coder, rather
than an application that uses the coder, into this subdirectory called
lpc10.
2.
Copied f2c.h from the f2c distribution into this subdirectory. Some
modifications were made to the "typedef" statements in this file, to
explicitly indicate the sizes (in bits) that different integer types
should be. The types INT32 and INT16 must be defined in a file called
lpc10.h in the directory above. Created the file f2clib.c, containing
only the functions pow_ii(), r_sign(), and i_nint() from the f2c
library.
3.
The f2c output originally had a file called contrl_com.c, that defined
a small structure containing a few variables that were used in many
different functions of the LPC10 code. Every file containing
functions that used it defined it as "extern", while contrl_com.c
actually allocated storage for the structure. Bill Dorsey, one of the
lead developers of Nautilus, said that the Microsoft C compiler had
problems either compiling this file, or linking it with all of the
other compiled files, so he just eliminated that file and removed the
"extern" keyword from the one of the files that declared it that way.
The file chosen (arbitrarily) was analys.c.
4.
Copied the makefiles for Unix and Microsoft C from the Nautilus v1.5a
distribution into the lpc10 directory. Modified them to take out
references to Nautilus. These makefiles don't create an executable,
but a library of compiled functions called liblpc10.a (Unix) or
LPC10.LIB (DOS). This library can be used when linking an executable
that calls the functions lpcini_(), lpcenc_(), and lpcdec_().
AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_OLD], [dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl -------------------------------------------------------------------------
AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_NEW], [dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
[AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])])
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
[AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])])
AC_DEFUN([AX_CFLAGS_SUN_OPTION_OLD], [dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_sun_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for sun/cc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "+xstrconst % -xc99=all m4_ifval($2,$2,-option)" dnl Solaris C
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_SUN_OPTION_OLD], [dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_sun_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for sun/cc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "+xstrconst % -xc99=all m4_ifval($2,$2,-option)" dnl Solaris C
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl -----------------------------------------------------------------------
AC_DEFUN([AX_CFLAGS_SUN_OPTION_NEW], [dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_sun_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for sun/cc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "+xstrconst % -xc99=all m4_ifval($1,$1,-option)" dnl Solaris C
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_SUN_OPTION_NEW], [dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_sun_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for sun/cc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "+xstrconst % -xc99=all m4_ifval($1,$1,-option)" dnl Solaris C
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
AC_DEFUN([AX_CFLAGS_SUN_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
[AX_CFLAGS_SUN_OPTION_NEW($@)],[AX_CFLAGS_SUN_OPTION_OLD($@)])])
AC_DEFUN([AX_CXXFLAGS_SUN_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
[AX_CXXFLAGS_SUN_OPTION_NEW($@)],[AX_CXXFLAGS_SUN_OPTION_OLD($@)])])
AC_DEFUN([AX_GCC_ARCHFLAG],
[AC_REQUIRE([AC_PROG_CC])
AC_ARG_WITH(gcc-arch, [AC_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])],
ax_gcc_arch=$withval, ax_gcc_arch=yes)
AC_MSG_CHECKING([for gcc architecture flag])
AC_MSG_RESULT([])
AC_CACHE_VAL(ax_cv_gcc_archflag,
[
ax_cv_gcc_archflag="unknown"
if test "$GCC" = yes; then
if test "x$ax_gcc_arch" = xyes; then
ax_gcc_arch=""
if test "$cross_compiling" = no; then
case $host_cpu in
i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones
AX_GCC_X86_CPUID(0)
AX_GCC_X86_CPUID(1)
case $ax_cv_gcc_x86_cpuid_0 in
*:756e6547:*:*) # Intel
case $ax_cv_gcc_x86_cpuid_1 in
*5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;;
*5??:*:*:*) ax_gcc_arch=pentium ;;
*6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
*6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
*6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
*6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;;
*6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
*6??:*:*:*) ax_gcc_arch=pentiumpro ;;
*f3[[347]]:*:*:*|*f4[1347]:*:*:*)
case $host_cpu in
x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;;
*) ax_gcc_arch="prescott pentium4 pentiumpro" ;;
esac ;;
*f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";;
esac ;;
*:68747541:*:*) # AMD
case $ax_cv_gcc_x86_cpuid_1 in
*5[[67]]?:*:*:*) ax_gcc_arch=k6 ;;
*5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;;
*5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;;
*60?:*:*:*) ax_gcc_arch=k7 ;;
*6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;;
*6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;;
*67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;;
*6[[68a]]?:*:*:*)
AX_GCC_X86_CPUID(0x80000006) # L2 cache size
case $ax_cv_gcc_x86_cpuid_0x80000006 in
*:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256
ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;;
*) ax_gcc_arch="athlon-4 athlon k7" ;;
esac ;;
*f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;;
*f5?:*:*:*) ax_gcc_arch="opteron k8" ;;
*f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;;
*f??:*:*:*) ax_gcc_arch="k8" ;;
esac ;;
*:746e6543:*:*) # IDT
case $ax_cv_gcc_x86_cpuid_1 in
*54?:*:*:*) ax_gcc_arch=winchip-c6 ;;
*58?:*:*:*) ax_gcc_arch=winchip2 ;;
*6[[78]]?:*:*:*) ax_gcc_arch=c3 ;;
*69?:*:*:*) ax_gcc_arch="c3-2 c3" ;;
esac ;;
esac
if test x"$ax_gcc_arch" = x; then # fallback
case $host_cpu in
i586*) ax_gcc_arch=pentium ;;
i686*) ax_gcc_arch=pentiumpro ;;
esac
fi
;;
sparc*)
AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/])
cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters`
case $cputype in
*ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
*ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
*ultrasparc*) ax_gcc_arch="ultrasparc v9" ;;
*supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;;
*hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;;
*cypress*) ax_gcc_arch=cypress ;;
esac ;;
alphaev5) ax_gcc_arch=ev5 ;;
alphaev56) ax_gcc_arch=ev56 ;;
alphapca56) ax_gcc_arch="pca56 ev56" ;;
alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;;
alphaev6) ax_gcc_arch=ev6 ;;
alphaev67) ax_gcc_arch=ev67 ;;
alphaev68) ax_gcc_arch="ev68 ev67" ;;
alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;;
alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;;
alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;;
powerpc*)
cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null`
cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'`
case $cputype in
*750*) ax_gcc_arch="750 G3" ;;
*740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;;
*74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;;
*74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;;
*970*) ax_gcc_arch="970 G5 power4";;
*POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";;
*POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";;
603ev|8240) ax_gcc_arch="$cputype 603e 603";;
*) ax_gcc_arch=$cputype ;;
esac
ax_gcc_arch="$ax_gcc_arch powerpc"
;;
esac
fi # not cross-compiling
fi # guess arch
if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then
for arch in $ax_gcc_arch; do
if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code
flags="-mtune=$arch"
# -mcpu=$arch and m$arch generate nonportable code on every arch except
# x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr.
case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac
else
flags="-march=$arch -mcpu=$arch -m$arch"
fi
for flag in $flags; do
AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break])
done
test "x$ax_cv_gcc_archflag" = xunknown || break
done
fi
fi # $GCC=yes
])
AC_MSG_CHECKING([for gcc architecture flag])
AC_MSG_RESULT($ax_cv_gcc_archflag)
if test "x$ax_cv_gcc_archflag" = xunknown; then
m4_default([$3],:)
else
m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"])
fi
])
AC_DEFUN([AX_GCC_X86_CPUID],
[AC_REQUIRE([AC_PROG_CC])
AC_LANG_PUSH([C])
AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [
int op = $1, eax, ebx, ecx, edx;
FILE *f;
__asm__("cpuid"
: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
: "a" (op));
f = fopen("conftest_cpuid", "w"); if (!f) return 1;
fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
fclose(f);
return 0;
])],
[ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid],
[ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid],
[ax_cv_gcc_x86_cpuid_$1=unknown])])
AC_LANG_POP([C])
])
AC_DEFUN([AC_PROG_GZIP],[
AC_CHECK_PROGS(gzip,[gzip],no)
export gzip;
if test $gzip = "no" ;
then
AC_MSG_ERROR([Unable to find the gzip application]);
fi
AC_SUBST(gzip)
])
AC_DEFUN([AC_PROG_WGET],[
AC_CHECK_PROGS(wget,[wget],no)
export wget;
if test $wget = "no" ;
then
AC_MSG_ERROR([Unable to find the wget application]);
fi
AC_SUBST(wget)
])
AC_DEFUN([AX_CC_MAXOPT],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AX_COMPILER_VENDOR])
AC_ARG_ENABLE(portable-binary, [AC_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])],
acx_maxopt_portable=$withval, acx_maxopt_portable=no)
# Try to determine "good" native compiler flags if none specified via CFLAGS
if test "$ac_test_CFLAGS" != "set"; then
CFLAGS=""
case $ax_cv_c_compiler_vendor in
dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host"
if test "x$acx_maxopt_portable" = xno; then
CFLAGS="$CFLAGS -arch host"
fi;;
sun) CFLAGS="-native -fast -xO5 -dalign -xc99=all"
if test "x$acx_maxopt_portable" = xyes; then
CFLAGS="$CFLAGS -xarch=generic"
fi;;
hp) CFLAGS="+Oall +Optrs_ansi +DSnative"
if test "x$acx_maxopt_portable" = xyes; then
CFLAGS="$CFLAGS +DAportable"
fi;;
ibm) if test "x$acx_maxopt_portable" = xno; then
xlc_opt="-qarch=auto -qtune=auto"
else
xlc_opt="-qtune=auto"
fi
AX_CHECK_COMPILER_FLAGS($xlc_opt,
CFLAGS="-O3 -qansialias -w $xlc_opt",
[CFLAGS="-O3 -qansialias -w"
echo "******************************************************"
echo "* You seem to have the IBM C compiler. It is *"
echo "* recommended for best performance that you use: *"
echo "* *"
echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *"
echo "* ^^^ ^^^ *"
echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *"
echo "* CPU you have. (Set the CFLAGS environment var. *"
echo "* and re-run configure.) For more info, man cc. *"
echo "******************************************************"])
;;
intel) CFLAGS="-O3 -ansi_alias"
if test "x$acx_maxopt_portable" = xno; then
icc_archflag=unknown
icc_flags=""
case $host_cpu in
i686*|x86_64*)
# icc accepts gcc assembly syntax, so these should work:
AX_GCC_X86_CPUID(0)
AX_GCC_X86_CPUID(1)
case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG
*:756e6547:*:*) # Intel
case $ax_cv_gcc_x86_cpuid_1 in
*6a?:*[[234]]:*:*|*6[[789b]]?:*:*:*) icc_flags="-xK";;
*f3[[347]]:*:*:*|*f4[1347]:*:*:*) icc_flags="-xP -xN -xW -xK";;
*f??:*:*:*) icc_flags="-xN -xW -xK";;
esac ;;
esac ;;
esac
if test "x$icc_flags" != x; then
for flag in $icc_flags; do
AX_CHECK_COMPILER_FLAGS($flag, [icc_archflag=$flag; break])
done
fi
AC_MSG_CHECKING([for icc architecture flag])
AC_MSG_RESULT($icc_archflag)
if test "x$icc_archflag" != xunknown; then
CFLAGS="$CFLAGS $icc_archflag"
fi
fi
;;
gnu)
# default optimization flags for gcc on all systems
CFLAGS="-O3 -fomit-frame-pointer"
# -malign-double for x86 systems
AX_CHECK_COMPILER_FLAGS(-malign-double, CFLAGS="$CFLAGS -malign-double")
# -fstrict-aliasing for gcc-2.95+
AX_CHECK_COMPILER_FLAGS(-fstrict-aliasing,
CFLAGS="$CFLAGS -fstrict-aliasing")
# note that we enable "unsafe" fp optimization with other compilers, too
AX_CHECK_COMPILER_FLAGS(-ffast-math, CFLAGS="$CFLAGS -ffast-math")
AX_GCC_ARCHFLAG($acx_maxopt_portable)
;;
esac
if test -z "$CFLAGS"; then
echo ""
echo "********************************************************"
echo "* WARNING: Don't know the best CFLAGS for this system *"
echo "* Use ./configure CFLAGS=... to specify your own flags *"
echo "* (otherwise, a default of CFLAGS=-O3 will be used) *"
echo "********************************************************"
echo ""
CFLAGS="-O3"
fi
AX_CHECK_COMPILER_FLAGS($CFLAGS, [], [
echo ""
echo "********************************************************"
echo "* WARNING: The guessed CFLAGS don't seem to work with *"
echo "* your compiler. *"
echo "* Use ./configure CFLAGS=... to specify your own flags *"
echo "********************************************************"
echo ""
CFLAGS=""
])
fi
])
AC_DEFUN([AX_CFLAGS_WARN_ALL_ANSI],[dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all_ansi])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
# IRIX C compiler:
# -use_readonly_const is the default for IRIX C,
# puts them into .rodata, but they are copied later.
# need to be "-G0 -rdatashared" for strictmode but
# I am not sure what effect that has really. - guidod
for ac_arg dnl
in "-pedantic % -Wall -std=c99 -pedantic" dnl GCC
"-xstrconst % -v -xc99=all" dnl Solaris C
"-std1 % -verbose -w0 -warnprotos -std1" dnl Digital Unix
" % -qlanglvl=ansi -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
" % -ansi -ansiE -fullwarn" dnl IRIX
"+ESlit % +w1 -Aa" dnl HP-UX C
"-Xc % -pvctl[,]fullmsg -Xc" dnl NEC SX-5 (Super-UX 10)
"-h conform % -h msglevel 2 -h conform" dnl Cray C (Unicos)
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_WARN_ALL_ANSI],[dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all_ansi])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
# IRIX C compiler:
# -use_readonly_const is the default for IRIX C,
# puts them into .rodata, but they are copied later.
# need to be "-G0 -rdatashared" for strictmode but
# I am not sure what effect that has really. - guidod
for ac_arg dnl
in "-pedantic % -Wall -ansi -pedantic" dnl GCC
"-xstrconst % -v -Xc" dnl Solaris C
"-std1 % -verbose -w0 -warnprotos -std1" dnl Digital Unix
" % -qlanglvl=ansi -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
" % -ansi -ansiE -fullwarn" dnl IRIX
"+ESlit % +w1 -Aa" dnl HP-UX C
"-Xc % -pvctl[,]fullmsg -Xc" dnl NEC SX-5 (Super-UX 10)
"-h conform % -h msglevel 2 -h conform" dnl Cray C (Unicos)
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
AC_DEFUN([AX_CHECK_COMPILER_FLAGS],
[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1])
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
AS_LITERAL_IF([$1],
[AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1), [
ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes,
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no)
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])],
[ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes,
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no)
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])
eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)
AC_MSG_RESULT($ax_check_compiler_flags)
if test "x$ax_check_compiler_flags" = xyes; then
m4_default([$2], :)
else
m4_default([$3], :)
fi
])dnl AX_CHECK_COMPILER_FLAG
AC_DEFUN([AX_COMPILER_VENDOR],
[
AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
[ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown
# note: don't check for gcc first since some other compilers define __GNUC__
for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
#if !($vencpp)
thisisanerror;
#endif
])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
done
])
])
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(liblpc10, 1.0, liblpc10)
AC_CONFIG_AUX_DIR(build)
AM_INIT_AUTOMAKE(liblpc10,1.0)
#Set default language
AC_LANG_C
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_INSTALL
#Check for compiler vendor
AX_COMPILER_VENDOR
# Optimize
AC_ARG_ENABLE(optimization,
[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"])
if test "${enable_optimizer}" = "yes" ; then
AC_DEFINE([OPTIMZER],[],[Enable Optimization.])
AX_CC_MAXOPT
fi
# Enable debugging
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],[build with debug information])],[enable_debug="$enable_debug"],[enable_debug="yes"])
if test "${enable_debug}" = "yes"; then
AC_DEFINE([DEBUG],[],[Enable extra debugging.])
AX_CFLAGS_WARN_ALL_ANSI
fi
AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
case "$host" in
*-solaris2*)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-R${prefix}/lib"
elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
IN_LINE=inline
fi
DYNAMIC_LIB_EXTEN="so"
;;
*-darwin*)
if test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-dynamic -bundle -force-flat-namespace"
new_AM_CFLAGS="-DMACOSX"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="dylib"
;;
x86_64-*-linux-gnu)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-R${prefix}/lib"
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="so"
;;
i*6-*-linux-gnu)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-R${prefix}/lib"
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fpic"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="so"
;;
x86_64-*-freebsd*|amd64-*-freebsd*)
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
DYNAMIC_LIB_EXTEN="so"
;;
i*6-*-freebsd*)
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fpic"
new_AM_LDFLAGS=""
DYNAMIC_LIB_EXTEN="so"
;;
esac
# Enable 64 bit build
AC_ARG_ENABLE(64,
[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"])
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
if test "${enable_64}" = "yes"; then
new_AM_CFLAGS="$new_AM_CFLAGS -m64"
fi
fi
AC_SUBST(new_AM_CFLAGS)
AC_SUBST(new_AM_LDFLAGS)
AC_SUBST(SOLINK)
AC_SUBST(DYNAMIC_LIB_EXTEN)
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([malloc.h stdlib.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([floor sqrt])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
#! /bin/sh
./configure "$@" --disable-shared
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="liblpc10"
ProjectGUID="{FF1D238A-9D59-4850-838E-78182E05736B}"
RootNamespace="liblpc10"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="4"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\f2c.h"
>
</File>
<File
RelativePath=".\lpc10.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\analys.c"
>
</File>
<File
RelativePath=".\bsynz.c"
>
</File>
<File
RelativePath=".\chanwr.c"
>
</File>
<File
RelativePath=".\dcbias.c"
>
</File>
<File
RelativePath=".\decode.c"
>
</File>
<File
RelativePath=".\deemp.c"
>
</File>
<File
RelativePath=".\difmag.c"
>
</File>
<File
RelativePath=".\dyptrk.c"
>
</File>
<File
RelativePath=".\encode.c"
>
</File>
<File
RelativePath=".\energy.c"
>
</File>
<File
RelativePath=".\f2clib.c"
>
</File>
<File
RelativePath=".\ham84.c"
>
</File>
<File
RelativePath=".\hp100.c"
>
</File>
<File
RelativePath=".\invert.c"
>
</File>
<File
RelativePath=".\irc2pc.c"
>
</File>
<File
RelativePath=".\ivfilt.c"
>
</File>
<File
RelativePath=".\lpcdec.c"
>
</File>
<File
RelativePath=".\lpcenc.c"
>
</File>
<File
RelativePath=".\lpcini.c"
>
</File>
<File
RelativePath=".\lpfilt.c"
>
</File>
<File
RelativePath=".\median.c"
>
</File>
<File
RelativePath=".\mload.c"
>
</File>
<File
RelativePath=".\onset.c"
>
</File>
<File
RelativePath=".\pitsyn.c"
>
</File>
<File
RelativePath=".\placea.c"
>
</File>
<File
RelativePath=".\placev.c"
>
</File>
<File
RelativePath=".\preemp.c"
>
</File>
<File
RelativePath=".\prepro.c"
>
</File>
<File
RelativePath=".\random.c"
>
</File>
<File
RelativePath=".\rcchk.c"
>
</File>
<File
RelativePath=".\synths.c"
>
</File>
<File
RelativePath=".\tbdm.c"
>
</File>
<File
RelativePath=".\voicin.c"
>
</File>
<File
RelativePath=".\vparms.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
差异被折叠。
差异被折叠。
/*
$Log: chanwr.c,v $
Revision 1.1 2004/05/04 11:16:42 csoutheren
Initial version
Revision 1.1 2000/06/05 04:45:12 robertj
Added LPC-10 2400bps codec
* Revision 1.2 1996/08/20 20:20:24 jaf
* Removed all static local variables that were SAVE'd in the Fortran
* code, and put them in struct lpc10_encoder_state that is passed as an
* argument.
*
* Revision 1.1 1996/08/19 22:40:31 jaf
* Initial revision
*
*/
#ifdef P_R_O_T_O_T_Y_P_E_S
extern int chanwr_(integer *order, integer *ipitv, integer *irms, integer *irc, integer *ibits, struct lpc10_encoder_state *st);
extern int chanrd_(integer *order, integer *ipitv, integer *irms, integer *irc, integer *ibits);
#endif
/* -- translated by f2c (version 19951025).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* *********************************************************************** */
/* CHANL Version 49 */
/* $Log: chanwr.c,v $
* Revision 1.1 2004/05/04 11:16:42 csoutheren
* Initial version
*
* Revision 1.1 2000/06/05 04:45:12 robertj
* Added LPC-10 2400bps codec
*
* Revision 1.2 1996/08/20 20:20:24 jaf
* Removed all static local variables that were SAVE'd in the Fortran
* code, and put them in struct lpc10_encoder_state that is passed as an
* argument.
*
* Revision 1.1 1996/08/19 22:40:31 jaf
* Initial revision
*
*/
/* Revision 1.3 1996/03/21 15:14:57 jaf */
/* Added comments about which indices of argument arrays are read or */
/* written, and about the one bit of local state in CHANWR. CHANRD */
/* has no local state. */
/* Revision 1.2 1996/03/13 18:55:10 jaf */
/* Comments added explaining which of the local variables of this */
/* subroutine need to be saved from one invocation to the next, and which */
/* do not. */
/* Revision 1.1 1996/02/07 14:43:31 jaf */
/* Initial revision */
/* *********************************************************************** */
/* CHANWR: */
/* Place quantized parameters into bitstream */
/* Input: */
/* ORDER - Number of reflection coefficients (not really variable) */
/* IPITV - Quantized pitch/voicing parameter */
/* IRMS - Quantized energy parameter */
/* IRC - Quantized reflection coefficients */
/* Indices 1 through ORDER read. */
/* Output: */
/* IBITS - Serial bitstream */
/* Indices 1 through 54 written. */
/* Bit 54, the SYNC bit, alternates from one call to the next. */
/* Subroutine CHANWR maintains one bit of local state from one call to */
/* the next, in the variable ISYNC. I believe that this one bit is only */
/* intended to allow a receiver to resynchronize its interpretation of */
/* the bit stream, by looking for which of the 54 bits alternates every */
/* frame time. This is just a simple framing mechanism that is not */
/* useful when other, higher overhead framing mechanisms are used to */
/* transmit the coded frames. */
/* I'm not going to make an entry to reinitialize this bit, since it */
/* doesn't help a receiver much to know whether the first sync bit is a 0 */
/* or a 1. It needs to examine several frames in sequence to have */
/* reasonably good assurance that its framing is correct. */
/* CHANRD: */
/* Reconstruct parameters from bitstream */
/* Input: */
/* ORDER - Number of reflection coefficients (not really variable) */
/* IBITS - Serial bitstream */
/* Indices 1 through 53 read (SYNC bit is ignored). */
/* Output: */
/* IPITV - Quantized pitch/voicing parameter */
/* IRMS - Quantized energy parameter */
/* IRC - Quantized reflection coefficients */
/* Indices 1 through ORDER written */
/* Entry CHANRD has no local state. */
/* IBITS is 54 bits of LPC data ordered as follows: */
/* R1-0, R2-0, R3-0, P-0, A-0, */
/* R1-1, R2-1, R3-1, P-1, A-1, */
/* R1-2, R4-0, R3-2, A-2, P-2, R4-1, */
/* R1-3, R2-2, R3-3, R4-2, A-3, */
/* R1-4, R2-3, R3-4, R4-3, A-4, */
/* P-3, R2-4, R7-0, R8-0, P-4, R4-4, */
/* R5-0, R6-0, R7-1,R10-0, R8-1, */
/* R5-1, R6-1, R7-2, R9-0, P-5, */
/* R5-2, R6-2,R10-1, R8-2, P-6, R9-1, */
/* R5-3, R6-3, R7-3, R9-2, R8-3, SYNC */
/* Subroutine */ int chanwr_0_(int n__, integer *order, integer *ipitv,
integer *irms, integer *irc, integer *ibits,
struct lpc10_encoder_state *st)
{
/* Initialized data */
integer *isync;
static integer bit[10] = { 2,4,8,8,8,8,16,16,16,16 };
static integer iblist[53] = { 13,12,11,1,2,13,12,11,1,2,13,10,11,2,1,10,
13,12,11,10,2,13,12,11,10,2,1,12,7,6,1,10,9,8,7,4,6,9,8,7,5,1,9,8,
4,6,1,5,9,8,7,5,6 };
/* System generated locals */
integer i__1;
/* Local variables */
integer itab[13], i__;
/* Arguments */
/* Parameters/constants */
/* These arrays are not Fortran PARAMETER's, but they are defined */
/* by DATA statements below, and their contents are never altered.
*/
/* Local variables that need not be saved */
/* Local state */
/* ISYNC is only used by CHANWR, not by ENTRY CHANRD. */
/* Parameter adjustments */
--irc;
--ibits;
/* Function Body */
switch(n__) {
case 1: goto L_chanrd;
}
isync = &(st->isync);
/* ***********************************************************************
*/
/* Place quantized parameters into bitstream */
/* ***********************************************************************
*/
/* Place parameters into ITAB */
itab[0] = *ipitv;
itab[1] = *irms;
itab[2] = 0;
i__1 = *order;
for (i__ = 1; i__ <= i__1; ++i__) {
itab[i__ + 2] = irc[*order + 1 - i__] & 32767;
}
/* Put 54 bits into IBITS array */
for (i__ = 1; i__ <= 53; ++i__) {
ibits[i__] = itab[iblist[i__ - 1] - 1] & 1;
itab[iblist[i__ - 1] - 1] /= 2;
}
ibits[54] = *isync & 1;
*isync = 1 - *isync;
return 0;
/* ***********************************************************************
*/
/* Reconstruct parameters from bitstream */
/* ***********************************************************************
*/
L_chanrd:
/* Reconstruct ITAB */
for (i__ = 1; i__ <= 13; ++i__) {
itab[i__ - 1] = 0;
}
for (i__ = 1; i__ <= 53; ++i__) {
itab[iblist[54 - i__ - 1] - 1] = (itab[iblist[54 - i__ - 1] - 1] << 1)
+ ibits[54 - i__];
}
/* Sign extend RC's */
i__1 = *order;
for (i__ = 1; i__ <= i__1; ++i__) {
if ((itab[i__ + 2] & bit[i__ - 1]) != 0) {
itab[i__ + 2] -= bit[i__ - 1] << 1;
}
}
/* Restore variables */
*ipitv = itab[0];
*irms = itab[1];
i__1 = *order;
for (i__ = 1; i__ <= i__1; ++i__) {
irc[i__] = itab[*order + 4 - i__ - 1];
}
return 0;
} /* chanwr_ */
/* Subroutine */ int chanwr_(integer *order, integer *ipitv, integer *irms,
integer *irc, integer *ibits, struct lpc10_encoder_state *st)
{
return chanwr_0_(0, order, ipitv, irms, irc, ibits, st);
}
/* Subroutine */ int chanrd_(integer *order, integer *ipitv, integer *irms,
integer *irc, integer *ibits)
{
return chanwr_0_(1, order, ipitv, irms, irc, ibits, 0);
}
/*
$Log: dcbias.c,v $
Revision 1.1 2004/05/04 11:16:42 csoutheren
Initial version
Revision 1.1 2000/06/05 04:45:12 robertj
Added LPC-10 2400bps codec
* Revision 1.1 1996/08/19 22:40:23 jaf
* Initial revision
*
*/
#ifdef P_R_O_T_O_T_Y_P_E_S
extern int dcbias_(integer *len, real *speech, real *sigout);
#endif
/* -- translated by f2c (version 19951025).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* ********************************************************************* */
/* DCBIAS Version 50 */
/* $Log: dcbias.c,v $
* Revision 1.1 2004/05/04 11:16:42 csoutheren
* Initial version
*
* Revision 1.1 2000/06/05 04:45:12 robertj
* Added LPC-10 2400bps codec
*
* Revision 1.1 1996/08/19 22:40:23 jaf
* Initial revision
*
*/
/* Revision 1.3 1996/03/18 21:19:22 jaf */
/* Just added a few comments about which array indices of the arguments */
/* are used, and mentioning that this subroutine has no local state. */
/* Revision 1.2 1996/03/13 16:44:53 jaf */
/* Comments added explaining that none of the local variables of this */
/* subroutine need to be saved from one invocation to the next. */
/* Revision 1.1 1996/02/07 14:44:21 jaf */
/* Initial revision */
/* ********************************************************************* */
/* Calculate and remove DC bias from buffer. */
/* Input: */
/* LEN - Length of speech buffers */
/* SPEECH - Input speech buffer */
/* Indices 1 through LEN read. */
/* Output: */
/* SIGOUT - Output speech buffer */
/* Indices 1 through LEN written */
/* This subroutine has no local state. */
/* Subroutine */ int dcbias_(integer *len, real *speech, real *sigout)
{
/* System generated locals */
integer i__1;
/* Local variables */
real bias;
integer i__;
/* Arguments */
/* Local variables that need not be saved */
/* Parameter adjustments */
--sigout;
--speech;
/* Function Body */
bias = 0.f;
i__1 = *len;
for (i__ = 1; i__ <= i__1; ++i__) {
bias += speech[i__];
}
bias /= *len;
i__1 = *len;
for (i__ = 1; i__ <= i__1; ++i__) {
sigout[i__] = speech[i__] - bias;
}
return 0;
} /* dcbias_ */
差异被折叠。
/*
$Log: deemp.c,v $
Revision 1.1 2004/05/04 11:16:42 csoutheren
Initial version
Revision 1.1 2000/06/05 04:45:12 robertj
Added LPC-10 2400bps codec
* Revision 1.2 1996/08/20 20:23:46 jaf
* Removed all static local variables that were SAVE'd in the Fortran
* code, and put them in struct lpc10_decoder_state that is passed as an
* argument.
*
* Removed init function, since all initialization is now done in
* init_lpc10_decoder_state().
*
* Revision 1.1 1996/08/19 22:32:34 jaf
* Initial revision
*
*/
#ifdef P_R_O_T_O_T_Y_P_E_S
extern int deemp_(real *x, integer *n, struct lpc10_decoder_state *st);
#endif
/* -- translated by f2c (version 19951025).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* ***************************************************************** */
/* DEEMP Version 48 */
/* $Log: deemp.c,v $
* Revision 1.1 2004/05/04 11:16:42 csoutheren
* Initial version
*
* Revision 1.1 2000/06/05 04:45:12 robertj
* Added LPC-10 2400bps codec
*
* Revision 1.2 1996/08/20 20:23:46 jaf
* Removed all static local variables that were SAVE'd in the Fortran
* code, and put them in struct lpc10_decoder_state that is passed as an
* argument.
*
* Removed init function, since all initialization is now done in
* init_lpc10_decoder_state().
*
* Revision 1.1 1996/08/19 22:32:34 jaf
* Initial revision
*
*/
/* Revision 1.3 1996/03/20 15:54:37 jaf */
/* Added comments about which indices of array arguments are read or */
/* written. */
/* Added entry INITDEEMP to reinitialize the local state variables, if */
/* desired. */
/* Revision 1.2 1996/03/14 22:11:13 jaf */
/* Comments added explaining which of the local variables of this */
/* subroutine need to be saved from one invocation to the next, and which */
/* do not. */
/* Revision 1.1 1996/02/07 14:44:53 jaf */
/* Initial revision */
/* ***************************************************************** */
/* De-Emphasize output speech with 1 / ( 1 - .75z**-1 ) */
/* cascaded with 200 Hz high pass filter */
/* ( 1 - 1.9998z**-1 + z**-2 ) / ( 1 - 1.75z**-1 + .78z**-2 ) */
/* WARNING! The coefficients above may be out of date with the code */
/* below. Either that, or some kind of transformation was performed */
/* on the coefficients above to create the code below. */
/* Input: */
/* N - Number of samples */
/* Input/Output: */
/* X - Speech */
/* Indices 1 through N are read before being written. */
/* This subroutine maintains local state from one call to the next. If */
/* you want to switch to using a new audio stream for this filter, or */
/* reinitialize its state for any other reason, call the ENTRY */
/* INITDEEMP. */
/* Subroutine */ int deemp_(real *x, integer *n, struct lpc10_decoder_state *st)
{
/* Initialized data */
real *dei1;
real *dei2;
real *deo1;
real *deo2;
real *deo3;
/* System generated locals */
integer i__1;
real r__1;
/* Local variables */
integer k;
real dei0;
/* Arguments */
/* Local variables that need not be saved */
/* Local state */
/* All of the locals saved below were not given explicit initial */
/* values in the original code. I think 0 is a safe choice. */
/* Parameter adjustments */
if (x) {
--x;
}
/* Function Body */
dei1 = &(st->dei1);
dei2 = &(st->dei2);
deo1 = &(st->deo1);
deo2 = &(st->deo2);
deo3 = &(st->deo3);
i__1 = *n;
for (k = 1; k <= i__1; ++k) {
dei0 = x[k];
r__1 = x[k] - *dei1 * 1.9998f + *dei2;
x[k] = r__1 + *deo1 * 2.5f - *deo2 * 2.0925f + *deo3 * .585f;
*dei2 = *dei1;
*dei1 = dei0;
*deo3 = *deo2;
*deo2 = *deo1;
*deo1 = x[k];
}
return 0;
} /* deemp_ */
/*
$Log: difmag.c,v $
Revision 1.1 2004/05/04 11:16:42 csoutheren
Initial version
Revision 1.1 2000/06/05 04:45:12 robertj
Added LPC-10 2400bps codec
* Revision 1.1 1996/08/19 22:32:31 jaf
* Initial revision
*
*/
#ifdef P_R_O_T_O_T_Y_P_E_S
extern int difmag_(real *speech, integer *lpita, integer *tau, integer *ltau, integer *maxlag, real *amdf, integer *minptr, integer *maxptr);
#endif
/* -- translated by f2c (version 19951025).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* ********************************************************************** */
/* DIFMAG Version 49 */
/* $Log: difmag.c,v $
* Revision 1.1 2004/05/04 11:16:42 csoutheren
* Initial version
*
* Revision 1.1 2000/06/05 04:45:12 robertj
* Added LPC-10 2400bps codec
*
* Revision 1.1 1996/08/19 22:32:31 jaf
* Initial revision
*
*/
/* Revision 1.3 1996/03/15 23:09:39 jaf */
/* Just added a few comments about which array indices of the arguments */
/* are used, and mentioning that this subroutine has no local state. */
/* Revision 1.2 1996/03/13 14:41:31 jaf */
/* Comments added explaining that none of the local variables of this */
/* subroutine need to be saved from one invocation to the next. */
/* Revision 1.1 1996/02/07 14:45:04 jaf */
/* Initial revision */
/* ********************************************************************* */
/* Compute Average Magnitude Difference Function */
/* Inputs: */
/* SPEECH - Low pass filtered speech */
/* Indices MIN_N1 through MAX_N1+LPITA-1 are read, where */
/* MIN_N1 = (MAXLAG - MAX_TAU)/2+1 MAX_TAU = max of TAU(I) for I=1,LTAU
*/
/* MAX_N1 = (MAXLAG - MIN_TAU)/2+1 MIN_TAU = min of TAU(I) for I=1,LTAU
*/
/* LPITA - Length of speech buffer */
/* TAU - Table of lags */
/* Indices 1 through LTAU read. */
/* LTAU - Number of lag values to compute */
/* MAXLAG - Maximum possible lag value */
/* Outputs: */
/* (All of these outputs are also read, but only after being written.) */
/* AMDF - Average Magnitude Difference for each lag in TAU */
/* Indices 1 through LTAU written */
/* MINPTR - Index of minimum AMDF value */
/* MAXPTR - Index of maximum AMDF value */
/* This subroutine has no local state. */
/* Subroutine */ int difmag_(real *speech, integer *lpita, integer *tau,
integer *ltau, integer *maxlag, real *amdf, integer *minptr, integer *
maxptr)
{
/* System generated locals */
integer i__1, i__2;
real r__1;
/* Local variables */
integer i__, j, n1, n2;
real sum;
/* Arguments */
/* Local variables that need not be saved */
/* Local state */
/* None */
/* Parameter adjustments */
--amdf;
--tau;
--speech;
/* Function Body */
*minptr = 1;
*maxptr = 1;
i__1 = *ltau;
for (i__ = 1; i__ <= i__1; ++i__) {
n1 = (*maxlag - tau[i__]) / 2 + 1;
n2 = n1 + *lpita - 1;
sum = 0.f;
i__2 = n2;
for (j = n1; j <= i__2; j += 4) {
sum += (r__1 = speech[j] - speech[j + tau[i__]], abs(r__1));
}
amdf[i__] = sum;
if (amdf[i__] < amdf[*minptr]) {
*minptr = i__;
}
if (amdf[i__] > amdf[*maxptr]) {
*maxptr = i__;
}
}
return 0;
} /* difmag_ */
差异被折叠。
差异被折叠。
/*
$Log: energy.c,v $
Revision 1.1 2004/05/04 11:16:42 csoutheren
Initial version
Revision 1.2 2002/02/15 03:57:55 yurik
Warnings removed during compilation, patch courtesy of Jehan Bing, jehan@bravobrava.com
Revision 1.1 2000/06/05 04:45:12 robertj
Added LPC-10 2400bps codec
* Revision 1.1 1996/08/19 22:32:17 jaf
* Initial revision
*
*/
#ifdef P_R_O_T_O_T_Y_P_E_S
extern int energy_(integer *len, real *speech, real *rms);
#endif
/* -- translated by f2c (version 19951025).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* ********************************************************************* */
/* ENERGY Version 50 */
/* $Log: energy.c,v $
* Revision 1.1 2004/05/04 11:16:42 csoutheren
* Initial version
*
* Revision 1.2 2002/02/15 03:57:55 yurik
* Warnings removed during compilation, patch courtesy of Jehan Bing, jehan@bravobrava.com
*
* Revision 1.1 2000/06/05 04:45:12 robertj
* Added LPC-10 2400bps codec
*
* Revision 1.1 1996/08/19 22:32:17 jaf
* Initial revision
*
*/
/* Revision 1.3 1996/03/18 21:17:41 jaf */
/* Just added a few comments about which array indices of the arguments */
/* are used, and mentioning that this subroutine has no local state. */
/* Revision 1.2 1996/03/13 16:46:02 jaf */
/* Comments added explaining that none of the local variables of this */
/* subroutine need to be saved from one invocation to the next. */
/* Revision 1.1 1996/02/07 14:45:40 jaf */
/* Initial revision */
/* ********************************************************************* */
/* Compute RMS energy. */
/* Input: */
/* LEN - Length of speech buffer */
/* SPEECH - Speech buffer */
/* Indices 1 through LEN read. */
/* Output: */
/* RMS - Root Mean Square energy */
/* This subroutine has no local state. */
/* Subroutine */ int energy_(integer *len, real *speech, real *rms)
{
/* System generated locals */
integer i__1;
/* Builtin functions */
double sqrt(doublereal);
/* Local variables */
integer i__;
/* Arguments */
/* Local variables that need not be saved */
/* Parameter adjustments */
--speech;
/* Function Body */
*rms = 0.f;
i__1 = *len;
for (i__ = 1; i__ <= i__1; ++i__) {
*rms += speech[i__] * speech[i__];
}
*rms = (real)sqrt(*rms / *len);
return 0;
} /* energy_ */
/*
$Log: f2c.h,v $
Revision 1.1 2004/05/04 11:16:42 csoutheren
Initial version
Revision 1.1 2000/06/05 04:45:12 robertj
Added LPC-10 2400bps codec
* Revision 1.2 1996/08/20 20:26:28 jaf
* Any typedef defining a type that was used in lpc10_encoder_state or
* lpc10_decoder_state struct's was commented out here and added to
* lpc10.h.
*
* Revision 1.1 1996/08/19 22:32:13 jaf
* Initial revision
*
*/
/*
* f2c.h
*
* SCCS ID: @(#)f2c.h 1.2 96/05/19
*/
/* f2c.h -- Standard Fortran to C header file */
/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
#include "lpc10.h"
/*typedef long int integer;*/
/*typedef INT32 integer;*/
/*typedef short int shortint;*/
/*typedef INT16 shortint;*/
/*typedef float real;*/
/* doublereal only used for function arguments to sqrt, exp, etc. */
typedef double doublereal;
/* 32 bits seems wasteful, but there really aren't that many logical
* variables around, and making them 32 bits could avoid word
* alignment problems, perhaps. */
/*typedef long int logical;*/
/*typedef INT32 logical;*/
/* The following types are not used in the translated C code for the
* LPC-10 coder, but they might be needed by the definitions down
* below, so they don't cause compilation errors. */
typedef char *address;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
/* typedef long long longint; */ /* system-dependent */
#define TRUE_ (1)
#define FALSE_ (0)
/* Extern is for use with -E */
#ifndef Extern
#define Extern extern
#endif
/* I/O stuff */
#ifdef f2c_i2
/* for -i2 */
typedef short flag;
typedef short ftnlen;
typedef short ftnint;
#else
typedef long int flag;
typedef long int ftnlen;
typedef long int ftnint;
#endif
/*external read, write*/
typedef struct
{ flag cierr;
ftnint ciunit;
flag ciend;
char *cifmt;
ftnint cirec;
} cilist;
/*internal read, write*/
typedef struct
{ flag icierr;
char *iciunit;
flag iciend;
char *icifmt;
ftnint icirlen;
ftnint icirnum;
} icilist;
/*open*/
typedef struct
{ flag oerr;
ftnint ounit;
char *ofnm;
ftnlen ofnmlen;
char *osta;
char *oacc;
char *ofm;
ftnint orl;
char *oblnk;
} olist;
/*close*/
typedef struct
{ flag cerr;
ftnint cunit;
char *csta;
} cllist;
/*rewind, backspace, endfile*/
typedef struct
{ flag aerr;
ftnint aunit;
} alist;
/* inquire */
typedef struct
{ flag inerr;
ftnint inunit;
char *infile;
ftnlen infilen;
ftnint *inex; /*parameters in standard's order*/
ftnint *inopen;
ftnint *innum;
ftnint *innamed;
char *inname;
ftnlen innamlen;
char *inacc;
ftnlen inacclen;
char *inseq;
ftnlen inseqlen;
char *indir;
ftnlen indirlen;
char *infmt;
ftnlen infmtlen;
char *inform;
ftnint informlen;
char *inunf;
ftnlen inunflen;
ftnint *inrecl;
ftnint *innrec;
char *inblank;
ftnlen inblanklen;
} inlist;
#define VOID void
union Multitype { /* for multiple entry points */
integer1 g;
shortint h;
integer i;
/* longint j; */
real r;
doublereal d;
complex c;
doublecomplex z;
};
typedef union Multitype Multitype;
/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
struct Vardesc { /* for Namelist */
char *name;
char *addr;
ftnlen *dims;
int type;
};
typedef struct Vardesc Vardesc;
struct Namelist {
char *name;
Vardesc **vars;
int nvars;
};
typedef struct Namelist Namelist;
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (doublereal)abs(x)
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))
#define dmin(a,b) (doublereal)min(a,b)
#define dmax(a,b) (doublereal)max(a,b)
/* procedure parameter types for -A and -C++ */
#define F2C_proc_par_types 1
#ifdef __cplusplus
typedef int /* Unknown procedure type */ (*U_fp)(...);
typedef shortint (*J_fp)(...);
typedef integer (*I_fp)(...);
typedef real (*R_fp)(...);
typedef doublereal (*D_fp)(...), (*E_fp)(...);
typedef /* Complex */ VOID (*C_fp)(...);
typedef /* Double Complex */ VOID (*Z_fp)(...);
typedef logical (*L_fp)(...);
typedef shortlogical (*K_fp)(...);
typedef /* Character */ VOID (*H_fp)(...);
typedef /* Subroutine */ int (*S_fp)(...);
#else
typedef int /* Unknown procedure type */ (*U_fp)();
typedef shortint (*J_fp)();
typedef integer (*I_fp)();
typedef real (*R_fp)();
typedef doublereal (*D_fp)(), (*E_fp)();
typedef /* Complex */ VOID (*C_fp)();
typedef /* Double Complex */ VOID (*Z_fp)();
typedef logical (*L_fp)();
typedef shortlogical (*K_fp)();
typedef /* Character */ VOID (*H_fp)();
typedef /* Subroutine */ int (*S_fp)();
#endif
/* E_fp is for real functions when -R is not specified */
typedef VOID C_f; /* complex function */
typedef VOID H_f; /* character function */
typedef VOID Z_f; /* double complex function */
typedef doublereal E_f; /* real function with -R not specified */
/* undef any lower-case symbols that your C compiler predefines, e.g.: */
#ifndef Skip_f2c_Undefs
#undef cray
#undef gcos
#undef mc68010
#undef mc68020
#undef mips
#undef pdp11
#undef sgi
#undef sparc
#undef sun
#undef sun2
#undef sun3
#undef sun4
#undef u370
#undef u3b
#undef u3b2
#undef u3b5
#undef unix
#undef vax
#endif
#endif
/*
$Log: f2clib.c,v $
Revision 1.2 2004/05/05 13:25:38 rjongbloed
Fixed clearly incorrect code (dived by zero) found with an MSVC warning
Revision 1.1 2004/05/04 11:16:42 csoutheren
Initial version
Revision 1.3 2004/02/17 09:21:45 csoutheren
Fix for GM bug 134591
Revision 1.2 2002/02/15 03:57:55 yurik
Warnings removed during compilation, patch courtesy of Jehan Bing, jehan@bravobrava.com
Revision 1.1 2000/06/05 04:45:12 robertj
Added LPC-10 2400bps codec
* Revision 1.1 1996/08/19 22:32:10 jaf
* Initial revision
*
*/
/*
* f2clib.c
*
* SCCS ID: @(#)f2clib.c 1.2 96/05/19
*/
#include "f2c.h"
#ifdef KR_headers
integer pow_ii(ap, bp) integer *ap, *bp;
#else
integer pow_ii(integer *ap, integer *bp)
#endif
{
integer pow, x, n;
unsigned long u;
x = *ap;
n = *bp;
if (n <= 0) {
if (n == 0 || x == 1)
return 1;
if (x != -1)
return x != 0 ? 1/x : 0;
n = -n;
}
u = n;
for(pow = 1; ; )
{
if(u & 01)
pow *= x;
if(u >>= 1)
x *= x;
else
break;
}
return(pow);
}
#ifdef KR_headers
double r_sign(a,b) real *a, *b;
#else
double r_sign(real *a, real *b)
#endif
{
double x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}
#ifdef KR_headers
double floor();
integer i_nint(x) real *x;
#else
#undef abs
#include "math.h"
integer i_nint(real *x)
#endif
{
return (integer)( (*x)>=0 ?
floor(*x + .5) : -(floor(.5 - *x)) );
}
/*
$Log: ham84.c,v $
Revision 1.1 2004/05/04 11:16:42 csoutheren
Initial version
Revision 1.1 2000/06/05 04:45:12 robertj
Added LPC-10 2400bps codec
* Revision 1.1 1996/08/19 22:32:07 jaf
* Initial revision
*
*/
#ifdef P_R_O_T_O_T_Y_P_E_S
extern int ham84_(integer *input, integer *output, integer *errcnt);
#endif
/* -- translated by f2c (version 19951025).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* ***************************************************************** */
/* HAM84 Version 45G */
/* $Log: ham84.c,v $
* Revision 1.1 2004/05/04 11:16:42 csoutheren
* Initial version
*
* Revision 1.1 2000/06/05 04:45:12 robertj
* Added LPC-10 2400bps codec
*
* Revision 1.1 1996/08/19 22:32:07 jaf
* Initial revision
*
*/
/* Revision 1.3 1996/03/21 15:26:00 jaf */
/* Put comment header in standard form. */
/* Revision 1.2 1996/03/13 22:00:13 jaf */
/* Comments added explaining that none of the local variables of this */
/* subroutine need to be saved from one invocation to the next. */
/* Revision 1.1 1996/02/07 14:47:04 jaf */
/* Initial revision */
/* ***************************************************************** */
/* Hamming 8,4 Decoder - can correct 1 out of seven bits */
/* and can detect up to two errors. */
/* Input: */
/* INPUT - Seven bit data word, 4 bits parameter and */
/* 4 bits parity information */
/* Input/Output: */
/* ERRCNT - Sums errors detected by Hamming code */
/* Output: */
/* OUTPUT - 4 corrected parameter bits */
/* This subroutine is entered with an eight bit word in INPUT. The 8th */
/* bit is parity and is stripped off. The remaining 7 bits address the */
/* hamming 8,4 table and the output OUTPUT from the table gives the 4 */
/* bits of corrected data. If bit 4 is set, no error was detected. */
/* ERRCNT is the number of errors counted. */
/* This subroutine has no local state. */
/* Subroutine */ int ham84_(integer *input, integer *output, integer *errcnt)
{
/* Initialized data */
static integer dactab[128] = { 16,0,0,3,0,5,14,7,0,9,14,11,14,13,30,14,0,
9,2,7,4,7,7,23,9,25,10,9,12,9,14,7,0,5,2,11,5,21,6,5,8,11,11,27,
12,5,14,11,2,1,18,2,12,5,2,7,12,9,2,11,28,12,12,15,0,3,3,19,4,13,
6,3,8,13,10,3,13,29,14,13,4,1,10,3,20,4,4,7,10,9,26,10,4,13,10,15,
8,1,6,3,6,5,22,6,24,8,8,11,8,13,6,15,1,17,2,1,4,1,6,15,8,1,10,15,
12,15,15,31 };
integer i__, j, parity;
/* Arguments */
/* Parameters/constants */
/* Local variables that need not be saved */
/* Determine parity of input word */
parity = *input & 255;
parity ^= parity / 16;
parity ^= parity / 4;
parity ^= parity / 2;
parity &= 1;
i__ = dactab[*input & 127];
*output = i__ & 15;
j = i__ & 16;
if (j != 0) {
/* No errors detected in seven bits */
if (parity != 0) {
++(*errcnt);
}
} else {
/* One or two errors detected */
++(*errcnt);
if (parity == 0) {
/* Two errors detected */
++(*errcnt);
*output = -1;
}
}
return 0;
} /* ham84_ */
差异被折叠。
差异被折叠。
差异被折叠。
/*
$Log: ivfilt.c,v $
Revision 1.1 2004/05/04 11:16:43 csoutheren
Initial version
Revision 1.2 2002/02/15 03:57:55 yurik
Warnings removed during compilation, patch courtesy of Jehan Bing, jehan@bravobrava.com
Revision 1.1 2000/06/05 04:45:12 robertj
Added LPC-10 2400bps codec
* Revision 1.1 1996/08/19 22:31:53 jaf
* Initial revision
*
*/
#ifdef P_R_O_T_O_T_Y_P_E_S
extern int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *nsamp, real *ivrc);
#endif
/* -- translated by f2c (version 19951025).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* ********************************************************************* */
/* IVFILT Version 48 */
/* $Log: ivfilt.c,v $
* Revision 1.1 2004/05/04 11:16:43 csoutheren
* Initial version
*
* Revision 1.2 2002/02/15 03:57:55 yurik
* Warnings removed during compilation, patch courtesy of Jehan Bing, jehan@bravobrava.com
*
* Revision 1.1 2000/06/05 04:45:12 robertj
* Added LPC-10 2400bps codec
*
* Revision 1.1 1996/08/19 22:31:53 jaf
* Initial revision
*
*/
/* Revision 1.3 1996/03/15 21:36:29 jaf */
/* Just added a few comments about which array indices of the arguments */
/* are used, and mentioning that this subroutine has no local state. */
/* Revision 1.2 1996/03/13 00:01:00 jaf */
/* Comments added explaining that none of the local variables of this */
/* subroutine need to be saved from one invocation to the next. */
/* Revision 1.1 1996/02/07 14:47:34 jaf */
/* Initial revision */
/* ********************************************************************* */
/* 2nd order inverse filter, speech is decimated 4:1 */
/* Input: */
/* LEN - Length of speech buffers */
/* NSAMP - Number of samples to filter */
/* LPBUF - Low pass filtered speech buffer */
/* Indices LEN-NSAMP-7 through LEN read. */
/* Output: */
/* IVBUF - Inverse filtered speech buffer */
/* Indices LEN-NSAMP+1 through LEN written. */
/* IVRC - Inverse filter reflection coefficients (for voicing) */
/* Indices 1 and 2 both written (also read, but only after writing).
*/
/* This subroutine has no local state. */
/* Subroutine */ int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *
nsamp, real *ivrc)
{
/* System generated locals */
integer i__1;
/* Local variables */
integer i__, j, k;
real r__[3], pc1, pc2;
/* Arguments */
/* Local variables that need not be saved */
/* Local state */
/* None */
/* Calculate Autocorrelations */
/* Parameter adjustments */
--ivbuf;
--lpbuf;
--ivrc;
/* Function Body */
for (i__ = 1; i__ <= 3; ++i__) {
r__[i__ - 1] = 0.f;
k = i__ - (1 << 2);
i__1 = *len;
for (j = (i__ << 2) + *len - *nsamp; j <= i__1; j += 2) {
r__[i__ - 1] += lpbuf[j] * lpbuf[j - k];
}
}
/* Calculate predictor coefficients */
pc1 = 0.f;
pc2 = 0.f;
ivrc[1] = 0.f;
ivrc[2] = 0.f;
if (r__[0] > 1e-10f) {
ivrc[1] = r__[1] / r__[0];
ivrc[2] = (r__[2] - ivrc[1] * r__[1]) / (r__[0] - ivrc[1] * r__[1]);
pc1 = ivrc[1] - ivrc[1] * ivrc[2];
pc2 = ivrc[2];
}
/* Inverse filter LPBUF into IVBUF */
i__1 = *len;
for (i__ = *len + 1 - *nsamp; i__ <= i__1; ++i__) {
ivbuf[i__] = lpbuf[i__] - pc1 * lpbuf[i__ - 4] - pc2 * lpbuf[i__ - 8];
}
return 0;
} /* ivfilt_ */
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论