aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadaf Ebrahimi <sadafebrahimi@google.com>2023-03-28 15:01:02 +0000
committerSadaf Ebrahimi <sadafebrahimi@google.com>2023-03-28 15:09:02 +0000
commit7ebe79ef403bc08939107dfb775bfbaf9aedf323 (patch)
treedec5574d9317bfd36e5dc80f96a42bef57b6fbf1
parent7f5bc7819acb7d8655a84090a924d048f4ac27dd (diff)
parent1b28a0f61bc31162979e1f26f3981fc3637095c8 (diff)
downloadspeex-7ebe79ef403bc08939107dfb775bfbaf9aedf323.tar.gz
Upgrade speex to SpeexDSP-1.2.1
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update speex For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md Test: TreeHugger Change-Id: I76400629ea5578387ff07b38435f9efacb523b14
-rw-r--r--.cvsignore17
-rw-r--r--.gitignore1
-rw-r--r--.gitlab-ci.yml39
-rw-r--r--.travis.yml19
-rw-r--r--COPYING2
-rw-r--r--METADATA4
-rw-r--r--Makefile9
-rw-r--r--Makefile.in1
-rw-r--r--SpeexDSP.spec2
-rwxr-xr-xautogen.sh2
-rw-r--r--config.h34
-rw-r--r--config.h.in30
-rw-r--r--config.log863
-rwxr-xr-xconfig.status25
-rwxr-xr-xconfigure117
-rw-r--r--configure.ac64
-rw-r--r--doc/.cvsignore2
-rw-r--r--doc/Makefile9
-rw-r--r--doc/Makefile.in1
-rw-r--r--doc/sampledec.c6
-rw-r--r--doc/sampleenc.c4
-rw-r--r--include/Makefile9
-rw-r--r--include/Makefile.in1
-rw-r--r--include/speex/Makefile9
-rw-r--r--include/speex/Makefile.in1
-rw-r--r--include/speex/speex_buffer.h2
-rw-r--r--include/speex/speex_echo.h10
-rw-r--r--include/speex/speex_jitter.h40
-rw-r--r--include/speex/speex_preprocess.h12
-rw-r--r--include/speex/speex_resampler.h119
-rw-r--r--include/speex/speexdsp_config_types.h8
-rw-r--r--include/speex/speexdsp_config_types.h.in8
-rw-r--r--include/speex/speexdsp_types.h2
-rw-r--r--libspeexdsp/.cvsignore11
-rw-r--r--libspeexdsp/Makefile37
-rw-r--r--libspeexdsp/Makefile.am6
-rw-r--r--libspeexdsp/Makefile.in27
-rw-r--r--libspeexdsp/_kiss_fft_guts.h4
-rw-r--r--libspeexdsp/arch.h36
-rw-r--r--libspeexdsp/buffer.c6
-rw-r--r--libspeexdsp/fftwrap.c18
-rw-r--r--libspeexdsp/fftwrap.h12
-rw-r--r--libspeexdsp/filterbank.c12
-rw-r--r--libspeexdsp/fixed_arm4.h23
-rw-r--r--libspeexdsp/fixed_arm5e.h28
-rw-r--r--libspeexdsp/fixed_bfin.h47
-rw-r--r--libspeexdsp/fixed_debug.h74
-rw-r--r--libspeexdsp/fixed_generic.h24
-rw-r--r--libspeexdsp/jitter.c150
-rw-r--r--libspeexdsp/kiss_fft.c40
-rw-r--r--libspeexdsp/kiss_fft.h26
-rw-r--r--libspeexdsp/kiss_fftr.c38
-rw-r--r--libspeexdsp/kiss_fftr.h12
-rw-r--r--libspeexdsp/math_approx.h14
-rw-r--r--libspeexdsp/mdf.c134
-rw-r--r--libspeexdsp/misc_bfin.h10
-rw-r--r--libspeexdsp/os_support.h6
-rw-r--r--libspeexdsp/preprocess.c144
-rw-r--r--libspeexdsp/pseudofloat.h26
-rw-r--r--libspeexdsp/resample.c207
-rw-r--r--libspeexdsp/resample_neon.h168
-rw-r--r--libspeexdsp/resample_sse.h10
-rw-r--r--libspeexdsp/scal.c36
-rw-r--r--libspeexdsp/smallft.c16
-rw-r--r--libspeexdsp/stack_alloc.h115
-rw-r--r--libspeexdsp/testjitter.c12
-rw-r--r--libspeexdsp/testresample.c4
-rwxr-xr-xlibspeexdsp/testresample2210
-rw-r--r--libspeexdsp/testresample2.c93
-rw-r--r--libspeexdsp/vorbis_psy.h10
-rw-r--r--symbian/Makefile9
-rw-r--r--symbian/Makefile.in1
-rw-r--r--ti/Makefile9
-rw-r--r--ti/Makefile.in1
-rw-r--r--ti/config.h12
-rw-r--r--ti/os_support_custom.h36
-rw-r--r--ti/speex_C54_test/Makefile9
-rw-r--r--ti/speex_C54_test/Makefile.in1
-rw-r--r--ti/speex_C55_test/Makefile9
-rw-r--r--ti/speex_C55_test/Makefile.in1
-rw-r--r--ti/speex_C64_test/Makefile9
-rw-r--r--ti/speex_C64_test/Makefile.in1
-rw-r--r--tmv/_kiss_fft_guts_tm.h8
-rw-r--r--tmv/config.h28
-rw-r--r--tmv/fftwrap_tm.h24
-rw-r--r--tmv/filterbank_tm.h30
-rw-r--r--tmv/fixed_tm.h10
-rw-r--r--tmv/kiss_fft_tm.h118
-rw-r--r--tmv/kiss_fftr_tm.h34
-rw-r--r--tmv/mdf_tm.h362
-rw-r--r--tmv/misc_tm.h8
-rw-r--r--tmv/preprocess_tm.h160
-rw-r--r--tmv/profile_tm.h10
-rw-r--r--win32/Makefile9
-rw-r--r--win32/Makefile.in1
-rw-r--r--win32/VS2003/Makefile9
-rw-r--r--win32/VS2003/Makefile.in1
-rw-r--r--win32/VS2003/libspeexdsp/Makefile9
-rw-r--r--win32/VS2003/libspeexdsp/Makefile.in1
-rwxr-xr-xwin32/VS2003/libspeexdsp/libspeexdsp.vcproj4
-rw-r--r--win32/VS2003/tests/Makefile9
-rw-r--r--win32/VS2003/tests/Makefile.in1
-rw-r--r--win32/VS2005/Makefile9
-rw-r--r--win32/VS2005/Makefile.in1
-rw-r--r--win32/VS2005/libspeexdsp/Makefile9
-rw-r--r--win32/VS2005/libspeexdsp/Makefile.in1
-rwxr-xr-xwin32/VS2005/libspeexdsp/libspeexdsp.vcproj2
-rw-r--r--win32/VS2005/tests/Makefile9
-rw-r--r--win32/VS2005/tests/Makefile.in1
-rw-r--r--win32/VS2008/Makefile9
-rw-r--r--win32/VS2008/Makefile.in1
-rw-r--r--win32/VS2008/libspeexdsp/Makefile9
-rw-r--r--win32/VS2008/libspeexdsp/Makefile.in1
-rwxr-xr-xwin32/VS2008/libspeexdsp/libspeexdsp.vcproj50
-rw-r--r--win32/VS2008/tests/Makefile9
-rw-r--r--win32/VS2008/tests/Makefile.in1
-rw-r--r--win32/VS2008/tests/testdenoise.vcproj2
-rw-r--r--win32/VS2008/tests/testecho.vcproj2
-rw-r--r--win32/VS2008/tests/testresample.vcproj2
-rw-r--r--win32/config.h8
-rw-r--r--win32/libspeexdsp/Makefile9
-rw-r--r--win32/libspeexdsp/Makefile.in1
122 files changed, 2338 insertions, 2050 deletions
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 0c6bca2..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,17 +0,0 @@
-Makefile
-Makefile.in
-Speex.spec
-aclocal.m4
-autom4te.cache
-config.guess
-config.log
-config.status
-config.sub
-configure
-depcomp
-install-sh
-libtool
-ltconfig
-ltmain.sh
-missing
-mkinstalldirs
diff --git a/.gitignore b/.gitignore
index 75337f5..8d2e73b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ libtool
speexdsp.pc
stamp-*
patches
+/m4
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..3e85869
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,39 @@
+default:
+ tags:
+ - docker
+ # Image from https://hub.docker.com/_/gcc/ based on Debian
+ image: gcc:9
+
+.autoconf:
+ stage: build
+ before_script:
+ - apt-get update &&
+ apt-get install -y libfftw3-dev
+ script:
+ - ./autogen.sh
+ - ./configure ${CONFIG_FLAGS}
+ - make
+ - make check
+
+autoconf:
+ extends: .autoconf
+ script:
+ - ./autogen.sh
+ - ./configure ${CONFIG_FLAGS}
+ - make
+ - make distcheck
+
+fixed-point:
+ extends: .autoconf
+ variables:
+ CONFIG_FLAGS: --enable-fixed-point
+
+no-float:
+ extends: .autoconf
+ variables:
+ CONFIG_FLAGS: --enable-fixed-point --disable-float-api
+
+no-examples:
+ extends: .autoconf
+ variables:
+ CONFIG_FLAGS: --disable-examples
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..c93c75e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,19 @@
+language: c
+
+env:
+ - CONFIG=""
+ - CONFIG="--enable-fixed-point"
+ - CONFIG="--enable-fixed-point --disable-float-api"
+
+os:
+ - linux
+ - osx
+
+compiler:
+ - gcc
+ - clang
+
+script:
+ - ./autogen.sh
+ - ./configure $CONFIG
+ - make distcheck
diff --git a/COPYING b/COPYING
index de6fbe2..7d6dc4a 100644
--- a/COPYING
+++ b/COPYING
@@ -1,7 +1,7 @@
Copyright 2002-2008 Xiph.org Foundation
Copyright 2002-2008 Jean-Marc Valin
Copyright 2005-2007 Analog Devices Inc.
-Copyright 2005-2008 Commonwealth Scientific and Industrial Research
+Copyright 2005-2008 Commonwealth Scientific and Industrial Research
Organisation (CSIRO)
Copyright 1993, 2002, 2006 David Rowe
Copyright 2003 EpicGames
diff --git a/METADATA b/METADATA
index f0810a4..4431b93 100644
--- a/METADATA
+++ b/METADATA
@@ -9,11 +9,11 @@ third_party {
type: GIT
value: "https://gitlab.xiph.org/xiph/speexdsp"
}
- version: "SpeexDSP-1.2rc3"
+ version: "SpeexDSP-1.2.1"
license_type: NOTICE
last_upgrade_date {
year: 2023
month: 3
- day: 22
+ day: 28
}
}
diff --git a/Makefile b/Makefile
index 3c9f6cb..a099491 100644
--- a/Makefile
+++ b/Makefile
@@ -267,6 +267,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -295,10 +296,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -311,11 +312,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/Makefile.in b/Makefile.in
index 7062e70..e26301b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -267,6 +267,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/SpeexDSP.spec b/SpeexDSP.spec
index 96feb3b..2a1b11c 100644
--- a/SpeexDSP.spec
+++ b/SpeexDSP.spec
@@ -1,5 +1,5 @@
%define name speexdsp
-%define ver 1.2rc3
+%define ver 1.2.1
%define rel 1
Summary: An open-source, patent-free speech codec
diff --git a/autogen.sh b/autogen.sh
index b58da31..0606d12 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -8,7 +8,5 @@ test -n "$srcdir" && cd "$srcdir"
echo "Updating build configuration files, please wait...."
mkdir -p m4
-
-ACLOCAL_FLAGS="-I m4"
autoreconf -if
diff --git a/config.h b/config.h
index 85a6d89..0c05c6d 100644
--- a/config.h
+++ b/config.h
@@ -16,9 +16,6 @@
/* Disable all parts of the API that are using floats */
/* #undef DISABLE_FLOAT_API */
-/* Enable valgrind extra checks */
-/* #undef ENABLE_VALGRIND */
-
/* Symbol visibility prefix */
#define EXPORT __attribute__((visibility("default")))
@@ -31,15 +28,9 @@
/* Compile as floating-point */
#define FLOATING_POINT /**/
-/* Define to 1 if you have the <alloca.h> header file. */
-#define HAVE_ALLOCA_H 1
-
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
-/* Define to 1 if you have the <getopt.h> header file. */
-#define HAVE_GETOPT_H 1
-
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
@@ -83,7 +74,7 @@
#define PACKAGE_NAME "speexdsp"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "speexdsp 1.2rc3"
+#define PACKAGE_STRING "speexdsp 1.2.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "speexdsp"
@@ -92,7 +83,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.2rc3"
+#define PACKAGE_VERSION "1.2.1"
/* Resample with full SINC table (no interpolation) */
/* #undef RESAMPLE_FULL_SINC_TABLE */
@@ -132,9 +123,6 @@
/* Enable support for TI C55X DSP */
/* #undef TI_C55X */
-/* Make use of alloca */
-/* #undef USE_ALLOCA */
-
/* Use FFTW3 for FFT */
/* #undef USE_GPL_FFTW3 */
@@ -144,9 +132,18 @@
/* Use KISS Fast Fourier Transform */
/* #undef USE_KISS_FFT */
+/* Enable NEON support */
+/* #undef USE_NEON */
+
/* Use FFT from OggVorbis */
#define USE_SMALLFT /**/
+/* Enable SSE support */
+#define USE_SSE /**/
+
+/* Enable SSE2 support */
+#define USE_SSE2 /**/
+
/* Use C99 variable-size arrays */
#define VAR_ARRAYS /**/
@@ -162,15 +159,6 @@
# endif
#endif
-/* Enable NEON support */
-/* #undef _USE_NEON */
-
-/* Enable SSE support */
-#define _USE_SSE /**/
-
-/* Enable SSE2 support */
-#define _USE_SSE2 /**/
-
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
diff --git a/config.h.in b/config.h.in
index 76c0381..6f93a0d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -15,9 +15,6 @@
/* Disable all parts of the API that are using floats */
#undef DISABLE_FLOAT_API
-/* Enable valgrind extra checks */
-#undef ENABLE_VALGRIND
-
/* Symbol visibility prefix */
#undef EXPORT
@@ -30,15 +27,9 @@
/* Compile as floating-point */
#undef FLOATING_POINT
-/* Define to 1 if you have the <alloca.h> header file. */
-#undef HAVE_ALLOCA_H
-
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
-/* Define to 1 if you have the <getopt.h> header file. */
-#undef HAVE_GETOPT_H
-
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -131,9 +122,6 @@
/* Enable support for TI C55X DSP */
#undef TI_C55X
-/* Make use of alloca */
-#undef USE_ALLOCA
-
/* Use FFTW3 for FFT */
#undef USE_GPL_FFTW3
@@ -143,9 +131,18 @@
/* Use KISS Fast Fourier Transform */
#undef USE_KISS_FFT
+/* Enable NEON support */
+#undef USE_NEON
+
/* Use FFT from OggVorbis */
#undef USE_SMALLFT
+/* Enable SSE support */
+#undef USE_SSE
+
+/* Enable SSE2 support */
+#undef USE_SSE2
+
/* Use C99 variable-size arrays */
#undef VAR_ARRAYS
@@ -161,15 +158,6 @@
# endif
#endif
-/* Enable NEON support */
-#undef _USE_NEON
-
-/* Enable SSE support */
-#undef _USE_SSE
-
-/* Enable SSE2 support */
-#undef _USE_SSE2
-
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
diff --git a/config.log b/config.log
index ef8432e..5a0883b 100644
--- a/config.log
+++ b/config.log
@@ -1,7 +1,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by speexdsp configure 1.2rc3, which was
+It was created by speexdsp configure 1.2.1, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ ./configure
@@ -27,6 +27,20 @@ uname -v = #1 SMP PREEMPT_DYNAMIC Debian 5.19.11-1rodete1 (2022-10-31)
/usr/bin/oslevel = unknown
/bin/universe = unknown
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/out/host/linux-x86/bin/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/out/host/linux-x86/bin/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/prebuilts/clang/host/linux-x86/llvm-binutils-stable/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/prebuilts/asuite/acloud/linux-x86/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/prebuilts/asuite/aidegen/linux-x86/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/prebuilts/asuite/atest/linux-x86/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/prebuilts/jdk/jdk17/linux-x86/bin/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/vendor/google/tools/atest/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/build/bazel/bin/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/development/scripts/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/prebuilts/devtools/tools/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/prebuilts/misc/linux-x86/dtc/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/prebuilts/misc/linux-x86/libufdt/
+PATH: /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/prebuilts/android-emulator/linux-x86_64/
PATH: /usr/lib/google-golang/bin/
PATH: /usr/local/buildtools/java/jdk/bin/
PATH: /usr/local/sbin/
@@ -41,52 +55,52 @@ PATH: /bin/
## Core tests. ##
## ----------- ##
-configure:2657: looking for aux files: compile ltmain.sh config.guess config.sub missing install-sh
-configure:2670: trying ./
-configure:2699: ./compile found
-configure:2699: ./ltmain.sh found
-configure:2699: ./config.guess found
-configure:2699: ./config.sub found
-configure:2699: ./missing found
-configure:2681: ./install-sh found
-configure:2826: checking whether make supports nested variables
-configure:2844: result: yes
-configure:2884: checking for a BSD-compatible install
-configure:2957: result: /usr/bin/install -c
-configure:2968: checking whether build environment is sane
-configure:3023: result: yes
-configure:3182: checking for a race-free mkdir -p
-configure:3226: result: /usr/bin/mkdir -p
-configure:3233: checking for gawk
-configure:3254: found /usr/bin/gawk
-configure:3265: result: gawk
-configure:3276: checking whether make sets $(MAKE)
-configure:3299: result: yes
-configure:3438: checking whether to enable maintainer-specific portions of Makefiles
-configure:3448: result: yes
-configure:3468: checking build system type
-configure:3483: result: x86_64-pc-linux-gnu
-configure:3503: checking host system type
-configure:3517: result: x86_64-pc-linux-gnu
-configure:3917: checking how to print strings
-configure:3944: result: printf
-configure:3978: checking whether make supports the include directive
-configure:3993: make -f confmf.GNU && cat confinc.out
+configure:2656: looking for aux files: compile ltmain.sh config.guess config.sub missing install-sh
+configure:2669: trying ./
+configure:2698: ./compile found
+configure:2698: ./ltmain.sh found
+configure:2698: ./config.guess found
+configure:2698: ./config.sub found
+configure:2698: ./missing found
+configure:2680: ./install-sh found
+configure:2825: checking whether make supports nested variables
+configure:2843: result: yes
+configure:2883: checking for a BSD-compatible install
+configure:2956: result: /usr/bin/install -c
+configure:2967: checking whether build environment is sane
+configure:3022: result: yes
+configure:3181: checking for a race-free mkdir -p
+configure:3225: result: /usr/bin/mkdir -p
+configure:3232: checking for gawk
+configure:3253: found /usr/bin/gawk
+configure:3264: result: gawk
+configure:3275: checking whether make sets $(MAKE)
+configure:3298: result: yes
+configure:3437: checking whether to enable maintainer-specific portions of Makefiles
+configure:3447: result: yes
+configure:3467: checking build system type
+configure:3482: result: x86_64-pc-linux-gnu
+configure:3502: checking host system type
+configure:3516: result: x86_64-pc-linux-gnu
+configure:3914: checking how to print strings
+configure:3941: result: printf
+configure:3975: checking whether make supports the include directive
+configure:3990: make -f confmf.GNU && cat confinc.out
this is the am__doit target
-configure:3996: $? = 0
-configure:4015: result: yes (GNU style)
-configure:4091: checking for gcc
-configure:4112: found /usr/bin/gcc
-configure:4123: result: gcc
-configure:4476: checking for C compiler version
-configure:4485: gcc --version >&5
+configure:3993: $? = 0
+configure:4012: result: yes (GNU style)
+configure:4088: checking for gcc
+configure:4109: found /usr/bin/gcc
+configure:4120: result: gcc
+configure:4473: checking for C compiler version
+configure:4482: gcc --version >&5
gcc (Debian 12.2.0-10) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-configure:4496: $? = 0
-configure:4485: gcc -v >&5
+configure:4493: $? = 0
+configure:4482: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper
@@ -98,227 +112,227 @@ Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Debian 12.2.0-10)
... rest of stderr output deleted ...
-configure:4496: $? = 0
-configure:4485: gcc -V >&5
+configure:4493: $? = 0
+configure:4482: gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.
-configure:4496: $? = 1
-configure:4485: gcc -qversion >&5
+configure:4493: $? = 1
+configure:4482: gcc -qversion >&5
gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
-configure:4496: $? = 1
-configure:4485: gcc -version >&5
+configure:4493: $? = 1
+configure:4482: gcc -version >&5
gcc: error: unrecognized command-line option '-version'
gcc: fatal error: no input files
compilation terminated.
-configure:4496: $? = 1
-configure:4516: checking whether the C compiler works
-configure:4538: gcc conftest.c >&5
-configure:4542: $? = 0
-configure:4592: result: yes
-configure:4595: checking for C compiler default output file name
-configure:4597: result: a.out
-configure:4603: checking for suffix of executables
-configure:4610: gcc -o conftest conftest.c >&5
-configure:4614: $? = 0
-configure:4637: result:
-configure:4659: checking whether we are cross compiling
-configure:4667: gcc -o conftest conftest.c >&5
-configure:4671: $? = 0
-configure:4678: ./conftest
-configure:4682: $? = 0
-configure:4697: result: no
-configure:4702: checking for suffix of object files
-configure:4725: gcc -c conftest.c >&5
-configure:4729: $? = 0
-configure:4751: result: o
-configure:4755: checking whether the compiler supports GNU C
-configure:4775: gcc -c conftest.c >&5
-configure:4775: $? = 0
-configure:4785: result: yes
-configure:4796: checking whether gcc accepts -g
-configure:4817: gcc -c -g conftest.c >&5
-configure:4817: $? = 0
-configure:4861: result: yes
-configure:4881: checking for gcc option to enable C11 features
-configure:4896: gcc -c -g -O2 conftest.c >&5
-configure:4896: $? = 0
-configure:4914: result: none needed
-configure:5030: checking whether gcc understands -c and -o together
-configure:5053: gcc -c conftest.c -o conftest2.o
-configure:5056: $? = 0
-configure:5053: gcc -c conftest.c -o conftest2.o
-configure:5056: $? = 0
-configure:5068: result: yes
-configure:5087: checking dependency style of gcc
-configure:5199: result: gcc3
-configure:5214: checking for a sed that does not truncate output
-configure:5284: result: /usr/bin/sed
-configure:5302: checking for grep that handles long lines and -e
-configure:5366: result: /usr/bin/grep
-configure:5371: checking for egrep
-configure:5439: result: /usr/bin/grep -E
-configure:5444: checking for fgrep
-configure:5512: result: /usr/bin/grep -F
-configure:5548: checking for ld used by gcc
-configure:5616: result: /usr/bin/ld
-configure:5623: checking if the linker (/usr/bin/ld) is GNU ld
-configure:5639: result: yes
-configure:5651: checking for BSD- or MS-compatible name lister (nm)
-configure:5706: result: /usr/bin/nm -B
-configure:5846: checking the name lister (/usr/bin/nm -B) interface
-configure:5854: gcc -c -g -O2 conftest.c >&5
-configure:5857: /usr/bin/nm -B "conftest.o"
-configure:5860: output
+configure:4493: $? = 1
+configure:4513: checking whether the C compiler works
+configure:4535: gcc conftest.c >&5
+configure:4539: $? = 0
+configure:4589: result: yes
+configure:4592: checking for C compiler default output file name
+configure:4594: result: a.out
+configure:4600: checking for suffix of executables
+configure:4607: gcc -o conftest conftest.c >&5
+configure:4611: $? = 0
+configure:4634: result:
+configure:4656: checking whether we are cross compiling
+configure:4664: gcc -o conftest conftest.c >&5
+configure:4668: $? = 0
+configure:4675: ./conftest
+configure:4679: $? = 0
+configure:4694: result: no
+configure:4699: checking for suffix of object files
+configure:4722: gcc -c conftest.c >&5
+configure:4726: $? = 0
+configure:4748: result: o
+configure:4752: checking whether the compiler supports GNU C
+configure:4772: gcc -c conftest.c >&5
+configure:4772: $? = 0
+configure:4782: result: yes
+configure:4793: checking whether gcc accepts -g
+configure:4814: gcc -c -g conftest.c >&5
+configure:4814: $? = 0
+configure:4858: result: yes
+configure:4878: checking for gcc option to enable C11 features
+configure:4893: gcc -c -g -O2 conftest.c >&5
+configure:4893: $? = 0
+configure:4911: result: none needed
+configure:5027: checking whether gcc understands -c and -o together
+configure:5050: gcc -c conftest.c -o conftest2.o
+configure:5053: $? = 0
+configure:5050: gcc -c conftest.c -o conftest2.o
+configure:5053: $? = 0
+configure:5065: result: yes
+configure:5084: checking dependency style of gcc
+configure:5196: result: gcc3
+configure:5211: checking for a sed that does not truncate output
+configure:5281: result: /usr/bin/sed
+configure:5299: checking for grep that handles long lines and -e
+configure:5363: result: /usr/bin/grep
+configure:5368: checking for egrep
+configure:5436: result: /usr/bin/grep -E
+configure:5441: checking for fgrep
+configure:5509: result: /usr/bin/grep -F
+configure:5545: checking for ld used by gcc
+configure:5613: result: /usr/bin/ld
+configure:5620: checking if the linker (/usr/bin/ld) is GNU ld
+configure:5636: result: yes
+configure:5648: checking for BSD- or MS-compatible name lister (nm)
+configure:5703: result: /usr/bin/nm -B
+configure:5843: checking the name lister (/usr/bin/nm -B) interface
+configure:5851: gcc -c -g -O2 conftest.c >&5
+configure:5854: /usr/bin/nm -B "conftest.o"
+configure:5857: output
0000000000000000 B some_variable
-configure:5867: result: BSD nm
-configure:5870: checking whether ln -s works
-configure:5874: result: yes
-configure:5882: checking the maximum length of command line arguments
-configure:6014: result: 1572864
-configure:6062: checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format
-configure:6103: result: func_convert_file_noop
-configure:6110: checking how to convert x86_64-pc-linux-gnu file names to toolchain format
-configure:6131: result: func_convert_file_noop
-configure:6138: checking for /usr/bin/ld option to reload object files
-configure:6146: result: -r
-configure:6225: checking for file
-configure:6246: found /usr/bin/file
-configure:6257: result: file
-configure:6333: checking for objdump
-configure:6365: result: objdump
-configure:6394: checking how to recognize dependent libraries
-configure:6595: result: pass_all
-configure:6685: checking for dlltool
-configure:6717: result: dlltool
-configure:6747: checking how to associate runtime and link libraries
-configure:6775: result: printf %s\n
-configure:6841: checking for ar
-configure:6862: found /usr/bin/ar
-configure:6873: result: ar
-configure:6926: checking for archiver @FILE support
-configure:6944: gcc -c -g -O2 conftest.c >&5
-configure:6944: $? = 0
-configure:6948: ar cr libconftest.a @conftest.lst >&5
-configure:6951: $? = 0
-configure:6956: ar cr libconftest.a @conftest.lst >&5
+configure:5864: result: BSD nm
+configure:5867: checking whether ln -s works
+configure:5871: result: yes
+configure:5879: checking the maximum length of command line arguments
+configure:6011: result: 1572864
+configure:6059: checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format
+configure:6100: result: func_convert_file_noop
+configure:6107: checking how to convert x86_64-pc-linux-gnu file names to toolchain format
+configure:6128: result: func_convert_file_noop
+configure:6135: checking for /usr/bin/ld option to reload object files
+configure:6143: result: -r
+configure:6222: checking for file
+configure:6243: found /usr/bin/file
+configure:6254: result: file
+configure:6330: checking for objdump
+configure:6362: result: objdump
+configure:6391: checking how to recognize dependent libraries
+configure:6592: result: pass_all
+configure:6682: checking for dlltool
+configure:6714: result: dlltool
+configure:6744: checking how to associate runtime and link libraries
+configure:6772: result: printf %s\n
+configure:6838: checking for ar
+configure:6859: found /usr/bin/ar
+configure:6870: result: ar
+configure:6923: checking for archiver @FILE support
+configure:6941: gcc -c -g -O2 conftest.c >&5
+configure:6941: $? = 0
+configure:6945: ar cr libconftest.a @conftest.lst >&5
+configure:6948: $? = 0
+configure:6953: ar cr libconftest.a @conftest.lst >&5
ar: conftest.o: No such file or directory
-configure:6959: $? = 1
-configure:6971: result: @
-configure:7034: checking for strip
-configure:7055: found /usr/bin/strip
-configure:7066: result: strip
-configure:7143: checking for ranlib
-configure:7164: found /usr/bin/ranlib
-configure:7175: result: ranlib
-configure:7277: checking command to parse /usr/bin/nm -B output from gcc object
-configure:7431: gcc -c -g -O2 conftest.c >&5
-configure:7434: $? = 0
-configure:7438: /usr/bin/nm -B conftest.o | /usr/bin/sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | /usr/bin/sed '/ __gnu_lto/d' > conftest.nm
-configure:7504: gcc -o conftest -g -O2 conftest.c conftstm.o >&5
-configure:7507: $? = 0
-configure:7545: result: ok
-configure:7592: checking for sysroot
-configure:7623: result: no
-configure:7630: checking for a working dd
-configure:7674: result: /usr/bin/dd
-configure:7678: checking how to truncate binary pipes
-configure:7694: result: /usr/bin/dd bs=4096 count=1
-configure:7831: gcc -c -g -O2 conftest.c >&5
-configure:7834: $? = 0
-configure:8031: checking for mt
-configure:8052: found /usr/bin/mt
-configure:8063: result: mt
-configure:8086: checking if mt is a manifest tool
-configure:8093: mt '-?'
-configure:8101: result: no
-configure:8826: checking for stdio.h
-configure:8826: gcc -c -g -O2 conftest.c >&5
-configure:8826: $? = 0
-configure:8826: result: yes
-configure:8826: checking for stdlib.h
-configure:8826: gcc -c -g -O2 conftest.c >&5
-configure:8826: $? = 0
-configure:8826: result: yes
-configure:8826: checking for string.h
-configure:8826: gcc -c -g -O2 conftest.c >&5
-configure:8826: $? = 0
-configure:8826: result: yes
-configure:8826: checking for inttypes.h
-configure:8826: gcc -c -g -O2 conftest.c >&5
-configure:8826: $? = 0
-configure:8826: result: yes
-configure:8826: checking for stdint.h
-configure:8826: gcc -c -g -O2 conftest.c >&5
-configure:8826: $? = 0
-configure:8826: result: yes
-configure:8826: checking for strings.h
-configure:8826: gcc -c -g -O2 conftest.c >&5
-configure:8826: $? = 0
-configure:8826: result: yes
-configure:8826: checking for sys/stat.h
-configure:8826: gcc -c -g -O2 conftest.c >&5
-configure:8826: $? = 0
-configure:8826: result: yes
-configure:8826: checking for sys/types.h
-configure:8826: gcc -c -g -O2 conftest.c >&5
-configure:8826: $? = 0
-configure:8826: result: yes
-configure:8826: checking for unistd.h
-configure:8826: gcc -c -g -O2 conftest.c >&5
-configure:8826: $? = 0
-configure:8826: result: yes
-configure:8851: checking for dlfcn.h
-configure:8851: gcc -c -g -O2 conftest.c >&5
-configure:8851: $? = 0
-configure:8851: result: yes
-configure:9108: checking for objdir
-configure:9124: result: .libs
-configure:9388: checking if gcc supports -fno-rtti -fno-exceptions
-configure:9407: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5
+configure:6956: $? = 1
+configure:6968: result: @
+configure:7031: checking for strip
+configure:7052: found /usr/bin/strip
+configure:7063: result: strip
+configure:7140: checking for ranlib
+configure:7161: found /usr/bin/ranlib
+configure:7172: result: ranlib
+configure:7274: checking command to parse /usr/bin/nm -B output from gcc object
+configure:7428: gcc -c -g -O2 conftest.c >&5
+configure:7431: $? = 0
+configure:7435: /usr/bin/nm -B conftest.o | /usr/bin/sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | /usr/bin/sed '/ __gnu_lto/d' > conftest.nm
+configure:7501: gcc -o conftest -g -O2 conftest.c conftstm.o >&5
+configure:7504: $? = 0
+configure:7542: result: ok
+configure:7589: checking for sysroot
+configure:7620: result: no
+configure:7627: checking for a working dd
+configure:7671: result: /usr/bin/dd
+configure:7675: checking how to truncate binary pipes
+configure:7691: result: /usr/bin/dd bs=4096 count=1
+configure:7828: gcc -c -g -O2 conftest.c >&5
+configure:7831: $? = 0
+configure:8028: checking for mt
+configure:8049: found /usr/bin/mt
+configure:8060: result: mt
+configure:8083: checking if mt is a manifest tool
+configure:8090: mt '-?'
+configure:8098: result: no
+configure:8823: checking for stdio.h
+configure:8823: gcc -c -g -O2 conftest.c >&5
+configure:8823: $? = 0
+configure:8823: result: yes
+configure:8823: checking for stdlib.h
+configure:8823: gcc -c -g -O2 conftest.c >&5
+configure:8823: $? = 0
+configure:8823: result: yes
+configure:8823: checking for string.h
+configure:8823: gcc -c -g -O2 conftest.c >&5
+configure:8823: $? = 0
+configure:8823: result: yes
+configure:8823: checking for inttypes.h
+configure:8823: gcc -c -g -O2 conftest.c >&5
+configure:8823: $? = 0
+configure:8823: result: yes
+configure:8823: checking for stdint.h
+configure:8823: gcc -c -g -O2 conftest.c >&5
+configure:8823: $? = 0
+configure:8823: result: yes
+configure:8823: checking for strings.h
+configure:8823: gcc -c -g -O2 conftest.c >&5
+configure:8823: $? = 0
+configure:8823: result: yes
+configure:8823: checking for sys/stat.h
+configure:8823: gcc -c -g -O2 conftest.c >&5
+configure:8823: $? = 0
+configure:8823: result: yes
+configure:8823: checking for sys/types.h
+configure:8823: gcc -c -g -O2 conftest.c >&5
+configure:8823: $? = 0
+configure:8823: result: yes
+configure:8823: checking for unistd.h
+configure:8823: gcc -c -g -O2 conftest.c >&5
+configure:8823: $? = 0
+configure:8823: result: yes
+configure:8848: checking for dlfcn.h
+configure:8848: gcc -c -g -O2 conftest.c >&5
+configure:8848: $? = 0
+configure:8848: result: yes
+configure:9105: checking for objdir
+configure:9121: result: .libs
+configure:9385: checking if gcc supports -fno-rtti -fno-exceptions
+configure:9404: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5
cc1: warning: command-line option '-fno-rtti' is valid for C++/D/ObjC++ but not for C
-configure:9411: $? = 0
-configure:9424: result: no
-configure:9788: checking for gcc option to produce PIC
-configure:9796: result: -fPIC -DPIC
-configure:9804: checking if gcc PIC flag -fPIC -DPIC works
-configure:9823: gcc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5
-configure:9827: $? = 0
-configure:9840: result: yes
-configure:9869: checking if gcc static flag -static works
-configure:9898: result: yes
-configure:9913: checking if gcc supports -c -o file.o
-configure:9935: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5
-configure:9939: $? = 0
-configure:9961: result: yes
-configure:9969: checking if gcc supports -c -o file.o
-configure:10017: result: yes
-configure:10050: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
-configure:11324: result: yes
-configure:11361: checking whether -lc should be explicitly linked in
-configure:11370: gcc -c -g -O2 conftest.c >&5
-configure:11373: $? = 0
-configure:11388: gcc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /usr/bin/grep -lc \>/dev/null 2\>\&1
-configure:11391: $? = 0
-configure:11405: result: no
-configure:11565: checking dynamic linker characteristics
-configure:12147: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5
-configure:12147: $? = 0
-configure:12398: result: GNU/Linux ld.so
-configure:12520: checking how to hardcode library paths into programs
-configure:12545: result: immediate
-configure:13097: checking whether stripping libraries is possible
-configure:13106: result: yes
-configure:13148: checking if libtool supports shared libraries
-configure:13150: result: yes
-configure:13153: checking whether to build shared libraries
-configure:13178: result: yes
-configure:13181: checking whether to build static libraries
-configure:13185: result: yes
-configure:13223: checking whether byte ordering is bigendian
-configure:13239: gcc -c -g -O2 conftest.c >&5
+configure:9408: $? = 0
+configure:9421: result: no
+configure:9785: checking for gcc option to produce PIC
+configure:9793: result: -fPIC -DPIC
+configure:9801: checking if gcc PIC flag -fPIC -DPIC works
+configure:9820: gcc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5
+configure:9824: $? = 0
+configure:9837: result: yes
+configure:9866: checking if gcc static flag -static works
+configure:9895: result: yes
+configure:9910: checking if gcc supports -c -o file.o
+configure:9932: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5
+configure:9936: $? = 0
+configure:9958: result: yes
+configure:9966: checking if gcc supports -c -o file.o
+configure:10014: result: yes
+configure:10047: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
+configure:11321: result: yes
+configure:11358: checking whether -lc should be explicitly linked in
+configure:11367: gcc -c -g -O2 conftest.c >&5
+configure:11370: $? = 0
+configure:11385: gcc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /usr/bin/grep -lc \>/dev/null 2\>\&1
+configure:11388: $? = 0
+configure:11402: result: no
+configure:11562: checking dynamic linker characteristics
+configure:12144: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5
+configure:12144: $? = 0
+configure:12395: result: GNU/Linux ld.so
+configure:12517: checking how to hardcode library paths into programs
+configure:12542: result: immediate
+configure:13094: checking whether stripping libraries is possible
+configure:13103: result: yes
+configure:13145: checking if libtool supports shared libraries
+configure:13147: result: yes
+configure:13150: checking whether to build shared libraries
+configure:13175: result: yes
+configure:13178: checking whether to build static libraries
+configure:13182: result: yes
+configure:13220: checking whether byte ordering is bigendian
+configure:13236: gcc -c -g -O2 conftest.c >&5
conftest.c:22:16: error: unknown type name 'not'
22 | not a universal capable compiler
| ^~~
@@ -326,13 +340,13 @@ conftest.c:22:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before
22 | not a universal capable compiler
| ^~~~~~~~~
conftest.c:22:22: error: unknown type name 'universal'
-configure:13239: $? = 1
+configure:13236: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "speexdsp"
| #define PACKAGE_TARNAME "speexdsp"
-| #define PACKAGE_VERSION "1.2rc3"
-| #define PACKAGE_STRING "speexdsp 1.2rc3"
+| #define PACKAGE_VERSION "1.2.1"
+| #define PACKAGE_STRING "speexdsp 1.2.1"
| #define PACKAGE_BUGREPORT "speex-dev@xiph.org"
| #define PACKAGE_URL ""
| #define HAVE_STDIO_H 1
@@ -353,9 +367,9 @@ configure: failed program was:
| #endif
| typedef int dummy;
|
-configure:13285: gcc -c -g -O2 conftest.c >&5
-configure:13285: $? = 0
-configure:13304: gcc -c -g -O2 conftest.c >&5
+configure:13282: gcc -c -g -O2 conftest.c >&5
+configure:13282: $? = 0
+configure:13301: gcc -c -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:28:18: error: unknown type name 'not'; did you mean 'ino_t'?
28 | not big endian
@@ -364,13 +378,13 @@ conftest.c:28:18: error: unknown type name 'not'; did you mean 'ino_t'?
conftest.c:28:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'endian'
28 | not big endian
| ^~~~~~
-configure:13304: $? = 1
+configure:13301: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "speexdsp"
| #define PACKAGE_TARNAME "speexdsp"
-| #define PACKAGE_VERSION "1.2rc3"
-| #define PACKAGE_STRING "speexdsp 1.2rc3"
+| #define PACKAGE_VERSION "1.2.1"
+| #define PACKAGE_STRING "speexdsp 1.2.1"
| #define PACKAGE_BUGREPORT "speex-dev@xiph.org"
| #define PACKAGE_URL ""
| #define HAVE_STDIO_H 1
@@ -399,56 +413,44 @@ configure: failed program was:
| ;
| return 0;
| }
-configure:13438: result: no
-configure:13456: checking for an ANSI C-conforming const
-configure:13523: gcc -c -g -O2 conftest.c >&5
-configure:13523: $? = 0
-configure:13531: result: yes
-configure:13539: checking for inline
-configure:13556: gcc -c -g -O2 conftest.c >&5
-configure:13556: $? = 0
-configure:13565: result: inline
-configure:13583: checking for C/C++ restrict keyword
-configure:13613: gcc -c -g -O2 conftest.c >&5
-configure:13613: $? = 0
-configure:13622: result: __restrict__
-configure:13635: checking for C99 variable-size arrays
-configure:13652: gcc -c -g -O2 conftest.c >&5
-configure:13652: $? = 0
-configure:13663: result: yes
-configure:13666: checking for alloca.h
-configure:13666: gcc -c -g -O2 conftest.c >&5
-configure:13666: $? = 0
-configure:13666: result: yes
-configure:13672: checking for getopt.h
-configure:13672: gcc -c -g -O2 conftest.c >&5
-configure:13672: $? = 0
-configure:13672: result: yes
-configure:13679: checking for alloca
-configure:13700: gcc -c -g -O2 conftest.c >&5
-configure:13700: $? = 0
-configure:13715: result: yes
-configure:13718: checking for SSE in current arch/CFLAGS
-configure:13737: gcc -o conftest -g -O2 conftest.c >&5
-configure:13737: $? = 0
-configure:13750: result: yes
-configure:13753: checking for SSE2 in current arch/CFLAGS
-configure:13772: gcc -o conftest -g -O2 conftest.c >&5
-configure:13772: $? = 0
-configure:13785: result: yes
-configure:13788: checking for NEON in current arch/CFLAGS
-configure:13807: gcc -o conftest -g -O2 conftest.c >&5
-conftest.c:27:10: fatal error: arm_neon.h: No such file or directory
- 27 | #include <arm_neon.h>
+configure:13435: result: no
+configure:13453: checking for an ANSI C-conforming const
+configure:13520: gcc -c -g -O2 conftest.c >&5
+configure:13520: $? = 0
+configure:13528: result: yes
+configure:13536: checking for inline
+configure:13553: gcc -c -g -O2 conftest.c >&5
+configure:13553: $? = 0
+configure:13562: result: inline
+configure:13580: checking for C/C++ restrict keyword
+configure:13610: gcc -c -g -O2 conftest.c >&5
+configure:13610: $? = 0
+configure:13619: result: __restrict__
+configure:13632: checking for C99 variable-size arrays
+configure:13649: gcc -c -g -O2 conftest.c >&5
+configure:13649: $? = 0
+configure:13660: result: yes
+configure:13663: checking for SSE in current arch/CFLAGS
+configure:13682: gcc -o conftest -g -O2 conftest.c >&5
+configure:13682: $? = 0
+configure:13695: result: yes
+configure:13698: checking for SSE2 in current arch/CFLAGS
+configure:13717: gcc -o conftest -g -O2 conftest.c >&5
+configure:13717: $? = 0
+configure:13730: result: yes
+configure:13733: checking for NEON in current arch/CFLAGS
+configure:13752: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:25:10: fatal error: arm_neon.h: No such file or directory
+ 25 | #include <arm_neon.h>
| ^~~~~~~~~~~~
compilation terminated.
-configure:13807: $? = 1
+configure:13752: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "speexdsp"
| #define PACKAGE_TARNAME "speexdsp"
-| #define PACKAGE_VERSION "1.2rc3"
-| #define PACKAGE_STRING "speexdsp 1.2rc3"
+| #define PACKAGE_VERSION "1.2.1"
+| #define PACKAGE_STRING "speexdsp 1.2.1"
| #define PACKAGE_BUGREPORT "speex-dev@xiph.org"
| #define PACKAGE_URL ""
| #define HAVE_STDIO_H 1
@@ -465,8 +467,6 @@ configure: failed program was:
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| #define VAR_ARRAYS /**/
-| #define HAVE_ALLOCA_H 1
-| #define HAVE_GETOPT_H 1
| /* end confdefs.h. */
|
|
@@ -482,28 +482,28 @@ configure: failed program was:
| ;
| return 0;
| }
-configure:13820: result: no
-configure:13825: checking for ELF visibility
-configure:13843: gcc -c -g -O2 -fvisibility=hidden conftest.c >&5
-configure:13843: $? = 0
-configure:13862: result: yes
-configure:13865: checking for sys/soundcard.h
-configure:13865: gcc -c -g -O2 -fvisibility=hidden conftest.c >&5
-configure:13865: $? = 0
-configure:13865: result: yes
-configure:13871: checking for sys/audioio.h
-configure:13871: gcc -c -g -O2 -fvisibility=hidden conftest.c >&5
-conftest.c:55:10: fatal error: sys/audioio.h: No such file or directory
- 55 | #include <sys/audioio.h>
+configure:13765: result: no
+configure:13770: checking for ELF visibility
+configure:13788: gcc -c -g -O2 -fvisibility=hidden conftest.c >&5
+configure:13788: $? = 0
+configure:13807: result: yes
+configure:13810: checking for sys/soundcard.h
+configure:13810: gcc -c -g -O2 -fvisibility=hidden conftest.c >&5
+configure:13810: $? = 0
+configure:13810: result: yes
+configure:13816: checking for sys/audioio.h
+configure:13816: gcc -c -g -O2 -fvisibility=hidden conftest.c >&5
+conftest.c:53:10: fatal error: sys/audioio.h: No such file or directory
+ 53 | #include <sys/audioio.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
-configure:13871: $? = 1
+configure:13816: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "speexdsp"
| #define PACKAGE_TARNAME "speexdsp"
-| #define PACKAGE_VERSION "1.2rc3"
-| #define PACKAGE_STRING "speexdsp 1.2rc3"
+| #define PACKAGE_VERSION "1.2.1"
+| #define PACKAGE_STRING "speexdsp 1.2.1"
| #define PACKAGE_BUGREPORT "speex-dev@xiph.org"
| #define PACKAGE_URL ""
| #define HAVE_STDIO_H 1
@@ -520,8 +520,6 @@ configure: failed program was:
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| #define VAR_ARRAYS /**/
-| #define HAVE_ALLOCA_H 1
-| #define HAVE_GETOPT_H 1
| #define EXPORT __attribute__((visibility("default")))
| #define HAVE_SYS_SOUNDCARD_H 1
| /* end confdefs.h. */
@@ -554,84 +552,84 @@ configure: failed program was:
| # include <unistd.h>
| #endif
| #include <sys/audioio.h>
-configure:13871: result: no
-configure:13969: checking for cos in -lm
-configure:13992: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c -lm >&5
-conftest.c:31:6: warning: conflicting types for built-in function 'cos'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
- 31 | char cos ();
+configure:13816: result: no
+configure:13914: checking for cos in -lm
+configure:13937: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c -lm >&5
+conftest.c:29:6: warning: conflicting types for built-in function 'cos'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
+ 29 | char cos ();
| ^~~
conftest.c:1:1: note: 'cos' is declared in header '<math.h>'
1 | /* confdefs.h */
-configure:13992: $? = 0
-configure:14002: result: yes
-configure:14274: checking for pkg-config
-configure:14297: found /usr/bin/pkg-config
-configure:14309: result: /usr/bin/pkg-config
-configure:14334: checking pkg-config is at least version 0.9.0
-configure:14337: result: yes
-configure:14523: checking size of int16_t
-configure:14529: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
-configure:14529: $? = 0
-configure:14529: ./conftest
-configure:14529: $? = 0
-configure:14544: result: 2
-configure:14556: checking size of uint16_t
-configure:14562: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
-configure:14562: $? = 0
-configure:14562: ./conftest
-configure:14562: $? = 0
-configure:14577: result: 2
-configure:14589: checking size of u_int16_t
-configure:14595: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
-configure:14595: $? = 0
-configure:14595: ./conftest
-configure:14595: $? = 0
-configure:14610: result: 2
-configure:14622: checking size of int32_t
-configure:14628: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
-configure:14628: $? = 0
-configure:14628: ./conftest
-configure:14628: $? = 0
-configure:14643: result: 4
-configure:14655: checking size of uint32_t
-configure:14661: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
-configure:14661: $? = 0
-configure:14661: ./conftest
-configure:14661: $? = 0
-configure:14676: result: 4
-configure:14688: checking size of u_int32_t
-configure:14694: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
-configure:14694: $? = 0
-configure:14694: ./conftest
-configure:14694: $? = 0
-configure:14709: result: 4
-configure:14721: checking size of short
-configure:14727: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
-configure:14727: $? = 0
-configure:14727: ./conftest
-configure:14727: $? = 0
-configure:14742: result: 2
-configure:14754: checking size of int
-configure:14760: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
-configure:14760: $? = 0
-configure:14760: ./conftest
-configure:14760: $? = 0
-configure:14775: result: 4
-configure:14787: checking size of long
-configure:14793: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
-configure:14793: $? = 0
-configure:14793: ./conftest
-configure:14793: $? = 0
-configure:14808: result: 8
-configure:14987: checking that generated files are newer than configure
-configure:14993: result: done
-configure:15037: creating ./config.status
+configure:13937: $? = 0
+configure:13947: result: yes
+configure:14214: checking for pkg-config
+configure:14237: found /usr/bin/pkg-config
+configure:14249: result: /usr/bin/pkg-config
+configure:14274: checking pkg-config is at least version 0.9.0
+configure:14277: result: yes
+configure:14463: checking size of int16_t
+configure:14469: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
+configure:14469: $? = 0
+configure:14469: ./conftest
+configure:14469: $? = 0
+configure:14484: result: 2
+configure:14496: checking size of uint16_t
+configure:14502: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
+configure:14502: $? = 0
+configure:14502: ./conftest
+configure:14502: $? = 0
+configure:14517: result: 2
+configure:14529: checking size of u_int16_t
+configure:14535: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
+configure:14535: $? = 0
+configure:14535: ./conftest
+configure:14535: $? = 0
+configure:14550: result: 2
+configure:14562: checking size of int32_t
+configure:14568: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
+configure:14568: $? = 0
+configure:14568: ./conftest
+configure:14568: $? = 0
+configure:14583: result: 4
+configure:14595: checking size of uint32_t
+configure:14601: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
+configure:14601: $? = 0
+configure:14601: ./conftest
+configure:14601: $? = 0
+configure:14616: result: 4
+configure:14628: checking size of u_int32_t
+configure:14634: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
+configure:14634: $? = 0
+configure:14634: ./conftest
+configure:14634: $? = 0
+configure:14649: result: 4
+configure:14661: checking size of short
+configure:14667: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
+configure:14667: $? = 0
+configure:14667: ./conftest
+configure:14667: $? = 0
+configure:14682: result: 2
+configure:14694: checking size of int
+configure:14700: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
+configure:14700: $? = 0
+configure:14700: ./conftest
+configure:14700: $? = 0
+configure:14715: result: 4
+configure:14727: checking size of long
+configure:14733: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c >&5
+configure:14733: $? = 0
+configure:14733: ./conftest
+configure:14733: $? = 0
+configure:14748: result: 8
+configure:14940: checking that generated files are newer than configure
+configure:14946: result: done
+configure:14990: creating ./config.status
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
-This file was extended by speexdsp config.status 1.2rc3, which was
+This file was extended by speexdsp config.status 1.2.1, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES =
@@ -642,35 +640,35 @@ generated by GNU Autoconf 2.71. Invocation command line was
on sadaf-specialist.c.googlers.com
-config.status:1148: creating Makefile
-config.status:1148: creating libspeexdsp/Makefile
-config.status:1148: creating doc/Makefile
-config.status:1148: creating SpeexDSP.spec
-config.status:1148: creating include/Makefile
-config.status:1148: creating include/speex/Makefile
-config.status:1148: creating speexdsp.pc
-config.status:1148: creating win32/Makefile
-config.status:1148: creating win32/libspeexdsp/Makefile
-config.status:1148: creating symbian/Makefile
-config.status:1148: creating win32/VS2003/Makefile
-config.status:1148: creating win32/VS2003/libspeexdsp/Makefile
-config.status:1148: creating win32/VS2003/tests/Makefile
-config.status:1148: creating win32/VS2005/Makefile
-config.status:1148: creating win32/VS2005/libspeexdsp/Makefile
-config.status:1148: creating win32/VS2005/tests/Makefile
-config.status:1148: creating win32/VS2008/Makefile
-config.status:1148: creating win32/VS2008/libspeexdsp/Makefile
-config.status:1148: creating win32/VS2008/tests/Makefile
-config.status:1148: creating include/speex/speexdsp_config_types.h
-config.status:1148: creating ti/Makefile
-config.status:1148: creating ti/speex_C54_test/Makefile
-config.status:1148: creating ti/speex_C55_test/Makefile
-config.status:1148: creating ti/speex_C64_test/Makefile
-config.status:1148: creating config.h
-config.status:1377: executing depfiles commands
-config.status:1454: cd libspeexdsp && sed -e '/# am--include-marker/d' Makefile | make -f - am--depfiles
-config.status:1459: $? = 0
-config.status:1377: executing libtool commands
+config.status:1147: creating Makefile
+config.status:1147: creating libspeexdsp/Makefile
+config.status:1147: creating doc/Makefile
+config.status:1147: creating SpeexDSP.spec
+config.status:1147: creating include/Makefile
+config.status:1147: creating include/speex/Makefile
+config.status:1147: creating speexdsp.pc
+config.status:1147: creating win32/Makefile
+config.status:1147: creating win32/libspeexdsp/Makefile
+config.status:1147: creating symbian/Makefile
+config.status:1147: creating win32/VS2003/Makefile
+config.status:1147: creating win32/VS2003/libspeexdsp/Makefile
+config.status:1147: creating win32/VS2003/tests/Makefile
+config.status:1147: creating win32/VS2005/Makefile
+config.status:1147: creating win32/VS2005/libspeexdsp/Makefile
+config.status:1147: creating win32/VS2005/tests/Makefile
+config.status:1147: creating win32/VS2008/Makefile
+config.status:1147: creating win32/VS2008/libspeexdsp/Makefile
+config.status:1147: creating win32/VS2008/tests/Makefile
+config.status:1147: creating include/speex/speexdsp_config_types.h
+config.status:1147: creating ti/Makefile
+config.status:1147: creating ti/speex_C54_test/Makefile
+config.status:1147: creating ti/speex_C55_test/Makefile
+config.status:1147: creating ti/speex_C64_test/Makefile
+config.status:1147: creating config.h
+config.status:1376: executing depfiles commands
+config.status:1453: cd libspeexdsp && sed -e '/# am--include-marker/d' Makefile | make -f - am--depfiles
+config.status:1458: $? = 0
+config.status:1376: executing libtool commands
## ---------------- ##
## Cache variables. ##
@@ -710,9 +708,7 @@ ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
-ac_cv_header_alloca_h=yes
ac_cv_header_dlfcn_h=yes
-ac_cv_header_getopt_h=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdio_h=yes
@@ -838,6 +834,7 @@ FFT_PKGCONFIG=''
FGREP='/usr/bin/grep -F'
FILECMD='file'
GREP='/usr/bin/grep'
+INCLUDE_STDINT='#include <stdint.h>'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
@@ -867,10 +864,10 @@ OTOOL=''
PACKAGE='speexdsp'
PACKAGE_BUGREPORT='speex-dev@xiph.org'
PACKAGE_NAME='speexdsp'
-PACKAGE_STRING='speexdsp 1.2rc3'
+PACKAGE_STRING='speexdsp 1.2.1'
PACKAGE_TARNAME='speexdsp'
PACKAGE_URL=''
-PACKAGE_VERSION='1.2rc3'
+PACKAGE_VERSION='1.2.1'
PATH_SEPARATOR=':'
PKG_CONFIG='/usr/bin/pkg-config'
PKG_CONFIG_LIBDIR=''
@@ -883,11 +880,11 @@ SIZE16='int16_t'
SIZE32='int32_t'
SPEEXDSP_LT_AGE='5'
SPEEXDSP_LT_CURRENT='6'
-SPEEXDSP_LT_REVISION='0'
+SPEEXDSP_LT_REVISION='2'
STRIP='strip'
USIZE16='uint16_t'
USIZE32='uint32_t'
-VERSION='1.2rc3'
+VERSION='1.2.1'
ac_ct_AR='ar'
ac_ct_CC='gcc'
ac_ct_DUMPBIN=''
@@ -947,8 +944,8 @@ target_alias=''
/* confdefs.h */
#define PACKAGE_NAME "speexdsp"
#define PACKAGE_TARNAME "speexdsp"
-#define PACKAGE_VERSION "1.2rc3"
-#define PACKAGE_STRING "speexdsp 1.2rc3"
+#define PACKAGE_VERSION "1.2.1"
+#define PACKAGE_STRING "speexdsp 1.2.1"
#define PACKAGE_BUGREPORT "speex-dev@xiph.org"
#define PACKAGE_URL ""
#define HAVE_STDIO_H 1
@@ -965,13 +962,11 @@ target_alias=''
#define LT_OBJDIR ".libs/"
#define restrict __restrict__
#define VAR_ARRAYS /**/
-#define HAVE_ALLOCA_H 1
-#define HAVE_GETOPT_H 1
#define EXPORT __attribute__((visibility("default")))
#define HAVE_SYS_SOUNDCARD_H 1
#define FLOATING_POINT /**/
-#define _USE_SSE /**/
-#define _USE_SSE2 /**/
+#define USE_SSE /**/
+#define USE_SSE2 /**/
#define USE_SMALLFT /**/
#define SIZEOF_INT16_T 2
#define SIZEOF_UINT16_T 2
diff --git a/config.status b/config.status
index 89bf2d2..b137c5c 100755
--- a/config.status
+++ b/config.status
@@ -373,7 +373,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by speexdsp $as_me 1.2rc3, which was
+This file was extended by speexdsp $as_me 1.2.1, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -422,7 +422,7 @@ Report bugs to <speex-dev@xiph.org>."
ac_cs_config=''
ac_cs_version="\
-speexdsp config.status 1.2rc3
+speexdsp config.status 1.2.1
configured by ./configure, generated by GNU Autoconf 2.71,
with options \"$ac_cs_config\"
@@ -730,7 +730,7 @@ fi
PACKAGE='speexdsp'
- VERSION='1.2rc3'
+ VERSION='1.2.1'
RM='rm -f'
ofile='libtool'
@@ -838,6 +838,7 @@ S["am__EXEEXT_FALSE"]=""
S["am__EXEEXT_TRUE"]="#"
S["LTLIBOBJS"]=""
S["LIBOBJS"]=""
+S["INCLUDE_STDINT"]="#include <stdint.h>"
S["USIZE32"]="uint32_t"
S["SIZE32"]="int32_t"
S["USIZE16"]="uint16_t"
@@ -926,7 +927,7 @@ S["AUTOHEADER"]="${SHELL} '/usr/local/google/home/sadafebrahimi/aosp/forupdateso
S["AUTOMAKE"]="${SHELL} '/usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/missing' automake-1.16"
S["AUTOCONF"]="${SHELL} '/usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/missing' autoconf"
S["ACLOCAL"]="${SHELL} '/usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/missing' aclocal-1.16"
-S["VERSION"]="1.2rc3"
+S["VERSION"]="1.2.1"
S["PACKAGE"]="speexdsp"
S["CYGPATH_W"]="echo"
S["am__isrc"]=""
@@ -934,7 +935,7 @@ S["INSTALL_DATA"]="${INSTALL} -m 644"
S["INSTALL_SCRIPT"]="${INSTALL}"
S["INSTALL_PROGRAM"]="${INSTALL}"
S["SPEEXDSP_LT_AGE"]="5"
-S["SPEEXDSP_LT_REVISION"]="0"
+S["SPEEXDSP_LT_REVISION"]="2"
S["SPEEXDSP_LT_CURRENT"]="6"
S["AM_BACKSLASH"]="\\"
S["AM_DEFAULT_VERBOSITY"]="0"
@@ -973,8 +974,8 @@ S["prefix"]="/usr/local"
S["exec_prefix"]="${prefix}"
S["PACKAGE_URL"]=""
S["PACKAGE_BUGREPORT"]="speex-dev@xiph.org"
-S["PACKAGE_STRING"]="speexdsp 1.2rc3"
-S["PACKAGE_VERSION"]="1.2rc3"
+S["PACKAGE_STRING"]="speexdsp 1.2.1"
+S["PACKAGE_VERSION"]="1.2.1"
S["PACKAGE_TARNAME"]="speexdsp"
S["PACKAGE_NAME"]="speexdsp"
S["PATH_SEPARATOR"]=":"
@@ -1023,8 +1024,8 @@ cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
D["PACKAGE_NAME"]=" \"speexdsp\""
D["PACKAGE_TARNAME"]=" \"speexdsp\""
-D["PACKAGE_VERSION"]=" \"1.2rc3\""
-D["PACKAGE_STRING"]=" \"speexdsp 1.2rc3\""
+D["PACKAGE_VERSION"]=" \"1.2.1\""
+D["PACKAGE_STRING"]=" \"speexdsp 1.2.1\""
D["PACKAGE_BUGREPORT"]=" \"speex-dev@xiph.org\""
D["PACKAGE_URL"]=" \"\""
D["HAVE_STDIO_H"]=" 1"
@@ -1041,13 +1042,11 @@ D["HAVE_DLFCN_H"]=" 1"
D["LT_OBJDIR"]=" \".libs/\""
D["restrict"]=" __restrict__"
D["VAR_ARRAYS"]=" /**/"
-D["HAVE_ALLOCA_H"]=" 1"
-D["HAVE_GETOPT_H"]=" 1"
D["EXPORT"]=" __attribute__((visibility(\"default\")))"
D["HAVE_SYS_SOUNDCARD_H"]=" 1"
D["FLOATING_POINT"]=" /**/"
-D["_USE_SSE"]=" /**/"
-D["_USE_SSE2"]=" /**/"
+D["USE_SSE"]=" /**/"
+D["USE_SSE2"]=" /**/"
D["USE_SMALLFT"]=" /**/"
D["SIZEOF_INT16_T"]=" 2"
D["SIZEOF_UINT16_T"]=" 2"
diff --git a/configure b/configure
index 490b499..cf41ef5 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for speexdsp 1.2rc3.
+# Generated by GNU Autoconf 2.71 for speexdsp 1.2.1.
#
# Report bugs to <speex-dev@xiph.org>.
#
@@ -621,8 +621,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='speexdsp'
PACKAGE_TARNAME='speexdsp'
-PACKAGE_VERSION='1.2rc3'
-PACKAGE_STRING='speexdsp 1.2rc3'
+PACKAGE_VERSION='1.2.1'
+PACKAGE_STRING='speexdsp 1.2.1'
PACKAGE_BUGREPORT='speex-dev@xiph.org'
PACKAGE_URL=''
@@ -663,6 +663,7 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+INCLUDE_STDINT
USIZE32
SIZE32
USIZE16
@@ -819,7 +820,6 @@ enable_dependency_tracking
with_gnu_ld
with_sysroot
enable_libtool_lock
-enable_valgrind
enable_sse
enable_neon
enable_fixed_point
@@ -1395,7 +1395,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures speexdsp 1.2rc3 to adapt to many kinds of systems.
+\`configure' configures speexdsp 1.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1466,7 +1466,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of speexdsp 1.2rc3:";;
+ short | recursive ) echo "Configuration of speexdsp 1.2.1:";;
esac
cat <<\_ACEOF
@@ -1488,7 +1488,6 @@ Optional Features:
--disable-dependency-tracking
speeds up one-time build
--disable-libtool-lock avoid locking (might break parallel builds)
- --enable-valgrind Enable valgrind extra checks
--enable-sse Enable SSE support
--enable-neon Enable NEON support
--enable-fixed-point Compile as fixed-point
@@ -1602,7 +1601,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-speexdsp configure 1.2rc3
+speexdsp configure 1.2.1
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2052,7 +2051,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by speexdsp $as_me 1.2rc3, which was
+It was created by speexdsp $as_me 1.2.1, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -2855,7 +2854,7 @@ AM_BACKSLASH='\'
SPEEXDSP_LT_CURRENT=6
-SPEEXDSP_LT_REVISION=0
+SPEEXDSP_LT_REVISION=2
SPEEXDSP_LT_AGE=5
@@ -3336,7 +3335,7 @@ fi
# Define the identity of the package.
PACKAGE='speexdsp'
- VERSION='1.2rc3'
+ VERSION='1.2.1'
# Some tools Automake needs.
@@ -3865,8 +3864,6 @@ test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
case `pwd` in
*\ * | *\ *)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@@ -13663,58 +13660,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $has_var_arrays" >&5
printf "%s\n" "$has_var_arrays" >&6; }
-ac_fn_c_check_header_compile "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default"
-if test "x$ac_cv_header_alloca_h" = xyes
-then :
- printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h
-
-fi
-ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
-if test "x$ac_cv_header_getopt_h" = xyes
-then :
- printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h
-
-fi
-
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-printf %s "checking for alloca... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
-#include <stdlib.h>
-
-int
-main (void)
-{
-
-int foo=10;
-int *array = alloca(foo);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-
-has_alloca=yes;
-if test x$has_var_arrays = "xno" ; then
-
-printf "%s\n" "#define USE_ALLOCA /**/" >>confdefs.h
-
-fi
-
-else $as_nop
- has_alloca=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $has_alloca" >&5
-printf "%s\n" "$has_alloca" >&6; }
-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSE in current arch/CFLAGS" >&5
printf %s "checking for SSE in current arch/CFLAGS... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -14012,17 +13957,6 @@ esac
-# Check whether --enable-valgrind was given.
-if test ${enable_valgrind+y}
-then :
- enableval=$enable_valgrind; if test "$enableval" = yes; then
-
-printf "%s\n" "#define ENABLE_VALGRIND /**/" >>confdefs.h
-
-fi
-fi
-
-
# Check whether --enable-sse was given.
if test ${enable_sse+y}
then :
@@ -14045,7 +13979,13 @@ then :
enableval=$enable_neon;
if test "x$enableval" != xno; then
has_neon=yes
-CFLAGS="$CFLAGS -O3 -march=armv7-a -mfpu=neon"
+case "$host" in #(
+ arm*) :
+ CFLAGS="$CFLAGS -O3 -march=armv7-a -mfpu=neon"
+ ;; #(
+ *) :
+ ;;
+esac
else
has_neon=no
fi
@@ -14079,19 +14019,19 @@ fi
if test "$has_sse" = yes; then
-printf "%s\n" "#define _USE_SSE /**/" >>confdefs.h
+printf "%s\n" "#define USE_SSE /**/" >>confdefs.h
fi
if test "$has_neon" = yes; then
-printf "%s\n" "#define _USE_NEON /**/" >>confdefs.h
+printf "%s\n" "#define USE_NEON /**/" >>confdefs.h
fi
if test "$has_sse2" = yes; then
-printf "%s\n" "#define _USE_SSE2 /**/" >>confdefs.h
+printf "%s\n" "#define USE_SSE2 /**/" >>confdefs.h
fi
@@ -14877,6 +14817,19 @@ fi
+if test "$ac_cv_header_stdint_h" = "yes"
+then :
+ INCLUDE_STDINT="#include <stdint.h>"
+elif test "$ac_cv_header_inttypes_h" = "yes"
+then :
+ INCLUDE_STDINT="#include <inttypes.h>"
+elif test "$ac_cv_header_sys_types_h" = "yes"
+then :
+ INCLUDE_STDINT="#include <sys/types.h>"
+fi
+
+
+
ac_config_files="$ac_config_files Makefile libspeexdsp/Makefile doc/Makefile SpeexDSP.spec include/Makefile include/speex/Makefile speexdsp.pc win32/Makefile win32/libspeexdsp/Makefile symbian/Makefile win32/VS2003/Makefile win32/VS2003/libspeexdsp/Makefile win32/VS2003/tests/Makefile win32/VS2005/Makefile win32/VS2005/libspeexdsp/Makefile win32/VS2005/tests/Makefile win32/VS2008/Makefile win32/VS2008/libspeexdsp/Makefile win32/VS2008/tests/Makefile include/speex/speexdsp_config_types.h ti/Makefile ti/speex_C54_test/Makefile ti/speex_C55_test/Makefile ti/speex_C64_test/Makefile"
@@ -15427,7 +15380,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by speexdsp $as_me 1.2rc3, which was
+This file was extended by speexdsp $as_me 1.2.1, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15495,7 +15448,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-speexdsp config.status 1.2rc3
+speexdsp config.status 1.2.1
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 2cd2d1e..19361cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script. -*-m4-*-
-AC_INIT([speexdsp],[1.2rc3],[speex-dev@xiph.org])
+AC_INIT([speexdsp],[1.2.1],[speex-dev@xiph.org])
AC_CONFIG_SRCDIR([libspeexdsp/preprocess.c])
AC_CONFIG_MACRO_DIR([m4])
@@ -10,7 +10,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
SPEEXDSP_LT_CURRENT=6
-SPEEXDSP_LT_REVISION=0
+SPEEXDSP_LT_REVISION=2
SPEEXDSP_LT_AGE=5
@@ -22,8 +22,8 @@ AM_INIT_AUTOMAKE([foreign no-define])
AM_MAINTAINER_MODE([enable])
AC_CANONICAL_HOST
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
+_LT_SET_OPTION([LT_INIT],[win32-dll])
+LT_INIT
AC_C_BIGENDIAN
AC_C_CONST
@@ -32,38 +32,15 @@ AC_C_RESTRICT
AC_MSG_CHECKING(for C99 variable-size arrays)
-AC_TRY_COMPILE( , [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
int foo;
foo = 10;
int array[foo];
-],
-[has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
-],
-has_var_arrays=no
-)
+]])],[has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
+],[has_var_arrays=no
+])
AC_MSG_RESULT($has_var_arrays)
-AC_CHECK_HEADERS([alloca.h getopt.h])
-AC_MSG_CHECKING(for alloca)
-AC_TRY_COMPILE( [
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
-#include <stdlib.h>
-], [
-int foo=10;
-int *array = alloca(foo);
-],
-[
-has_alloca=yes;
-if test x$has_var_arrays = "xno" ; then
-AC_DEFINE([USE_ALLOCA], [], [Make use of alloca])
-fi
-],
-has_alloca=no
-)
-AC_MSG_RESULT($has_alloca)
-
AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
@@ -143,11 +120,6 @@ AC_SUBST(src)
LT_LIB_M
-AC_ARG_ENABLE(valgrind, [ --enable-valgrind Enable valgrind extra checks],
-[if test "$enableval" = yes; then
- AC_DEFINE([ENABLE_VALGRIND], , [Enable valgrind extra checks])
-fi])
-
AC_ARG_ENABLE(sse, [ --enable-sse Enable SSE support], [
if test "x$enableval" != xno; then
has_sse=yes
@@ -162,7 +134,9 @@ fi
AC_ARG_ENABLE(neon, [ --enable-neon Enable NEON support], [
if test "x$enableval" != xno; then
has_neon=yes
-CFLAGS="$CFLAGS -O3 -march=armv7-a -mfpu=neon"
+AS_CASE(["$host"],
+ [arm*], [CFLAGS="$CFLAGS -O3 -march=armv7-a -mfpu=neon"]
+)
else
has_neon=no
fi
@@ -182,15 +156,15 @@ fi],
AC_DEFINE([FLOATING_POINT], , [Compile as floating-point]))
if test "$has_sse" = yes; then
- AC_DEFINE([_USE_SSE], , [Enable SSE support])
+ AC_DEFINE([USE_SSE], , [Enable SSE support])
fi
if test "$has_neon" = yes; then
- AC_DEFINE([_USE_NEON], , [Enable NEON support])
+ AC_DEFINE([USE_NEON], , [Enable NEON support])
fi
if test "$has_sse2" = yes; then
- AC_DEFINE([_USE_SSE2], , [Enable SSE2 support])
+ AC_DEFINE([USE_SSE2], , [Enable SSE2 support])
fi
AC_ARG_ENABLE(float-api, [ --disable-float-api Disable the floating-point API],
@@ -334,11 +308,17 @@ AC_SUBST([USIZE16])
AC_SUBST([SIZE32])
AC_SUBST([USIZE32])
+AS_IF([test "$ac_cv_header_stdint_h" = "yes"], [INCLUDE_STDINT="#include <stdint.h>"],
+ [test "$ac_cv_header_inttypes_h" = "yes"], [INCLUDE_STDINT="#include <inttypes.h>"],
+ [test "$ac_cv_header_sys_types_h" = "yes"], [INCLUDE_STDINT="#include <sys/types.h>"])
+
+AC_SUBST([INCLUDE_STDINT])
+
AC_CONFIG_FILES([
Makefile libspeexdsp/Makefile doc/Makefile SpeexDSP.spec
include/Makefile include/speex/Makefile speexdsp.pc
win32/Makefile win32/libspeexdsp/Makefile
- symbian/Makefile
+ symbian/Makefile
win32/VS2003/Makefile
win32/VS2003/libspeexdsp/Makefile
@@ -351,7 +331,7 @@ AC_CONFIG_FILES([
win32/VS2008/Makefile
win32/VS2008/libspeexdsp/Makefile
win32/VS2008/tests/Makefile
- include/speex/speexdsp_config_types.h ti/Makefile
+ include/speex/speexdsp_config_types.h ti/Makefile
ti/speex_C54_test/Makefile ti/speex_C55_test/Makefile
ti/speex_C64_test/Makefile ])
diff --git a/doc/.cvsignore b/doc/.cvsignore
deleted file mode 100644
index 282522d..0000000
--- a/doc/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/doc/Makefile b/doc/Makefile
index 7a823f4..51f0774 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -185,6 +185,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -213,10 +214,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -229,11 +230,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/doc
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/doc
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 325a39f..66aa3af 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -185,6 +185,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/doc/sampledec.c b/doc/sampledec.c
index 2878c47..8e89e12 100644
--- a/doc/sampledec.c
+++ b/doc/sampledec.c
@@ -33,13 +33,13 @@ int main(int argc, char **argv)
speex_bits_init(&bits);
while (1)
{
- /*Read the size encoded by sampleenc, this part will likely be
+ /*Read the size encoded by sampleenc, this part will likely be
different in your application*/
fread(&nbBytes, sizeof(int), 1, stdin);
fprintf (stderr, "nbBytes: %d\n", nbBytes);
if (feof(stdin))
break;
-
+
/*Read the "packet" encoded by sampleenc*/
fread(cbits, 1, nbBytes, stdin);
/*Copy the data into the bit-stream struct*/
@@ -55,7 +55,7 @@ int main(int argc, char **argv)
/*Write the decoded audio to file*/
fwrite(out, sizeof(short), FRAME_SIZE, fout);
}
-
+
/*Destroy the decoder state*/
speex_decoder_destroy(state);
/*Destroy the bit-stream truct*/
diff --git a/doc/sampleenc.c b/doc/sampleenc.c
index d508181..a0ec8b6 100644
--- a/doc/sampleenc.c
+++ b/doc/sampleenc.c
@@ -52,9 +52,9 @@ int main(int argc, char **argv)
fwrite(&nbBytes, sizeof(int), 1, stdout);
/*Write the compressed data*/
fwrite(cbits, 1, nbBytes, stdout);
-
+
}
-
+
/*Destroy the encoder state*/
speex_encoder_destroy(state);
/*Destroy the bit-packing struct*/
diff --git a/include/Makefile b/include/Makefile
index 563d3da..8203ed5 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -213,6 +213,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -241,10 +242,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -257,11 +258,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/include
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/include
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/include/Makefile.in b/include/Makefile.in
index 3a3d08c..dacc661 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -213,6 +213,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/include/speex/Makefile b/include/speex/Makefile
index 8c6cca8..a839e08 100644
--- a/include/speex/Makefile
+++ b/include/speex/Makefile
@@ -214,6 +214,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -242,10 +243,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -258,11 +259,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/include/speex
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/include/speex
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/include/speex/Makefile.in b/include/speex/Makefile.in
index dc08e9b..2e2794b 100644
--- a/include/speex/Makefile.in
+++ b/include/speex/Makefile.in
@@ -214,6 +214,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/include/speex/speex_buffer.h b/include/speex/speex_buffer.h
index 5bd128a..9e85cfc 100644
--- a/include/speex/speex_buffer.h
+++ b/include/speex/speex_buffer.h
@@ -1,5 +1,5 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_buffer.h
This is a very simple ring buffer implementation. It is not thread-safe
so you need to do your own locking.
diff --git a/include/speex/speex_echo.h b/include/speex/speex_echo.h
index 6f14d09..4c1aa5a 100644
--- a/include/speex/speex_echo.h
+++ b/include/speex/speex_echo.h
@@ -63,7 +63,7 @@ extern "C" {
struct SpeexEchoState_;
/** @class SpeexEchoState
- * This holds the state of the echo canceller. You need one per channel.
+ * This holds the state of the echo canceller. You need one per channel.
*/
/** Internal echo canceller state. Should never be accessed directly. */
@@ -85,7 +85,7 @@ SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length);
*/
SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_length, int nb_mic, int nb_speakers);
-/** Destroys an echo canceller state
+/** Destroys an echo canceller state
* @param st Echo canceller state
*/
void speex_echo_state_destroy(SpeexEchoState *st);
@@ -117,7 +117,7 @@ void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t
*/
void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play);
-/** Reset the echo canceller to its original state
+/** Reset the echo canceller to its original state
* @param st Echo canceller state
*/
void speex_echo_state_reset(SpeexEchoState *st);
@@ -139,7 +139,7 @@ typedef struct SpeexDecorrState_ SpeexDecorrState;
/** Create a state for the channel decorrelation algorithm
- This is useful for multi-channel echo cancellation only
+ This is useful for multi-channel echo cancellation only
* @param rate Sampling rate
* @param channels Number of channels (it's a bit pointless if you don't have at least 2)
* @param frame_size Size of the frame to process at ones (counting samples *per* channel)
@@ -155,7 +155,7 @@ SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame_size);
*/
void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_int16_t *out, int strength);
-/** Destroy a Decorrelation state
+/** Destroy a Decorrelation state
* @param st State to destroy
*/
void speex_decorrelate_destroy(SpeexDecorrState *st);
diff --git a/include/speex/speex_jitter.h b/include/speex/speex_jitter.h
index 66708da..8fc8d7e 100644
--- a/include/speex/speex_jitter.h
+++ b/include/speex/speex_jitter.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -89,7 +89,7 @@ struct _JitterBufferPacket {
/** Included because of an early misspelling (will remove in next release) */
#define JITTER_BUFFER_GET_AVALIABLE_COUNT 3
-/** Assign a function to destroy unused packet. When setting that, the jitter
+/** Assign a function to destroy unused packet. When setting that, the jitter
buffer no longer copies packet data. */
#define JITTER_BUFFER_SET_DESTROY_CALLBACK 4
/** */
@@ -104,7 +104,7 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8
#define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9
-/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
+/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
should be half of that or less. */
#define JITTER_BUFFER_SET_MAX_LATE_RATE 10
#define JITTER_BUFFER_GET_MAX_LATE_RATE 11
@@ -114,59 +114,59 @@ struct _JitterBufferPacket {
#define JITTER_BUFFER_GET_LATE_COST 13
-/** Initialises jitter buffer
- *
- * @param step_size Starting value for the size of concleanment packets and delay
+/** Initialises jitter buffer
+ *
+ * @param step_size Starting value for the size of concleanment packets and delay
adjustment steps. Can be changed at any time using JITTER_BUFFER_SET_DELAY_STEP
and JITTER_BUFFER_GET_CONCEALMENT_SIZE.
* @return Newly created jitter buffer state
*/
JitterBuffer *jitter_buffer_init(int step_size);
-/** Restores jitter buffer to its original state
- *
+/** Restores jitter buffer to its original state
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_reset(JitterBuffer *jitter);
-/** Destroys jitter buffer
- *
+/** Destroys jitter buffer
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_destroy(JitterBuffer *jitter);
/** Put one packet into the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Incoming packet
*/
void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet);
/** Get one packet from the jitter buffer
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
* @param desired_span Number of samples (or units) we wish to get from the buffer (no guarantee)
- * @param current_timestamp Timestamp for the returned packet
+ * @param current_timestamp Timestamp for the returned packet
*/
int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset);
/** Used right after jitter_buffer_get() to obtain another packet that would have the same timestamp.
* This is mainly useful for media where a single "frame" can be split into several packets.
- *
+ *
* @param jitter Jitter buffer state
* @param packet Returned packet
*/
int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet);
/** Get pointer timestamp of jitter buffer
- *
+ *
* @param jitter Jitter buffer state
*/
int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter);
/** Advance by one tick
- *
+ *
* @param jitter Jitter buffer state
*/
void jitter_buffer_tick(JitterBuffer *jitter);
@@ -178,7 +178,7 @@ void jitter_buffer_tick(JitterBuffer *jitter);
void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem);
/** Used like the ioctl function to control the jitter buffer parameters
- *
+ *
* @param jitter Jitter buffer state
* @param request ioctl-type request (one of the JITTER_BUFFER_* macros)
* @param ptr Data exchanged to-from function
diff --git a/include/speex/speex_preprocess.h b/include/speex/speex_preprocess.h
index b9555eb..a2e1210 100644
--- a/include/speex/speex_preprocess.h
+++ b/include/speex/speex_preprocess.h
@@ -2,7 +2,7 @@
Written by Jean-Marc Valin */
/**
* @file speex_preprocess.h
- * @brief Speex preprocessor. The preprocess can do noise suppression,
+ * @brief Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
*/
@@ -37,7 +37,7 @@
#ifndef SPEEX_PREPROCESS_H
#define SPEEX_PREPROCESS_H
/** @defgroup SpeexPreprocessState SpeexPreprocessState: The Speex preprocessor
- * This is the Speex preprocessor. The preprocess can do noise suppression,
+ * This is the Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
* @{
@@ -48,7 +48,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+
/** State of the preprocessor (one per channel). Should never be accessed directly. */
struct SpeexPreprocessState_;
@@ -64,12 +64,12 @@ typedef struct SpeexPreprocessState_ SpeexPreprocessState;
*/
SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate);
-/** Destroys a preprocessor state
+/** Destroys a preprocessor state
* @param st Preprocessor state to destroy
*/
void speex_preprocess_state_destroy(SpeexPreprocessState *st);
-/** Preprocess a frame
+/** Preprocess a frame
* @param st Preprocessor state
* @param x Audio sample vector (in and out). Must be same size as specified in speex_preprocess_state_init().
* @return Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on.
@@ -85,7 +85,7 @@ int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo
*/
void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x);
-/** Used like the ioctl function to control the preprocessor parameters
+/** Used like the ioctl function to control the preprocessor parameters
* @param st Preprocessor state
* @param request ioctl-type request (one of the SPEEX_PREPROCESS_* macros)
* @param ptr Data exchanged to-from function
diff --git a/include/speex/speex_resampler.h b/include/speex/speex_resampler.h
index 50d777f..901de37 100644
--- a/include/speex/speex_resampler.h
+++ b/include/speex/speex_resampler.h
@@ -1,8 +1,8 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: speex_resampler.h
Resampling code
-
+
The design goals of this code are:
- Very fast algorithm
- Low memory requirement
@@ -43,7 +43,7 @@
/********* WARNING: MENTAL SANITY ENDS HERE *************/
-/* If the resampler is defined outside of Speex, we change the symbol names so that
+/* If the resampler is defined outside of Speex, we change the symbol names so that
there won't be any clash if linking with Speex later on. */
/* #define RANDOM_PREFIX your software name here */
@@ -53,7 +53,7 @@
#define CAT_PREFIX2(a,b) a ## b
#define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
-
+
#define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init)
#define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac)
#define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy)
@@ -81,7 +81,9 @@
#define spx_int32_t int
#define spx_uint16_t unsigned short
#define spx_uint32_t unsigned int
-
+
+#define speex_assert(cond)
+
#else /* OUTSIDE_SPEEX */
#include "speexdsp_types.h"
@@ -104,7 +106,8 @@ enum {
RESAMPLER_ERR_BAD_STATE = 2,
RESAMPLER_ERR_INVALID_ARG = 3,
RESAMPLER_ERR_PTR_OVERLAP = 4,
-
+ RESAMPLER_ERR_OVERFLOW = 5,
+
RESAMPLER_ERR_MAX_ERROR
};
@@ -120,14 +123,14 @@ typedef struct SpeexResamplerState_ SpeexResamplerState;
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
+SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
int quality,
int *err);
-/** Create a new resampler with fractional input/output rates. The sampling
- * rate ratio is an arbitrary rational number with both the numerator and
+/** Create a new resampler with fractional input/output rates. The sampling
+ * rate ratio is an arbitrary rational number with both the numerator and
* denominator being 32-bit integers.
* @param nb_channels Number of channels to be processed
* @param ratio_num Numerator of the sampling rate ratio
@@ -139,11 +142,11 @@ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
-SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
- spx_uint32_t out_rate,
+SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
+ spx_uint32_t out_rate,
int quality,
int *err);
@@ -154,24 +157,24 @@ void speex_resampler_destroy(SpeexResamplerState *st);
/** Resample a float array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
- * @param in_len Number of input samples in the input buffer. Returns the
+ * @param in_len Number of input samples in the input buffer. Returns the
* number of samples processed
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_float(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
+int speex_resampler_process_float(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
spx_uint32_t *out_len);
/** Resample an int array. The input and output buffers must *not* overlap.
* @param st Resampler state
- * @param channel_index Index of the channel to process for the multi-channel
+ * @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the number
@@ -179,11 +182,11 @@ int speex_resampler_process_float(SpeexResamplerState *st,
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
-int speex_resampler_process_int(SpeexResamplerState *st,
- spx_uint32_t channel_index,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
+int speex_resampler_process_int(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
spx_uint32_t *out_len);
/** Resample an interleaved float array. The input and output buffers must *not* overlap.
@@ -195,10 +198,10 @@ int speex_resampler_process_int(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
- const float *in,
- spx_uint32_t *in_len,
- float *out,
+int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
+ const float *in,
+ spx_uint32_t *in_len,
+ float *out,
spx_uint32_t *out_len);
/** Resample an interleaved int array. The input and output buffers must *not* overlap.
@@ -210,10 +213,10 @@ int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
-int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
- const spx_int16_t *in,
- spx_uint32_t *in_len,
- spx_int16_t *out,
+int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
+ const spx_int16_t *in,
+ spx_uint32_t *in_len,
+ spx_int16_t *out,
spx_uint32_t *out_len);
/** Set (change) the input/output sampling rates (integer value).
@@ -221,8 +224,8 @@ int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
* @param in_rate Input sampling rate (integer number of Hz).
* @param out_rate Output sampling rate (integer number of Hz).
*/
-int speex_resampler_set_rate(SpeexResamplerState *st,
- spx_uint32_t in_rate,
+int speex_resampler_set_rate(SpeexResamplerState *st,
+ spx_uint32_t in_rate,
spx_uint32_t out_rate);
/** Get the current input/output sampling rates (integer value).
@@ -230,11 +233,11 @@ int speex_resampler_set_rate(SpeexResamplerState *st,
* @param in_rate Input sampling rate (integer number of Hz) copied.
* @param out_rate Output sampling rate (integer number of Hz) copied.
*/
-void speex_resampler_get_rate(SpeexResamplerState *st,
- spx_uint32_t *in_rate,
+void speex_resampler_get_rate(SpeexResamplerState *st,
+ spx_uint32_t *in_rate,
spx_uint32_t *out_rate);
-/** Set (change) the input/output sampling rates and resampling ratio
+/** Set (change) the input/output sampling rates and resampling ratio
* (fractional values in Hz supported).
* @param st Resampler state
* @param ratio_num Numerator of the sampling rate ratio
@@ -242,10 +245,10 @@ void speex_resampler_get_rate(SpeexResamplerState *st,
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
*/
-int speex_resampler_set_rate_frac(SpeexResamplerState *st,
- spx_uint32_t ratio_num,
- spx_uint32_t ratio_den,
- spx_uint32_t in_rate,
+int speex_resampler_set_rate_frac(SpeexResamplerState *st,
+ spx_uint32_t ratio_num,
+ spx_uint32_t ratio_den,
+ spx_uint32_t in_rate,
spx_uint32_t out_rate);
/** Get the current resampling ratio. This will be reduced to the least
@@ -254,52 +257,52 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st,
* @param ratio_num Numerator of the sampling rate ratio copied
* @param ratio_den Denominator of the sampling rate ratio copied
*/
-void speex_resampler_get_ratio(SpeexResamplerState *st,
- spx_uint32_t *ratio_num,
+void speex_resampler_get_ratio(SpeexResamplerState *st,
+ spx_uint32_t *ratio_num,
spx_uint32_t *ratio_den);
/** Set (change) the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-int speex_resampler_set_quality(SpeexResamplerState *st,
+int speex_resampler_set_quality(SpeexResamplerState *st,
int quality);
/** Get the conversion quality.
* @param st Resampler state
- * @param quality Resampling quality between 0 and 10, where 0 has poor
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
-void speex_resampler_get_quality(SpeexResamplerState *st,
+void speex_resampler_get_quality(SpeexResamplerState *st,
int *quality);
/** Set (change) the input stride.
* @param st Resampler state
* @param stride Input stride
*/
-void speex_resampler_set_input_stride(SpeexResamplerState *st,
+void speex_resampler_set_input_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the input stride.
* @param st Resampler state
* @param stride Input stride copied
*/
-void speex_resampler_get_input_stride(SpeexResamplerState *st,
+void speex_resampler_get_input_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Set (change) the output stride.
* @param st Resampler state
* @param stride Output stride
*/
-void speex_resampler_set_output_stride(SpeexResamplerState *st,
+void speex_resampler_set_output_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the output stride.
* @param st Resampler state copied
* @param stride Output stride
*/
-void speex_resampler_get_output_stride(SpeexResamplerState *st,
+void speex_resampler_get_output_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Get the latency introduced by the resampler measured in input samples.
@@ -312,8 +315,8 @@ int speex_resampler_get_input_latency(SpeexResamplerState *st);
*/
int speex_resampler_get_output_latency(SpeexResamplerState *st);
-/** Make sure that the first samples to go out of the resamplers don't have
- * leading zeros. This is only useful before starting to use a newly created
+/** Make sure that the first samples to go out of the resamplers don't have
+ * leading zeros. This is only useful before starting to use a newly created
* resampler. It is recommended to use that when resampling an audio file, as
* it will generate a file with the same length. For real-time processing,
* it is probably easier not to use this call (so that the output duration
diff --git a/include/speex/speexdsp_config_types.h b/include/speex/speexdsp_config_types.h
index 4258618..ca1f5a3 100644
--- a/include/speex/speexdsp_config_types.h
+++ b/include/speex/speexdsp_config_types.h
@@ -1,13 +1,7 @@
#ifndef __SPEEX_TYPES_H__
#define __SPEEX_TYPES_H__
-#if defined HAVE_STDINT_H
-# include <stdint.h>
-#elif defined HAVE_INTTYPES_H
-# include <inttypes.h>
-#elif defined HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <stdint.h>
typedef int16_t spx_int16_t;
typedef uint16_t spx_uint16_t;
diff --git a/include/speex/speexdsp_config_types.h.in b/include/speex/speexdsp_config_types.h.in
index 02b82fd..5ea7b55 100644
--- a/include/speex/speexdsp_config_types.h.in
+++ b/include/speex/speexdsp_config_types.h.in
@@ -1,13 +1,7 @@
#ifndef __SPEEX_TYPES_H__
#define __SPEEX_TYPES_H__
-#if defined HAVE_STDINT_H
-# include <stdint.h>
-#elif defined HAVE_INTTYPES_H
-# include <inttypes.h>
-#elif defined HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+@INCLUDE_STDINT@
typedef @SIZE16@ spx_int16_t;
typedef @USIZE16@ spx_uint16_t;
diff --git a/include/speex/speexdsp_types.h b/include/speex/speexdsp_types.h
index 334d674..4b4a76a 100644
--- a/include/speex/speexdsp_types.h
+++ b/include/speex/speexdsp_types.h
@@ -22,7 +22,7 @@
#ifndef _SPEEX_TYPES_H
#define _SPEEX_TYPES_H
-#if defined(_WIN32)
+#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
diff --git a/libspeexdsp/.cvsignore b/libspeexdsp/.cvsignore
deleted file mode 100644
index 09a90ac..0000000
--- a/libspeexdsp/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-.libs
-*.la
-*.lo
-*.o
-Makefile
-Makefile.in
-testdenoise
-testenc
-testenc_uwb
-testenc_wb
diff --git a/libspeexdsp/Makefile b/libspeexdsp/Makefile
index c728a02..ce95da0 100644
--- a/libspeexdsp/Makefile
+++ b/libspeexdsp/Makefile
@@ -95,7 +95,8 @@ build_triplet = x86_64-pc-linux-gnu
host_triplet = x86_64-pc-linux-gnu
noinst_PROGRAMS = testdenoise$(EXEEXT) \
testecho$(EXEEXT) testjitter$(EXEEXT) \
- testresample$(EXEEXT)
+ testresample$(EXEEXT) \
+ testresample2$(EXEEXT)
subdir = libspeexdsp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
@@ -174,6 +175,11 @@ am__testresample_SOURCES_DIST = testresample.c
am_testresample_OBJECTS = testresample.$(OBJEXT)
testresample_OBJECTS = $(am_testresample_OBJECTS)
testresample_DEPENDENCIES = libspeexdsp.la
+am__testresample2_SOURCES_DIST = testresample2.c
+am_testresample2_OBJECTS = \
+ testresample2.$(OBJEXT)
+testresample2_OBJECTS = $(am_testresample2_OBJECTS)
+testresample2_DEPENDENCIES = libspeexdsp.la
AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
am__v_P_0 = false
@@ -196,7 +202,7 @@ am__depfiles_remade = ./$(DEPDIR)/buffer.Plo ./$(DEPDIR)/fftwrap.Plo \
./$(DEPDIR)/resample.Plo ./$(DEPDIR)/scal.Plo \
./$(DEPDIR)/smallft.Plo ./$(DEPDIR)/testdenoise.Po \
./$(DEPDIR)/testecho.Po ./$(DEPDIR)/testjitter.Po \
- ./$(DEPDIR)/testresample.Po
+ ./$(DEPDIR)/testresample.Po ./$(DEPDIR)/testresample2.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -218,11 +224,12 @@ am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libspeexdsp_la_SOURCES) $(testdenoise_SOURCES) \
$(testecho_SOURCES) $(testjitter_SOURCES) \
- $(testresample_SOURCES)
+ $(testresample_SOURCES) $(testresample2_SOURCES)
DIST_SOURCES = $(am__libspeexdsp_la_SOURCES_DIST) \
$(am__testdenoise_SOURCES_DIST) $(am__testecho_SOURCES_DIST) \
$(am__testjitter_SOURCES_DIST) \
- $(am__testresample_SOURCES_DIST)
+ $(am__testresample_SOURCES_DIST) \
+ $(am__testresample2_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -281,6 +288,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -309,10 +317,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -325,11 +333,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/libspeexdsp
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/libspeexdsp
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
@@ -397,11 +405,11 @@ noinst_HEADERS = arch.h bfin.h \
fixed_arm4.h \
fixed_arm5e.h fixed_bfin.h fixed_debug.h \
math_approx.h misc_bfin.h \
- stack_alloc.h fftwrap.h \
+ fftwrap.h \
filterbank.h fixed_generic.h os_support.h \
pseudofloat.h smallft.h vorbis_psy.h resample_sse.h resample_neon.h
-libspeexdsp_la_LDFLAGS = -no-undefined -version-info 6:0:5
+libspeexdsp_la_LDFLAGS = -no-undefined -version-info 6:2:5
libspeexdsp_la_LIBADD = $(LIBM)
testdenoise_SOURCES = testdenoise.c
testdenoise_LDADD = libspeexdsp.la
@@ -411,6 +419,8 @@ testjitter_SOURCES = testjitter.c
testjitter_LDADD = libspeexdsp.la
testresample_SOURCES = testresample.c
testresample_LDADD = libspeexdsp.la -lm
+testresample2_SOURCES = testresample2.c
+testresample2_LDADD = libspeexdsp.la -lm
all: all-am
.SUFFIXES:
@@ -508,6 +518,10 @@ testresample$(EXEEXT): $(testresample_OBJECTS) $(testresample_DEPENDENCIES) $(EX
@rm -f testresample$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(testresample_OBJECTS) $(testresample_LDADD) $(LIBS)
+testresample2$(EXEEXT): $(testresample2_OBJECTS) $(testresample2_DEPENDENCIES) $(EXTRA_testresample2_DEPENDENCIES)
+ @rm -f testresample2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(testresample2_OBJECTS) $(testresample2_LDADD) $(LIBS)
+
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -529,6 +543,7 @@ include ./$(DEPDIR)/testdenoise.Po # am--include-marker
include ./$(DEPDIR)/testecho.Po # am--include-marker
include ./$(DEPDIR)/testjitter.Po # am--include-marker
include ./$(DEPDIR)/testresample.Po # am--include-marker
+include ./$(DEPDIR)/testresample2.Po # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@@ -705,6 +720,7 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/testecho.Po
-rm -f ./$(DEPDIR)/testjitter.Po
-rm -f ./$(DEPDIR)/testresample.Po
+ -rm -f ./$(DEPDIR)/testresample2.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -765,6 +781,7 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/testecho.Po
-rm -f ./$(DEPDIR)/testjitter.Po
-rm -f ./$(DEPDIR)/testresample.Po
+ -rm -f ./$(DEPDIR)/testresample2.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/libspeexdsp/Makefile.am b/libspeexdsp/Makefile.am
index d0499b9..b2ab187 100644
--- a/libspeexdsp/Makefile.am
+++ b/libspeexdsp/Makefile.am
@@ -24,7 +24,7 @@ noinst_HEADERS = arch.h bfin.h \
fixed_arm4.h \
fixed_arm5e.h fixed_bfin.h fixed_debug.h \
math_approx.h misc_bfin.h \
- stack_alloc.h fftwrap.h \
+ fftwrap.h \
filterbank.h fixed_generic.h os_support.h \
pseudofloat.h smallft.h vorbis_psy.h resample_sse.h resample_neon.h
@@ -32,7 +32,7 @@ libspeexdsp_la_LDFLAGS = -no-undefined -version-info @SPEEXDSP_LT_CURRENT@:@SPEE
libspeexdsp_la_LIBADD = $(LIBM)
if BUILD_EXAMPLES
-noinst_PROGRAMS = testdenoise testecho testjitter testresample
+noinst_PROGRAMS = testdenoise testecho testjitter testresample testresample2
testdenoise_SOURCES = testdenoise.c
testdenoise_LDADD = libspeexdsp.la @FFT_LIBS@
testecho_SOURCES = testecho.c
@@ -41,4 +41,6 @@ testjitter_SOURCES = testjitter.c
testjitter_LDADD = libspeexdsp.la @FFT_LIBS@
testresample_SOURCES = testresample.c
testresample_LDADD = libspeexdsp.la @FFT_LIBS@ @LIBM@
+testresample2_SOURCES = testresample2.c
+testresample2_LDADD = libspeexdsp.la @FFT_LIBS@ @LIBM@
endif
diff --git a/libspeexdsp/Makefile.in b/libspeexdsp/Makefile.in
index 8113273..5e933f1 100644
--- a/libspeexdsp/Makefile.in
+++ b/libspeexdsp/Makefile.in
@@ -95,7 +95,8 @@ build_triplet = @build@
host_triplet = @host@
@BUILD_EXAMPLES_TRUE@noinst_PROGRAMS = testdenoise$(EXEEXT) \
@BUILD_EXAMPLES_TRUE@ testecho$(EXEEXT) testjitter$(EXEEXT) \
-@BUILD_EXAMPLES_TRUE@ testresample$(EXEEXT)
+@BUILD_EXAMPLES_TRUE@ testresample$(EXEEXT) \
+@BUILD_EXAMPLES_TRUE@ testresample2$(EXEEXT)
subdir = libspeexdsp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
@@ -174,6 +175,11 @@ am__testresample_SOURCES_DIST = testresample.c
@BUILD_EXAMPLES_TRUE@am_testresample_OBJECTS = testresample.$(OBJEXT)
testresample_OBJECTS = $(am_testresample_OBJECTS)
@BUILD_EXAMPLES_TRUE@testresample_DEPENDENCIES = libspeexdsp.la
+am__testresample2_SOURCES_DIST = testresample2.c
+@BUILD_EXAMPLES_TRUE@am_testresample2_OBJECTS = \
+@BUILD_EXAMPLES_TRUE@ testresample2.$(OBJEXT)
+testresample2_OBJECTS = $(am_testresample2_OBJECTS)
+@BUILD_EXAMPLES_TRUE@testresample2_DEPENDENCIES = libspeexdsp.la
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -196,7 +202,7 @@ am__depfiles_remade = ./$(DEPDIR)/buffer.Plo ./$(DEPDIR)/fftwrap.Plo \
./$(DEPDIR)/resample.Plo ./$(DEPDIR)/scal.Plo \
./$(DEPDIR)/smallft.Plo ./$(DEPDIR)/testdenoise.Po \
./$(DEPDIR)/testecho.Po ./$(DEPDIR)/testjitter.Po \
- ./$(DEPDIR)/testresample.Po
+ ./$(DEPDIR)/testresample.Po ./$(DEPDIR)/testresample2.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -218,11 +224,12 @@ am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libspeexdsp_la_SOURCES) $(testdenoise_SOURCES) \
$(testecho_SOURCES) $(testjitter_SOURCES) \
- $(testresample_SOURCES)
+ $(testresample_SOURCES) $(testresample2_SOURCES)
DIST_SOURCES = $(am__libspeexdsp_la_SOURCES_DIST) \
$(am__testdenoise_SOURCES_DIST) $(am__testecho_SOURCES_DIST) \
$(am__testjitter_SOURCES_DIST) \
- $(am__testresample_SOURCES_DIST)
+ $(am__testresample_SOURCES_DIST) \
+ $(am__testresample2_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -281,6 +288,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -397,7 +405,7 @@ noinst_HEADERS = arch.h bfin.h \
fixed_arm4.h \
fixed_arm5e.h fixed_bfin.h fixed_debug.h \
math_approx.h misc_bfin.h \
- stack_alloc.h fftwrap.h \
+ fftwrap.h \
filterbank.h fixed_generic.h os_support.h \
pseudofloat.h smallft.h vorbis_psy.h resample_sse.h resample_neon.h
@@ -411,6 +419,8 @@ libspeexdsp_la_LIBADD = $(LIBM)
@BUILD_EXAMPLES_TRUE@testjitter_LDADD = libspeexdsp.la @FFT_LIBS@
@BUILD_EXAMPLES_TRUE@testresample_SOURCES = testresample.c
@BUILD_EXAMPLES_TRUE@testresample_LDADD = libspeexdsp.la @FFT_LIBS@ @LIBM@
+@BUILD_EXAMPLES_TRUE@testresample2_SOURCES = testresample2.c
+@BUILD_EXAMPLES_TRUE@testresample2_LDADD = libspeexdsp.la @FFT_LIBS@ @LIBM@
all: all-am
.SUFFIXES:
@@ -508,6 +518,10 @@ testresample$(EXEEXT): $(testresample_OBJECTS) $(testresample_DEPENDENCIES) $(EX
@rm -f testresample$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(testresample_OBJECTS) $(testresample_LDADD) $(LIBS)
+testresample2$(EXEEXT): $(testresample2_OBJECTS) $(testresample2_DEPENDENCIES) $(EXTRA_testresample2_DEPENDENCIES)
+ @rm -f testresample2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(testresample2_OBJECTS) $(testresample2_LDADD) $(LIBS)
+
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -529,6 +543,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testecho.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testjitter.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testresample.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testresample2.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@@ -705,6 +720,7 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/testecho.Po
-rm -f ./$(DEPDIR)/testjitter.Po
-rm -f ./$(DEPDIR)/testresample.Po
+ -rm -f ./$(DEPDIR)/testresample2.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -765,6 +781,7 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/testecho.Po
-rm -f ./$(DEPDIR)/testjitter.Po
-rm -f ./$(DEPDIR)/testresample.Po
+ -rm -f ./$(DEPDIR)/testresample2.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/libspeexdsp/_kiss_fft_guts.h b/libspeexdsp/_kiss_fft_guts.h
index 6571e79..f5f2a5f 100644
--- a/libspeexdsp/_kiss_fft_guts.h
+++ b/libspeexdsp/_kiss_fft_guts.h
@@ -23,7 +23,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include "math_approx.h"
#define MAXFACTORS 32
-/* e.g. an fft of length 128 has 4 factors
+/* e.g. an fft of length 128 has 4 factors
as far as kissfft is concerned
4*4*4*2
*/
@@ -47,7 +47,7 @@ struct kiss_fft_state{
#ifdef FIXED_POINT
#include "arch.h"
# define FRACBITS 15
-# define SAMPPROD spx_int32_t
+# define SAMPPROD spx_int32_t
#define SAMP_MAX 32767
#define SAMP_MIN -SAMP_MAX
diff --git a/libspeexdsp/arch.h b/libspeexdsp/arch.h
index 535d308..1cac3d9 100644
--- a/libspeexdsp/arch.h
+++ b/libspeexdsp/arch.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -41,10 +41,10 @@
#ifdef FLOATING_POINT
#error You cannot compile as floating point and fixed point at the same time
#endif
-#ifdef _USE_SSE
+#ifdef USE_SSE
#error SSE is only for floating-point
#endif
-#if ((defined (ARM4_ASM)||defined (ARM4_ASM)) && defined(BFIN_ASM)) || (defined (ARM4_ASM)&&defined(ARM5E_ASM))
+#if defined(ARM4_ASM) + defined(ARM5E_ASM) + defined(BFIN_ASM) > 1
#error Make up your mind. What CPU do you have?
#endif
#ifdef VORBIS_PSYCHO
@@ -56,10 +56,10 @@
#ifndef FLOATING_POINT
#error You now need to define either FIXED_POINT or FLOATING_POINT
#endif
-#if defined (ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM)
+#if defined(ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM)
#error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
#endif
-#ifdef FIXED_POINT_DEBUG
+#ifdef FIXED_DEBUG
#error "Don't you think enabling fixed-point is a good thing to do if you want to debug that?"
#endif
@@ -101,6 +101,8 @@ typedef spx_word32_t spx_sig_t;
#define SIG_SHIFT 14
#define GAIN_SHIFT 6
+#define WORD2INT(x) ((x) < -32767 ? -32768 : ((x) > 32766 ? 32767 : (x)))
+
#define VERY_SMALL 0
#define VERY_LARGE32 ((spx_word32_t)2147483647)
#define VERY_LARGE16 ((spx_word16_t)32767)
@@ -115,9 +117,9 @@ typedef spx_word32_t spx_sig_t;
#ifdef ARM5E_ASM
#include "fixed_arm5e.h"
-#elif defined (ARM4_ASM)
+#elif defined(ARM4_ASM)
#include "fixed_arm4.h"
-#elif defined (BFIN_ASM)
+#elif defined(BFIN_ASM)
#include "fixed_bfin.h"
#endif
@@ -175,16 +177,13 @@ typedef float spx_word32_t;
#define ADD32(a,b) ((a)+(b))
#define SUB32(a,b) ((a)-(b))
#define MULT16_16_16(a,b) ((a)*(b))
+#define MULT16_32_32(a,b) ((a)*(b))
#define MULT16_16(a,b) ((spx_word32_t)(a)*(spx_word32_t)(b))
#define MAC16_16(c,a,b) ((c)+(spx_word32_t)(a)*(spx_word32_t)(b))
-#define MULT16_32_Q11(a,b) ((a)*(b))
-#define MULT16_32_Q13(a,b) ((a)*(b))
-#define MULT16_32_Q14(a,b) ((a)*(b))
#define MULT16_32_Q15(a,b) ((a)*(b))
#define MULT16_32_P15(a,b) ((a)*(b))
-#define MAC16_32_Q11(c,a,b) ((c)+(a)*(b))
#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
#define MAC16_16_Q11(c,a,b) ((c)+(a)*(b))
@@ -203,18 +202,19 @@ typedef float spx_word32_t;
#define DIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
#define PDIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
-
+#define WORD2INT(x) ((x) < -32767.5f ? -32768 : \
+ ((x) > 32766.5f ? 32767 : (spx_int16_t)floor(.5 + (x))))
#endif
-#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
+#if defined(CONFIG_TI_C54X) || defined(CONFIG_TI_C55X)
/* 2 on TI C5x DSP */
-#define BYTES_PER_CHAR 2
+#define BYTES_PER_CHAR 2
#define BITS_PER_CHAR 16
#define LOG2_BITS_PER_CHAR 4
-#else
+#else
#define BYTES_PER_CHAR 1
#define BITS_PER_CHAR 8
diff --git a/libspeexdsp/buffer.c b/libspeexdsp/buffer.c
index c82cab5..b06a155 100644
--- a/libspeexdsp/buffer.c
+++ b/libspeexdsp/buffer.c
@@ -1,5 +1,5 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: buffer.c
This is a very simple ring buffer implementation. It is not thread-safe
so you need to do your own locking.
@@ -99,7 +99,7 @@ EXPORT int speex_buffer_write(SpeexBuffer *st, void *_data, int len)
EXPORT int speex_buffer_writezeros(SpeexBuffer *st, int len)
{
- /* This is almost the same as for speex_buffer_write() but using
+ /* This is almost the same as for speex_buffer_write() but using
SPEEX_MEMSET() instead of SPEEX_COPY(). Update accordingly. */
int end;
int end1;
@@ -135,7 +135,7 @@ EXPORT int speex_buffer_read(SpeexBuffer *st, void *_data, int len)
char *data = _data;
if (len > st->available)
{
- SPEEX_MEMSET(data+st->available, 0, st->size-st->available);
+ SPEEX_MEMSET(data+st->available, 0, len - st->available);
len = st->available;
}
end = st->read_ptr + len;
diff --git a/libspeexdsp/fftwrap.c b/libspeexdsp/fftwrap.c
index a14b1e4..4573479 100644
--- a/libspeexdsp/fftwrap.c
+++ b/libspeexdsp/fftwrap.c
@@ -1,23 +1,23 @@
-/* Copyright (C) 2005-2006 Jean-Marc Valin
+/* Copyright (C) 2005-2006 Jean-Marc Valin
File: fftwrap.c
- Wrapper for various FFTs
+ Wrapper for various FFTs
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -62,7 +62,7 @@ static int maximize_range(spx_word16_t *in, spx_word16_t *out, spx_word16_t boun
for (i=0;i<len;i++)
{
out[i] = SHL16(in[i], shift);
- }
+ }
return shift;
}
@@ -270,7 +270,7 @@ void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out)
out[i] = optr[i+1];
}
-void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out)
+void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out)
{
int i;
struct fftw_config *t = (struct fftw_config *) table;
@@ -285,7 +285,7 @@ void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out)
iptr[N+1] = 0.0f;
fftwf_execute(t->ifft);
-
+
for(i=0;i<N;++i)
out[i] = optr[i];
}
diff --git a/libspeexdsp/fftwrap.h b/libspeexdsp/fftwrap.h
index dfaf489..2c07425 100644
--- a/libspeexdsp/fftwrap.h
+++ b/libspeexdsp/fftwrap.h
@@ -1,23 +1,23 @@
-/* Copyright (C) 2005 Jean-Marc Valin
+/* Copyright (C) 2005 Jean-Marc Valin
File: fftwrap.h
- Wrapper for various FFTs
+ Wrapper for various FFTs
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/libspeexdsp/filterbank.c b/libspeexdsp/filterbank.c
index e2fb71d..c8fdd7a 100644
--- a/libspeexdsp/filterbank.c
+++ b/libspeexdsp/filterbank.c
@@ -40,15 +40,15 @@
#include <math.h>
#include "math_approx.h"
#include "os_support.h"
-
+
#ifdef FIXED_POINT
#define toBARK(n) (MULT16_16(26829,spx_atan(SHR32(MULT16_16(97,n),2))) + MULT16_16(4588,spx_atan(MULT16_32_Q15(20,MULT16_16(n,n)))) + MULT16_16(3355,n))
-
+
#else
#define toBARK(n) (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n))
#endif
-
+
#define toMEL(n) (2595.f*log10(1.f+(n)/700.f))
FilterBank *filterbank_new(int banks, spx_word32_t sampling, int len, int type)
@@ -62,7 +62,7 @@ FilterBank *filterbank_new(int banks, spx_word32_t sampling, int len, int type)
df = DIV32(SHL32(sampling,15),MULT16_16(2,len));
max_mel = toBARK(EXTRACT16(sampling/2));
mel_interval = PDIV32(max_mel,banks-1);
-
+
bank = (FilterBank*)speex_alloc(sizeof(FilterBank));
bank->nb_banks = banks;
bank->len = len;
@@ -85,7 +85,7 @@ FilterBank *filterbank_new(int banks, spx_word32_t sampling, int len, int type)
break;
#ifdef FIXED_POINT
id1 = DIV32(mel,mel_interval);
-#else
+#else
id1 = (int)(floor(mel/mel_interval));
#endif
if (id1>banks-2)
@@ -101,7 +101,7 @@ FilterBank *filterbank_new(int banks, spx_word32_t sampling, int len, int type)
bank->bank_right[i] = id2;
bank->filter_right[i] = val;
}
-
+
/* Think I can safely disable normalisation for fixed-point (and probably float as well) */
#ifndef FIXED_POINT
for (i=0;i<bank->nb_banks;i++)
diff --git a/libspeexdsp/fixed_arm4.h b/libspeexdsp/fixed_arm4.h
index b6981ca..a7040b8 100644
--- a/libspeexdsp/fixed_arm4.h
+++ b/libspeexdsp/fixed_arm4.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -35,19 +35,6 @@
#ifndef FIXED_ARM4_H
#define FIXED_ARM4_H
-#undef MULT16_32_Q14
-static inline spx_word32_t MULT16_32_Q14(spx_word16_t x, spx_word32_t y) {
- int res;
- int dummy;
- asm (
- "smull %0,%1,%2,%3 \n\t"
- "mov %0, %0, lsr #14 \n\t"
- "add %0, %0, %1, lsl #18 \n\t"
- : "=&r"(res), "=&r" (dummy)
- : "r"(y),"r"((int)x));
- return(res);
-}
-
#undef MULT16_32_Q15
static inline spx_word32_t MULT16_32_Q15(spx_word16_t x, spx_word32_t y) {
int res;
@@ -109,7 +96,7 @@ static inline short DIV32_16(int a, int b)
"\tsubs %3, %0, %1, asl #6 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #6 \n"
-
+
"\tsubs %3, %0, %1, asl #5 \n"
"\tmovpl %0, %3 \n"
"\torrpl %2, %2, %4, asl #5 \n"
diff --git a/libspeexdsp/fixed_arm5e.h b/libspeexdsp/fixed_arm5e.h
index 9b4861c..15c6d5d 100644
--- a/libspeexdsp/fixed_arm5e.h
+++ b/libspeexdsp/fixed_arm5e.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -71,24 +71,6 @@ static inline spx_word32_t MAC16_32_Q15(spx_word32_t a, spx_word16_t x, spx_word
return(res);
}
-#undef MULT16_32_Q11
-static inline spx_word32_t MULT16_32_Q11(spx_word16_t x, spx_word32_t y) {
- int res;
- asm ("smulwb %0,%1,%2;\n"
- : "=&r"(res)
- : "%r"(y<<5),"r"(x));
- return(res);
-}
-
-#undef MAC16_32_Q11
-static inline spx_word32_t MAC16_32_Q11(spx_word32_t a, spx_word16_t x, spx_word32_t y) {
- int res;
- asm ("smlawb %0,%1,%2,%3;\n"
- : "=&r"(res)
- : "%r"(y<<5),"r"(x),"r"(a));
- return(res);
-}
-
#undef DIV32_16
static inline short DIV32_16(int a, int b)
{
@@ -161,7 +143,7 @@ static inline short DIV32_16(int a, int b)
"\tsubs %3, %0, %1 \n"
"\torrpl %2, %2, %4 \n"
"\tmovpl %0, %3 \n"
-
+
"\tmovs %5, %5, lsr #31 \n"
"\trsbne %2, %2, #0 \n"
: "=r" (dead1), "=r" (dead2), "=r" (res),
diff --git a/libspeexdsp/fixed_bfin.h b/libspeexdsp/fixed_bfin.h
index 9eb21e3..9a54d64 100644
--- a/libspeexdsp/fixed_bfin.h
+++ b/libspeexdsp/fixed_bfin.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -68,9 +68,9 @@ static inline spx_word16_t DIV32_16(spx_word32_t a, spx_word16_t b)
{
spx_word32_t res, bb;
bb = b;
- /* Make the roundinf consistent with the C version
+ /* Make the roundinf consistent with the C version
(do we need to do that?)*/
- if (a<0)
+ if (a<0)
a += (b-1);
__asm__ (
"P0 = 15;\n\t"
@@ -138,39 +138,4 @@ static inline spx_word32_t MAC16_32_Q15(spx_word32_t c, spx_word16_t a, spx_word
return res;
}
-#undef MULT16_32_Q14
-static inline spx_word32_t MULT16_32_Q14(spx_word16_t a, spx_word32_t b)
-{
- spx_word32_t res;
- __asm__
- (
- "%2 <<= 1;\n\t"
- "A1 = %1.L*%2.L (M);\n\t"
- "A1 = A1 >>> 15;\n\t"
- "%0 = (A1 += %1.L*%2.H);\n\t"
- : "=W" (res), "=d" (a), "=d" (b)
- : "1" (a), "2" (b)
- : "A1", "ASTAT"
- );
- return res;
-}
-
-#undef MAC16_32_Q14
-static inline spx_word32_t MAC16_32_Q14(spx_word32_t c, spx_word16_t a, spx_word32_t b)
-{
- spx_word32_t res;
- __asm__
- (
- "%1 <<= 1;\n\t"
- "A1 = %2.L*%1.L (M);\n\t"
- "A1 = A1 >>> 15;\n\t"
- "%0 = (A1 += %2.L*%1.H);\n\t"
- "%0 = %0 + %4;\n\t"
- : "=&W" (res), "=&d" (b)
- : "d" (a), "1" (b), "d" (c)
- : "A1", "ASTAT"
- );
- return res;
-}
-
#endif
diff --git a/libspeexdsp/fixed_debug.h b/libspeexdsp/fixed_debug.h
index 54f3866..dbf02f1 100644
--- a/libspeexdsp/fixed_debug.h
+++ b/libspeexdsp/fixed_debug.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -101,7 +101,7 @@ static inline int _EXTEND32(int x, char *file, int line)
}
#define SHR16(a, shift) _SHR16(a, shift, __FILE__, __LINE__)
-static inline short _SHR16(int a, int shift, char *file, int line)
+static inline short _SHR16(int a, int shift, char *file, int line)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift))
@@ -115,7 +115,7 @@ static inline short _SHR16(int a, int shift, char *file, int line)
return res;
}
#define SHL16(a, shift) _SHL16(a, shift, __FILE__, __LINE__)
-static inline short _SHL16(int a, int shift, char *file, int line)
+static inline short _SHL16(int a, int shift, char *file, int line)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift))
@@ -129,7 +129,7 @@ static inline short _SHL16(int a, int shift, char *file, int line)
return res;
}
-static inline int SHR32(long long a, int shift)
+static inline int SHR32(long long a, int shift)
{
long long res;
if (!VERIFY_INT(a) || !VERIFY_SHORT(shift))
@@ -144,7 +144,7 @@ static inline int SHR32(long long a, int shift)
spx_mips++;
return res;
}
-static inline int SHL32(long long a, int shift)
+static inline int SHL32(long long a, int shift)
{
long long res;
if (!VERIFY_INT(a) || !VERIFY_SHORT(shift))
@@ -171,7 +171,7 @@ static inline int SHL32(long long a, int shift)
//#define SHL(a,shift) ((a) << (shift))
#define ADD16(a, b) _ADD16(a, b, __FILE__, __LINE__)
-static inline short _ADD16(int a, int b, char *file, int line)
+static inline short _ADD16(int a, int b, char *file, int line)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -188,7 +188,7 @@ static inline short _ADD16(int a, int b, char *file, int line)
}
#define SUB16(a, b) _SUB16(a, b, __FILE__, __LINE__)
-static inline short _SUB16(int a, int b, char *file, int line)
+static inline short _SUB16(int a, int b, char *file, int line)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -203,7 +203,7 @@ static inline short _SUB16(int a, int b, char *file, int line)
}
#define ADD32(a, b) _ADD32(a, b, __FILE__, __LINE__)
-static inline int _ADD32(long long a, long long b, char *file, int line)
+static inline int _ADD32(long long a, long long b, char *file, int line)
{
long long res;
if (!VERIFY_INT(a) || !VERIFY_INT(b))
@@ -219,7 +219,7 @@ static inline int _ADD32(long long a, long long b, char *file, int line)
return res;
}
-static inline int SUB32(long long a, long long b)
+static inline int SUB32(long long a, long long b)
{
long long res;
if (!VERIFY_INT(a) || !VERIFY_INT(b))
@@ -236,7 +236,7 @@ static inline int SUB32(long long a, long long b)
#define ADD64(a,b) (MIPS_INC(a)+(b))
/* result fits in 16 bits */
-static inline short MULT16_16_16(int a, int b)
+static inline short MULT16_16_16(int a, int b)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -250,8 +250,23 @@ static inline short MULT16_16_16(int a, int b)
return res;
}
+/* result fits in 32 bits */
+static inline int MULT16_32_32(int a, long long b)
+{
+ long long res;
+ if (!VERIFY_SHORT(a) || !VERIFY_INT(b))
+ {
+ fprintf (stderr, "MULT16_32_32: inputs are not short+int: %d %d\n", a, (int)b);
+ }
+ res = a*b;
+ if (!VERIFY_INT(res))
+ fprintf (stderr, "MULT16_32_32: output is not int: %d\n", (int)res);
+ spx_mips++;
+ return res;
+}
+
#define MULT16_16(a, b) _MULT16_16(a, b, __FILE__, __LINE__)
-static inline int _MULT16_16(int a, int b, char *file, int line)
+static inline int _MULT16_16(int a, int b, char *file, int line)
{
long long res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -279,8 +294,8 @@ static inline int _MULT16_32_QX(int a, long long b, int Q, char *file, int line)
{
fprintf (stderr, "MULT16_32_Q%d: inputs are not short+int: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line);
}
- if (ABS32(b)>=(EXTEND32(1)<<(15+Q)))
- fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line);
+ if (ABS(b)>>(16+Q))
+ fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line);
res = (((long long)a)*(long long)b) >> Q;
if (!VERIFY_INT(res))
fprintf (stderr, "MULT16_32_Q%d: output is not int: %d*%d=%d in %s: line %d\n", Q, (int)a, (int)b,(int)res, file, line);
@@ -295,8 +310,8 @@ static inline int MULT16_32_PX(int a, long long b, int Q)
{
fprintf (stderr, "MULT16_32_P%d: inputs are not short+int: %d %d\n", Q, (int)a, (int)b);
}
- if (ABS32(b)>=(EXTEND32(1)<<(15+Q)))
- fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d\n", Q, (int)a, (int)b);
+ if (ABS(b)>>(16+Q))
+ fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d\n", Q, (int)a, (int)b);
res = ((((long long)a)*(long long)b) + ((EXTEND32(1)<<Q)>>1))>> Q;
if (!VERIFY_INT(res))
fprintf (stderr, "MULT16_32_P%d: output is not int: %d*%d=%d\n", Q, (int)a, (int)b,(int)res);
@@ -305,11 +320,6 @@ static inline int MULT16_32_PX(int a, long long b, int Q)
}
-#define MULT16_32_Q11(a,b) MULT16_32_QX(a,b,11)
-#define MAC16_32_Q11(c,a,b) ADD32((c),MULT16_32_Q11((a),(b)))
-#define MULT16_32_Q12(a,b) MULT16_32_QX(a,b,12)
-#define MULT16_32_Q13(a,b) MULT16_32_QX(a,b,13)
-#define MULT16_32_Q14(a,b) MULT16_32_QX(a,b,14)
#define MULT16_32_Q15(a,b) MULT16_32_QX(a,b,15)
#define MULT16_32_P15(a,b) MULT16_32_PX(a,b,15)
#define MAC16_32_Q15(c,a,b) ADD32((c),MULT16_32_Q15((a),(b)))
@@ -323,7 +333,7 @@ static inline int SATURATE(int a, int b)
return a;
}
-static inline int MULT16_16_Q11_32(int a, int b)
+static inline int MULT16_16_Q11_32(int a, int b)
{
long long res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -337,7 +347,7 @@ static inline int MULT16_16_Q11_32(int a, int b)
spx_mips+=3;
return res;
}
-static inline short MULT16_16_Q13(int a, int b)
+static inline short MULT16_16_Q13(int a, int b)
{
long long res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -351,7 +361,7 @@ static inline short MULT16_16_Q13(int a, int b)
spx_mips+=3;
return res;
}
-static inline short MULT16_16_Q14(int a, int b)
+static inline short MULT16_16_Q14(int a, int b)
{
long long res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -365,7 +375,7 @@ static inline short MULT16_16_Q14(int a, int b)
spx_mips+=3;
return res;
}
-static inline short MULT16_16_Q15(int a, int b)
+static inline short MULT16_16_Q15(int a, int b)
{
long long res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -382,7 +392,7 @@ static inline short MULT16_16_Q15(int a, int b)
return res;
}
-static inline short MULT16_16_P13(int a, int b)
+static inline short MULT16_16_P13(int a, int b)
{
long long res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -399,7 +409,7 @@ static inline short MULT16_16_P13(int a, int b)
spx_mips+=4;
return res;
}
-static inline short MULT16_16_P14(int a, int b)
+static inline short MULT16_16_P14(int a, int b)
{
long long res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -416,7 +426,7 @@ static inline short MULT16_16_P14(int a, int b)
spx_mips+=4;
return res;
}
-static inline short MULT16_16_P15(int a, int b)
+static inline short MULT16_16_P15(int a, int b)
{
long long res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
@@ -436,7 +446,7 @@ static inline short MULT16_16_P15(int a, int b)
#define DIV32_16(a, b) _DIV32_16(a, b, __FILE__, __LINE__)
-static inline int _DIV32_16(long long a, long long b, char *file, int line)
+static inline int _DIV32_16(long long a, long long b, char *file, int line)
{
long long res;
if (b==0)
@@ -462,7 +472,7 @@ static inline int _DIV32_16(long long a, long long b, char *file, int line)
}
#define DIV32(a, b) _DIV32(a, b, __FILE__, __LINE__)
-static inline int _DIV32(long long a, long long b, char *file, int line)
+static inline int _DIV32(long long a, long long b, char *file, int line)
{
long long res;
if (b==0)
diff --git a/libspeexdsp/fixed_generic.h b/libspeexdsp/fixed_generic.h
index 0e012e9..09366c3 100644
--- a/libspeexdsp/fixed_generic.h
+++ b/libspeexdsp/fixed_generic.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -69,22 +69,18 @@
/* result fits in 16 bits */
-#define MULT16_16_16(a,b) ((((spx_word16_t)(a))*((spx_word16_t)(b))))
+#define MULT16_16_16(a,b) (((spx_word16_t)(a))*((spx_word16_t)(b)))
+/* result fits in 32 bits */
+#define MULT16_32_32(a,b) (((spx_word16_t)(a))*((spx_word32_t)(b)))
/* (spx_word32_t)(spx_word16_t) gives TI compiler a hint that it's 16x16->32 multiply */
#define MULT16_16(a,b) (((spx_word32_t)(spx_word16_t)(a))*((spx_word32_t)(spx_word16_t)(b)))
#define MAC16_16(c,a,b) (ADD32((c),MULT16_16((a),(b))))
-#define MULT16_32_Q12(a,b) ADD32(MULT16_16((a),SHR((b),12)), SHR(MULT16_16((a),((b)&0x00000fff)),12))
-#define MULT16_32_Q13(a,b) ADD32(MULT16_16((a),SHR((b),13)), SHR(MULT16_16((a),((b)&0x00001fff)),13))
-#define MULT16_32_Q14(a,b) ADD32(MULT16_16((a),SHR((b),14)), SHR(MULT16_16((a),((b)&0x00003fff)),14))
-
-#define MULT16_32_Q11(a,b) ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11))
-#define MAC16_32_Q11(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11)))
-#define MULT16_32_P15(a,b) ADD32(MULT16_16((a),SHR((b),15)), PSHR(MULT16_16((a),((b)&0x00007fff)),15))
-#define MULT16_32_Q15(a,b) ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15))
-#define MAC16_32_Q15(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)))
+#define MULT16_32_P15(a,b) ADD32(MULT16_32_32(a,SHR((b),15)), PSHR(MULT16_16((a),((b)&0x00007fff)),15))
+#define MULT16_32_Q15(a,b) ADD32(MULT16_32_32(a,SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15))
+#define MAC16_32_Q15(c,a,b) ADD32(c,MULT16_32_Q15(a,b))
#define MAC16_16_Q11(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),11)))
diff --git a/libspeexdsp/jitter.c b/libspeexdsp/jitter.c
index a077d8d..a9c0dd3 100644
--- a/libspeexdsp/jitter.c
+++ b/libspeexdsp/jitter.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Jean-Marc Valin
+/* Copyright (C) 2002 Jean-Marc Valin
File: speex_jitter.h
Adaptive jitter buffer for Speex
@@ -6,18 +6,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -71,7 +71,7 @@ TODO:
#define LT32(a,b) (((spx_int32_t)((a)-(b)))<0)
#define LE32(a,b) (((spx_int32_t)((a)-(b)))<=0)
-#define ROUND_DOWN(x, step) ((x)<0 ? ((x)-(step)+1)/(step)*(step) : (x)/(step)*(step))
+#define ROUND_DOWN(x, step) ((x)<0 ? ((x)-(step)+1)/(step)*(step) : (x)/(step)*(step))
#define MAX_TIMINGS 40
#define MAX_BUFFERS 3
@@ -101,7 +101,7 @@ static void tb_add(struct TimingBuffer *tb, spx_int16_t timing)
tb->curr_count++;
return;
}
-
+
/* Find where the timing info goes in the sorted list */
pos = 0;
/* FIXME: Do bisection instead of linear search */
@@ -109,9 +109,9 @@ static void tb_add(struct TimingBuffer *tb, spx_int16_t timing)
{
pos++;
}
-
+
speex_assert(pos <= tb->filled && pos < MAX_TIMINGS);
-
+
/* Shift everything so we can perform the insertion */
if (pos < tb->filled)
{
@@ -124,7 +124,7 @@ static void tb_add(struct TimingBuffer *tb, spx_int16_t timing)
/* Insert */
tb->timing[pos] = timing;
tb->counts[pos] = tb->curr_count;
-
+
tb->curr_count++;
if (tb->filled<MAX_TIMINGS)
tb->filled++;
@@ -137,12 +137,12 @@ struct JitterBuffer_ {
spx_uint32_t pointer_timestamp; /**< Timestamp of what we will *get* next */
spx_uint32_t last_returned_timestamp; /**< Useful for getting the next packet with the same timestamp (for fragmented media) */
spx_uint32_t next_stop; /**< Estimated time the next get() will be called */
-
+
spx_int32_t buffered; /**< Amount of data we think is still buffered by the application (timestamp units)*/
-
+
JitterBufferPacket packets[SPEEX_JITTER_MAX_BUFFER_SIZE]; /**< Packets stored in the buffer */
spx_uint32_t arrival[SPEEX_JITTER_MAX_BUFFER_SIZE]; /**< Packet arrival time (0 means it was late, even though it's a valid timestamp) */
-
+
void (*destroy) (void *); /**< Callback for destroying a packet */
spx_int32_t delay_step; /**< Size of the steps when adjusting buffering (timestamp units) */
@@ -152,7 +152,7 @@ struct JitterBuffer_ {
int late_cutoff; /**< How late must a packet be for it not to be considered at all */
int interp_requested; /**< An interpolation is requested by speex_jitter_update_delay() */
int auto_adjust; /**< Whether to automatically adjust the delay at any time */
-
+
struct TimingBuffer _tb[MAX_BUFFERS]; /**< Don't use those directly */
struct TimingBuffer *timeBuffers[MAX_BUFFERS]; /**< Storing arrival time of latest frames so we can compute some stats */
int window_size; /**< Total window over which the late frames are counted */
@@ -160,15 +160,15 @@ struct JitterBuffer_ {
int max_late_rate; /**< Absolute maximum amount of late packets tolerable (in percent) */
int latency_tradeoff; /**< Latency equivalent of losing one percent of packets */
int auto_tradeoff; /**< Latency equivalent of losing one percent of packets (automatic default) */
-
+
int lost_count; /**< Number of consecutive lost packets */
};
-/** Based on available data, this computes the optimal delay for the jitter buffer.
+/** Based on available data, this computes the optimal delay for the jitter buffer.
The optimised function is in timestamp units and is:
cost = delay + late_factor*[number of frames that would be late if we used that delay]
@param tb Array of buffers
- @param late_factor Equivalent cost of a late frame (in timestamp units)
+ @param late_factor Equivalent cost of a late frame (in timestamp units)
*/
static spx_int16_t compute_opt_delay(JitterBuffer *jitter)
{
@@ -184,27 +184,27 @@ static spx_int16_t compute_opt_delay(JitterBuffer *jitter)
int worst = 0;
spx_int32_t deltaT;
struct TimingBuffer *tb;
-
+
tb = jitter->_tb;
-
+
/* Number of packet timings we have received (including those we didn't keep) */
tot_count = 0;
for (i=0;i<MAX_BUFFERS;i++)
tot_count += tb[i].curr_count;
if (tot_count==0)
return 0;
-
+
/* Compute cost for one lost packet */
if (jitter->latency_tradeoff != 0)
late_factor = jitter->latency_tradeoff * 100.0f / tot_count;
else
late_factor = jitter->auto_tradeoff * jitter->window_size/tot_count;
-
+
/*fprintf(stderr, "late_factor = %f\n", late_factor);*/
for (i=0;i<MAX_BUFFERS;i++)
pos[i] = 0;
-
- /* Pick the TOP_DELAY "latest" packets (doesn't need to actually be late
+
+ /* Pick the TOP_DELAY "latest" packets (doesn't need to actually be late
for the current settings) */
for (i=0;i<TOP_DELAY;i++)
{
@@ -223,13 +223,13 @@ static spx_int16_t compute_opt_delay(JitterBuffer *jitter)
if (next != -1)
{
spx_int32_t cost;
-
+
if (i==0)
worst = latest;
best = latest;
latest = ROUND_DOWN(latest, jitter->delay_step);
pos[next]++;
-
+
/* Actual cost function that tells us how bad using this delay would be */
cost = -latest + late_factor*late;
/*fprintf(stderr, "cost %d = %d + %f * %d\n", cost, -latest, late_factor, late);*/
@@ -241,7 +241,7 @@ static spx_int16_t compute_opt_delay(JitterBuffer *jitter)
} else {
break;
}
-
+
/* For the next timing we will consider, there will be one more late packet to count */
late++;
/* Two-frame penalty if we're going to increase the amount of late frames (hysteresis) */
@@ -251,14 +251,14 @@ static spx_int16_t compute_opt_delay(JitterBuffer *jitter)
late+=4;
}
}
-
+
deltaT = best-worst;
/* This is a default "automatic latency tradeoff" when none is provided */
jitter->auto_tradeoff = 1 + deltaT/TOP_DELAY;
/*fprintf(stderr, "auto_tradeoff = %d (%d %d %d)\n", jitter->auto_tradeoff, best, worst, i);*/
-
+
/* FIXME: Compute a short-term estimate too and combine with the long-term one */
-
+
/* Prevents reducing the buffer size when we haven't really had much data */
if (tot_count < TOP_DELAY && opt > 0)
return 0;
@@ -313,7 +313,7 @@ EXPORT void jitter_buffer_reset(JitterBuffer *jitter)
jitter->lost_count = 0;
jitter->buffered = 0;
jitter->auto_tradeoff = 32000;
-
+
for (i=0;i<MAX_BUFFERS;i++)
{
tb_init(&jitter->_tb[i]);
@@ -368,7 +368,7 @@ EXPORT void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pa
int i,j;
int late;
/*fprintf (stderr, "put packet %d %d\n", timestamp, span);*/
-
+
/* Cleanup buffer (remove old packets that weren't played) */
if (!jitter->reset_state)
{
@@ -386,7 +386,7 @@ EXPORT void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pa
}
}
}
-
+
/*fprintf(stderr, "arrival: %d %d %d\n", packet->timestamp, jitter->next_stop, jitter->pointer_timestamp);*/
/* Check if packet is late (could still be useful though) */
if (!jitter->reset_state && LT32(packet->timestamp, jitter->next_stop))
@@ -403,7 +403,7 @@ EXPORT void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pa
{
jitter_buffer_reset(jitter);
}
-
+
/* Only insert the packet if it's not hopelessly late (i.e. totally useless) */
if (jitter->reset_state || GE32(packet->timestamp+packet->span+jitter->delay_step, jitter->pointer_timestamp))
{
@@ -414,7 +414,7 @@ EXPORT void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pa
if (jitter->packets[i].data==NULL)
break;
}
-
+
/*No place left in the buffer, need to make room for it by discarding the oldest packet */
if (i==SPEEX_JITTER_MAX_BUFFER_SIZE)
{
@@ -433,9 +433,9 @@ EXPORT void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pa
else
speex_free(jitter->packets[i].data);
jitter->packets[i].data=NULL;
- /*fprintf (stderr, "Buffer is full, discarding earliest frame %d (currently at %d)\n", timestamp, jitter->pointer_timestamp);*/
+ /*fprintf (stderr, "Buffer is full, discarding earliest frame %d (currently at %d)\n", timestamp, jitter->pointer_timestamp);*/
}
-
+
/* Copy packet in buffer */
if (jitter->destroy)
{
@@ -455,8 +455,8 @@ EXPORT void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pa
else
jitter->arrival[i] = jitter->next_stop;
}
-
-
+
+
}
/** Get one packet from the jitter buffer */
@@ -465,7 +465,7 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
int i;
unsigned int j;
spx_int16_t opt;
-
+
if (start_offset != NULL)
*start_offset = 0;
@@ -485,7 +485,7 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
}
if (found)
{
- jitter->reset_state=0;
+ jitter->reset_state=0;
jitter->pointer_timestamp = oldest;
jitter->next_stop = oldest;
} else {
@@ -494,36 +494,36 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
return JITTER_BUFFER_MISSING;
}
}
-
+
jitter->last_returned_timestamp = jitter->pointer_timestamp;
-
+
if (jitter->interp_requested != 0)
{
packet->timestamp = jitter->pointer_timestamp;
packet->span = jitter->interp_requested;
-
+
/* Increment the pointer because it got decremented in the delay update */
jitter->pointer_timestamp += jitter->interp_requested;
packet->len = 0;
/*fprintf (stderr, "Deferred interpolate\n");*/
-
+
jitter->interp_requested = 0;
-
+
jitter->buffered = packet->span - desired_span;
return JITTER_BUFFER_INSERTION;
}
-
+
/* Searching for the packet that fits best */
-
+
/* Search the buffer for a packet with the right timestamp and spanning the whole current chunk */
for (i=0;i<SPEEX_JITTER_MAX_BUFFER_SIZE;i++)
{
if (jitter->packets[i].data && jitter->packets[i].timestamp==jitter->pointer_timestamp && GE32(jitter->packets[i].timestamp+jitter->packets[i].span,jitter->pointer_timestamp+desired_span))
break;
}
-
+
/* If no match, try for an "older" packet that still spans (fully) the current chunk */
if (i==SPEEX_JITTER_MAX_BUFFER_SIZE)
{
@@ -533,7 +533,7 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
break;
}
}
-
+
/* If still no match, try for an "older" packet that spans part of the current chunk */
if (i==SPEEX_JITTER_MAX_BUFFER_SIZE)
{
@@ -543,7 +543,7 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
break;
}
}
-
+
/* If still no match, try for earliest packet possible */
if (i==SPEEX_JITTER_MAX_BUFFER_SIZE)
{
@@ -576,17 +576,17 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
if (i!=SPEEX_JITTER_MAX_BUFFER_SIZE)
{
spx_int32_t offset;
-
+
/* We (obviously) haven't lost this packet */
jitter->lost_count = 0;
-
+
/* In this case, 0 isn't as a valid timestamp */
if (jitter->arrival[i] != 0)
{
update_timings(jitter, ((spx_int32_t)jitter->packets[i].timestamp) - ((spx_int32_t)jitter->arrival[i]) - jitter->buffer_margin);
}
-
-
+
+
/* Copy packet */
if (jitter->destroy)
{
@@ -611,10 +611,10 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
*start_offset = offset;
else if (offset != 0)
speex_warning_int("jitter_buffer_get() discarding non-zero start_offset", offset);
-
+
packet->timestamp = jitter->packets[i].timestamp;
jitter->last_returned_timestamp = packet->timestamp;
-
+
packet->span = jitter->packets[i].span;
packet->sequence = jitter->packets[i].sequence;
packet->user_data = jitter->packets[i].user_data;
@@ -622,36 +622,36 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
jitter->pointer_timestamp = jitter->packets[i].timestamp+jitter->packets[i].span;
jitter->buffered = packet->span - desired_span;
-
+
if (start_offset != NULL)
jitter->buffered += *start_offset;
-
+
return JITTER_BUFFER_OK;
}
-
-
+
+
/* If we haven't found anything worth returning */
-
+
/*fprintf (stderr, "not found\n");*/
jitter->lost_count++;
/*fprintf (stderr, "m");*/
/*fprintf (stderr, "lost_count = %d\n", jitter->lost_count);*/
-
+
opt = compute_opt_delay(jitter);
-
- /* Should we force an increase in the buffer or just do normal interpolation? */
+
+ /* Should we force an increase in the buffer or just do normal interpolation? */
if (opt < 0)
{
/* Need to increase buffering */
-
+
/* Shift histogram to compensate */
shift_timings(jitter, -opt);
-
+
packet->timestamp = jitter->pointer_timestamp;
packet->span = -opt;
/* Don't move the pointer_timestamp forward */
packet->len = 0;
-
+
jitter->buffered = packet->span - desired_span;
return JITTER_BUFFER_INSERTION;
/*jitter->pointer_timestamp -= jitter->delay_step;*/
@@ -659,12 +659,12 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
} else {
/* Normal packet loss */
packet->timestamp = jitter->pointer_timestamp;
-
+
desired_span = ROUND_DOWN(desired_span, jitter->concealment_size);
packet->span = desired_span;
jitter->pointer_timestamp += desired_span;
packet->len = 0;
-
+
jitter->buffered = packet->span - desired_span;
return JITTER_BUFFER_MISSING;
/*fprintf (stderr, "Normal loss\n");*/
@@ -713,11 +713,11 @@ static int _jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket
{
spx_int16_t opt = compute_opt_delay(jitter);
/*fprintf(stderr, "opt adjustment is %d ", opt);*/
-
+
if (opt < 0)
{
shift_timings(jitter, -opt);
-
+
jitter->pointer_timestamp += opt;
jitter->interp_requested = -opt;
/*fprintf (stderr, "Decision to interpolate %d samples\n", -opt);*/
@@ -727,14 +727,14 @@ static int _jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket
jitter->pointer_timestamp += opt;
/*fprintf (stderr, "Decision to drop %d samples\n", opt);*/
}
-
+
return opt;
}
/* Let the jitter buffer know it's the right time to adjust the buffering delay to the network conditions */
EXPORT int jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t *start_offset)
{
- /* If the programmer calls jitter_buffer_update_delay() directly,
+ /* If the programmer calls jitter_buffer_update_delay() directly,
automatically disable auto-adjustment */
jitter->auto_adjust = 0;
@@ -752,7 +752,7 @@ EXPORT void jitter_buffer_tick(JitterBuffer *jitter)
/* Automatically-adjust the buffering delay if requested */
if (jitter->auto_adjust)
_jitter_buffer_update_delay(jitter, NULL, NULL);
-
+
if (jitter->buffered >= 0)
{
jitter->next_stop = jitter->pointer_timestamp - jitter->buffered;
@@ -768,7 +768,7 @@ EXPORT void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem)
/* Automatically-adjust the buffering delay if requested */
if (jitter->auto_adjust)
_jitter_buffer_update_delay(jitter, NULL, NULL);
-
+
if (jitter->buffered < 0)
speex_warning_int("jitter buffer sees negative buffering, your code might be broken. Value is ", jitter->buffered);
jitter->next_stop = jitter->pointer_timestamp - rem;
diff --git a/libspeexdsp/kiss_fft.c b/libspeexdsp/kiss_fft.c
index 6778281..285e557 100644
--- a/libspeexdsp/kiss_fft.c
+++ b/libspeexdsp/kiss_fft.c
@@ -110,7 +110,7 @@ static void kf_bfly4(
C_MUL(scratch[0],Fout[m] , *tw1 );
C_MUL(scratch[1],Fout[m2] , *tw2 );
C_MUL(scratch[2],Fout[m3] , *tw3 );
-
+
C_SUB( scratch[5] , *Fout, scratch[1] );
C_ADDTO(*Fout, scratch[1]);
C_ADD( scratch[3] , scratch[0] , scratch[2] );
@@ -120,7 +120,7 @@ static void kf_bfly4(
tw2 += fstride*2;
tw3 += fstride*3;
C_ADDTO( *Fout , scratch[3] );
-
+
Fout[m].r = scratch[5].r - scratch[4].i;
Fout[m].i = scratch[5].i + scratch[4].r;
Fout[m3].r = scratch[5].r + scratch[4].i;
@@ -140,7 +140,7 @@ static void kf_bfly4(
C_MUL4(scratch[0],Fout[m] , *tw1 );
C_MUL4(scratch[1],Fout[m2] , *tw2 );
C_MUL4(scratch[2],Fout[m3] , *tw3 );
-
+
Fout->r = PSHR16(Fout->r, 2);
Fout->i = PSHR16(Fout->i, 2);
C_SUB( scratch[5] , *Fout, scratch[1] );
@@ -154,7 +154,7 @@ static void kf_bfly4(
tw2 += fstride*2;
tw3 += fstride*3;
C_ADDTO( *Fout , scratch[3] );
-
+
Fout[m].r = scratch[5].r + scratch[4].i;
Fout[m].i = scratch[5].i - scratch[4].r;
Fout[m3].r = scratch[5].r - scratch[4].i;
@@ -292,7 +292,7 @@ static void kf_bfly_generic(
/*CHECKBUF(scratchbuf,nscratchbuf,p);*/
if (p>17)
speex_fatal("KissFFT: max radix supported is 17");
-
+
for ( u=0; u<m; ++u ) {
k=u;
for ( q1=0 ; q1<p ; ++q1 ) {
@@ -317,7 +317,7 @@ static void kf_bfly_generic(
}
}
}
-
+
static
void kf_shuffle(
kiss_fft_cpx * Fout,
@@ -330,7 +330,7 @@ void kf_shuffle(
{
const int p=*factors++; /* the radix */
const int m=*factors++; /* stage's fft length/p */
-
+
/*printf ("fft %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N);*/
if (m==1)
{
@@ -392,14 +392,14 @@ void kf_work(
switch (p) {
case 2: kf_bfly2(Fout,fstride,st,m); break;
- case 3: kf_bfly3(Fout,fstride,st,m); break;
+ case 3: kf_bfly3(Fout,fstride,st,m); break;
case 4: kf_bfly4(Fout,fstride,st,m); break;
- case 5: kf_bfly5(Fout,fstride,st,m); break;
+ case 5: kf_bfly5(Fout,fstride,st,m); break;
default: kf_bfly_generic(Fout,fstride,st,m,p); break;
}
#else
/*printf ("fft %d %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N, m2);*/
- if (m==1)
+ if (m==1)
{
/*for (i=0;i<N;i++)
{
@@ -416,24 +416,24 @@ void kf_work(
kf_work( Fout , f, fstride*p, in_stride, factors,st, N*p, fstride*in_stride, m);
}
-
-
-
+
+
+
switch (p) {
case 2: kf_bfly2(Fout,fstride,st,m, N, m2); break;
- case 3: for (i=0;i<N;i++){Fout=Fout_beg+i*m2; kf_bfly3(Fout,fstride,st,m);} break;
+ case 3: for (i=0;i<N;i++){Fout=Fout_beg+i*m2; kf_bfly3(Fout,fstride,st,m);} break;
case 4: kf_bfly4(Fout,fstride,st,m, N, m2); break;
- case 5: for (i=0;i<N;i++){Fout=Fout_beg+i*m2; kf_bfly5(Fout,fstride,st,m);} break;
+ case 5: for (i=0;i<N;i++){Fout=Fout_beg+i*m2; kf_bfly5(Fout,fstride,st,m);} break;
default: for (i=0;i<N;i++){Fout=Fout_beg+i*m2; kf_bfly_generic(Fout,fstride,st,m,p);} break;
- }
+ }
#endif
}
/* facbuf is populated by p1,m1,p2,m2, ...
- where
+ where
p[i] * m[i] = m[i-1]
m0 = n */
-static
+static
void kf_factor(int n,int * facbuf)
{
int p=4;
@@ -501,10 +501,10 @@ kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem
-
+
void kiss_fft_stride(kiss_fft_cfg st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int in_stride)
{
- if (fin == fout)
+ if (fin == fout)
{
speex_fatal("In-place FFT not supported");
/*CHECKBUF(tmpbuf,ntmpbuf,st->nfft);
diff --git a/libspeexdsp/kiss_fft.h b/libspeexdsp/kiss_fft.h
index fa3f2c6..bb19ead 100644
--- a/libspeexdsp/kiss_fft.h
+++ b/libspeexdsp/kiss_fft.h
@@ -26,13 +26,13 @@ extern "C" {
# include <xmmintrin.h>
# define kiss_fft_scalar __m128
#define KISS_FFT_MALLOC(nbytes) memalign(16,nbytes)
-#else
+#else
#define KISS_FFT_MALLOC speex_alloc
-#endif
+#endif
#ifdef FIXED_POINT
-#include "arch.h"
+#include "arch.h"
# define kiss_fft_scalar spx_int16_t
#else
# ifndef kiss_fft_scalar
@@ -48,9 +48,9 @@ typedef struct {
typedef struct kiss_fft_state* kiss_fft_cfg;
-/*
+/*
* kiss_fft_alloc
- *
+ *
* Initialize a FFT (or IFFT) algorithm's cfg/state buffer.
*
* typical usage: kiss_fft_cfg mycfg=kiss_fft_alloc(1024,0,NULL,NULL);
@@ -60,18 +60,18 @@ typedef struct kiss_fft_state* kiss_fft_cfg;
*
* If lenmem is NULL, then kiss_fft_alloc will allocate a cfg buffer using malloc.
* The returned value should be free()d when done to avoid memory leaks.
- *
+ *
* The state can be placed in a user supplied buffer 'mem':
* If lenmem is not NULL and mem is not NULL and *lenmem is large enough,
* then the function places the cfg in mem and the size used in *lenmem
* and returns mem.
- *
+ *
* If lenmem is not NULL and ( mem is NULL or *lenmem is not large enough),
- * then the function returns NULL and places the minimum cfg
+ * then the function returns NULL and places the minimum cfg
* buffer size in *lenmem.
* */
-kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem);
+kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem);
/*
* kiss_fft(cfg,in_out_buf)
@@ -90,19 +90,19 @@ void kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout);
* */
void kiss_fft_stride(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int fin_stride);
-/* If kiss_fft_alloc allocated a buffer, it is one contiguous
+/* If kiss_fft_alloc allocated a buffer, it is one contiguous
buffer and can be simply free()d when no longer needed*/
#define kiss_fft_free speex_free
/*
- Cleans up some memory that gets managed internally. Not necessary to call, but it might clean up
+ Cleans up some memory that gets managed internally. Not necessary to call, but it might clean up
your compiler output to call this before you exit.
*/
void kiss_fft_cleanup(void);
-
+
#ifdef __cplusplus
-}
+}
#endif
#endif
diff --git a/libspeexdsp/kiss_fftr.c b/libspeexdsp/kiss_fftr.c
index f6275b8..827e0b1 100644
--- a/libspeexdsp/kiss_fftr.c
+++ b/libspeexdsp/kiss_fftr.c
@@ -24,9 +24,9 @@ struct kiss_fftr_state{
kiss_fft_cfg substate;
kiss_fft_cpx * tmpbuf;
kiss_fft_cpx * super_twiddles;
-#ifdef USE_SIMD
+#ifdef USE_SIMD
long pad;
-#endif
+#endif
};
kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem)
@@ -96,12 +96,12 @@ void kiss_fftr(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_cpx *fr
* contains the sum of the even-numbered elements of the input time sequence
* The imag part is the sum of the odd-numbered elements
*
- * The sum of tdc.r and tdc.i is the sum of the input time sequence.
+ * The sum of tdc.r and tdc.i is the sum of the input time sequence.
* yielding DC of input time sequence
- * The difference of tdc.r - tdc.i is the sum of the input (dot product) [1,-1,1,-1...
+ * The difference of tdc.r - tdc.i is the sum of the input (dot product) [1,-1,1,-1...
* yielding Nyquist bin of input time sequence
*/
-
+
tdc.r = st->tmpbuf[0].r;
tdc.i = st->tmpbuf[0].i;
C_FIXDIV(tdc,2);
@@ -109,14 +109,14 @@ void kiss_fftr(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_cpx *fr
CHECK_OVERFLOW_OP(tdc.r ,-, tdc.i);
freqdata[0].r = tdc.r + tdc.i;
freqdata[ncfft].r = tdc.r - tdc.i;
-#ifdef USE_SIMD
+#ifdef USE_SIMD
freqdata[ncfft].i = freqdata[0].i = _mm_set1_ps(0);
#else
freqdata[ncfft].i = freqdata[0].i = 0;
#endif
for ( k=1;k <= ncfft/2 ; ++k ) {
- fpk = st->tmpbuf[k];
+ fpk = st->tmpbuf[k];
fpnk.r = st->tmpbuf[ncfft-k].r;
fpnk.i = - st->tmpbuf[ncfft-k].i;
C_FIXDIV(fpk,2);
@@ -161,7 +161,7 @@ void kiss_fftri(kiss_fftr_cfg st,const kiss_fft_cpx *freqdata, kiss_fft_scalar *
C_MUL (fok, tmp, st->super_twiddles[k]);
C_ADD (st->tmpbuf[k], fek, fok);
C_SUB (st->tmpbuf[ncfft - k], fek, fok);
-#ifdef USE_SIMD
+#ifdef USE_SIMD
st->tmpbuf[ncfft - k].i *= _mm_set1_ps(-1.0);
#else
st->tmpbuf[ncfft - k].i *= -1;
@@ -189,12 +189,12 @@ void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar
* contains the sum of the even-numbered elements of the input time sequence
* The imag part is the sum of the odd-numbered elements
*
- * The sum of tdc.r and tdc.i is the sum of the input time sequence.
+ * The sum of tdc.r and tdc.i is the sum of the input time sequence.
* yielding DC of input time sequence
- * The difference of tdc.r - tdc.i is the sum of the input (dot product) [1,-1,1,-1...
+ * The difference of tdc.r - tdc.i is the sum of the input (dot product) [1,-1,1,-1...
* yielding Nyquist bin of input time sequence
*/
-
+
tdc.r = st->tmpbuf[0].r;
tdc.i = st->tmpbuf[0].i;
C_FIXDIV(tdc,2);
@@ -205,7 +205,7 @@ void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar
for ( k=1;k <= ncfft/2 ; ++k )
{
- /*fpk = st->tmpbuf[k];
+ /*fpk = st->tmpbuf[k];
fpnk.r = st->tmpbuf[ncfft-k].r;
fpnk.i = - st->tmpbuf[ncfft-k].i;
C_FIXDIV(fpk,2);
@@ -213,7 +213,7 @@ void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar
C_ADD( f1k, fpk , fpnk );
C_SUB( f2k, fpk , fpnk );
-
+
C_MUL( tw , f2k , st->super_twiddles[k]);
freqdata[2*k-1] = HALF_OF(f1k.r + tw.r);
@@ -226,7 +226,7 @@ void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar
f1k.i = PSHR32(SUB32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),1);
f2k.r = PSHR32(SUB32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),1);
f2k.i = SHR32(ADD32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),1);
-
+
C_MUL( tw , f2k , st->super_twiddles[k]);
freqdata[2*k-1] = HALF_OF(f1k.r + tw.r);
@@ -236,13 +236,13 @@ void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar
*/
f2k.r = SHR32(SUB32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),1);
f2k.i = PSHR32(ADD32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),1);
-
+
f1kr = SHL32(ADD32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),13);
f1ki = SHL32(SUB32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),13);
-
+
twr = SHR32(SUB32(MULT16_16(f2k.r,st->super_twiddles[k].r),MULT16_16(f2k.i,st->super_twiddles[k].i)), 1);
twi = SHR32(ADD32(MULT16_16(f2k.i,st->super_twiddles[k].r),MULT16_16(f2k.r,st->super_twiddles[k].i)), 1);
-
+
#ifdef FIXED_POINT
freqdata[2*k-1] = PSHR32(f1kr + twr, 15);
freqdata[2*k] = PSHR32(f1ki + twi, 15);
@@ -253,7 +253,7 @@ void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar
freqdata[2*k] = .5f*(f1ki + twi);
freqdata[2*(ncfft-k)-1] = .5f*(f1kr - twr);
freqdata[2*(ncfft-k)] = .5f*(twi - f1ki);
-
+
#endif
}
}
@@ -287,7 +287,7 @@ void kiss_fftri2(kiss_fftr_cfg st,const kiss_fft_scalar *freqdata,kiss_fft_scala
C_MUL (fok, tmp, st->super_twiddles[k]);
C_ADD (st->tmpbuf[k], fek, fok);
C_SUB (st->tmpbuf[ncfft - k], fek, fok);
-#ifdef USE_SIMD
+#ifdef USE_SIMD
st->tmpbuf[ncfft - k].i *= _mm_set1_ps(-1.0);
#else
st->tmpbuf[ncfft - k].i *= -1;
diff --git a/libspeexdsp/kiss_fftr.h b/libspeexdsp/kiss_fftr.h
index 7bfb423..8cfeda1 100644
--- a/libspeexdsp/kiss_fftr.h
+++ b/libspeexdsp/kiss_fftr.h
@@ -6,13 +6,13 @@
extern "C" {
#endif
-
-/*
-
+
+/*
+
Real optimized version can save about 45% cpu time vs. complex fft of a real seq.
-
-
+
+
*/
typedef struct kiss_fftr_state *kiss_fftr_cfg;
@@ -22,7 +22,7 @@ kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem, size_t * lenm
/*
nfft must be even
- If you don't care to allocate space, use mem = lenmem = NULL
+ If you don't care to allocate space, use mem = lenmem = NULL
*/
diff --git a/libspeexdsp/math_approx.h b/libspeexdsp/math_approx.h
index 9ca8307..596dfdc 100644
--- a/libspeexdsp/math_approx.h
+++ b/libspeexdsp/math_approx.h
@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -168,11 +168,11 @@ static inline spx_word16_t spx_acos(spx_word16_t x)
x = NEG16(x);
}
x = SUB16(16384,x);
-
+
x = x >> 1;
sq = MULT16_16_Q13(x, ADD16(A1, MULT16_16_Q13(x, ADD16(A2, MULT16_16_Q13(x, (A3))))));
ret = spx_sqrt(SHL32(EXTEND32(sq),13));
-
+
/*ret = spx_sqrt(67108864*(-1.6129e-04 + 2.0104e+00*f + 2.7373e-01*f*f + 1.8136e-01*f*f*f));*/
if (s)
ret = SUB16(25736,ret);
@@ -208,7 +208,7 @@ static inline spx_word16_t spx_cos(spx_word16_t x)
static inline spx_word16_t _spx_cos_pi_2(spx_word16_t x)
{
spx_word16_t x2;
-
+
x2 = MULT16_16_P15(x,x);
return ADD16(1,MIN16(32766,ADD32(SUB16(L1,x2), MULT16_16_P15(x2, ADD32(L2, MULT16_16_P15(x2, ADD32(L3, MULT16_16_P15(L4, x2))))))));
}
diff --git a/libspeexdsp/mdf.c b/libspeexdsp/mdf.c
index 456ab84..7b367f9 100644
--- a/libspeexdsp/mdf.c
+++ b/libspeexdsp/mdf.c
@@ -33,36 +33,36 @@
/*
The echo canceller is based on the MDF algorithm described in:
- J. S. Soo, K. K. Pang Multidelay block frequency adaptive filter,
- IEEE Trans. Acoust. Speech Signal Process., Vol. ASSP-38, No. 2,
+ J. S. Soo, K. K. Pang Multidelay block frequency adaptive filter,
+ IEEE Trans. Acoust. Speech Signal Process., Vol. ASSP-38, No. 2,
February 1990.
-
- We use the Alternatively Updated MDF (AUMDF) variant. Robustness to
+
+ We use the Alternatively Updated MDF (AUMDF) variant. Robustness to
double-talk is achieved using a variable learning rate as described in:
-
- Valin, J.-M., On Adjusting the Learning Rate in Frequency Domain Echo
+
+ Valin, J.-M., On Adjusting the Learning Rate in Frequency Domain Echo
Cancellation With Double-Talk. IEEE Transactions on Audio,
Speech and Language Processing, Vol. 15, No. 3, pp. 1030-1034, 2007.
http://people.xiph.org/~jm/papers/valin_taslp2006.pdf
-
+
There is no explicit double-talk detection, but a continuous variation
in the learning rate based on residual echo, double-talk and background
noise.
-
+
About the fixed-point version:
- All the signals are represented with 16-bit words. The filter weights
+ All the signals are represented with 16-bit words. The filter weights
are represented with 32-bit words, but only the top 16 bits are used
in most cases. The lower 16 bits are completely unreliable (due to the
fact that the update is done only on the top bits), but help in the
adaptation -- probably by removing a "threshold effect" due to
quantization (rounding going to zero) when the gradient is small.
-
+
Another kludge that seems to work good: when performing the weight
update, we only move half the way toward the "goal" this seems to
reduce the effect of quantization noise in the update phase. This
can be seen as applying a gradient descent on a "soft constraint"
instead of having a hard constraint.
-
+
*/
#ifdef HAVE_CONFIG_H
@@ -88,12 +88,6 @@
#define WEIGHT_SHIFT 0
#endif
-#ifdef FIXED_POINT
-#define WORD2INT(x) ((x) < -32767 ? -32768 : ((x) > 32766 ? 32767 : (x)))
-#else
-#define WORD2INT(x) ((x) < -32767.5f ? -32768 : ((x) > 32766.5f ? 32767 : floor(.5+(x))))
-#endif
-
/* If enabled, the AEC will use a foreground filter and a background filter to be more robust to double-talk
and difficult signals in general. The cost is an extra FFT and a matrix-vector multiply */
#define TWO_PATH
@@ -145,7 +139,7 @@ struct SpeexEchoState_ {
spx_word16_t beta_max;
spx_word32_t sum_adapt;
spx_word16_t leak_estimate;
-
+
spx_word16_t *e; /* scratch */
spx_word16_t *x; /* Far-end input buffer (2N) */
spx_word16_t *X; /* Far-end buffer (M+1 frames) in frequency domain */
@@ -198,7 +192,7 @@ static inline void filter_dc_notch16(const spx_int16_t *in, spx_word16_t radius,
den2 = MULT16_16_Q15(radius,radius) + MULT16_16_Q15(QCONST16(.7,15),MULT16_16_Q15(32767-radius,32767-radius));
#else
den2 = radius*radius + .7*(1-radius)*(1-radius);
-#endif
+#endif
/*printf ("%d %d %d %d %d %d\n", num[0], num[1], num[2], den[0], den[1], den[2]);*/
for (i=0;i<len;i++)
{
@@ -420,7 +414,7 @@ EXPORT SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_lengt
pFile = fopen("aec_play.sw", "wb");
oFile = fopen("aec_out.sw", "wb");
#endif
-
+
st->frame_size = frame_size;
st->window_size = 2*frame_size;
N = st->window_size;
@@ -442,7 +436,7 @@ EXPORT SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_lengt
st->leak_estimate = 0;
st->fft_table = spx_fft_init(N);
-
+
st->e = (spx_word16_t*)speex_alloc(C*N*sizeof(spx_word16_t));
st->x = (spx_word16_t*)speex_alloc(K*N*sizeof(spx_word16_t));
st->input = (spx_word16_t*)speex_alloc(C*st->frame_size*sizeof(spx_word16_t));
@@ -498,7 +492,7 @@ EXPORT SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_lengt
st->prop[i] = DIV32(MULT16_16(QCONST16(.8f,15), st->prop[i]),sum);
}
}
-
+
st->memX = (spx_word16_t*)speex_alloc(K*sizeof(spx_word16_t));
st->memD = (spx_word16_t*)speex_alloc(C*sizeof(spx_word16_t));
st->memE = (spx_word16_t*)speex_alloc(C*sizeof(spx_word16_t));
@@ -513,16 +507,16 @@ EXPORT SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_lengt
st->notch_mem = (spx_mem_t*)speex_alloc(2*C*sizeof(spx_mem_t));
st->adapted = 0;
st->Pey = st->Pyy = FLOAT_ONE;
-
+
#ifdef TWO_PATH
st->Davg1 = st->Davg2 = 0;
st->Dvar1 = st->Dvar2 = FLOAT_ZERO;
#endif
-
+
st->play_buf = (spx_int16_t*)speex_alloc(K*(PLAYBACK_DELAY+1)*st->frame_size*sizeof(spx_int16_t));
st->play_buf_pos = PLAYBACK_DELAY*st->frame_size;
st->play_buf_started = 0;
-
+
return st;
}
@@ -624,7 +618,7 @@ EXPORT void speex_echo_state_destroy(SpeexEchoState *st)
speex_free(st->play_buf);
speex_free(st);
-
+
#ifdef DUMP_ECHO_CANCEL_DATA
fclose(rFile);
fclose(pFile);
@@ -704,7 +698,7 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
spx_float_t alpha, alpha_1;
spx_word16_t RER;
spx_word32_t tmp32;
-
+
N = st->window_size;
M = st->M;
C = st->C;
@@ -736,7 +730,7 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
tmp32 = 32767;
if (st->saturated == 0)
st->saturated = 1;
- }
+ }
if (tmp32 < -32767)
{
tmp32 = -32767;
@@ -762,18 +756,18 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
{
tmp32 = 32767;
st->saturated = M+1;
- }
+ }
if (tmp32 < -32767)
{
tmp32 = -32767;
st->saturated = M+1;
- }
+ }
#endif
st->x[speak*N+i+st->frame_size] = EXTRACT16(tmp32);
st->memX[speak] = far_end[i*K+speak];
}
- }
-
+ }
+
for (speak = 0; speak < K; speak++)
{
/* Shift memory: this could be optimized eventually*/
@@ -785,15 +779,15 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
/* Convert x (echo input) to frequency domain */
spx_fft(st->fft_table, st->x+speak*N, &st->X[speak*N]);
}
-
+
Sxx = 0;
for (speak = 0; speak < K; speak++)
{
Sxx += mdf_inner_prod(st->x+speak*N+st->frame_size, st->x+speak*N+st->frame_size, st->frame_size);
power_spectrum_accum(st->X+speak*N, st->Xf, N);
}
-
- Sff = 0;
+
+ Sff = 0;
for (chan = 0; chan < C; chan++)
{
#ifdef TWO_PATH
@@ -805,7 +799,7 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
Sff += mdf_inner_prod(st->e+chan*N, st->e+chan*N, st->frame_size);
#endif
}
-
+
/* Adjust proportional adaption rate */
/* FIXME: Adjust that for C, K*/
if (st->adapted)
@@ -828,8 +822,8 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
} else {
st->saturated--;
}
-
- /* FIXME: MC conversion required */
+
+ /* FIXME: MC conversion required */
/* Update weight to prevent circular convolution (MDF / AUMDF) */
for (chan = 0; chan < C; chan++)
{
@@ -869,13 +863,13 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
}
}
}
-
- /* So we can use power_spectrum_accum */
+
+ /* So we can use power_spectrum_accum */
for (i=0;i<=st->frame_size;i++)
st->Rf[i] = st->Yf[i] = st->Xf[i] = 0;
-
+
Dbf = 0;
- See = 0;
+ See = 0;
#ifdef TWO_PATH
/* Difference in response, this is used to estimate the variance of our residual power estimate */
for (chan = 0; chan < C; chan++)
@@ -897,20 +891,20 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
#ifdef TWO_PATH
/* Logic for updating the foreground filter */
-
+
/* For two time windows, compute the mean of the energy difference, as well as the variance */
st->Davg1 = ADD32(MULT16_32_Q15(QCONST16(.6f,15),st->Davg1), MULT16_32_Q15(QCONST16(.4f,15),SUB32(Sff,See)));
st->Davg2 = ADD32(MULT16_32_Q15(QCONST16(.85f,15),st->Davg2), MULT16_32_Q15(QCONST16(.15f,15),SUB32(Sff,See)));
st->Dvar1 = FLOAT_ADD(FLOAT_MULT(VAR1_SMOOTH, st->Dvar1), FLOAT_MUL32U(MULT16_32_Q15(QCONST16(.4f,15),Sff), MULT16_32_Q15(QCONST16(.4f,15),Dbf)));
st->Dvar2 = FLOAT_ADD(FLOAT_MULT(VAR2_SMOOTH, st->Dvar2), FLOAT_MUL32U(MULT16_32_Q15(QCONST16(.15f,15),Sff), MULT16_32_Q15(QCONST16(.15f,15),Dbf)));
-
+
/* Equivalent float code:
st->Davg1 = .6*st->Davg1 + .4*(Sff-See);
st->Davg2 = .85*st->Davg2 + .15*(Sff-See);
st->Dvar1 = .36*st->Dvar1 + .16*Sff*Dbf;
st->Dvar2 = .7225*st->Dvar2 + .0225*Sff*Dbf;
*/
-
+
update_foreground = 0;
/* Check if we have a statistically significant reduction in the residual echo */
/* Note that this is *not* Gaussian, so we need to be careful about the longer tail */
@@ -920,7 +914,7 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
update_foreground = 1;
else if (FLOAT_GT(FLOAT_MUL32U(st->Davg2, ABS32(st->Davg2)), FLOAT_MULT(VAR2_UPDATE,(st->Dvar2))))
update_foreground = 1;
-
+
/* Do we update? */
if (update_foreground)
{
@@ -949,12 +943,12 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
st->W[i] = SHL32(EXTEND32(st->foreground[i]),16);
/* We also need to copy the output so as to get correct adaptation */
for (chan = 0; chan < C; chan++)
- {
+ {
for (i=0;i<st->frame_size;i++)
st->y[chan*N+i+st->frame_size] = st->e[chan*N+i+st->frame_size];
for (i=0;i<st->frame_size;i++)
st->e[chan*N+i] = SUB16(st->input[chan*st->frame_size+i], st->y[chan*N+i+st->frame_size]);
- }
+ }
See = Sff;
st->Davg1 = st->Davg2 = 0;
st->Dvar1 = st->Dvar2 = FLOAT_ZERO;
@@ -962,10 +956,10 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
}
#endif
- Sey = Syy = Sdd = 0;
+ Sey = Syy = Sdd = 0;
for (chan = 0; chan < C; chan++)
- {
- /* Compute error signal (for the output with de-emphasis) */
+ {
+ /* Compute error signal (for the output with de-emphasis) */
for (i=0;i<st->frame_size;i++)
{
spx_word32_t tmp_out;
@@ -988,34 +982,34 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
#ifdef DUMP_ECHO_CANCEL_DATA
dump_audio(in, far_end, out, st->frame_size);
#endif
-
- /* Compute error signal (filter update version) */
+
+ /* Compute error signal (filter update version) */
for (i=0;i<st->frame_size;i++)
{
st->e[chan*N+i+st->frame_size] = st->e[chan*N+i];
st->e[chan*N+i] = 0;
}
-
+
/* Compute a bunch of correlations */
/* FIXME: bad merge */
Sey += mdf_inner_prod(st->e+chan*N+st->frame_size, st->y+chan*N+st->frame_size, st->frame_size);
Syy += mdf_inner_prod(st->y+chan*N+st->frame_size, st->y+chan*N+st->frame_size, st->frame_size);
Sdd += mdf_inner_prod(st->input+chan*st->frame_size, st->input+chan*st->frame_size, st->frame_size);
-
+
/* Convert error to frequency domain */
spx_fft(st->fft_table, st->e+chan*N, st->E+chan*N);
for (i=0;i<st->frame_size;i++)
st->y[i+chan*N] = 0;
spx_fft(st->fft_table, st->y+chan*N, st->Y+chan*N);
-
+
/* Compute power spectrum of echo (X), error (E) and filter response (Y) */
power_spectrum_accum(st->E+chan*N, st->Rf, N);
power_spectrum_accum(st->Y+chan*N, st->Yf, N);
-
+
}
-
+
/*printf ("%f %f %f %f\n", Sff, See, Syy, Sdd, st->update_cond);*/
-
+
/* Do some sanity check */
if (!(Syy>=0 && Sxx>=0 && See >= 0)
#ifndef FIXED_POINT
@@ -1044,14 +1038,14 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
/* Add a small noise floor to make sure not to have problems when dividing */
See = MAX32(See, SHR32(MULT16_16(N, 100),6));
-
+
for (speak = 0; speak < K; speak++)
{
Sxx += mdf_inner_prod(st->x+speak*N+st->frame_size, st->x+speak*N+st->frame_size, st->frame_size);
power_spectrum_accum(st->X+speak*N, st->Xf, N);
}
-
+
/* Smooth far end energy estimate over time */
for (j=0;j<=st->frame_size;j++)
st->power[j] = MULT16_32_Q15(ss_1,st->power[j]) + 1 + MULT16_32_Q15(ss,st->Xf[j]);
@@ -1072,7 +1066,7 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
st->Yh[j] = (1-st->spec_average)*st->Yh[j] + st->spec_average*st->Yf[j];
#endif
}
-
+
Pyy = FLOAT_SQRT(Pyy);
Pey = FLOAT_DIVU(Pey,Pyy);
@@ -1100,7 +1094,7 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
else
st->leak_estimate = SHL16(st->leak_estimate,1);
/*printf ("%f\n", st->leak_estimate);*/
-
+
/* Compute Residual to Error Ratio */
#ifdef FIXED_POINT
tmp32 = MULT16_32_Q15(st->leak_estimate,Syy);
@@ -1156,7 +1150,7 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
/* Temporary adaption rate if filter is not yet adapted enough */
spx_word16_t adapt_rate=0;
- if (Sxx > SHR32(MULT16_16(N, 1000),6))
+ if (Sxx > SHR32(MULT16_16(N, 1000),6))
{
tmp32 = MULT16_32_Q15(QCONST16(.25f, 15), Sxx);
#ifdef FIXED_POINT
@@ -1176,7 +1170,7 @@ EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, c
st->sum_adapt = ADD32(st->sum_adapt,adapt_rate);
}
- /* FIXME: MC conversion required */
+ /* FIXME: MC conversion required */
for (i=0;i<st->frame_size;i++)
st->last_y[i] = st->last_y[st->frame_size+i];
if (st->adapted)
@@ -1198,17 +1192,17 @@ void speex_echo_get_residual(SpeexEchoState *st, spx_word32_t *residual_echo, in
int i;
spx_word16_t leak2;
int N;
-
+
N = st->window_size;
/* Apply hanning window (should pre-compute it)*/
for (i=0;i<N;i++)
st->y[i] = MULT16_16_Q15(st->window[i],st->last_y[i]);
-
+
/* Compute power spectrum of the echo */
spx_fft(st->fft_table, st->y, st->Y);
power_spectrum(st->Y, residual_echo, N);
-
+
#ifdef FIXED_POINT
if (st->leak_estimate > 16383)
leak2 = 32767;
@@ -1223,14 +1217,14 @@ void speex_echo_get_residual(SpeexEchoState *st, spx_word32_t *residual_echo, in
/* Estimate residual echo */
for (i=0;i<=st->frame_size;i++)
residual_echo[i] = (spx_int32_t)MULT16_32_Q15(leak2,residual_echo[i]);
-
+
}
EXPORT int speex_echo_ctl(SpeexEchoState *st, int request, void *ptr)
{
switch(request)
{
-
+
case SPEEX_ECHO_GET_FRAME_SIZE:
(*(int*)ptr) = st->frame_size;
break;
diff --git a/libspeexdsp/misc_bfin.h b/libspeexdsp/misc_bfin.h
index 3c8c09d..4e27681 100644
--- a/libspeexdsp/misc_bfin.h
+++ b/libspeexdsp/misc_bfin.h
@@ -1,25 +1,25 @@
/* Copyright (C) 2005 Analog Devices */
/**
@file misc_bfin.h
- @author Jean-Marc Valin
+ @author Jean-Marc Valin
@brief Various compatibility routines for Speex (Blackfin version)
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/libspeexdsp/os_support.h b/libspeexdsp/os_support.h
index 2e23a5e..0db31a6 100644
--- a/libspeexdsp/os_support.h
+++ b/libspeexdsp/os_support.h
@@ -1,5 +1,5 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: os_support.h
This is the (tiny) OS abstraction layer. Aside from math.h, this is the
only place where system headers are allowed.
@@ -45,12 +45,12 @@
#include "os_support_custom.h"
#endif
-/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free
+/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free
NOTE: speex_alloc needs to CLEAR THE MEMORY */
#ifndef OVERRIDE_SPEEX_ALLOC
static inline void *speex_alloc (int size)
{
- /* WARNING: this is not equivalent to malloc(). If you want to use malloc()
+ /* WARNING: this is not equivalent to malloc(). If you want to use malloc()
or your own allocator, YOU NEED TO CLEAR THE MEMORY ALLOCATED. Otherwise
you will experience strange bugs */
return calloc(size,1);
diff --git a/libspeexdsp/preprocess.c b/libspeexdsp/preprocess.c
index b8e287a..3053eb5 100644
--- a/libspeexdsp/preprocess.c
+++ b/libspeexdsp/preprocess.c
@@ -1,6 +1,6 @@
/* Copyright (C) 2003 Epic Games (written by Jean-Marc Valin)
- Copyright (C) 2004-2006 Epic Games
-
+ Copyright (C) 2004-2006 Epic Games
+
File: preprocess.c
Preprocessor with denoising based on the algorithm by Ephraim and Malah
@@ -34,24 +34,24 @@
/*
Recommended papers:
-
+
Y. Ephraim and D. Malah, "Speech enhancement using minimum mean-square error
- short-time spectral amplitude estimator". IEEE Transactions on Acoustics,
+ short-time spectral amplitude estimator". IEEE Transactions on Acoustics,
Speech and Signal Processing, vol. ASSP-32, no. 6, pp. 1109-1121, 1984.
-
+
Y. Ephraim and D. Malah, "Speech enhancement using minimum mean-square error
- log-spectral amplitude estimator". IEEE Transactions on Acoustics, Speech and
+ log-spectral amplitude estimator". IEEE Transactions on Acoustics, Speech and
Signal Processing, vol. ASSP-33, no. 2, pp. 443-445, 1985.
-
+
I. Cohen and B. Berdugo, "Speech enhancement for non-stationary noise environments".
Signal Processing, vol. 81, no. 2, pp. 2403-2418, 2001.
- Stefan Gustafsson, Rainer Martin, Peter Jax, and Peter Vary. "A psychoacoustic
- approach to combined acoustic echo cancellation and noise reduction". IEEE
+ Stefan Gustafsson, Rainer Martin, Peter Jax, and Peter Vary. "A psychoacoustic
+ approach to combined acoustic echo cancellation and noise reduction". IEEE
Transactions on Speech and Audio Processing, 2002.
-
+
J.-M. Valin, J. Rouat, and F. Michaud, "Microphone array post-filter for separation
- of simultaneous non-stationary sources". In Proceedings IEEE International
+ of simultaneous non-stationary sources". In Proceedings IEEE International
Conference on Acoustics, Speech, and Signal Processing, 2004.
*/
@@ -71,7 +71,7 @@
#define LOUDNESS_EXP 5.f
#define AMP_SCALE .001f
#define AMP_SCALE_1 1000.f
-
+
#define NB_BANDS 24
#define SPEECH_PROB_START_DEFAULT QCONST16(0.35f,15)
@@ -113,7 +113,7 @@ static inline spx_word16_t DIV32_16_Q8(spx_word32_t a, spx_word32_t b)
a = SHL32(a,8);
return PDIV32_16(a,b);
}
-
+
}
static inline spx_word16_t DIV32_16_Q15(spx_word32_t a, spx_word32_t b)
{
@@ -181,7 +181,7 @@ struct SpeexPreprocessState_ {
int sampling_rate; /**< Sampling rate of the input/output */
int nbands;
FilterBank *bank;
-
+
/* Parameters */
int denoise_enabled;
int vad_enabled;
@@ -194,7 +194,7 @@ struct SpeexPreprocessState_ {
int echo_suppress;
int echo_suppress_active;
SpeexEchoState *echo_state;
-
+
spx_word16_t speech_prob; /**< Probability last frame was speech */
/* DSP-related arrays */
@@ -256,7 +256,7 @@ static void conj_window(spx_word16_t *w, int len)
spx_word16_t tmp;
#ifdef FIXED_POINT
spx_word16_t x = DIV32_16(MULT16_16(32767,i),len);
-#else
+#else
spx_word16_t x = DIV32_16(MULT16_16(QCONST16(4.f,13),i),len);
#endif
int inv=0;
@@ -281,10 +281,10 @@ static void conj_window(spx_word16_t *w, int len)
}
}
-
+
#ifdef FIXED_POINT
-/* This function approximates the gain function
- y = gamma(1.25)^2 * M(-.25;1;-x) / sqrt(x)
+/* This function approximates the gain function
+ y = gamma(1.25)^2 * M(-.25;1;-x) / sqrt(x)
which multiplied by xi/(1+xi) is the optimal gain
in the loudness domain ( sqrt[amplitude] )
Input in Q11 format, output in Q15
@@ -317,7 +317,7 @@ static inline spx_word16_t qcurve(spx_word16_t x)
static void compute_gain_floor(int noise_suppress, int effective_echo_suppress, spx_word32_t *noise, spx_word32_t *echo, spx_word16_t *gain_floor, int len)
{
int i;
-
+
if (noise_suppress > effective_echo_suppress)
{
spx_word16_t noise_gain, gain_ratio;
@@ -343,8 +343,8 @@ static void compute_gain_floor(int noise_suppress, int effective_echo_suppress,
}
#else
-/* This function approximates the gain function
- y = gamma(1.25)^2 * M(-.25;1;-x) / sqrt(x)
+/* This function approximates the gain function
+ y = gamma(1.25)^2 * M(-.25;1;-x) / sqrt(x)
which multiplied by xi/(1+xi) is the optimal gain
in the loudness domain ( sqrt[amplitude] )
*/
@@ -410,8 +410,8 @@ EXPORT SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sam
break;
}
}
-
-
+
+
if (st->ps_size < 3*st->frame_size/4)
st->ps_size = st->ps_size * 3 / 2;
#else
@@ -421,7 +421,7 @@ EXPORT SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sam
N = st->ps_size;
N3 = 2*N - st->frame_size;
N4 = st->frame_size - N3;
-
+
st->sampling_rate = sampling_rate;
st->denoise_enabled = 1;
st->vad_enabled = 0;
@@ -436,15 +436,15 @@ EXPORT SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sam
st->speech_prob_continue = SPEECH_PROB_CONTINUE_DEFAULT;
st->echo_state = NULL;
-
+
st->nbands = NB_BANDS;
M = st->nbands;
st->bank = filterbank_new(M, sampling_rate, N, 1);
-
+
st->frame = (spx_word16_t*)speex_alloc(2*N*sizeof(spx_word16_t));
st->window = (spx_word16_t*)speex_alloc(2*N*sizeof(spx_word16_t));
st->ft = (spx_word16_t*)speex_alloc(2*N*sizeof(spx_word16_t));
-
+
st->ps = (spx_word32_t*)speex_alloc((N+M)*sizeof(spx_word32_t));
st->noise = (spx_word32_t*)speex_alloc((N+M)*sizeof(spx_word32_t));
st->echo_noise = (spx_word32_t*)speex_alloc((N+M)*sizeof(spx_word32_t));
@@ -457,19 +457,19 @@ EXPORT SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sam
st->gain2 = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));
st->gain_floor = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));
st->zeta = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));
-
+
st->S = (spx_word32_t*)speex_alloc(N*sizeof(spx_word32_t));
st->Smin = (spx_word32_t*)speex_alloc(N*sizeof(spx_word32_t));
st->Stmp = (spx_word32_t*)speex_alloc(N*sizeof(spx_word32_t));
st->update_prob = (int*)speex_alloc(N*sizeof(int));
-
+
st->inbuf = (spx_word16_t*)speex_alloc(N3*sizeof(spx_word16_t));
st->outbuf = (spx_word16_t*)speex_alloc(N3*sizeof(spx_word16_t));
conj_window(st->window, 2*N3);
for (i=2*N3;i<2*st->ps_size;i++)
st->window[i]=Q15_ONE;
-
+
if (N4>0)
{
for (i=N3-1;i>=0;i--)
@@ -569,7 +569,7 @@ static void speex_compute_agc(SpeexPreprocessState *st, spx_word16_t Pframe, spx
float target_gain;
float loudness=1.f;
float rate;
-
+
for (i=2;i<N;i++)
{
loudness += 2.f*N*st->ps[i]* st->loudness_weight[i];
@@ -587,7 +587,7 @@ static void speex_compute_agc(SpeexPreprocessState *st, spx_word16_t Pframe, spx
st->init_max *= 1.f + .1f*Pframe*Pframe;
}
/*printf ("%f %f %f %f\n", Pframe, loudness, pow(st->loudness, 1.0f/LOUDNESS_EXP), st->loudness2);*/
-
+
target_gain = AMP_SCALE*st->agc_level*pow(st->loudness/(1e-4+st->loudness_accum), -1.0f/LOUDNESS_EXP);
if ((Pframe>.5 && st->nb_adapt > 20) || target_gain < st->agc_gain)
@@ -600,11 +600,11 @@ static void speex_compute_agc(SpeexPreprocessState *st, spx_word16_t Pframe, spx
target_gain = st->max_gain;
if (target_gain > st->init_max)
target_gain = st->init_max;
-
+
st->agc_gain = target_gain;
}
/*fprintf (stderr, "%f %f %f\n", loudness, (float)AMP_SCALE_1*pow(st->loudness, 1.0f/LOUDNESS_EXP), st->agc_gain);*/
-
+
for (i=0;i<2*N;i++)
ft[i] *= st->agc_gain;
st->prev_loudness = loudness;
@@ -624,7 +624,7 @@ static void preprocess_analysis(SpeexPreprocessState *st, spx_int16_t *x)
st->frame[i]=st->inbuf[i];
for (i=0;i<st->frame_size;i++)
st->frame[N3+i]=x[i];
-
+
/* Update inbuf */
for (i=0;i<N3;i++)
st->inbuf[i]=x[N4+i];
@@ -643,10 +643,10 @@ static void preprocess_analysis(SpeexPreprocessState *st, spx_int16_t *x)
st->frame[i] = SHL16(st->frame[i], st->frame_shift);
}
#endif
-
+
/* Perform FFT */
spx_fft(st->fft_lookup, st->frame, st->ft);
-
+
/* Power spectrum */
ps[0]=MULT16_16(st->ft[0],st->ft[0]);
for (i=1;i<N;i++)
@@ -664,11 +664,11 @@ static void update_noise_prob(SpeexPreprocessState *st)
int N = st->ps_size;
for (i=1;i<N-1;i++)
- st->S[i] = MULT16_32_Q15(QCONST16(.8f,15),st->S[i]) + MULT16_32_Q15(QCONST16(.05f,15),st->ps[i-1])
+ st->S[i] = MULT16_32_Q15(QCONST16(.8f,15),st->S[i]) + MULT16_32_Q15(QCONST16(.05f,15),st->ps[i-1])
+ MULT16_32_Q15(QCONST16(.1f,15),st->ps[i]) + MULT16_32_Q15(QCONST16(.05f,15),st->ps[i+1]);
st->S[0] = MULT16_32_Q15(QCONST16(.8f,15),st->S[0]) + MULT16_32_Q15(QCONST16(.2f,15),st->ps[0]);
st->S[N-1] = MULT16_32_Q15(QCONST16(.8f,15),st->S[N-1]) + MULT16_32_Q15(QCONST16(.2f,15),st->ps[N-1]);
-
+
if (st->nb_adapt==1)
{
for (i=0;i<N;i++)
@@ -695,7 +695,7 @@ static void update_noise_prob(SpeexPreprocessState *st)
for (i=0;i<N;i++)
{
st->Smin[i] = MIN32(st->Smin[i], st->S[i]);
- st->Stmp[i] = MIN32(st->Stmp[i], st->S[i]);
+ st->Stmp[i] = MIN32(st->Stmp[i], st->S[i]);
}
}
for (i=0;i<N;i++)
@@ -731,12 +731,12 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
spx_word16_t Pframe;
spx_word16_t beta, beta_1;
spx_word16_t effective_echo_suppress;
-
+
st->nb_adapt++;
if (st->nb_adapt>20000)
st->nb_adapt = 20000;
st->min_count++;
-
+
beta = MAX16(QCONST16(.03,15),DIV32_16(Q15_ONE,st->nb_adapt));
beta_1 = Q15_ONE-beta;
M = st->nbands;
@@ -770,7 +770,7 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
st->update_prob[i] = 0;
}
*/
-
+
/* Update the noise estimate for the frequencies where it can be */
for (i=0;i<N;i++)
{
@@ -788,17 +788,17 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
for (i=0;i<N+M;i++)
{
spx_word16_t gamma;
-
+
/* Total noise estimate including residual echo and reverberation */
spx_word32_t tot_noise = ADD32(ADD32(ADD32(EXTEND32(1), PSHR32(st->noise[i],NOISE_SHIFT)) , st->echo_noise[i]) , st->reverb_estimate[i]);
-
+
/* A posteriori SNR = ps/noise - 1*/
st->post[i] = SUB16(DIV32_16_Q8(ps[i],tot_noise), QCONST16(1.f,SNR_SHIFT));
st->post[i]=MIN16(st->post[i], QCONST16(100.f,SNR_SHIFT));
-
+
/* Computing update gamma = .1 + .9*(old/(old+noise))^2 */
gamma = QCONST16(.1f,15)+MULT16_16_Q15(QCONST16(.89f,15),SQR16_Q15(DIV32_16_Q15(st->old_ps[i],ADD32(st->old_ps[i],tot_noise))));
-
+
/* A priori SNR update = gamma*max(0,post) + (1-gamma)*old/noise */
st->prior[i] = EXTRACT16(PSHR32(ADD32(MULT16_16(gamma,MAX16(0,st->post[i])), MULT16_16(Q15_ONE-gamma,DIV32_16_Q8(st->old_ps[i],tot_noise))), 15));
st->prior[i]=MIN16(st->prior[i], QCONST16(100.f,SNR_SHIFT));
@@ -819,13 +819,13 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
for (i=N;i<N+M;i++)
Zframe = ADD32(Zframe, EXTEND32(st->zeta[i]));
Pframe = QCONST16(.1f,15)+MULT16_16_Q15(QCONST16(.899f,15),qcurve(DIV32_16(Zframe,st->nbands)));
-
+
effective_echo_suppress = EXTRACT16(PSHR32(ADD32(MULT16_16(SUB16(Q15_ONE,Pframe), st->echo_suppress), MULT16_16(Pframe, st->echo_suppress_active)),15));
-
+
compute_gain_floor(st->noise_suppress, effective_echo_suppress, st->noise+N, st->echo_noise+N, st->gain_floor+N, M);
-
- /* Compute Ephraim & Malah gain speech probability of presence for each critical band (Bark scale)
- Technically this is actually wrong because the EM gaim assumes a slightly different probability
+
+ /* Compute Ephraim & Malah gain speech probability of presence for each critical band (Bark scale)
+ Technically this is actually wrong because the EM gaim assumes a slightly different probability
distribution */
for (i=N;i<N+M;i++)
{
@@ -842,7 +842,7 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
#ifdef FIXED_POINT
spx_word16_t tmp;
#endif
-
+
prior_ratio = PDIV32_16(SHL32(EXTEND32(st->prior[i]), 15), ADD16(st->prior[i], SHL32(1,SNR_SHIFT)));
theta = MULT16_32_P15(prior_ratio, QCONST32(1.f,EXPIN_SHIFT)+SHL32(EXTEND32(st->post[i]),EXPIN_SHIFT-SNR_SHIFT));
@@ -867,12 +867,12 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
/* Convert the EM gains and speech prob to linear frequency */
filterbank_compute_psd16(st->bank,st->gain2+N, st->gain2);
filterbank_compute_psd16(st->bank,st->gain+N, st->gain);
-
+
/* Use 1 for linear gain resolution (best) or 0 for Bark gain resolution (faster) */
if (1)
{
filterbank_compute_psd16(st->bank,st->gain_floor+N, st->gain_floor);
-
+
/* Compute gain according to the Ephraim-Malah algorithm -- linear frequency */
for (i=0;i<N;i++)
{
@@ -882,7 +882,7 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
spx_word16_t tmp;
spx_word16_t p;
spx_word16_t g;
-
+
/* Wiener filter gain */
prior_ratio = PDIV32_16(SHL32(EXTEND32(st->prior[i]), 15), ADD16(st->prior[i], SHL32(1,SNR_SHIFT)));
theta = MULT16_32_P15(prior_ratio, QCONST32(1.f,EXPIN_SHIFT)+SHL32(EXTEND32(st->post[i]),EXPIN_SHIFT-SNR_SHIFT));
@@ -893,22 +893,22 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
g = EXTRACT16(MIN32(Q15_ONE, MULT16_32_Q15(prior_ratio, MM)));
/* Interpolated speech probability of presence */
p = st->gain2[i];
-
+
/* Constrain the gain to be close to the Bark scale gain */
if (MULT16_16_Q15(QCONST16(.333f,15),g) > st->gain[i])
g = MULT16_16(3,st->gain[i]);
st->gain[i] = g;
-
+
/* Save old power spectrum */
st->old_ps[i] = MULT16_32_P15(QCONST16(.2f,15),st->old_ps[i]) + MULT16_32_P15(MULT16_16_P15(QCONST16(.8f,15),SQR16_Q15(st->gain[i])),ps[i]);
-
+
/* Apply gain floor */
if (st->gain[i] < st->gain_floor[i])
st->gain[i] = st->gain_floor[i];
/* Exponential decay model for reverberation (unused) */
/*st->reverb_estimate[i] = st->reverb_decay*st->reverb_estimate[i] + st->reverb_decay*st->reverb_level*st->gain[i]*st->gain[i]*st->ps[i];*/
-
+
/* Take into account speech probability of presence (loudness domain MMSE estimator) */
/* gain2 = [p*sqrt(gain)+(1-p)*sqrt(gain _floor) ]^2 */
tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(st->gain[i]),15))) + MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(st->gain_floor[i]),15)));
@@ -922,20 +922,20 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
{
spx_word16_t tmp;
spx_word16_t p = st->gain2[i];
- st->gain[i] = MAX16(st->gain[i], st->gain_floor[i]);
+ st->gain[i] = MAX16(st->gain[i], st->gain_floor[i]);
tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(st->gain[i]),15))) + MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(st->gain_floor[i]),15)));
st->gain2[i]=SQR16_Q15(tmp);
}
filterbank_compute_psd16(st->bank,st->gain2+N, st->gain2);
}
-
+
/* If noise suppression is off, don't apply the gain (but then why call this in the first place!) */
if (!st->denoise_enabled)
{
for (i=0;i<N+M;i++)
st->gain2[i]=Q15_ONE;
}
-
+
/* Apply computed gain */
for (i=1;i<N;i++)
{
@@ -944,7 +944,7 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
}
st->ft[0] = MULT16_16_P15(st->gain2[0],st->ft[0]);
st->ft[2*N-1] = MULT16_16_P15(st->gain2[N-1],st->ft[2*N-1]);
-
+
/*FIXME: This *will* not work for fixed-point */
#ifndef FIXED_POINT
if (st->agc_enabled)
@@ -973,17 +973,17 @@ EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
}
}
#endif
-
+
/* Synthesis window (for WOLA) */
for (i=0;i<2*N;i++)
st->frame[i] = MULT16_16_Q15(st->frame[i], st->window[i]);
/* Perform overlap and add */
for (i=0;i<N3;i++)
- x[i] = st->outbuf[i] + st->frame[i];
+ x[i] = WORD2INT(ADD32(EXTEND32(st->outbuf[i]), EXTEND32(st->frame[i])));
for (i=0;i<N4;i++)
x[N3+i] = st->frame[N3+i];
-
+
/* Update outbuf */
for (i=0;i<N3;i++)
st->outbuf[i] = st->frame[st->frame_size+i];
@@ -1016,11 +1016,11 @@ EXPORT void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16
M = st->nbands;
st->min_count++;
-
+
preprocess_analysis(st, x);
update_noise_prob(st);
-
+
for (i=1;i<N-1;i++)
{
if (!st->update_prob[i] || st->ps[i] < PSHR32(st->noise[i],NOISE_SHIFT))
@@ -1099,7 +1099,7 @@ EXPORT int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *
case SPEEX_PREPROCESS_GET_VAD:
(*(spx_int32_t*)ptr) = st->vad_enabled;
break;
-
+
case SPEEX_PREPROCESS_SET_DEREVERB:
st->dereverb_enabled = (*(spx_int32_t*)ptr);
for (i=0;i<st->ps_size;i++)
@@ -1117,7 +1117,7 @@ EXPORT int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *
/* FIXME: Re-enable when de-reverberation is actually enabled again */
/*(*(float*)ptr) = st->reverb_level;*/
break;
-
+
case SPEEX_PREPROCESS_SET_DEREVERB_DECAY:
/* FIXME: Re-enable when de-reverberation is actually enabled again */
/*st->reverb_decay = (*(float*)ptr);*/
diff --git a/libspeexdsp/pseudofloat.h b/libspeexdsp/pseudofloat.h
index fa841a0..ed5ab14 100644
--- a/libspeexdsp/pseudofloat.h
+++ b/libspeexdsp/pseudofloat.h
@@ -3,7 +3,7 @@
@file pseudofloat.h
@brief Pseudo-floating point
* This header file provides a lightweight floating point type for
- * use on fixed-point platforms when a large dynamic range is
+ * use on fixed-point platforms when a large dynamic range is
* required. The new type is not compatible with the 32-bit IEEE format,
* it is not even remotely as accurate as 32-bit floats, and is not
* even guaranteed to produce even remotely correct results for code
@@ -16,18 +16,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -84,7 +84,7 @@ static inline spx_float_t PSEUDOFLOAT(spx_int32_t x)
r.e = e;
return r;
}
- else
+ else
{
spx_float_t r;
r.m = x;
@@ -101,12 +101,12 @@ static inline spx_float_t FLOAT_ADD(spx_float_t a, spx_float_t b)
return b;
else if (b.m==0)
return a;
- if ((a).e > (b).e)
+ if ((a).e > (b).e)
{
r.m = ((a).m>>1) + ((b).m>>MIN(15,(a).e-(b).e+1));
r.e = (a).e+1;
}
- else
+ else
{
r.m = ((b).m>>1) + ((a).m>>MIN(15,(b).e-(a).e+1));
r.e = (b).e+1;
@@ -141,7 +141,7 @@ static inline spx_float_t FLOAT_SUB(spx_float_t a, spx_float_t b)
r.m = ((a).m>>1) - ((b).m>>MIN(15,(a).e-(b).e+1));
r.e = (a).e+1;
}
- else
+ else
{
r.m = ((a).m>>MIN(15,(b).e-(a).e+1)) - ((b).m>>1);
r.e = (b).e+1;
@@ -169,10 +169,10 @@ static inline int FLOAT_LT(spx_float_t a, spx_float_t b)
if (a.m==0)
return b.m>0;
else if (b.m==0)
- return a.m<0;
+ return a.m<0;
if ((a).e > (b).e)
return ((a).m>>1) < ((b).m>>MIN(15,(a).e-(b).e+1));
- else
+ else
return ((b).m>>1) > ((a).m>>MIN(15,(b).e-(a).e+1));
}
@@ -202,7 +202,7 @@ static inline spx_float_t FLOAT_MULT(spx_float_t a, spx_float_t b)
}
}
/*printf ("%f * %f = %f\n", REALFLOAT(a), REALFLOAT(b), REALFLOAT(r));*/
- return r;
+ return r;
}
static inline spx_float_t FLOAT_AMULT(spx_float_t a, spx_float_t b)
@@ -210,7 +210,7 @@ static inline spx_float_t FLOAT_AMULT(spx_float_t a, spx_float_t b)
spx_float_t r;
r.m = (spx_int16_t)((spx_int32_t)(a).m*(b).m>>15);
r.e = (a).e+(b).e+15;
- return r;
+ return r;
}
diff --git a/libspeexdsp/resample.c b/libspeexdsp/resample.c
index edbd65b..2bfbc1c 100644
--- a/libspeexdsp/resample.c
+++ b/libspeexdsp/resample.c
@@ -1,6 +1,6 @@
/* Copyright (C) 2007-2008 Jean-Marc Valin
Copyright (C) 2008 Thorvald Natvig
-
+
File: resample.c
Arbitrary resampling code
@@ -38,22 +38,22 @@
- Low memory requirement
- Good *perceptual* quality (and not best SNR)
- Warning: This resampler is relatively new. Although I think I got rid of
+ Warning: This resampler is relatively new. Although I think I got rid of
all the major bugs and I don't expect the API to change anymore, there
may be something I've missed. So use with caution.
This algorithm is based on this original resampling algorithm:
Smith, Julius O. Digital Audio Resampling Home Page
- Center for Computer Research in Music and Acoustics (CCRMA),
+ Center for Computer Research in Music and Acoustics (CCRMA),
Stanford University, 2007.
- Web published at http://www-ccrma.stanford.edu/~jos/resample/.
+ Web published at https://ccrma.stanford.edu/~jos/resample/.
- There is one main difference, though. This resampler uses cubic
+ There is one main difference, though. This resampler uses cubic
interpolation instead of linear interpolation in the above paper. This
makes the table much smaller and makes it possible to compute that table
- on a per-stream basis. In turn, being able to tweak the table for each
- stream makes it possible to both reduce complexity on simple ratios
- (e.g. 2/3), and get rid of the rounding operations in the inner loop.
+ on a per-stream basis. In turn, being able to tweak the table for each
+ stream makes it possible to both reduce complexity on simple ratios
+ (e.g. 2/3), and get rid of the rounding operations in the inner loop.
The latter both reduces CPU time and makes the algorithm more SIMD-friendly.
*/
@@ -63,9 +63,12 @@
#ifdef OUTSIDE_SPEEX
#include <stdlib.h>
-static void *speex_alloc (int size) {return calloc(size,1);}
-static void *speex_realloc (void *ptr, int size) {return realloc(ptr, size);}
-static void speex_free (void *ptr) {free(ptr);}
+static void *speex_alloc(int size) {return calloc(size,1);}
+static void *speex_realloc(void *ptr, int size) {return realloc(ptr, size);}
+static void speex_free(void *ptr) {free(ptr);}
+#ifndef EXPORT
+#define EXPORT
+#endif
#include "speex_resampler.h"
#include "arch.h"
#else /* OUTSIDE_SPEEX */
@@ -75,7 +78,6 @@ static void speex_free (void *ptr) {free(ptr);}
#include "os_support.h"
#endif /* OUTSIDE_SPEEX */
-#include "stack_alloc.h"
#include <math.h>
#include <limits.h>
@@ -83,12 +85,6 @@ static void speex_free (void *ptr) {free(ptr);}
#define M_PI 3.14159265358979323846
#endif
-#ifdef FIXED_POINT
-#define WORD2INT(x) ((x) < -32767 ? -32768 : ((x) > 32766 ? 32767 : (x)))
-#else
-#define WORD2INT(x) ((x) < -32767.5f ? -32768 : ((x) > 32766.5f ? 32767 : floor(.5+(x))))
-#endif
-
#define IMAX(a,b) ((a) > (b) ? (a) : (b))
#define IMIN(a,b) ((a) < (b) ? (a) : (b))
@@ -96,11 +92,15 @@ static void speex_free (void *ptr) {free(ptr);}
#define NULL 0
#endif
-#ifdef _USE_SSE
+#ifndef UINT32_MAX
+#define UINT32_MAX 4294967295U
+#endif
+
+#ifdef USE_SSE
#include "resample_sse.h"
#endif
-#ifdef _USE_NEON
+#ifdef USE_NEON
#include "resample_neon.h"
#endif
@@ -118,7 +118,7 @@ struct SpeexResamplerState_ {
spx_uint32_t out_rate;
spx_uint32_t num_rate;
spx_uint32_t den_rate;
-
+
int quality;
spx_uint32_t nb_channels;
spx_uint32_t filt_len;
@@ -130,17 +130,17 @@ struct SpeexResamplerState_ {
spx_uint32_t oversample;
int initialised;
int started;
-
+
/* These are per-channel */
spx_int32_t *last_sample;
spx_uint32_t *samp_frac_num;
spx_uint32_t *magic_samples;
-
+
spx_word16_t *mem;
spx_word16_t *sinc_table;
spx_uint32_t sinc_table_length;
resampler_basic_func resampler_ptr;
-
+
int in_stride;
int out_stride;
} ;
@@ -182,7 +182,7 @@ static const double kaiser8_table[36] = {
0.32108304, 0.27619388, 0.23465776, 0.19672670, 0.16255380, 0.13219758,
0.10562887, 0.08273982, 0.06335451, 0.04724088, 0.03412321, 0.02369490,
0.01563093, 0.00959968, 0.00527363, 0.00233883, 0.00050000, 0.00000000};
-
+
static const double kaiser6_table[36] = {
0.99733006, 1.00000000, 0.99733006, 0.98935595, 0.97618418, 0.95799003,
0.93501423, 0.90755855, 0.87598009, 0.84068475, 0.80211977, 0.76076565,
@@ -195,17 +195,15 @@ struct FuncDef {
const double *table;
int oversample;
};
-
-static const struct FuncDef _KAISER12 = {kaiser12_table, 64};
-#define KAISER12 (&_KAISER12)
-/*static struct FuncDef _KAISER12 = {kaiser12_table, 32};
-#define KAISER12 (&_KAISER12)*/
-static const struct FuncDef _KAISER10 = {kaiser10_table, 32};
-#define KAISER10 (&_KAISER10)
-static const struct FuncDef _KAISER8 = {kaiser8_table, 32};
-#define KAISER8 (&_KAISER8)
-static const struct FuncDef _KAISER6 = {kaiser6_table, 32};
-#define KAISER6 (&_KAISER6)
+
+static const struct FuncDef kaiser12_funcdef = {kaiser12_table, 64};
+#define KAISER12 (&kaiser12_funcdef)
+static const struct FuncDef kaiser10_funcdef = {kaiser10_table, 32};
+#define KAISER10 (&kaiser10_funcdef)
+static const struct FuncDef kaiser8_funcdef = {kaiser8_table, 32};
+#define KAISER8 (&kaiser8_funcdef)
+static const struct FuncDef kaiser6_funcdef = {kaiser6_table, 32};
+#define KAISER6 (&kaiser6_funcdef)
struct QualityMapping {
int base_length;
@@ -217,7 +215,7 @@ struct QualityMapping {
/* This table maps conversion quality to internal parameters. There are two
- reasons that explain why the up-sampling bandwidth is larger than the
+ reasons that explain why the up-sampling bandwidth is larger than the
down-sampling bandwidth:
1) When up-sampling, we can assume that the spectrum is already attenuated
close to the Nyquist rate (from an A/D or a previous resampling filter)
@@ -243,7 +241,7 @@ static double compute_func(float x, const struct FuncDef *func)
{
float y, frac;
double interp[4];
- int ind;
+ int ind;
y = x*func->oversample;
ind = (int)floor(y);
frac = (y-ind);
@@ -254,7 +252,7 @@ static double compute_func(float x, const struct FuncDef *func)
interp[0] = -0.3333333333*frac + 0.5*(frac*frac) - 0.1666666667*(frac*frac*frac);
/* Just to make sure we don't have rounding problems */
interp[1] = 1.f-interp[3]-interp[2]-interp[0];
-
+
/*sum = frac*accum[1] + (1-frac)*accum[2];*/
return interp[0]*func->table[ind] + interp[1]*func->table[ind+1] + interp[2]*func->table[ind+2] + interp[3]*func->table[ind+3];
}
@@ -475,13 +473,13 @@ static int resampler_basic_interpolate_single(SpeexResamplerState *st, spx_uint3
}
cubic_coef(frac, interp);
- sum = MULT16_32_Q15(interp[0],SHR32(accum[0], 1)) + MULT16_32_Q15(interp[1],SHR32(accum[1], 1)) + MULT16_32_Q15(interp[2],SHR32(accum[2], 1)) + MULT16_32_Q15(interp[3],SHR32(accum[3], 1));
+ sum = MULT16_32_Q15(interp[0],accum[0]) + MULT16_32_Q15(interp[1],accum[1]) + MULT16_32_Q15(interp[2],accum[2]) + MULT16_32_Q15(interp[3],accum[3]);
sum = SATURATE32PSHR(sum, 15, 32767);
#else
cubic_coef(frac, interp);
sum = interpolate_product_single(iptr, st->sinc_table + st->oversample + 4 - offset - 2, N, st->oversample, interp);
#endif
-
+
out[out_stride * out_sample++] = sum;
last_sample += int_advance;
samp_frac_num += frac_advance;
@@ -543,7 +541,7 @@ static int resampler_basic_interpolate_double(SpeexResamplerState *st, spx_uint3
cubic_coef(frac, interp);
sum = interpolate_product_double(iptr, st->sinc_table + st->oversample + 4 - offset - 2, N, st->oversample, interp);
#endif
-
+
out[out_stride * out_sample++] = PSHR32(sum,15);
last_sample += int_advance;
samp_frac_num += frac_advance;
@@ -574,6 +572,7 @@ static int resampler_basic_zero(SpeexResamplerState *st, spx_uint32_t channel_in
const int frac_advance = st->frac_advance;
const spx_uint32_t den_rate = st->den_rate;
+ (void)in;
while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len))
{
out[out_stride * out_sample++] = 0;
@@ -591,6 +590,18 @@ static int resampler_basic_zero(SpeexResamplerState *st, spx_uint32_t channel_in
return out_sample;
}
+static int multiply_frac(spx_uint32_t *result, spx_uint32_t value, spx_uint32_t num, spx_uint32_t den)
+{
+ spx_uint32_t major = value / den;
+ spx_uint32_t remain = value % den;
+ /* TODO: Could use 64 bits operation to check for overflow. But only guaranteed in C99+ */
+ if (remain > UINT32_MAX / num || major > UINT32_MAX / num
+ || major * num > UINT32_MAX - remain * num / den)
+ return RESAMPLER_ERR_OVERFLOW;
+ *result = remain * num / den + major * num;
+ return RESAMPLER_ERR_SUCCESS;
+}
+
static int update_filter(SpeexResamplerState *st)
{
spx_uint32_t old_length = st->filt_len;
@@ -603,13 +614,13 @@ static int update_filter(SpeexResamplerState *st)
st->frac_advance = st->num_rate%st->den_rate;
st->oversample = quality_map[st->quality].oversample;
st->filt_len = quality_map[st->quality].base_length;
-
+
if (st->num_rate > st->den_rate)
{
/* down-sampling */
st->cutoff = quality_map[st->quality].downsample_bandwidth * st->den_rate / st->num_rate;
- /* FIXME: divide the numerator and denominator by a certain amount if they're too large */
- st->filt_len = st->filt_len*st->num_rate / st->den_rate;
+ if (multiply_frac(&st->filt_len,st->filt_len,st->num_rate,st->den_rate) != RESAMPLER_ERR_SUCCESS)
+ goto fail;
/* Round up to make sure we have a multiple of 8 for SSE */
st->filt_len = ((st->filt_len-1)&(~0x7))+8;
if (2*st->den_rate < st->num_rate)
@@ -626,13 +637,13 @@ static int update_filter(SpeexResamplerState *st)
/* up-sampling */
st->cutoff = quality_map[st->quality].upsample_bandwidth;
}
-
- /* Choose the resampling type that requires the least amount of memory */
+
#ifdef RESAMPLE_FULL_SINC_TABLE
use_direct = 1;
if (INT_MAX/sizeof(spx_word16_t)/st->den_rate < st->filt_len)
goto fail;
#else
+ /* Choose the resampling type that requires the least amount of memory */
use_direct = st->filt_len*st->den_rate <= st->filt_len*st->oversample+8
&& INT_MAX/sizeof(spx_word16_t)/st->den_rate >= st->filt_len;
#endif
@@ -725,7 +736,7 @@ static int update_filter(SpeexResamplerState *st)
/*if (st->magic_samples[i])*/
{
/* Try and remove the magic samples as if nothing had happened */
-
+
/* FIXME: This is wrong but for now we need it to avoid going over the array bounds */
olen = old_length + 2*st->magic_samples[i];
for (j=old_length-1+st->magic_samples[i];j--;)
@@ -787,17 +798,22 @@ EXPORT SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, spx_u
EXPORT SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
{
- spx_uint32_t i;
SpeexResamplerState *st;
int filter_err;
- if (quality > 10 || quality < 0)
+ if (nb_channels == 0 || ratio_num == 0 || ratio_den == 0 || quality > 10 || quality < 0)
{
if (err)
*err = RESAMPLER_ERR_INVALID_ARG;
return NULL;
}
st = (SpeexResamplerState *)speex_alloc(sizeof(SpeexResamplerState));
+ if (!st)
+ {
+ if (err)
+ *err = RESAMPLER_ERR_ALLOC_FAILED;
+ return NULL;
+ }
st->initialised = 0;
st->started = 0;
st->in_rate = 0;
@@ -810,24 +826,21 @@ EXPORT SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
st->filt_len = 0;
st->mem = 0;
st->resampler_ptr = 0;
-
+
st->cutoff = 1.f;
st->nb_channels = nb_channels;
st->in_stride = 1;
st->out_stride = 1;
-
+
st->buffer_size = 160;
-
+
/* Per channel data */
- st->last_sample = (spx_int32_t*)speex_alloc(nb_channels*sizeof(spx_int32_t));
- st->magic_samples = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t));
- st->samp_frac_num = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t));
- for (i=0;i<nb_channels;i++)
- {
- st->last_sample[i] = 0;
- st->magic_samples[i] = 0;
- st->samp_frac_num[i] = 0;
- }
+ if (!(st->last_sample = (spx_int32_t*)speex_alloc(nb_channels*sizeof(spx_int32_t))))
+ goto fail;
+ if (!(st->magic_samples = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t))))
+ goto fail;
+ if (!(st->samp_frac_num = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t))))
+ goto fail;
speex_resampler_set_quality(st, quality);
speex_resampler_set_rate_frac(st, ratio_num, ratio_den, in_rate, out_rate);
@@ -844,6 +857,12 @@ EXPORT SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
*err = filter_err;
return st;
+
+fail:
+ if (err)
+ *err = RESAMPLER_ERR_ALLOC_FAILED;
+ speex_resampler_destroy(st);
+ return NULL;
}
EXPORT void speex_resampler_destroy(SpeexResamplerState *st)
@@ -863,17 +882,17 @@ static int speex_resampler_process_native(SpeexResamplerState *st, spx_uint32_t
int out_sample = 0;
spx_word16_t *mem = st->mem + channel_index * st->mem_alloc_size;
spx_uint32_t ilen;
-
+
st->started = 1;
-
+
/* Call the right resampler through the function ptr */
out_sample = st->resampler_ptr(st, channel_index, mem, in_len, out, out_len);
-
+
if (st->last_sample[channel_index] < (spx_int32_t)*in_len)
*in_len = st->last_sample[channel_index];
*out_len = out_sample;
st->last_sample[channel_index] -= *in_len;
-
+
ilen = *in_len;
for(j=0;j<N-1;++j)
@@ -886,11 +905,11 @@ static int speex_resampler_magic(SpeexResamplerState *st, spx_uint32_t channel_i
spx_uint32_t tmp_in_len = st->magic_samples[channel_index];
spx_word16_t *mem = st->mem + channel_index * st->mem_alloc_size;
const int N = st->filt_len;
-
+
speex_resampler_process_native(st, channel_index, &tmp_in_len, *out, &out_len);
st->magic_samples[channel_index] -= tmp_in_len;
-
+
/* If we couldn't process all "magic" input samples, save the rest for next time */
if (st->magic_samples[channel_index])
{
@@ -916,13 +935,13 @@ EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t c
const spx_uint32_t xlen = st->mem_alloc_size - filt_offs;
const int istride = st->in_stride;
- if (st->magic_samples[channel_index])
+ if (st->magic_samples[channel_index])
olen -= speex_resampler_magic(st, channel_index, &out, olen);
if (! st->magic_samples[channel_index]) {
while (ilen && olen) {
spx_uint32_t ichunk = (ilen > xlen) ? xlen : ilen;
spx_uint32_t ochunk = olen;
-
+
if (in) {
for(j=0;j<ichunk;++j)
x[j+filt_offs]=in[j*istride];
@@ -958,15 +977,14 @@ EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t cha
const spx_uint32_t xlen = st->mem_alloc_size - (st->filt_len - 1);
#ifdef VAR_ARRAYS
const unsigned int ylen = (olen < FIXED_STACK_ALLOC) ? olen : FIXED_STACK_ALLOC;
- VARDECL(spx_word16_t *ystack);
- ALLOC(ystack, ylen, spx_word16_t);
+ spx_word16_t ystack[ylen];
#else
const unsigned int ylen = FIXED_STACK_ALLOC;
spx_word16_t ystack[FIXED_STACK_ALLOC];
#endif
st->out_stride = 1;
-
+
while (ilen && olen) {
spx_word16_t *y = ystack;
spx_uint32_t ichunk = (ilen > xlen) ? xlen : ilen;
@@ -1003,7 +1021,7 @@ EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t cha
#else
out[j*ostride_save] = WORD2INT(ystack[j]);
#endif
-
+
ilen -= ichunk;
olen -= ochunk;
out += (ochunk+omagic) * ostride_save;
@@ -1039,7 +1057,7 @@ EXPORT int speex_resampler_process_interleaved_float(SpeexResamplerState *st, co
st->out_stride = ostride_save;
return st->resampler_ptr == resampler_basic_zero ? RESAMPLER_ERR_ALLOC_FAILED : RESAMPLER_ERR_SUCCESS;
}
-
+
EXPORT int speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
{
spx_uint32_t i;
@@ -1074,40 +1092,53 @@ EXPORT void speex_resampler_get_rate(SpeexResamplerState *st, spx_uint32_t *in_r
*out_rate = st->out_rate;
}
+static inline spx_uint32_t compute_gcd(spx_uint32_t a, spx_uint32_t b)
+{
+ while (b != 0)
+ {
+ spx_uint32_t temp = a;
+
+ a = b;
+ b = temp % b;
+ }
+ return a;
+}
+
EXPORT int speex_resampler_set_rate_frac(SpeexResamplerState *st, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate)
{
spx_uint32_t fact;
spx_uint32_t old_den;
spx_uint32_t i;
+
+ if (ratio_num == 0 || ratio_den == 0)
+ return RESAMPLER_ERR_INVALID_ARG;
+
if (st->in_rate == in_rate && st->out_rate == out_rate && st->num_rate == ratio_num && st->den_rate == ratio_den)
return RESAMPLER_ERR_SUCCESS;
-
+
old_den = st->den_rate;
st->in_rate = in_rate;
st->out_rate = out_rate;
st->num_rate = ratio_num;
st->den_rate = ratio_den;
- /* FIXME: This is terribly inefficient, but who cares (at least for now)? */
- for (fact=2;fact<=IMIN(st->num_rate, st->den_rate);fact++)
- {
- while ((st->num_rate % fact == 0) && (st->den_rate % fact == 0))
- {
- st->num_rate /= fact;
- st->den_rate /= fact;
- }
- }
-
+
+ fact = compute_gcd(st->num_rate, st->den_rate);
+
+ st->num_rate /= fact;
+ st->den_rate /= fact;
+
if (old_den > 0)
{
for (i=0;i<st->nb_channels;i++)
{
- st->samp_frac_num[i]=st->samp_frac_num[i]*st->den_rate/old_den;
+ if (multiply_frac(&st->samp_frac_num[i],st->samp_frac_num[i],st->den_rate,old_den) != RESAMPLER_ERR_SUCCESS)
+ return RESAMPLER_ERR_OVERFLOW;
/* Safety net */
if (st->samp_frac_num[i] >= st->den_rate)
st->samp_frac_num[i] = st->den_rate-1;
}
}
-
+
if (st->initialised)
return update_filter(st);
return RESAMPLER_ERR_SUCCESS;
diff --git a/libspeexdsp/resample_neon.h b/libspeexdsp/resample_neon.h
index 0acbd27..e14ffe1 100644
--- a/libspeexdsp/resample_neon.h
+++ b/libspeexdsp/resample_neon.h
@@ -36,14 +36,24 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <arm_neon.h>
-
#ifdef FIXED_POINT
-#ifdef __thumb2__
+#if defined(__aarch64__)
+static inline int32_t saturate_32bit_to_16bit(int32_t a) {
+ int32_t ret;
+ asm ("fmov s0, %w[a]\n"
+ "sqxtn h0, s0\n"
+ "sxtl v0.4s, v0.4h\n"
+ "fmov %w[ret], s0\n"
+ : [ret] "=r" (ret)
+ : [a] "r" (a)
+ : "v0" );
+ return ret;
+}
+#elif defined(__thumb2__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm ("ssat %[ret], #16, %[a]"
- : [ret] "=&r" (ret)
+ : [ret] "=r" (ret)
: [a] "r" (a)
: );
return ret;
@@ -54,7 +64,7 @@ static inline int32_t saturate_32bit_to_16bit(int32_t a) {
asm ("vmov.s32 d0[0], %[a]\n"
"vqmovn.s32 d0, q0\n"
"vmov.s16 %[ret], d0[0]\n"
- : [ret] "=&r" (ret)
+ : [ret] "=r" (ret)
: [a] "r" (a)
: "q0");
return ret;
@@ -64,7 +74,63 @@ static inline int32_t saturate_32bit_to_16bit(int32_t a) {
#define WORD2INT(x) (saturate_32bit_to_16bit(x))
#define OVERRIDE_INNER_PRODUCT_SINGLE
-/* Only works when len % 4 == 0 */
+/* Only works when len % 4 == 0 and len >= 4 */
+#if defined(__aarch64__)
+static inline int32_t inner_product_single(const int16_t *a, const int16_t *b, unsigned int len)
+{
+ int32_t ret;
+ uint32_t remainder = len % 16;
+ len = len - remainder;
+
+ asm volatile (" cmp %w[len], #0\n"
+ " b.ne 1f\n"
+ " ld1 {v16.4h}, [%[b]], #8\n"
+ " ld1 {v20.4h}, [%[a]], #8\n"
+ " subs %w[remainder], %w[remainder], #4\n"
+ " smull v0.4s, v16.4h, v20.4h\n"
+ " b.ne 4f\n"
+ " b 5f\n"
+ "1:"
+ " ld1 {v16.4h, v17.4h, v18.4h, v19.4h}, [%[b]], #32\n"
+ " ld1 {v20.4h, v21.4h, v22.4h, v23.4h}, [%[a]], #32\n"
+ " subs %w[len], %w[len], #16\n"
+ " smull v0.4s, v16.4h, v20.4h\n"
+ " smlal v0.4s, v17.4h, v21.4h\n"
+ " smlal v0.4s, v18.4h, v22.4h\n"
+ " smlal v0.4s, v19.4h, v23.4h\n"
+ " b.eq 3f\n"
+ "2:"
+ " ld1 {v16.4h, v17.4h, v18.4h, v19.4h}, [%[b]], #32\n"
+ " ld1 {v20.4h, v21.4h, v22.4h, v23.4h}, [%[a]], #32\n"
+ " subs %w[len], %w[len], #16\n"
+ " smlal v0.4s, v16.4h, v20.4h\n"
+ " smlal v0.4s, v17.4h, v21.4h\n"
+ " smlal v0.4s, v18.4h, v22.4h\n"
+ " smlal v0.4s, v19.4h, v23.4h\n"
+ " b.ne 2b\n"
+ "3:"
+ " cmp %w[remainder], #0\n"
+ " b.eq 5f\n"
+ "4:"
+ " ld1 {v18.4h}, [%[b]], #8\n"
+ " ld1 {v22.4h}, [%[a]], #8\n"
+ " subs %w[remainder], %w[remainder], #4\n"
+ " smlal v0.4s, v18.4h, v22.4h\n"
+ " b.ne 4b\n"
+ "5:"
+ " saddlv d0, v0.4s\n"
+ " sqxtn s0, d0\n"
+ " sqrshrn h0, s0, #15\n"
+ " sxtl v0.4s, v0.4h\n"
+ " fmov %w[ret], s0\n"
+ : [ret] "=r" (ret), [a] "+r" (a), [b] "+r" (b),
+ [len] "+r" (len), [remainder] "+r" (remainder)
+ :
+ : "cc", "v0",
+ "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23");
+ return ret;
+}
+#else
static inline int32_t inner_product_single(const int16_t *a, const int16_t *b, unsigned int len)
{
int32_t ret;
@@ -112,33 +178,104 @@ static inline int32_t inner_product_single(const int16_t *a, const int16_t *b, u
" vqmovn.s64 d0, q0\n"
" vqrshrn.s32 d0, q0, #15\n"
" vmov.s16 %[ret], d0[0]\n"
- : [ret] "=&r" (ret), [a] "+r" (a), [b] "+r" (b),
+ : [ret] "=r" (ret), [a] "+r" (a), [b] "+r" (b),
[len] "+r" (len), [remainder] "+r" (remainder)
:
: "cc", "q0",
- "d16", "d17", "d18", "d19",
- "d20", "d21", "d22", "d23");
+ "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23");
return ret;
}
-#elif defined(FLOATING_POINT)
+#endif // !defined(__aarch64__)
+#elif defined(FLOATING_POINT)
+#if defined(__aarch64__)
+static inline int32_t saturate_float_to_16bit(float a) {
+ int32_t ret;
+ asm ("fcvtas s1, %s[a]\n"
+ "sqxtn h1, s1\n"
+ "sxtl v1.4s, v1.4h\n"
+ "fmov %w[ret], s1\n"
+ : [ret] "=r" (ret)
+ : [a] "w" (a)
+ : "v1");
+ return ret;
+}
+#else
static inline int32_t saturate_float_to_16bit(float a) {
int32_t ret;
asm ("vmov.f32 d0[0], %[a]\n"
"vcvt.s32.f32 d0, d0, #15\n"
"vqrshrn.s32 d0, q0, #15\n"
"vmov.s16 %[ret], d0[0]\n"
- : [ret] "=&r" (ret)
+ : [ret] "=r" (ret)
: [a] "r" (a)
: "q0");
return ret;
}
+#endif
+
#undef WORD2INT
#define WORD2INT(x) (saturate_float_to_16bit(x))
#define OVERRIDE_INNER_PRODUCT_SINGLE
-/* Only works when len % 4 == 0 */
+/* Only works when len % 4 == 0 and len >= 4 */
+#if defined(__aarch64__)
+static inline float inner_product_single(const float *a, const float *b, unsigned int len)
+{
+ float ret;
+ uint32_t remainder = len % 16;
+ len = len - remainder;
+
+ asm volatile (" cmp %w[len], #0\n"
+ " b.ne 1f\n"
+ " ld1 {v16.4s}, [%[b]], #16\n"
+ " ld1 {v20.4s}, [%[a]], #16\n"
+ " subs %w[remainder], %w[remainder], #4\n"
+ " fmul v1.4s, v16.4s, v20.4s\n"
+ " b.ne 4f\n"
+ " b 5f\n"
+ "1:"
+ " ld1 {v16.4s, v17.4s, v18.4s, v19.4s}, [%[b]], #64\n"
+ " ld1 {v20.4s, v21.4s, v22.4s, v23.4s}, [%[a]], #64\n"
+ " subs %w[len], %w[len], #16\n"
+ " fmul v1.4s, v16.4s, v20.4s\n"
+ " fmul v2.4s, v17.4s, v21.4s\n"
+ " fmul v3.4s, v18.4s, v22.4s\n"
+ " fmul v4.4s, v19.4s, v23.4s\n"
+ " b.eq 3f\n"
+ "2:"
+ " ld1 {v16.4s, v17.4s, v18.4s, v19.4s}, [%[b]], #64\n"
+ " ld1 {v20.4s, v21.4s, v22.4s, v23.4s}, [%[a]], #64\n"
+ " subs %w[len], %w[len], #16\n"
+ " fmla v1.4s, v16.4s, v20.4s\n"
+ " fmla v2.4s, v17.4s, v21.4s\n"
+ " fmla v3.4s, v18.4s, v22.4s\n"
+ " fmla v4.4s, v19.4s, v23.4s\n"
+ " b.ne 2b\n"
+ "3:"
+ " fadd v16.4s, v1.4s, v2.4s\n"
+ " fadd v17.4s, v3.4s, v4.4s\n"
+ " cmp %w[remainder], #0\n"
+ " fadd v1.4s, v16.4s, v17.4s\n"
+ " b.eq 5f\n"
+ "4:"
+ " ld1 {v18.4s}, [%[b]], #16\n"
+ " ld1 {v22.4s}, [%[a]], #16\n"
+ " subs %w[remainder], %w[remainder], #4\n"
+ " fmla v1.4s, v18.4s, v22.4s\n"
+ " b.ne 4b\n"
+ "5:"
+ " faddp v1.4s, v1.4s, v1.4s\n"
+ " faddp %[ret].4s, v1.4s, v1.4s\n"
+ : [ret] "=w" (ret), [a] "+r" (a), [b] "+r" (b),
+ [len] "+r" (len), [remainder] "+r" (remainder)
+ :
+ : "cc", "v1", "v2", "v3", "v4",
+ "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23");
+ return ret;
+}
+#else
static inline float inner_product_single(const float *a, const float *b, unsigned int len)
{
float ret;
@@ -191,11 +328,12 @@ static inline float inner_product_single(const float *a, const float *b, unsigne
" vadd.f32 d0, d0, d1\n"
" vpadd.f32 d0, d0, d0\n"
" vmov.f32 %[ret], d0[0]\n"
- : [ret] "=&r" (ret), [a] "+r" (a), [b] "+r" (b),
+ : [ret] "=r" (ret), [a] "+r" (a), [b] "+r" (b),
[len] "+l" (len), [remainder] "+l" (remainder)
:
- : "cc", "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8",
- "q9", "q10", "q11");
+ : "cc", "q0", "q1", "q2", "q3",
+ "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11");
return ret;
}
+#endif // defined(__aarch64__)
#endif
diff --git a/libspeexdsp/resample_sse.h b/libspeexdsp/resample_sse.h
index 64be8a1..00dc294 100644
--- a/libspeexdsp/resample_sse.h
+++ b/libspeexdsp/resample_sse.h
@@ -9,18 +9,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -71,7 +71,7 @@ static inline float interpolate_product_single(const float *a, const float *b, u
return ret;
}
-#ifdef _USE_SSE2
+#ifdef USE_SSE2
#include <emmintrin.h>
#define OVERRIDE_INNER_PRODUCT_DOUBLE
diff --git a/libspeexdsp/scal.c b/libspeexdsp/scal.c
index d2ea59c..807cb51 100644
--- a/libspeexdsp/scal.c
+++ b/libspeexdsp/scal.c
@@ -33,8 +33,8 @@
/*
The algorithm implemented here is described in:
-* J.-M. Valin, Perceptually-Motivated Nonlinear Channel Decorrelation For
- Stereo Acoustic Echo Cancellation, Accepted for Joint Workshop on
+* J.-M. Valin, Perceptually-Motivated Nonlinear Channel Decorrelation For
+ Stereo Acoustic Echo Cancellation, Accepted for Joint Workshop on
Hands­free Speech Communication and Microphone Arrays (HSCMA), 2008.
http://people.xiph.org/~jm/papers/valin_hscma2008.pdf
@@ -71,7 +71,7 @@ struct SpeexDecorrState_ {
float *vorbis_win;
int seed;
float *y;
-
+
/* Per-channel stuff */
float *buff;
float (*ring)[ALLPASS_ORDER];
@@ -102,13 +102,13 @@ EXPORT SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame
st->order = speex_alloc(channels*sizeof(int));
st->alpha = speex_alloc(channels*sizeof(float));
st->ring = speex_alloc(channels*ALLPASS_ORDER*sizeof(float));
-
+
/*FIXME: The +20 is there only as a kludge for ALL_PASS_OLA*/
st->vorbis_win = speex_alloc((2*frame_size+20)*sizeof(float));
for (i=0;i<2*frame_size;i++)
st->vorbis_win[i] = sin(.5*M_PI* sin(M_PI*i/(2*frame_size))*sin(M_PI*i/(2*frame_size)) );
st->seed = rand();
-
+
for (ch=0;ch<channels;ch++)
{
for (i=0;i<ALLPASS_ORDER;i++)
@@ -142,12 +142,12 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
{
int ch;
float amount;
-
+
if (strength<0)
strength = 0;
if (strength>100)
strength = 100;
-
+
amount = .01*strength;
for (ch=0;ch<st->channels;ch++)
{
@@ -156,7 +156,7 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
float beta, beta2;
float *x;
float max_alpha = 0;
-
+
float *buff;
float *ring;
int ringID;
@@ -168,7 +168,7 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
ringID = st->ringID[ch];
order = st->order[ch];
alpha = st->alpha[ch];
-
+
for (i=0;i<st->frame_size;i++)
buff[i] = buff[i+st->frame_size];
for (i=0;i<st->frame_size;i++)
@@ -182,12 +182,12 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
beta = 1-0.63246*amount;
if (beta<0)
beta = 0;
-
+
beta2 = beta;
for (i=0;i<st->frame_size;i++)
{
- st->y[i] = alpha*(x[i-ALLPASS_ORDER+order]-beta*x[i-ALLPASS_ORDER+order-1])*st->vorbis_win[st->frame_size+i+order]
- + x[i-ALLPASS_ORDER]*st->vorbis_win[st->frame_size+i]
+ st->y[i] = alpha*(x[i-ALLPASS_ORDER+order]-beta*x[i-ALLPASS_ORDER+order-1])*st->vorbis_win[st->frame_size+i+order]
+ + x[i-ALLPASS_ORDER]*st->vorbis_win[st->frame_size+i]
- alpha*(ring[ringID]
- beta*ring[ringID+1>=order?0:ringID+1]);
ring[ringID++]=st->y[i];
@@ -204,7 +204,7 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
max_alpha = pow(.96+.04*(amount-1),order);
if (max_alpha > .98/(1.+beta2))
max_alpha = .98/(1.+beta2);
-
+
alpha = alpha + .4*uni_rand(&st->seed);
if (alpha > max_alpha)
alpha = max_alpha;
@@ -215,8 +215,8 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
ringID = 0;
for (i=0;i<st->frame_size;i++)
{
- float tmp = alpha*(x[i-ALLPASS_ORDER+order]-beta*x[i-ALLPASS_ORDER+order-1])*st->vorbis_win[i+order]
- + x[i-ALLPASS_ORDER]*st->vorbis_win[i]
+ float tmp = alpha*(x[i-ALLPASS_ORDER+order]-beta*x[i-ALLPASS_ORDER+order-1])*st->vorbis_win[i+order]
+ + x[i-ALLPASS_ORDER]*st->vorbis_win[i]
- alpha*(ring[ringID]
- beta*ring[ringID+1>=order?0:ringID+1]);
ring[ringID++]=tmp;
@@ -225,7 +225,7 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
ringID=0;
st->y[i] += tmp;
}
-
+
#ifdef VORBIS_PSYCHO
float frame[N];
float scale = 1./N;
@@ -252,7 +252,7 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
for (i=0;i<2*st->frame_size;i++)
frame[i] *= st->vorbis_win[i];
#endif
-
+
for (i=0;i<st->frame_size;i++)
{
#ifdef VORBIS_PSYCHO
@@ -267,7 +267,7 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
tmp = -32767;
out[i*st->channels+ch] = tmp;
}
-
+
st->ringID[ch] = ringID;
st->order[ch] = order;
st->alpha[ch] = alpha;
diff --git a/libspeexdsp/smallft.c b/libspeexdsp/smallft.c
index 5c26d01..82c3b0a 100644
--- a/libspeexdsp/smallft.c
+++ b/libspeexdsp/smallft.c
@@ -127,7 +127,7 @@ static void dradf2(int ido,int l1,float *cc,float *ch,float *wa1){
t1+=ido;
t2+=ido;
}
-
+
if(ido<2)return;
if(ido==2)goto L105;
@@ -174,7 +174,7 @@ static void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
int i,k,t0,t1,t2,t3,t4,t5,t6;
float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
t0=l1*ido;
-
+
t1=t0;
t4=t1<<1;
t2=t1+(t1<<1);
@@ -246,7 +246,7 @@ static void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
if(ido&1)return;
L105:
-
+
t2=(t1=t0+ido-1)+(t0<<1);
t3=ido<<2;
t4=ido;
@@ -280,7 +280,7 @@ static void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
int nbd;
float dcp,arg,dsp,ar1h,ar2h;
int idp2,ipp2;
-
+
arg=tpi/(float)ip;
dcp=cos(arg);
dsp=sin(arg);
@@ -638,7 +638,7 @@ static void dradb2(int ido,int l1,float *cc,float *ch,float *wa1){
float ti2,tr2;
t0=l1*ido;
-
+
t1=0;
t2=0;
t3=(ido<<1)-1;
@@ -754,7 +754,7 @@ static void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8;
float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
t0=l1*ido;
-
+
t1=0;
t2=ido<<2;
t3=0;
@@ -763,7 +763,7 @@ static void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
t4=t3+t6;
t5=t1;
tr3=cc[t4-1]+cc[t4-1];
- tr4=cc[t4]+cc[t4];
+ tr4=cc[t4]+cc[t4];
tr1=cc[t3]-cc[(t4+=t6)-1];
tr2=cc[t3]+cc[t4-1];
ch[t5]=tr2+tr3;
@@ -858,7 +858,7 @@ static void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
ipp2=ip;
ipph=(ip+1)>>1;
if(ido<l1)goto L103;
-
+
t1=0;
t2=0;
for(k=0;k<l1;k++){
diff --git a/libspeexdsp/stack_alloc.h b/libspeexdsp/stack_alloc.h
deleted file mode 100644
index 5264e66..0000000
--- a/libspeexdsp/stack_alloc.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Copyright (C) 2002 Jean-Marc Valin */
-/**
- @file stack_alloc.h
- @brief Temporary memory allocation on stack
-*/
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- - Neither the name of the Xiph.org Foundation nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef STACK_ALLOC_H
-#define STACK_ALLOC_H
-
-#ifdef USE_ALLOCA
-# ifdef WIN32
-# include <malloc.h>
-# else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# include <stdlib.h>
-# endif
-# endif
-#endif
-
-/**
- * @def ALIGN(stack, size)
- *
- * Aligns the stack to a 'size' boundary
- *
- * @param stack Stack
- * @param size New size boundary
- */
-
-/**
- * @def PUSH(stack, size, type)
- *
- * Allocates 'size' elements of type 'type' on the stack
- *
- * @param stack Stack
- * @param size Number of elements
- * @param type Type of element
- */
-
-/**
- * @def VARDECL(var)
- *
- * Declare variable on stack
- *
- * @param var Variable to declare
- */
-
-/**
- * @def ALLOC(var, size, type)
- *
- * Allocate 'size' elements of 'type' on stack
- *
- * @param var Name of variable to allocate
- * @param size Number of elements
- * @param type Type of element
- */
-
-#ifdef ENABLE_VALGRIND
-
-#include <valgrind/memcheck.h>
-
-#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
-
-#define PUSH(stack, size, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),ALIGN((stack),sizeof(type)),VALGRIND_MAKE_WRITABLE(stack, ((size)*sizeof(type))),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
-
-#else
-
-#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
-
-#define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
-
-#endif
-
-#if defined(VAR_ARRAYS)
-#define VARDECL(var)
-#define ALLOC(var, size, type) type var[size]
-#elif defined(USE_ALLOCA)
-#define VARDECL(var) var
-#define ALLOC(var, size, type) var = alloca(sizeof(type)*(size))
-#else
-#define VARDECL(var) var
-#define ALLOC(var, size, type) var = PUSH(stack, size, type)
-#endif
-
-
-#endif
diff --git a/libspeexdsp/testjitter.c b/libspeexdsp/testjitter.c
index 557c5c3..399dfe9 100644
--- a/libspeexdsp/testjitter.c
+++ b/libspeexdsp/testjitter.c
@@ -13,7 +13,7 @@ union jbpdata {
void synthIn(JitterBufferPacket *in, int idx, int span) {
union jbpdata d;
d.idx = idx;
-
+
in->data = d.data;
in->len = sizeof(d);
in->timestamp = idx * 10;
@@ -28,13 +28,13 @@ void jitterFill(JitterBuffer *jb) {
int i;
out.data = buffer;
-
+
jitter_buffer_reset(jb);
for(i=0;i<100;++i) {
synthIn(&in, i, 1);
jitter_buffer_put(jb, &in);
-
+
out.len = 65536;
if (jitter_buffer_get(jb, &out, 10, NULL) != JITTER_BUFFER_OK) {
printf("Fill test failed iteration %d\n", i);
@@ -51,11 +51,11 @@ int main()
char buffer[65536];
JitterBufferPacket in, out;
int i;
-
+
JitterBuffer *jb = jitter_buffer_init(10);
-
+
out.data = buffer;
-
+
/* Frozen sender case */
jitterFill(jb);
for(i=0;i<100;++i) {
diff --git a/libspeexdsp/testresample.c b/libspeexdsp/testresample.c
index 1681e52..7ed8667 100644
--- a/libspeexdsp/testresample.c
+++ b/libspeexdsp/testresample.c
@@ -1,5 +1,5 @@
/* Copyright (C) 2007 Jean-Marc Valin
-
+
File: testresample.c
Testing the resampling code
@@ -51,7 +51,7 @@ int main()
SpeexResamplerState *st = speex_resampler_init(1, 8000, 12000, 10, NULL);
speex_resampler_set_rate(st, 96000, 44100);
speex_resampler_skip_zeros(st);
-
+
in = malloc(NN*sizeof(short));
out = malloc(2*NN*sizeof(short));
fin = malloc(NN*sizeof(float));
diff --git a/libspeexdsp/testresample2 b/libspeexdsp/testresample2
new file mode 100755
index 0000000..3e7f020
--- /dev/null
+++ b/libspeexdsp/testresample2
@@ -0,0 +1,210 @@
+#! /bin/sh
+
+# testresample2 - temporary wrapper script for .libs/testresample2
+# Generated by libtool (GNU libtool) 2.4.7 Debian-2.4.7-5
+#
+# The testresample2 program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=""
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='2.4.7'
+ notinst_deplibs=' libspeexdsp.la'
+else
+ # When we are sourced in execute mode, $file and $ECHO are already set.
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ file="$0"
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+ ECHO="printf %s\\n"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ that is used only on
+# windows platforms, and (c) all begin with the string --lt-
+# (application programs are unlikely to have options that match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's ../libtool value, followed by no.
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=$0
+ shift
+ for lt_opt
+ do
+ case "$lt_opt" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'`
+ test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=.
+ lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'`
+ cat "$lt_dump_D/$lt_dump_F"
+ exit 0
+ ;;
+ --lt-*)
+ $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n "$lt_option_debug"; then
+ echo "testresample2:testresample2:$LINENO: libtool wrapper (GNU libtool) 2.4.7 Debian-2.4.7-5" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ $ECHO "testresample2:testresample2:$LINENO: newargv[$lt_dump_args_N]: $lt_arg"
+ lt_dump_args_N=`expr $lt_dump_args_N + 1`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+
+ if test -n "$lt_option_debug"; then
+ $ECHO "testresample2:testresample2:$LINENO: newargv[0]: $progdir/$program" 1>&2
+ func_lt_dump_args ${1+"$@"} 1>&2
+ fi
+ exec "$progdir/$program" ${1+"$@"}
+
+ $ECHO "$0: cannot exec $program $*" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from $@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case " $* " in
+ *\ --lt-*)
+ for lt_wr_arg
+ do
+ case $lt_wr_arg in
+ --lt-*) ;;
+ *) set x "$@" "$lt_wr_arg"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core ${1+"$@"}
+}
+
+ # Parse options
+ func_parse_lt_options "$0" ${1+"$@"}
+
+ # Find the directory that this script lives in.
+ thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
+ test "x$thisdir" = "x$file" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
+ while test -n "$file"; do
+ destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
+
+ # If there was a directory component, then change thisdir.
+ if test "x$destdir" != "x$file"; then
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+ *) thisdir="$thisdir/$destdir" ;;
+ esac
+ fi
+
+ file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'`
+ file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
+ if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
+ # special case for '.'
+ if test "$thisdir" = "."; then
+ thisdir=`pwd`
+ fi
+ # remove .libs from thisdir
+ case "$thisdir" in
+ *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;;
+ .libs ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=`cd "$thisdir" && pwd`
+ test -n "$absdir" && thisdir="$absdir"
+
+ program='testresample2'
+ progdir="$thisdir/.libs"
+
+
+ if test -f "$progdir/$program"; then
+ # Add our own library path to LD_LIBRARY_PATH
+ LD_LIBRARY_PATH="/usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/libspeexdsp/.libs:$LD_LIBRARY_PATH"
+
+ # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'`
+
+ export LD_LIBRARY_PATH
+
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ # Run the actual program with our arguments.
+ func_exec_program ${1+"$@"}
+ fi
+ else
+ # The program doesn't exist.
+ $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2
+ $ECHO "This script is just a wrapper for $program." 1>&2
+ $ECHO "See the libtool documentation for more information." 1>&2
+ exit 1
+ fi
+fi
diff --git a/libspeexdsp/testresample2.c b/libspeexdsp/testresample2.c
new file mode 100644
index 0000000..99a830d
--- /dev/null
+++ b/libspeexdsp/testresample2.c
@@ -0,0 +1,93 @@
+/* Copyright (C) 2007 Jean-Marc Valin
+
+ File: testresample2.c
+ Testing the resampling code
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "speex/speex_resampler.h"
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+#define PERIOD 32
+#define INBLOCK 1024
+#define RATE 48000
+
+int main()
+{
+ spx_uint32_t i;
+ float *fin, *fout;
+ int rate = 1000, off = 0, avail = INBLOCK;
+ SpeexResamplerState *st = speex_resampler_init(1, RATE, RATE, 4, NULL);
+ speex_resampler_set_rate(st, RATE, rate);
+ speex_resampler_skip_zeros(st);
+
+ fin = malloc(INBLOCK*2*sizeof(float));
+ for (i=0; i<INBLOCK*2;i++)
+ fin[i] = sinf ((float)i/PERIOD * 2 * M_PI) * 0.9;
+
+ fout = malloc(INBLOCK*4*sizeof(float));
+
+ while (1)
+ {
+ spx_uint32_t in_len;
+ spx_uint32_t out_len;
+
+ in_len = avail;
+ out_len = (in_len * rate + RATE-1) / RATE;
+
+ fprintf (stderr, "%d %d %d %d -> ", rate, off, in_len, out_len);
+
+ speex_resampler_process_float(st, 0, fin + off, &in_len, fout, &out_len);
+
+ fprintf (stderr, "%d %d\n", in_len, out_len);
+ off += in_len;
+ avail = avail - in_len + INBLOCK;
+
+ if (off >= INBLOCK)
+ off -= INBLOCK;
+
+ fwrite(fout, sizeof(float), out_len, stdout);
+
+ rate += 100;
+ if (rate > 128000)
+ break;
+
+ speex_resampler_set_rate(st, RATE, rate);
+ }
+ speex_resampler_destroy(st);
+ free(fin);
+ free(fout);
+ return 0;
+}
+
diff --git a/libspeexdsp/vorbis_psy.h b/libspeexdsp/vorbis_psy.h
index 6871057..19ea9c3 100644
--- a/libspeexdsp/vorbis_psy.h
+++ b/libspeexdsp/vorbis_psy.h
@@ -4,18 +4,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -40,7 +40,7 @@
#define todB(x) ((x)>1e-13?log((x)*(x))*4.34294480f:-30)
-#define fromdB(x) (exp((x)*.11512925f))
+#define fromdB(x) (exp((x)*.11512925f))
/* The bark scale equations are approximations, since the original
table was somewhat hand rolled. The below are chosen to have the
diff --git a/symbian/Makefile b/symbian/Makefile
index c8b4982..dbb239d 100644
--- a/symbian/Makefile
+++ b/symbian/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/symbian
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/symbian
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/symbian/Makefile.in b/symbian/Makefile.in
index a26e984..27d6045 100644
--- a/symbian/Makefile.in
+++ b/symbian/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/ti/Makefile b/ti/Makefile
index 1ffc4a2..be3f8be 100644
--- a/ti/Makefile
+++ b/ti/Makefile
@@ -216,6 +216,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -244,10 +245,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -260,11 +261,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/ti
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/ti
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/ti/Makefile.in b/ti/Makefile.in
index 8d4db8a..9be9d5b 100644
--- a/ti/Makefile.in
+++ b/ti/Makefile.in
@@ -216,6 +216,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/ti/config.h b/ti/config.h
index da4834c..0957472 100644
--- a/ti/config.h
+++ b/ti/config.h
@@ -6,18 +6,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -37,7 +37,7 @@
#define EXPORT
/* Disable DC block if doing SNR testing */
-#define DISABLE_HIGHPASS
+#define DISABLE_HIGHPASS
/* Allow for 2 20ms narrowband blocks per frame, plus a couple of bytes */
#define MAX_CHARS_PER_FRAME (42/BYTES_PER_CHAR)
@@ -55,7 +55,7 @@
//#undef MANUAL_ALLOC
//#undef OS_SUPPORT_CUSTOM
-#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
+#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
//#define PRECISION16
// These values determined by analysis for 8kbps narrowband
diff --git a/ti/os_support_custom.h b/ti/os_support_custom.h
index 95dd679..d88249e 100644
--- a/ti/os_support_custom.h
+++ b/ti/os_support_custom.h
@@ -1,23 +1,23 @@
/* Copyright (C) 2007 Psi Systems, Inc.
- Author: Jean-Marc Valin
+ Author: Jean-Marc Valin
File: os_support_custom.h
Memory Allocation overrides to allow user control rather than C alloc/free.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -33,20 +33,20 @@
#ifdef MANUAL_ALLOC
-/* To avoid changing the Speex call model, this file relies on four static variables
- The user main creates two linear buffers, and initializes spxGlobalHeap/ScratchPtr
- to point to the start of the two buffers, and initializes spxGlobalHeap/ScratchEnd
+/* To avoid changing the Speex call model, this file relies on four static variables
+ The user main creates two linear buffers, and initializes spxGlobalHeap/ScratchPtr
+ to point to the start of the two buffers, and initializes spxGlobalHeap/ScratchEnd
to point to the first address following the last byte of the two buffers.
-
- This mechanism allows, for example, data caching for multichannel applications,
- where the Speex state is swapped from a large slow memory to a small fast memory
+
+ This mechanism allows, for example, data caching for multichannel applications,
+ where the Speex state is swapped from a large slow memory to a small fast memory
each time the codec runs.
-
+
Persistent data is allocated in spxGlobalHeap (instead of calloc), while scratch
data is allocated in spxGlobalScratch.
*/
-extern char *spxGlobalHeapPtr, *spxGlobalHeapEnd;
+extern char *spxGlobalHeapPtr, *spxGlobalHeapEnd;
extern char *spxGlobalScratchPtr, *spxGlobalScratchEnd;
/* Make sure that all structures are aligned to largest type */
@@ -57,19 +57,19 @@ extern inline void speex_warning(const char *str);
static inline void *speex_alloc (int size)
{
void *ptr;
-
+
ptr = (void *) (((int)spxGlobalHeapPtr + BLOCK_MASK) & ~BLOCK_MASK); //Start on 8 boundary
spxGlobalHeapPtr = (char *)((int)ptr + size); // Update pointer to next free location
- if (spxGlobalHeapPtr > spxGlobalHeapEnd )
+ if (spxGlobalHeapPtr > spxGlobalHeapEnd )
{
#ifdef VERBOSE_ALLOC
fprintf (stderr, "insufficient space for persistent alloc request %d bytes\n", size);
#endif
return 0;
}
-
+
#ifdef VERBOSE_ALLOC
fprintf (stderr, "Persist Allocated %d chars at %x, %d remaining\n", size, ptr, ((int)spxGlobalHeapEnd - (int)spxGlobalHeapPtr));
#endif
@@ -86,14 +86,14 @@ static inline void *speex_alloc_scratch (int size)
spxGlobalScratchPtr = (char *)((int)ptr + size); // Update pointer to next free location
- if (spxGlobalScratchPtr > spxGlobalScratchEnd )
+ if (spxGlobalScratchPtr > spxGlobalScratchEnd )
{
#ifdef VERBOSE_ALLOC
fprintf (stderr, "insufficient space for scratch alloc request %d bytes\n", size);
#endif
return 0;
}
-
+
#ifdef VERBOSE_ALLOC
fprintf (stderr, "Scratch Allocated %d chars at %x, %d remaining\n", size, ptr, ((int)spxGlobalScratchEnd - (int)spxGlobalScratchPtr));
#endif
diff --git a/ti/speex_C54_test/Makefile b/ti/speex_C54_test/Makefile
index ce30f94..14569c8 100644
--- a/ti/speex_C54_test/Makefile
+++ b/ti/speex_C54_test/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/ti/speex_C54_test
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/ti/speex_C54_test
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/ti/speex_C54_test/Makefile.in b/ti/speex_C54_test/Makefile.in
index 8e2009f..22bf39f 100644
--- a/ti/speex_C54_test/Makefile.in
+++ b/ti/speex_C54_test/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/ti/speex_C55_test/Makefile b/ti/speex_C55_test/Makefile
index d1606d0..f6b7f95 100644
--- a/ti/speex_C55_test/Makefile
+++ b/ti/speex_C55_test/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/ti/speex_C55_test
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/ti/speex_C55_test
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/ti/speex_C55_test/Makefile.in b/ti/speex_C55_test/Makefile.in
index 4a72ff1..9660d9a 100644
--- a/ti/speex_C55_test/Makefile.in
+++ b/ti/speex_C55_test/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/ti/speex_C64_test/Makefile b/ti/speex_C64_test/Makefile
index 5fcdddb..87018ff 100644
--- a/ti/speex_C64_test/Makefile
+++ b/ti/speex_C64_test/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/ti/speex_C64_test
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/ti/speex_C64_test
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/ti/speex_C64_test/Makefile.in b/ti/speex_C64_test/Makefile.in
index a75313e..3334e60 100644
--- a/ti/speex_C64_test/Makefile.in
+++ b/ti/speex_C64_test/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/tmv/_kiss_fft_guts_tm.h b/tmv/_kiss_fft_guts_tm.h
index 9cf2864..55c3049 100644
--- a/tmv/_kiss_fft_guts_tm.h
+++ b/tmv/_kiss_fft_guts_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/tmv/config.h b/tmv/config.h
index 0b68fb8..ea7abe1 100644
--- a/tmv/config.h
+++ b/tmv/config.h
@@ -19,23 +19,23 @@
#define TM_DEBUGMEM_ALIGNNMENT 1
-#define TM_PROFILE 1
-#define TM_PROFILE_FIRMEM16 0
-#define TM_PROFILE_IIRMEM16 0
-#define TM_PROFILE_FILTERMEM16 0
-#define TM_PROFILE_VQNBEST 0
-#define TM_PROFILE_VQNBESTSIGN 0
-#define TM_PROFILE_COMPUTEQUANTWEIGHTS 0
-#define TM_PROFILE_LSPQUANT 0
+#define TM_PROFILE 1
+#define TM_PROFILE_FIRMEM16 0
+#define TM_PROFILE_IIRMEM16 0
+#define TM_PROFILE_FILTERMEM16 0
+#define TM_PROFILE_VQNBEST 0
+#define TM_PROFILE_VQNBESTSIGN 0
+#define TM_PROFILE_COMPUTEQUANTWEIGHTS 0
+#define TM_PROFILE_LSPQUANT 0
#define TM_PROFILE_LSPWEIGHTQUANT 0
#define TM_PROFILE_LSPENFORCEMARGIN 0
#define TM_PROFILE_LSPTOLPC 0
-#define TM_PROFILE_INNERPROD 0
-#define TM_PROFILE_PITCHXCORR 0
-#define TM_PROFILE_LSP_INTERPOLATE 0
-#define TM_PROFILE_CHEBPOLYEVA 0
-#define TM_PROFILE_COMPUTEWEIGHTEDCODEBOOK 0
-#define TM_PROFILE_TARGETUPDATE 0
+#define TM_PROFILE_INNERPROD 0
+#define TM_PROFILE_PITCHXCORR 0
+#define TM_PROFILE_LSP_INTERPOLATE 0
+#define TM_PROFILE_CHEBPOLYEVA 0
+#define TM_PROFILE_COMPUTEWEIGHTEDCODEBOOK 0
+#define TM_PROFILE_TARGETUPDATE 0
#define TM_PROFILE_SPXAUTOCORR 0
#define TM_PROFILE_COMPUTEPITCHERROR 0
#define TM_PROFILE_COMPUTERMS16 0
diff --git a/tmv/fftwrap_tm.h b/tmv/fftwrap_tm.h
index 39d924e..488a8d2 100644
--- a/tmv/fftwrap_tm.h
+++ b/tmv/fftwrap_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -59,12 +59,12 @@ static int maximize_range(Int16 *in, Int16 *out, int bound, int len)
x32 = ld32x(in,i+1);
x54 = ld32x(in,i+2);
x76 = ld32x(in,i+3);
-
+
x10 = dspidualabs(x10);
x32 = dspidualabs(x32);
x54 = dspidualabs(x54);
x76 = dspidualabs(x76);
-
+
x10 = imax(sex16(x10), asri(16,x10));
x32 = imax(sex16(x32), asri(16,x32));
x54 = imax(sex16(x54), asri(16,x54));
@@ -101,7 +101,7 @@ static int maximize_range(Int16 *in, Int16 *out, int bound, int len)
st32d(j+4,out,x32);
st32d(j+8,out,x54);
st32d(j+12,out,x76);
- }
+ }
}
MAXIMIZERANGE_STOP();
@@ -157,7 +157,7 @@ static void renorm_range(Int16 *in, Int16 *out, int shift, int len)
#endif
-#ifdef USE_COMPACT_KISS_FFT
+#ifdef USE_COMPACT_KISS_FFT
#ifdef FIXED_POINT
#define OVERRIDE_POWER_SPECTRUM
@@ -175,9 +175,9 @@ void power_spectrum(const spx_word16_t *X, spx_word32_t *ps, int N)
x76 = 0;
ps[0] = MULT16_16(X[0],X[0]);
N >>= 1;
-
+
for( i=1 ; i<N ; i+=4 )
- {
+ {
x10 = ld32x(x, i);
x32 = ld32x(x, i+1);
x54 = ld32x(x, i+2);
@@ -202,7 +202,7 @@ void power_spectrum(const float * restrict X, float * restrict ps, int N)
{
register int i, j;
register float xx;
-
+
POWERSPECTRUM_START();
xx = X[0];
@@ -216,7 +216,7 @@ void power_spectrum(const float * restrict X, float * restrict ps, int N)
xi = X[i];
xii = X[i+1];
-
+
ps[j] = MULT16_16(xi,xi) + MULT16_16(xii,xii);
}
#pragma TCS_unrollexact=0
diff --git a/tmv/filterbank_tm.h b/tmv/filterbank_tm.h
index 39d2332..e739c66 100644
--- a/tmv/filterbank_tm.h
+++ b/tmv/filterbank_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -42,7 +42,7 @@ void filterbank_compute_bank32(FilterBank * restrict bank, spx_word32_t * restri
{
register int i, j, k, banks, len, zero, s;
register int * restrict left;
- register int * restrict right;
+ register int * restrict right;
register int * restrict bleft;
register int * restrict bright;
@@ -82,14 +82,14 @@ void filterbank_compute_bank32(FilterBank * restrict bank, spx_word32_t * restri
#pragma TCS_unrollexact=1
#endif
for ( i=0,j=1,k=0 ; i<len ; i+=2,j+=2,++k )
- { register int ps1, ps0, _mel, ps0_msb, ps0_lsb, ps1_msb, ps1_lsb;
+ { register int ps1, ps0, _mel, ps0_msb, ps0_lsb, ps1_msb, ps1_lsb;
register int left10, right10, left1, left0, right1, right0;
register int il1, ir1, il0, ir0;
ps0 = ld32x(ps,i);
il0 = ld32x(bleft,i);
_mel = ld32x(mel,il0);
- left10 = ld32x(left,k);
+ left10 = ld32x(left,k);
ir0 = ld32x(bright,i);
right10 = ld32x(right,k);
@@ -133,7 +133,7 @@ void filterbank_compute_psd16(FilterBank * restrict bank, spx_word16_t * restric
{
register int i, j, k, len, s;
register int * restrict left;
- register int * restrict right;
+ register int * restrict right;
register int * restrict bleft;
register int * restrict bright;
@@ -169,28 +169,28 @@ void filterbank_compute_psd16(FilterBank * restrict bank, spx_word16_t * restric
il0 = ld32x(bleft, i);
ir0 = ld32x(bright,i);
- mell0 = mel[il0];
+ mell0 = mel[il0];
melr0 = mel[ir0];
left10 = ld32x(left, k);
right10 = ld32x(right, k);
mel0 = pack16lsb(mell0, melr0);
lr0 = pack16lsb(left10, right10);
-
+
acc0 += ifir16(mel0, lr0);
acc0 >>= 15;
-
+
il1 = ld32x(bleft, i+1);
ir1 = ld32x(bright,i+1);
mell1 = mel[il1];
melr1 = mel[ir1];
mel1 = pack16lsb(mell1, melr1);
lr1 = pack16msb(left10, right10);
-
+
acc1 += ifir16(mel1, lr1);
acc1 >>= 15;
ps10 = pack16lsb(acc1, acc0);
-
+
st32d(j, ps, ps10);
}
#if (TM_UNROLL && TM_UNROLL_FILTERBANKCOMPUTEPSD16)
@@ -233,7 +233,7 @@ void filterbank_compute_bank32(FilterBank * restrict bank, float * restrict ps,
id1 = bleft[i];
id2 = bright[i];
psi = ps[i];
-
+
mel[id1] += left[i] * psi;
mel[id2] += right[i] * psi;
}
@@ -274,7 +274,7 @@ void filterbank_compute_psd16(FilterBank * restrict bank, float * restrict mel,
acc = mel[id1] * left[i];
acc += mel[id2] * right[i];
-
+
ps[i] = acc;
}
#if (TM_UNROLL && TM_UNROLL_FILTERBANKCOMPUTEPSD16)
diff --git a/tmv/fixed_tm.h b/tmv/fixed_tm.h
index c8fa968..d5e12b1 100644
--- a/tmv/fixed_tm.h
+++ b/tmv/fixed_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -75,7 +75,7 @@
#undef ADD32
#undef SUB32
#undef MULT16_16
-#undef MULT16_16_16
+#undef MULT16_16_16
#define ADD16(a,b) ((int)(a) + (int)(b))
#define SUB16(a,b) ((int)(a) - (int)(b))
diff --git a/tmv/kiss_fft_tm.h b/tmv/kiss_fft_tm.h
index dce2072..0a69f3d 100644
--- a/tmv/kiss_fft_tm.h
+++ b/tmv/kiss_fft_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -53,17 +53,17 @@ static void kf_bfly2(
register int * restrict tw1 = (int*)st->twiddles;
register int i, j;
register int _inv = !st->inverse;
-
+
Fout2 = (int*)Fout + m;
-
+
for ( i=0,j=0 ; i<m ; ++i,j+=4,tw1+=fstride )
{ register int tw_10, ff_10, f2_10;
ff_10 = ld32x(Fout, i);
f2_10 = ld32x(Fout2, i);
tw_10 = ld32(tw1);
-
- if ( _inv )
+
+ if ( _inv )
{ TM_SHR(f2_10, f2_10, 1);
TM_SHR(ff_10, ff_10, 1);
}
@@ -111,11 +111,11 @@ static void kf_bfly4(
sc0 = ld32x(Fout1,i);
sc3 = ld32(tw1);
sc1 = ld32x(Fout2, i);
- sc4 = ld32(tw2);
+ sc4 = ld32(tw2);
sc2 = ld32x(Fout3, i);
sc5 = ld32(tw3);
ff0 = ld32x(Fout,i);
-
+
if ( _inv )
{
TM_ADD(sc0, sc0, 0x00020002);
@@ -137,12 +137,12 @@ static void kf_bfly4(
TM_SUB(sc4, sc0, sc2);
TM_SUB(sc1, ff0, sc3);
TM_ADD(ff0, ff0, sc3);
-
+
st32d(j, Fout2, sc1);
st32d(j, Fout, ff0);
sc5 = funshift2(sc5, sc5);
-
+
if ( _inv )
{ TM_ADD(ff0, sc5, sc4);
TM_SUB(sc1, sc5, sc4);
@@ -193,7 +193,7 @@ static void kf_bfly3(
sc3 = ld32(tw1);
sc4 = ld32(tw2);
ff0 = ld32x(Fout,i);
-
+
if ( _inv )
{
TM_DIV(sc1, sc1, 3);
@@ -233,7 +233,7 @@ static void kf_bfly5(
const kiss_fft_cfg st,
int m
)
-{
+{
register int * restrict tw1;
register int * restrict tw2;
register int * restrict tw3;
@@ -309,7 +309,7 @@ static void kf_bfly5(
sc78_lsb = pack16lsb(sc7,sc8);
sc90_msb = pack16msb(sc10,sc9);
sc90_lsb = pack16lsb(sc10,sc9);
-
+
sc5 = pack16lsb( sround(ifir16(sc78_msb,yab_lsb)), sround(ifir16(sc78_lsb,yab_lsb)));
sc6 = pack16lsb(-sround(ifir16(sc90_lsb,yab_msb)), sround(ifir16(sc90_msb,yab_msb)));
@@ -348,41 +348,41 @@ static void kf_bfly_generic(
CHECKBUF(scratchbuf,nscratchbuf,p);
- for ( i=0; i<m; ++i )
+ for ( i=0; i<m; ++i )
{ register int sc10;
- for ( j=0,k=i ; j<p ; ++j,k+=m )
+ for ( j=0,k=i ; j<p ; ++j,k+=m )
{ register int f10;
f10 = ld32x(Fout,k);
- if ( _inv )
+ if ( _inv )
{ TM_DIV(f10, f10, p);
}
st32d(j<<2, scratchbuf, f10);
}
- for ( j=0,k=i,sc10=ld32(scratchbuf) ; j<p ; ++j,k+=m )
+ for ( j=0,k=i,sc10=ld32(scratchbuf) ; j<p ; ++j,k+=m )
{
register int twidx = 0;
register int f10;
- for ( l=1,f10 = sc10 ; l<p ; ++l )
+ for ( l=1,f10 = sc10 ; l<p ; ++l )
{ register int tw, sc;
twidx += fstride * k;
- if ( twidx>=Norig )
+ if ( twidx>=Norig )
{ twidx -= Norig;
}
-
+
sc = ld32x(scratchbuf,l);
tw = ld32x(twiddles,twidx);
-
+
TM_MUL(sc, sc, tw);
TM_ADD(f10, f10, sc);
}
- st32d(k<<2, Fout, f10);
+ st32d(k<<2, Fout, f10);
}
}
}
@@ -405,17 +405,17 @@ static void kf_bfly2(
do
{
register kiss_fft_cpx _fout2, _fout, t;
-
+
_fout2 = *Fout2;
_fout = *Fout;
-
+
C_MUL ( t, _fout2, *tw1);
C_SUB (_fout2, _fout, t);
C_ADD (_fout, _fout, t);
-
+
*Fout2 = _fout2;
*Fout = _fout;
-
+
tw1 += fstride;
++Fout2;
++Fout;
@@ -432,22 +432,22 @@ static void kf_bfly4(
)
{
register kiss_fft_cpx * restrict tw1,* restrict tw2,* restrict tw3;
- register kiss_fft_cpx * restrict Fout1, * restrict Fout2, * restrict Fout3;
+ register kiss_fft_cpx * restrict Fout1, * restrict Fout2, * restrict Fout3;
register int _inv = !st->inverse;
-
+
tw3 = tw2 = tw1 = st->twiddles;
-
+
Fout1 = Fout + m;
Fout2 = Fout + (m << 1);
Fout3 = Fout + (m * 3);
do {
-
+
register kiss_fft_cpx _fout;
register kiss_fft_cpx sc0, sc1, sc2, sc3, sc4, sc5;
-
+
_fout = *Fout;
-
+
C_MUL( sc0,*Fout1, *tw1);
C_MUL( sc1,*Fout2, *tw2);
C_MUL( sc2,*Fout3, *tw3);
@@ -458,10 +458,10 @@ static void kf_bfly4(
C_SUB(*Fout2, _fout, sc3);
C_ADD( *Fout, _fout, sc3);
- tw1 += fstride;
+ tw1 += fstride;
tw2 += (fstride << 1);
tw3 += (fstride * 3);
-
+
if ( _inv )
{
Fout1->r = sc5.r + sc4.i;
@@ -475,10 +475,10 @@ static void kf_bfly4(
Fout3->r = sc5.r + sc4.i;
Fout3->i = sc5.i - sc4.r;
}
-
-
+
+
++Fout; ++Fout1; ++Fout2; ++Fout3;
-
+
} while(--m);
}
@@ -493,40 +493,40 @@ static void kf_bfly3(
register kiss_fft_cpx * restrict Fout1, * restrict Fout2;
register kiss_fft_cpx * restrict tw1,* restrict tw2;
register float epi;
-
+
tw1 = tw2 = st->twiddles;
epi = st->twiddles[fstride*m].i;
Fout1 = Fout + m;
Fout2 = Fout + (m << 1);
do {
-
+
register kiss_fft_cpx _fout;
register kiss_fft_cpx sc0, sc1, sc2, sc3;
-
+
_fout = *Fout;
-
+
C_MUL( sc1, *Fout1, *tw1);
C_MUL( sc2, *Fout2, *tw2);
C_ADD( sc3, sc1, sc2);
C_SUB( sc0, sc1, sc2);
tw1 += fstride;
tw2 += (fstride << 1);
-
+
sc1.r = _fout.r - HALF_OF(sc3.r);
sc1.i = _fout.i - HALF_OF(sc3.i);
-
+
C_MULBYSCALAR(sc0, epi);
C_ADD(*Fout, _fout, sc3);
-
+
Fout2->r = sc1.r + sc0.i;
Fout2->i = sc1.i - sc0.r;
-
+
Fout1->r = sc1.i - sc0.i;
Fout1->i = sc1.r + sc0.r;
-
+
++Fout; ++Fout1; ++Fout2;
-
+
} while(--m);
}
@@ -553,42 +553,42 @@ static void kf_bfly5(
yai = tw[fstride*m].i;
ybr = tw[fstride*2*m].r;
ybi = tw[fstride*2*m].i;
-
+
for ( u=0; u<m; ++u )
{
register kiss_fft_cpx sc0, sc1, sc2, sc3, sc4, sc5, sc6, sc7, sc8, sc9, sc10, sc11, sc12;
-
+
sc0 = *Fout;
-
+
C_MUL( sc1,*Fout1, tw[u*fstride]);
C_MUL( sc2,*Fout2, tw[2*u*fstride]);
C_MUL( sc3,*Fout3, tw[3*u*fstride]);
C_MUL( sc4,*Fout4, tw[4*u*fstride]);
-
+
C_ADD( sc7, sc1, sc4);
C_SUB( sc10, sc1, sc4);
C_ADD( sc8, sc2, sc3);
C_SUB( sc9, sc2, sc3);
-
+
Fout->r = sc0.r + sc7.r + sc8.r;
Fout->i = sc0.i + sc7.i + sc8.i;
-
+
sc5.r = sc0.r + S_MUL(sc7.r,yar) + S_MUL(sc8.r,ybr);
sc5.i = sc0.i + S_MUL(sc7.i,yar) + S_MUL(sc8.i,ybr);
-
+
sc6.r = S_MUL(sc10.i,yai) + S_MUL(sc9.i,ybi);
sc6.i = -S_MUL(sc10.r,yai) - S_MUL(sc9.r,ybi);
-
+
C_SUB(*Fout1,sc5,sc6);
C_ADD(*Fout4,sc5,sc6);
-
+
sc11.r = sc0.r + S_MUL(sc7.r,ybr) + S_MUL(sc8.r,yar);
sc11.i = sc0.i + S_MUL(sc7.i,ybr) + S_MUL(sc8.i,yar);
sc12.r = - S_MUL(sc10.i,ybi) + S_MUL(sc9.i,yai);
sc12.i = S_MUL(sc10.r,ybi) - S_MUL(sc9.r,yai);
C_ADD(*Fout2,sc11,sc12);
C_SUB(*Fout3,sc11,sc12);
-
+
++Fout1; ++Fout2; ++Fout3; ++Fout4;
}
}
diff --git a/tmv/kiss_fftr_tm.h b/tmv/kiss_fftr_tm.h
index 5b2b2cf..8b9f75a 100644
--- a/tmv/kiss_fftr_tm.h
+++ b/tmv/kiss_fftr_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -46,7 +46,7 @@
c1 = -asri(16,(c)); \
c0 = sex16((c)); \
(res) = pack16lsb(sround(c1 * (32767/(frac))), sround(c0 * (32767/(frac))));\
- }
+ }
#define OVERRIDE_KISS_FFTR
@@ -78,8 +78,8 @@ void kiss_fftr(kiss_fftr_cfg st,const kiss_fft_scalar * restrict timedata, kiss_
freqdata[ncfft].i = freqdata[0].i = 0;
}
- for ( k=1 ; k <= ncfft2 ; ++k )
- {
+ for ( k=1 ; k <= ncfft2 ; ++k )
+ {
register int fpk, fpnk, i, tw, f1k, f2k;
register int fq1, fq2;
@@ -91,7 +91,7 @@ void kiss_fftr(kiss_fftr_cfg st,const kiss_fft_scalar * restrict timedata, kiss_
TM_DIV(fpk, fpk, 2);
TM_NDIV(fpnk,fpnk,2);
-
+
TM_ADD( f1k, fpk , fpnk );
TM_SUB( f2k, fpk , fpnk );
TM_MUL( tw , f2k, tw );
@@ -134,7 +134,7 @@ void kiss_fftri(kiss_fftr_cfg st,const kiss_fft_cpx * restrict freqdata,kiss_fft
st->tmpbuf[0].i = fqr - fqnr;
}
- for ( k=1 ; k <= ncfft2 ; ++k )
+ for ( k=1 ; k <= ncfft2 ; ++k )
{
register int fk, fnkc, i, tw, fek, fok, tmp;
register int tbk, tbn;
@@ -144,7 +144,7 @@ void kiss_fftri(kiss_fftr_cfg st,const kiss_fft_cpx * restrict freqdata,kiss_fft
fk = ld32x(freqdata,k);
tw = ld32x(twiddles,k);
fnkc = pack16lsb(-freqdata[i].i, freqdata[i].r);
-
+
TM_ADD (fek, fk, fnkc);
TM_SUB (tmp, fk, fnkc);
TM_MUL (fok, tmp, tw );
@@ -176,14 +176,14 @@ void kiss_fftr(kiss_fftr_cfg st,const kiss_fft_scalar * restrict timedata,kiss_f
tdcr = tmpbuf[0].r;
tdci = tmpbuf[0].i;
-
+
freqdata[0].r = tdcr + tdci;
freqdata[ncfft].r = tdcr - tdci;
freqdata[ncfft].i = freqdata[0].i = 0;
- for ( k=1;k <= ncfft/2 ; ++k )
+ for ( k=1;k <= ncfft/2 ; ++k )
{
- fpk = tmpbuf[k];
+ fpk = tmpbuf[k];
fpnk.r = tmpbuf[ncfft-k].r;
fpnk.i = -tmpbuf[ncfft-k].i;
@@ -203,16 +203,16 @@ void kiss_fftri(kiss_fftr_cfg st,const kiss_fft_cpx * restrict freqdata,kiss_fft
{
register int k, ncfft;
register kiss_fft_cpx * restrict tmpbuf, * restrict tw;
-
-
+
+
ncfft = st->substate->nfft;
tmpbuf= st->tmpbuf;
tw = st->super_twiddles;
-
+
tmpbuf[0].r = freqdata[0].r + freqdata[ncfft].r;
tmpbuf[0].i = freqdata[0].r - freqdata[ncfft].r;
- for (k = 1; k <= ncfft / 2; ++k)
+ for (k = 1; k <= ncfft / 2; ++k)
{
register kiss_fft_cpx fk, fnkc, fek, fok, tmp;
fk = freqdata[k];
diff --git a/tmv/mdf_tm.h b/tmv/mdf_tm.h
index cc82bf8..c505570 100644
--- a/tmv/mdf_tm.h
+++ b/tmv/mdf_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -36,7 +36,7 @@
#include "profile_tm.h"
// shifted power spectrum to fftwrap.c so that optimisation can be shared between mdf.c and preprocess.c
-#define OVERRIDE_POWER_SPECTRUM
+#define OVERRIDE_POWER_SPECTRUM
#ifdef FIXED_POINT
@@ -44,10 +44,10 @@
#define OVERRIDE_FILTER_DC_NOTCH16
void filter_dc_notch16(
- const spx_int16_t * restrict in,
- float radius,
- float * restrict out,
- int len,
+ const spx_int16_t * restrict in,
+ float radius,
+ float * restrict out,
+ int len,
float * restrict mem
)
{
@@ -74,7 +74,7 @@ void filter_dc_notch16(
mem0 = mem1 + 2 * (-vin + rvout);
mem1 = vin - (den2 * vout);
-
+
out[i] = rvout;
}
#if (TM_UNROLL && TM_UNROLL_FILTERDCNOTCH16)
@@ -90,17 +90,17 @@ void filter_dc_notch16(
#define OVERRIDE_MDF_INNER_PROD
float mdf_inner_prod(
- const float * restrict x,
- const float * restrict y,
+ const float * restrict x,
+ const float * restrict y,
int len
)
{
register float sum = 0;
-
+
MDFINNERPROD_START();
len >>= 1;
-
+
#if (TM_UNROLL && TM_UNROLL_MDFINNERPRODUCT)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
@@ -126,9 +126,9 @@ float mdf_inner_prod(
#define OVERRIDE_SPECTRAL_MUL_ACCUM
void spectral_mul_accum(
- const float * restrict X,
- const float * restrict Y,
- float * restrict acc,
+ const float * restrict X,
+ const float * restrict Y,
+ float * restrict acc,
int N, int M
)
{
@@ -151,11 +151,11 @@ void spectral_mul_accum(
acc[i] = (Xi * Yi - Xii * Yii);
acc[i+1]= (Xii * Yi + Xi * Yii);
}
-
+
acc[_N] = X[_N] * Y[_N];
for ( j=1,X+=N,Y+=N ; j<M ; j++ )
- {
+ {
acc[0] += X[0] * Y[0];
for ( i=1 ; i<N-1 ; i+=2 )
@@ -168,7 +168,7 @@ void spectral_mul_accum(
acc[i] += (Xi * Yi - Xii * Yii);
acc[i+1]+= (Xii * Yi + Xi * Yii);
}
-
+
acc[_N] += X[_N] * Y[_N];
X += N;
Y += N;
@@ -179,11 +179,11 @@ void spectral_mul_accum(
#define OVERRIDE_WEIGHTED_SPECTRAL_MUL_CONJ
void weighted_spectral_mul_conj(
- const float * restrict w,
- const float p,
- const float * restrict X,
- const float * restrict Y,
- float * restrict prod,
+ const float * restrict w,
+ const float p,
+ const float * restrict X,
+ const float * restrict Y,
+ float * restrict prod,
int N
)
{
@@ -192,7 +192,7 @@ void weighted_spectral_mul_conj(
WEIGHTEDSPECTRALMULCONJ_START();
- prod[0] = p * w[0] * X[0] * Y[0];
+ prod[0] = p * w[0] * X[0] * Y[0];
_N = N-1;
for (i=1,j=1;i<_N;i+=2,j++)
@@ -210,7 +210,7 @@ void weighted_spectral_mul_conj(
prod[i] = W * (Xi * Yi + Xii * Yii);
prod[i+1]= W * (Xi * Yii - Xii * Yi);
}
-
+
prod[_N] = p * w[j] * X[_N] * Y[_N];
WEIGHTEDSPECTRALMULCONJ_STOP();
@@ -218,9 +218,9 @@ void weighted_spectral_mul_conj(
#define OVERRIDE_MDF_ADJUST_PROP
void mdf_adjust_prop(
- const float * restrict W,
- int N,
- int M,
+ const float * restrict W,
+ int N,
+ int M,
float * restrict prop
)
{
@@ -242,9 +242,9 @@ void mdf_adjust_prop(
#pragma TCS_unrollexact=1
#endif
for ( j=k ; j<l ; ++j )
- {
+ {
register float wi = W[j];
-
+
tmp += wi * wi;
}
#if (TM_UNROLL && TM_UNROLL_MDFADJUSTPROP)
@@ -277,8 +277,8 @@ void mdf_adjust_prop(
#define OVERRIDE_SPEEX_ECHO_GET_RESIDUAL
void speex_echo_get_residual(
- SpeexEchoState * restrict st,
- float * restrict residual_echo,
+ SpeexEchoState * restrict st,
+ float * restrict residual_echo,
int len
)
{
@@ -302,16 +302,16 @@ void speex_echo_get_residual(
#pragma TCS_unrollexact=1
#endif
for (i=0;i<N;i++)
- { y[i] = window[i] * last_y[i];
+ { y[i] = window[i] * last_y[i];
}
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOGETRESIDUAL)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
#endif
-
+
spx_fft(st->fft_table, st->y, st->Y);
power_spectrum(st->Y, residual_echo, N);
-
+
leake = st->leak_estimate;
leak2 = fmux(leake > .5, 1, 2 * leake);
N = st->frame_size;
@@ -340,7 +340,7 @@ void speex_echo_get_residual(
void mdf_preemph(
- SpeexEchoState * restrict st,
+ SpeexEchoState * restrict st,
spx_word16_t * restrict x,
const spx_int16_t * restrict far_end,
int framesize
@@ -429,7 +429,7 @@ void mdf_sub(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
}
void mdf_sub_int(
@@ -458,8 +458,8 @@ void mdf_sub_int(
#else
for ( i=0,j=0 ; i<framesize ; i+=2,++j )
{ register int src1i, src2i, desti;
-
-
+
+
src1i = ld32d(src1,j);
src2i = ld32d(src2,j);
desti = dspidualsub(src1i,src2i);
@@ -472,7 +472,7 @@ void mdf_sub_int(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
}
void mdf_compute_weight_gradient(
@@ -490,11 +490,11 @@ void mdf_compute_weight_gradient(
register spx_word32_t * restrict W = &(st->W[j*N]);
weighted_spectral_mul_conj(
- st->power_1,
- FLOAT_SHL(PSEUDOFLOAT(st->prop[j]),-15),
- &X[(j+1)*N],
- st->E,
- st->PHI,
+ st->power_1,
+ FLOAT_SHL(PSEUDOFLOAT(st->prop[j]),-15),
+ &X[(j+1)*N],
+ st->E,
+ st->PHI,
N);
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unroll=4
@@ -506,7 +506,7 @@ void mdf_compute_weight_gradient(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
}
}
@@ -528,7 +528,7 @@ void mdf_update_weight(
for ( j=0 ; j<M ; j++ )
{
register spx_word32_t * restrict W = &(st->W[j*N]);
-
+
if (j==0 || cancel_count%(M-1) == j-1)
{
#ifdef FIXED_POINT
@@ -542,7 +542,7 @@ void mdf_update_weight(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
spx_ifft(st->fft_table, wtmp2, wtmp);
memset(wtmp, 0, framesize * sizeof(spx_word16_t));
@@ -556,7 +556,7 @@ void mdf_update_weight(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
spx_fft(st->fft_table, wtmp, wtmp2);
@@ -570,13 +570,13 @@ void mdf_update_weight(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
#else
spx_ifft(st->fft_table, W, wtmp);
memset(&wtmp[framesize], 0, (N-framesize) * sizeof(spx_word16_t));
spx_fft(st->fft_table, wtmp, W);
-#endif
+#endif
}
}
}
@@ -589,11 +589,11 @@ spx_word32_t mdf_update_foreground(
spx_word32_t Dbf,
spx_word32_t Sff,
spx_word32_t See
-)
-{
- register spx_word32_t Davg1 = st->Davg1;
- register spx_word32_t Davg2 = st->Davg2;
- register spx_word32_t Dvar1 = st->Dvar1;
+)
+{
+ register spx_word32_t Davg1 = st->Davg1;
+ register spx_word32_t Davg2 = st->Davg2;
+ register spx_word32_t Dvar1 = st->Dvar1;
register spx_word32_t Dvar2 = st->Dvar2;
register spx_word16_t * restrict input = st->input;
register int framesize = st->frame_size;
@@ -604,80 +604,80 @@ spx_word32_t mdf_update_foreground(
register int i;
register int N = st->window_size;
register int M = st->M;
-
-#ifdef FIXED_POINT
- register spx_word32_t sc0 = SUB32(Sff,See);
- register spx_float_t sc1 = FLOAT_MUL32U(Sff,Dbf);
-
- Davg1 = ADD32(MULT16_32_Q15(QCONST16(.6f,15),Davg1), MULT16_32_Q15(QCONST16(.4f,15),sc0));
- Davg2 = ADD32(MULT16_32_Q15(QCONST16(.85f,15),Davg2), MULT16_32_Q15(QCONST16(.15f,15),sc0));
- Dvar1 = FLOAT_ADD(
- FLOAT_MULT(VAR1_SMOOTH,Dvar1),
- FLOAT_MUL32U(MULT16_32_Q15(QCONST16(.4f,15),Sff),
- MULT16_32_Q15(QCONST16(.4f,15),Dbf)));
- Dvar2 = FLOAT_ADD(
- FLOAT_MULT(VAR2_SMOOTH,Dvar2),
- FLOAT_MUL32U(MULT16_32_Q15(QCONST16(.15f,15),Sff),
- MULT16_32_Q15(QCONST16(.15f,15),Dbf)));
+
+#ifdef FIXED_POINT
+ register spx_word32_t sc0 = SUB32(Sff,See);
+ register spx_float_t sc1 = FLOAT_MUL32U(Sff,Dbf);
+
+ Davg1 = ADD32(MULT16_32_Q15(QCONST16(.6f,15),Davg1), MULT16_32_Q15(QCONST16(.4f,15),sc0));
+ Davg2 = ADD32(MULT16_32_Q15(QCONST16(.85f,15),Davg2), MULT16_32_Q15(QCONST16(.15f,15),sc0));
+ Dvar1 = FLOAT_ADD(
+ FLOAT_MULT(VAR1_SMOOTH,Dvar1),
+ FLOAT_MUL32U(MULT16_32_Q15(QCONST16(.4f,15),Sff),
+ MULT16_32_Q15(QCONST16(.4f,15),Dbf)));
+ Dvar2 = FLOAT_ADD(
+ FLOAT_MULT(VAR2_SMOOTH,Dvar2),
+ FLOAT_MUL32U(MULT16_32_Q15(QCONST16(.15f,15),Sff),
+ MULT16_32_Q15(QCONST16(.15f,15),Dbf)));
#else
- register spx_word32_t sc0 = Sff - See;
- register spx_word32_t sc1 = Sff * Dbf;
-
- Davg1 = .6*Davg1 + .4*sc0;
- Davg2 = .85*Davg2 + .15*sc0;
- Dvar1 = VAR1_SMOOTH*Dvar1 + .16*sc1;
- Dvar2 = VAR2_SMOOTH*Dvar2 + .0225*sc1;
+ register spx_word32_t sc0 = Sff - See;
+ register spx_word32_t sc1 = Sff * Dbf;
+
+ Davg1 = .6*Davg1 + .4*sc0;
+ Davg2 = .85*Davg2 + .15*sc0;
+ Dvar1 = VAR1_SMOOTH*Dvar1 + .16*sc1;
+ Dvar2 = VAR2_SMOOTH*Dvar2 + .0225*sc1;
+#endif
+
+ update_foreground =
+ mux( FLOAT_GT(FLOAT_MUL32U(sc0, VABS(sc0)), sc1), 1,
+ mux( FLOAT_GT(FLOAT_MUL32U(Davg1, VABS(Davg1)), FLOAT_MULT(VAR1_UPDATE,(Dvar1))), 1,
+ mux( FLOAT_GT(FLOAT_MUL32U(Davg2, VABS(Davg2)), FLOAT_MULT(VAR2_UPDATE,(Dvar2))), 1, 0)));
+
+ if ( update_foreground )
+ {
+ register spx_word16_t * restrict windowf = st->window + framesize;
+ register spx_word16_t * restrict window = st->window;
+
+ st->Davg1 = st->Davg2 = 0;
+ st->Dvar1 = st->Dvar2 = FLOAT_ZERO;
+
+ memcpy(st->foreground, st->W, N*M*sizeof(spx_word32_t));
+
+#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
+#pragma TCS_unroll=4
+#pragma TCS_unrollexact=1
#endif
-
- update_foreground =
- mux( FLOAT_GT(FLOAT_MUL32U(sc0, VABS(sc0)), sc1), 1,
- mux( FLOAT_GT(FLOAT_MUL32U(Davg1, VABS(Davg1)), FLOAT_MULT(VAR1_UPDATE,(Dvar1))), 1,
- mux( FLOAT_GT(FLOAT_MUL32U(Davg2, VABS(Davg2)), FLOAT_MULT(VAR2_UPDATE,(Dvar2))), 1, 0)));
-
- if ( update_foreground )
- {
- register spx_word16_t * restrict windowf = st->window + framesize;
- register spx_word16_t * restrict window = st->window;
-
- st->Davg1 = st->Davg2 = 0;
- st->Dvar1 = st->Dvar2 = FLOAT_ZERO;
-
- memcpy(st->foreground, st->W, N*M*sizeof(spx_word32_t));
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<framesize ; ++i)
- { register spx_word16_t wi = window[i];
- register spx_word16_t wfi = windowf[i];
- register spx_word16_t ei = ee[i];
- register spx_word16_t yi = y[i];
-
- ee[i] = MULT16_16_Q15(wfi,ei) + MULT16_16_Q15(wi,yi);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- } else
- {
- register int reset_background;
-
- reset_background =
- mux( FLOAT_GT(FLOAT_MUL32U(-(sc0),VABS(sc0)), FLOAT_MULT(VAR_BACKTRACK,sc1)), 1,
- mux( FLOAT_GT(FLOAT_MUL32U(-(Davg1), VABS(Davg1)), FLOAT_MULT(VAR_BACKTRACK,Dvar1)), 1,
- mux( FLOAT_GT(FLOAT_MUL32U(-(Davg2), VABS(Davg2)), FLOAT_MULT(VAR_BACKTRACK,Dvar2)), 1, 0)));
-
- if ( reset_background )
- {
- memcpy(st->W, st->foreground, N*M*sizeof(spx_word32_t));
- memcpy(y, ee, framesize * sizeof(spx_word16_t));
- mdf_sub(xx,input,y,framesize);
- See = Sff;
- st->Davg1 = st->Davg2 = 0;
- st->Dvar1 = st->Dvar2 = FLOAT_ZERO;
+ for ( i=0 ; i<framesize ; ++i)
+ { register spx_word16_t wi = window[i];
+ register spx_word16_t wfi = windowf[i];
+ register spx_word16_t ei = ee[i];
+ register spx_word16_t yi = y[i];
+
+ ee[i] = MULT16_16_Q15(wfi,ei) + MULT16_16_Q15(wi,yi);
+ }
+#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
+#pragma TCS_unrollexact=0
+#pragma TCS_unroll=0
+#endif
+
+ } else
+ {
+ register int reset_background;
+
+ reset_background =
+ mux( FLOAT_GT(FLOAT_MUL32U(-(sc0),VABS(sc0)), FLOAT_MULT(VAR_BACKTRACK,sc1)), 1,
+ mux( FLOAT_GT(FLOAT_MUL32U(-(Davg1), VABS(Davg1)), FLOAT_MULT(VAR_BACKTRACK,Dvar1)), 1,
+ mux( FLOAT_GT(FLOAT_MUL32U(-(Davg2), VABS(Davg2)), FLOAT_MULT(VAR_BACKTRACK,Dvar2)), 1, 0)));
+
+ if ( reset_background )
+ {
+ memcpy(st->W, st->foreground, N*M*sizeof(spx_word32_t));
+ memcpy(y, ee, framesize * sizeof(spx_word16_t));
+ mdf_sub(xx,input,y,framesize);
+ See = Sff;
+ st->Davg1 = st->Davg2 = 0;
+ st->Dvar1 = st->Dvar2 = FLOAT_ZERO;
} else
{
st->Davg1 = Davg1;
@@ -688,9 +688,9 @@ spx_word32_t mdf_update_foreground(
}
return See;
-}
+}
#endif
-
+
void mdf_compute_error_signal(
SpeexEchoState * restrict st,
const spx_int16_t * restrict in,
@@ -733,7 +733,7 @@ void mdf_compute_error_signal(
#else
tmp_out = SUB32(EXTEND32(input[i]), EXTEND32(y[i]));
#endif
- tmp_out =
+ tmp_out =
fmux( tmp_out > 32767, 32767,
fmux( tmp_out < -32768, -32768, tmp_out));
#endif
@@ -749,7 +749,7 @@ void mdf_compute_error_signal(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
st->memE = memE;
st->saturated = saturated;
@@ -760,8 +760,8 @@ void mdf_compute_error_signal(
inline int mdf_check(
SpeexEchoState * restrict st,
spx_int16_t * out,
- spx_word32_t Syy,
- spx_word32_t Sxx,
+ spx_word32_t Syy,
+ spx_word32_t Sxx,
spx_word32_t See,
spx_word32_t Sff,
spx_word32_t Sdd
@@ -777,7 +777,7 @@ inline int mdf_check(
|| !(Sff < N1e9 && Syy < N1e9 && Sxx < N1e9 )
#endif
)
- {
+ {
screwed_up += 50;
memset(out, 0, framesize * sizeof(spx_int16_t));
@@ -811,7 +811,7 @@ void mdf_smooth(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for ( j=0 ; j<framesize ; ++j )
{ register spx_word32_t pi = power[j];
register spx_word32_t xfi = Xf[j];
@@ -821,7 +821,7 @@ void mdf_smooth(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
pf = power[framesize];
xff = Xf[framesize];
@@ -830,11 +830,11 @@ void mdf_smooth(
void mdf_compute_filtered_spectra_crosscorrelations(
SpeexEchoState * restrict st,
- spx_word32_t Syy,
+ spx_word32_t Syy,
spx_word32_t See,
int framesize
)
-{
+{
register spx_float_t Pey = FLOAT_ONE;
register spx_float_t Pyy = FLOAT_ONE;
register spx_word16_t spec_average = st->spec_average;
@@ -863,7 +863,7 @@ void mdf_compute_filtered_spectra_crosscorrelations(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for (j=framesize; j>0 ; --j)
{
_Ehj = pEh[j];
@@ -883,7 +883,7 @@ void mdf_compute_filtered_spectra_crosscorrelations(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
_Ehj = pEh[0];
_Rfj = pRf[0];
_Yfj = pYf[0];
@@ -906,21 +906,21 @@ void mdf_compute_filtered_spectra_crosscorrelations(
tmp32 = VMUX(tmp32 > tmpx, tmpx, tmp32);
alpha = FLOAT_DIV32(tmp32, See);
alpha_1 = FLOAT_SUB(FLOAT_ONE, alpha);
-
+
sPey = FLOAT_ADD(FLOAT_MULT(alpha_1,sPey) , FLOAT_MULT(alpha,Pey));
- sPyy = FLOAT_ADD(FLOAT_MULT(alpha_1,sPyy) , FLOAT_MULT(alpha,Pyy));
+ sPyy = FLOAT_ADD(FLOAT_MULT(alpha_1,sPyy) , FLOAT_MULT(alpha,Pyy));
tmp = FLOAT_MULT(MIN_LEAK,sPyy);
#ifndef FIXED_POINT
sPyy = VMUX(FLOAT_LT(sPyy, FLOAT_ONE), FLOAT_ONE, sPyy);
sPey = VMUX(FLOAT_LT(sPey, tmp), tmp, sPey);
- sPey = VMUX(FLOAT_LT(sPey, sPyy), sPey, sPyy);
+ sPey = VMUX(FLOAT_LT(sPey, sPyy), sPey, sPyy);
#else
sPyy = FLOAT_LT(sPyy, FLOAT_ONE) ? FLOAT_ONE : sPyy;
sPey = FLOAT_LT(sPey, tmp) ? tmp : sPey;
- sPey = FLOAT_LT(sPey, sPyy) ? sPey : sPyy;
+ sPey = FLOAT_LT(sPey, sPyy) ? sPey : sPyy;
#endif
-
+
leak_estimate = FLOAT_EXTRACT16(FLOAT_SHL(FLOAT_DIVU(sPey, sPyy),14));
leak_estimate = VMUX( leak_estimate > 16383, 32767, SHL16(leak_estimate,1));
@@ -943,10 +943,10 @@ inline spx_word16_t mdf_compute_RER(
register spx_word32_t tmp32;
register spx_word32_t tmp;
spx_float_t bound = PSEUDOFLOAT(Sey);
-
+
tmp32 = MULT16_32_Q15(leake,Syy);
tmp32 = ADD32(SHR32(Sxx,13), ADD32(tmp32, SHL32(tmp32,1)));
-
+
bound = FLOAT_DIVU(FLOAT_MULT(bound, bound), PSEUDOFLOAT(ADD32(1,Syy)));
tmp = FLOAT_EXTRACT32(bound);
tmp32 = imux( FLOAT_GT(bound, PSEUDOFLOAT(See)), See,
@@ -972,7 +972,7 @@ void mdf_adapt(
SpeexEchoState * restrict st,
spx_word16_t RER,
spx_word32_t Syy,
- spx_word32_t See,
+ spx_word32_t See,
spx_word32_t Sxx
)
{
@@ -985,20 +985,20 @@ void mdf_adapt(
register int i;
register int M = st->M;
- adapted = mux( !adapted && sum_adapt > QCONST32(M,15) &&
+ adapted = mux( !adapted && sum_adapt > QCONST32(M,15) &&
MULT16_32_Q15(leake,Syy) > MULT16_32_Q15(QCONST16(.03f,15),Syy), 1, adapted);
if ( adapted )
- { register spx_word32_t * restrict Yf = st->Yf;
+ { register spx_word32_t * restrict Yf = st->Yf;
register spx_word32_t * restrict Rf = st->Rf;
register spx_word32_t r, e, e2;
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for ( i=0 ; i<framesize ; ++i )
- {
+ {
r = SHL32(Yf[i],3);
r = MULT16_32_Q15(leake,r);
e = SHL32(Rf[i],3)+1;
@@ -1011,7 +1011,7 @@ void mdf_adapt(
r = fmux( r > e2, e2, r);
#endif
- r = MULT16_32_Q15(QCONST16(.7,15),r) +
+ r = MULT16_32_Q15(QCONST16(.7,15),r) +
MULT16_32_Q15(QCONST16(.3,15),(spx_word32_t)(MULT16_32_Q15(RER,e)));
power_1[i] = FLOAT_SHL(FLOAT_DIV32_FLOAT(r,FLOAT_MUL32U(e,power[i]+10)),WEIGHT_SHIFT+16);
@@ -1019,8 +1019,8 @@ void mdf_adapt(
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
-
+#endif
+
r = SHL32(Yf[framesize],3);
r = MULT16_32_Q15(leake,r);
e = SHL32(Rf[framesize],3)+1;
@@ -1033,19 +1033,19 @@ void mdf_adapt(
r = fmux( r > e2, e2, r);
#endif
- r = MULT16_32_Q15(QCONST16(.7,15),r) +
+ r = MULT16_32_Q15(QCONST16(.7,15),r) +
MULT16_32_Q15(QCONST16(.3,15),(spx_word32_t)(MULT16_32_Q15(RER,e)));
power_1[framesize] = FLOAT_SHL(FLOAT_DIV32_FLOAT(r,FLOAT_MUL32U(e,power[framesize]+10)),WEIGHT_SHIFT+16);
- } else
+ } else
{
register spx_word16_t adapt_rate=0;
register int N = st->window_size;
- if ( Sxx > SHR32(MULT16_16(N, 1000),6) )
+ if ( Sxx > SHR32(MULT16_16(N, 1000),6) )
{ register spx_word32_t tmp32, tmp32q;
-
+
tmp32 = MULT16_32_Q15(QCONST16(.25f, 15), Sxx);
#ifdef FIXED_POINT
tmp32q = SHR32(See,2);
@@ -1056,33 +1056,33 @@ void mdf_adapt(
#endif
adapt_rate = FLOAT_EXTRACT16(FLOAT_SHL(FLOAT_DIV32(tmp32, See),15));
}
-
+
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for (i=0;i<framesize;i++)
power_1[i] = FLOAT_SHL(FLOAT_DIV32(EXTEND32(adapt_rate),ADD32(power[i],10)),WEIGHT_SHIFT+1);
#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
power_1[framesize] = FLOAT_SHL(FLOAT_DIV32(EXTEND32(adapt_rate),ADD32(power[framesize],10)),WEIGHT_SHIFT+1);
sum_adapt = ADD32(sum_adapt,adapt_rate);
}
-
+
st->sum_adapt = sum_adapt;
st->adapted = adapted;
}
#define OVERRIDE_ECHO_CANCELLATION
void speex_echo_cancellation(
- SpeexEchoState * restrict st,
- const spx_int16_t * restrict in,
- const spx_int16_t * restrict far_end,
+ SpeexEchoState * restrict st,
+ const spx_int16_t * restrict in,
+ const spx_int16_t * restrict far_end,
spx_int16_t * restrict out
)
-{
+{
register int framesize = st->frame_size;
register spx_word16_t * restrict x = st->x;
register spx_word16_t * restrict xx = st->x + framesize;
@@ -1103,7 +1103,7 @@ void speex_echo_cancellation(
filter_dc_notch16(in, st->notch_radius, st->input, framesize, st->notch_mem);
mdf_preemph(st, xx, far_end, framesize);
-
+
{
register spx_word16_t * restrict X = st->X;
@@ -1119,19 +1119,19 @@ void speex_echo_cancellation(
memcpy(st->last_y, st->x, N * sizeof(spx_word16_t));
Sxx = mdf_inner_prod(xx, xx, framesize);
memcpy(x, xx, framesize * sizeof(spx_word16_t));
-
+
#ifdef TWO_PATH
- spectral_mul_accum(st->X, st->foreground, st->Y, N, M);
+ spectral_mul_accum(st->X, st->foreground, st->Y, N, M);
spx_ifft(st->fft_table, st->Y, st->e);
mdf_sub(xx, st->input, ee, framesize);
Sff = mdf_inner_prod(xx, xx, framesize);
#endif
-
+
mdf_adjust_prop (st->W, N, M, st->prop);
-
+
if (st->saturated == 0)
{ mdf_compute_weight_gradient(st, X, N, M);
- } else
+ } else
{ st->saturated--;
}
}
@@ -1141,7 +1141,7 @@ void speex_echo_cancellation(
spx_ifft(st->fft_table, st->Y, st->y);
#ifdef TWO_PATH
- mdf_sub(xx, ee, yy, framesize);
+ mdf_sub(xx, ee, yy, framesize);
Dbf = 10+mdf_inner_prod(xx, xx, framesize);
#endif
@@ -1154,12 +1154,12 @@ void speex_echo_cancellation(
See = mdf_update_foreground(st,Dbf,Sff,See);
#endif
-
+
mdf_compute_error_signal(st, in, out, framesize);
Sey = mdf_inner_prod(ee, yy, framesize);
Syy = mdf_inner_prod(yy, yy, framesize);
Sdd = mdf_inner_prod(st->input, st->input, framesize);
-
+
if ( mdf_check(st,out,Syy,Sxx,See,Sff,Sdd) >= 50 )
{ speex_warning("The echo canceller started acting funny and got slapped (reset). It swears it will behave now.");
speex_echo_state_reset(st);
@@ -1178,10 +1178,10 @@ void speex_echo_cancellation(
mdf_compute_filtered_spectra_crosscorrelations(st,Syy,See,framesize);
RER = mdf_compute_RER(See,Syy,Sey,Sxx,st->leak_estimate);
mdf_adapt(st, RER, Syy, See, Sxx);
-
+
if ( st->adapted )
{ register spx_word16_t * restrict last_yy = st->last_y + framesize;
-
+
memcpy(st->last_y, last_yy, framesize * sizeof(spx_word16_t));
mdf_sub_int(last_yy, in, out, framesize);
diff --git a/tmv/misc_tm.h b/tmv/misc_tm.h
index 4d6cea7..2954234 100644
--- a/tmv/misc_tm.h
+++ b/tmv/misc_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/tmv/preprocess_tm.h b/tmv/preprocess_tm.h
index f903b73..9e4a067 100644
--- a/tmv/preprocess_tm.h
+++ b/tmv/preprocess_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -62,7 +62,7 @@ static void preprocess_analysis(SpeexPreprocessState * restrict st, spx_int16_t
N3 >>= 1;
framesize >>= 1;
max_val = 0;
-
+
for ( i=0,j=0 ; i<N3 ; i+=2,j+=8 )
{ register int r1, r2;
@@ -82,7 +82,7 @@ static void preprocess_analysis(SpeexPreprocessState * restrict st, spx_int16_t
st32d(j, ptr, r1);
st32d(j+4,ptr, r2);
}
-
+
for ( i=0,j=0,ptr=(int*)(x+N4) ; i<N3 ; i+=2,j+=8 )
{ register int r1, r2;
@@ -115,7 +115,7 @@ static void preprocess_analysis(SpeexPreprocessState * restrict st, spx_int16_t
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
#endif
-
+
max_val = 14 - spx_ilog2(max_val);
st->frame_shift = max_val;
@@ -139,15 +139,15 @@ static void preprocess_analysis(SpeexPreprocessState * restrict st, spx_int16_t
#endif
}
- spx_fft(st->fft_lookup, st->frame, st->ft);
+ spx_fft(st->fft_lookup, st->frame, st->ft);
power_spectrum(st->ft, ps, N << 1);
-
+
#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
#endif
for ( i=0,ptr=(int*)st->ps,max_val<<=1,j=((1<<((max_val))>>1)) ;i<N ; ++i )
- {
+ {
ps[i] = (ps[i] + j) >> max_val;
}
#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
@@ -171,7 +171,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
register int * restrict Smin = (int*)st->Smin;
register int * restrict Stmp = (int*)st->Stmp;
register int * restrict S = (int*)st->S;
-
+
UPDATENOISEPROB_START();
{
@@ -180,7 +180,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
register int q8, q05, q2, q1;
register int *ps = (int*)st->ps;
register int si_lsb, si_msb, sii_lsb, sii_msb;
-
+
q8 = QCONST16(.8f,15);
q05 = QCONST16(.05f,15);
q2 = QCONST16(.2f,15);
@@ -196,7 +196,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
ips_lsb &= 0x00007fff;
psi_lsb &= 0x00007fff;
si_lsb &= 0x00007fff;
-
+
S[0] = _MULT16_32_Q15(q8,si_msb,si_lsb) + _MULT16_32_Q15(q2,ips_msb,ips_lsb);
for ( i=1 ; i<N-1 ; i+=2 )
@@ -209,11 +209,11 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
si_lsb &= 0x00007fff;
psii_lsb &= 0x00007fff;
- S[i]= _MULT16_32_Q15(q8,si_msb,si_lsb) +
- _MULT16_32_Q15(q05,ips_msb,ips_lsb) +
- _MULT16_32_Q15(q1,psi_msb,psi_lsb) +
+ S[i]= _MULT16_32_Q15(q8,si_msb,si_lsb) +
+ _MULT16_32_Q15(q05,ips_msb,ips_lsb) +
+ _MULT16_32_Q15(q1,psi_msb,psi_lsb) +
_MULT16_32_Q15(q05,psii_msb,psii_lsb);
-
+
psiii_lsb = ps[i+2];
sii_lsb = S[i+1];
@@ -222,9 +222,9 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
sii_lsb &= 0x00007fff;
psiii_lsb&= 0x00007fff;
- S[i+1]= _MULT16_32_Q15(q8,sii_msb,sii_lsb) +
- _MULT16_32_Q15(q05,psi_msb,psi_lsb) +
- _MULT16_32_Q15(q1,psii_msb,psii_lsb) +
+ S[i+1]= _MULT16_32_Q15(q8,sii_msb,sii_lsb) +
+ _MULT16_32_Q15(q05,psi_msb,psi_lsb) +
+ _MULT16_32_Q15(q1,psii_msb,psii_lsb) +
_MULT16_32_Q15(q05,psiii_msb,psiii_lsb);
ips_lsb = psii_lsb;
@@ -232,12 +232,12 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
psi_lsb = psiii_lsb;
psi_msb = psiii_msb;
}
-
+
S[N-1] = MULT16_32_Q15(q8,S[N-1]) + MULT16_32_Q15(q2,ps[N-1]);
}
nb_adapt = st->nb_adapt;
-
+
if ( nb_adapt==1 )
{ for ( i=0 ; i<N ; ++i )
Smin[i] = Stmp[i] = 0;
@@ -261,7 +261,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
si = S[i];
stmpi = Stmp[i];
-
+
Smin[i] = imin(stmpi,si);
Stmp[i] = si;
}
@@ -269,7 +269,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
#endif
- } else
+ } else
{
#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
@@ -284,7 +284,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
smini = Smin[i];
Smin[i] = imin(smini,si);
- Stmp[i] = imin(stmpi,si);
+ Stmp[i] = imin(stmpi,si);
}
#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
#pragma TCS_unrollexact=0
@@ -388,7 +388,7 @@ static void preprocess_analysis(SpeexPreprocessState * restrict st, spx_int16_t
#pragma TCS_unroll=0
#endif
- spx_fft(st->fft_lookup, frame, st->ft);
+ spx_fft(st->fft_lookup, frame, st->ft);
power_spectrum(st->ft, ps, N << 1);
filterbank_compute_bank32(st->bank, ps, ps+N);
@@ -399,7 +399,7 @@ static void preprocess_analysis(SpeexPreprocessState * restrict st, spx_int16_t
#define OVERRIDE_UPDATE_NOISE_PROB
static void update_noise_prob(SpeexPreprocessState * restrict st)
{
-
+
register float * restrict S = st->S;
register float * restrict ps = st->ps;
register int N = st->ps_size;
@@ -426,7 +426,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
psii = ps[i+1];
psiii = ps[i+2];
S[i] = .8f * S[i] + .05f * ips + .1f * psi + .05f * psii;
- S[i+1] = .8f * S[i+1] + .05f * psi + .1f * psii + .05f * psiii;
+ S[i+1] = .8f * S[i+1] + .05f * psi + .1f * psii + .05f * psiii;
ips = psii;
psi = psiii;
}
@@ -435,9 +435,9 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
}
nb_adapt = st->nb_adapt;
-
+
if ( nb_adapt==1 )
- {
+ {
for (i=0;i<N;i++)
Smin[i] = st->Stmp[i] = 0;
}
@@ -446,7 +446,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
mux(nb_adapt < 1000, 50,
mux(nb_adapt < 10000, 150, 300)));
-
+
if ( st->min_count > min_range )
{
st->min_count = 0;
@@ -469,7 +469,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
#pragma TCS_unroll=0
#endif
- } else
+ } else
{
register float * restrict Smin = st->Smin;
@@ -484,9 +484,9 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
stmpi = Stmp[i];
si = S[i];
smini = Smin[i];
-
+
Smin[i] = fmin(smini,si);
- Stmp[i] = fmin(stmpi,si);
+ Stmp[i] = fmin(stmpi,si);
}
#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
#pragma TCS_unrollexact=0
@@ -508,7 +508,7 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
si = S[i];
smini = Smin[i];
update_prob[i] = mux( (.4 * si) > (smini + 20.f), 1, 0);
-
+
}
#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
#pragma TCS_unrollexact=0
@@ -522,11 +522,11 @@ static void update_noise_prob(SpeexPreprocessState * restrict st)
#define OVERRIDE_COMPUTE_GAIN_FLOOR
static void compute_gain_floor(
- int noise_suppress,
- int effective_echo_suppress,
- float * restrict noise,
- float * restrict echo,
- float * gain_floor,
+ int noise_suppress,
+ int effective_echo_suppress,
+ float * restrict noise,
+ float * restrict echo,
+ float * gain_floor,
int len
)
{
@@ -592,7 +592,7 @@ void preprocess_residue_echo(
#ifndef FIXED_POINT
r = r_echo[0];
if (!(r >=0 && r < N*1e9f) )
- {
+ {
memset(r_echo, 0, N * sizeof(spx_word32_t));
}
#endif
@@ -610,8 +610,8 @@ void preprocess_residue_echo(
#pragma TCS_unroll=0
#endif
filterbank_compute_bank32(st->bank, e_noise, e_noise+N);
-
- } else
+
+ } else
{ memset(st->echo_noise, 0, (NM) * sizeof(spx_word32_t));
}
}
@@ -639,7 +639,7 @@ void preprocess_update_noise(
register spx_word32_t psi = ps[i];
if ( !up[i] || psi < PSHR32(ni, NOISE_SHIFT) )
- { noise[i] = MAX32(EXTEND32(0),MULT16_32_Q15(beta_1,ni) +
+ { noise[i] = MAX32(EXTEND32(0),MULT16_32_Q15(beta_1,ni) +
MULT16_32_Q15(beta,SHL32(psi,NOISE_SHIFT)));
}
}
@@ -677,7 +677,7 @@ void preprocess_compute_SNR(
register spx_word16_t priori;
tot_noise = ADD32(ADD32(ADD32(EXTEND32(1), PSHR32(noise[i],NOISE_SHIFT)), echo[i]) , reverb[i]);
-
+
posti = SUB16(DIV32_16_Q8(ps[i],tot_noise), QCONST16(1.f,SNR_SHIFT));
posti = MIN16(posti, QCONST16(100.f,SNR_SHIFT));
post[i] = posti;
@@ -685,7 +685,7 @@ void preprocess_compute_SNR(
opsi = old_ps[i];
gamma = QCONST16(.1f,15)+MULT16_16_Q15(QCONST16(.89f,15),SQR16_Q15(DIV32_16_Q15(opsi,ADD32(opsi,tot_noise))));
-
+
priori = EXTRACT16(PSHR32(ADD32(MULT16_16(gamma,MAX16(0,posti)), MULT16_16(Q15_ONE-gamma,DIV32_16_Q8(opsi,tot_noise))), 15));
prior[i]=MIN16(priori, QCONST16(100.f,SNR_SHIFT));
}
@@ -711,7 +711,7 @@ spx_word32_t preprocess_smooth_SNR(
iprior = prior[0];
priori = prior[1];
zeta[0] = PSHR32(ADD32(MULT16_16(QCONST16(.7f,15),zeta[0]), MULT16_16(QCONST16(.3f,15),iprior)),15);
-
+
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unroll=2
#pragma TCS_unrollexact=1
@@ -733,13 +733,13 @@ spx_word32_t preprocess_smooth_SNR(
for (i=_N; i<NM ; i++)
{ register spx_word16_t zetai = zeta[i];
-
+
priori = prior[i];
zeta[i] = PSHR32(ADD32(MULT16_16(QCONST16(.7f,15),zetai), MULT16_16(QCONST16(.3f,15),priori)),15);
}
Zframe = 0;
-
+
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
@@ -770,7 +770,7 @@ void preprocess_compute_emgain(
register spx_word16_t * restrict gain2 = st->gain2;
register int i;
register int N=st->ps_size;
-
+
for ( i=N ; i<NM ; ++i )
{
register spx_word32_t theta;
@@ -783,7 +783,7 @@ void preprocess_compute_emgain(
register spx_word16_t tmp;
#endif
register spx_word16_t priori = prior[i];
-
+
prior_ratio = PDIV32_16(SHL32(EXTEND32(priori), 15), ADD16(priori, SHL32(1,SNR_SHIFT)));
theta = MULT16_32_P15(prior_ratio, QCONST32(1.f,EXPIN_SHIFT)+SHL32(EXTEND32(post[i]),EXPIN_SHIFT-SNR_SHIFT));
@@ -811,7 +811,7 @@ void preprocess_compute_emgain(
void preprocess_compute_linear_gain(
SpeexPreprocessState * restrict st,
- spx_word32_t * restrict ps,
+ spx_word32_t * restrict ps,
int N
)
{
@@ -828,7 +828,7 @@ void preprocess_compute_linear_gain(
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for (i=0;i<N;i++)
{
register spx_word32_t MM;
@@ -845,16 +845,16 @@ void preprocess_compute_linear_gain(
g = EXTRACT16(MIN32(Q15_ONE, MULT16_32_Q15(prior_ratio, MM)));
p = gain2[i];
-
+
g = VMUX( MULT16_16_Q15(QCONST16(.333f,15),g) > gain[i], MULT16_16(3,gain[i]), g);
- old_ps[i]= MULT16_32_P15(QCONST16(.2f,15),old_ps[i]) +
+ old_ps[i]= MULT16_32_P15(QCONST16(.2f,15),old_ps[i]) +
MULT16_32_P15(MULT16_16_P15(QCONST16(.8f,15),SQR16_Q15(g)),ps[i]);
-
+
g = VMUX( g < gfi, gfi, g );
gain[i] = g;
- tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(g),15))) +
+ tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(g),15))) +
MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(gfi),15)));
gain2[i]=SQR16_Q15(tmp);
@@ -888,11 +888,11 @@ void preprocess_compute_bark_gain(
register spx_word16_t gaini;
register spx_word16_t gfi = gain_floor[i];
- gaini = MAX16(gain[i], gfi);
+ gaini = MAX16(gain[i], gfi);
gain[i] = gaini;
- tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(gaini),15))) +
+ tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(gaini),15))) +
MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(gfi),15)));
gain2[i]=SQR16_Q15(tmp);
@@ -940,10 +940,10 @@ void preprocess_scale(
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for ( i=0 ; i<N2 ;i++)
{ register spx_word16_t framei = frame[i];
-
+
frame[i] = PSHR16(framei,shift);
}
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
@@ -956,9 +956,9 @@ void preprocess_scale(
void preprocess_apply_agc(
SpeexPreprocessState * restrict st,
- int N
+ int N
)
-{
+{
register spx_word16_t max_sample=0;
register spx_word16_t * restrict frame = st->frame;
register int i;
@@ -967,7 +967,7 @@ void preprocess_apply_agc(
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for (i=0;i<N2;i++)
{ register spx_word16_t framei = VABS(frame[i]);
@@ -976,7 +976,7 @@ void preprocess_apply_agc(
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
if ( max_sample > 28000.f )
{
@@ -985,14 +985,14 @@ void preprocess_apply_agc(
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for ( i=0 ; i< N2 ; i++ )
{ frame[i] *= damp;
}
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
}
}
#endif
@@ -1001,7 +1001,7 @@ void preprocess_apply_agc(
void preprocess_update(
SpeexPreprocessState * restrict st,
spx_int16_t * restrict x,
- int N
+ int N
)
{
register spx_word16_t * restrict frame = st->frame;
@@ -1016,7 +1016,7 @@ void preprocess_update(
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for ( i=0 ; i<N2 ; i++)
{ register spx_word16_t fi = frame[i];
register spx_word16_t wi = window[i];
@@ -1029,12 +1029,12 @@ void preprocess_update(
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unrollexact=0
#pragma TCS_unroll=0
-#endif
+#endif
for ( i=0;i<N4;i++)
{ x[N3+i] = frame[N3+i];
}
-
+
memcpy(outbuf, frame+framesize, (N3) * sizeof(spx_word16_t));
}
@@ -1063,22 +1063,22 @@ int speex_preprocess_run(SpeexPreprocessState * restrict st, spx_int16_t * restr
preprocess_compute_SNR(st, ps, NM);
Zframe = preprocess_smooth_SNR(st, N, NM);
-
+
{
register spx_word16_t effective_echo_suppress;
-
+
Pframe = QCONST16(.1f,15)+MULT16_16_Q15(QCONST16(.899f,15),qcurve(DIV32_16(Zframe,M)));
- effective_echo_suppress = EXTRACT16(PSHR32(ADD32(MULT16_16(SUB16(Q15_ONE,Pframe), st->echo_suppress),
+ effective_echo_suppress = EXTRACT16(PSHR32(ADD32(MULT16_16(SUB16(Q15_ONE,Pframe), st->echo_suppress),
MULT16_16(Pframe, st->echo_suppress_active)),15));
compute_gain_floor(st->noise_suppress, effective_echo_suppress, st->noise+N, st->echo_noise+N, st->gain_floor+N, M);
-
+
}
preprocess_compute_emgain(st, ps, Pframe, NM);
preprocess_compute_linear_gain(st, ps, N);
-
+
if (!st->denoise_enabled)
{
register spx_word16_t * restrict gain2 = st->gain2;
@@ -1086,7 +1086,7 @@ int speex_preprocess_run(SpeexPreprocessState * restrict st, spx_int16_t * restr
#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
#pragma TCS_unroll=4
#pragma TCS_unrollexact=1
-#endif
+#endif
for ( i=0 ; i<NM ; i++ )
{ gain2[i] = Q15_ONE;
}
@@ -1095,7 +1095,7 @@ int speex_preprocess_run(SpeexPreprocessState * restrict st, spx_int16_t * restr
#pragma TCS_unroll=0
#endif
}
-
+
preprocess_apply_gain(st, N);
#ifndef FIXED_POINT
@@ -1124,12 +1124,12 @@ int speex_preprocess_run(SpeexPreprocessState * restrict st, spx_int16_t * restr
if (Pframe > st->speech_prob_start || (st->was_speech && Pframe > st->speech_prob_continue))
{ st->was_speech=1;
return 1;
-
+
} else
{ st->was_speech=0;
return 0;
}
- } else
+ } else
{ return 1;
}
}
diff --git a/tmv/profile_tm.h b/tmv/profile_tm.h
index 8588e26..e6fe111 100644
--- a/tmv/profile_tm.h
+++ b/tmv/profile_tm.h
@@ -8,18 +8,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
+
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
-
+
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -178,7 +178,7 @@ extern int __profile_end;
#define COMPUTERMS16_START()
#define COMPUTERMS16_STOP()
#endif
-
+
#if TM_PROFILE_NORMALIZE16
#define NORMALIZE16_START() PROFILE_START()
#define NORMALIZE16_STOP() PROFILE_STOP()
diff --git a/win32/Makefile b/win32/Makefile
index 7ce8bd4..5be8347 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -216,6 +216,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -244,10 +245,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -260,11 +261,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/Makefile.in b/win32/Makefile.in
index 91c6b70..35c74fb 100644
--- a/win32/Makefile.in
+++ b/win32/Makefile.in
@@ -216,6 +216,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2003/Makefile b/win32/VS2003/Makefile
index d03ac54..86f0b2d 100644
--- a/win32/VS2003/Makefile
+++ b/win32/VS2003/Makefile
@@ -216,6 +216,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -244,10 +245,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -260,11 +261,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2003
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2003
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/VS2003/Makefile.in b/win32/VS2003/Makefile.in
index 747bf78..e8bb95f 100644
--- a/win32/VS2003/Makefile.in
+++ b/win32/VS2003/Makefile.in
@@ -216,6 +216,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2003/libspeexdsp/Makefile b/win32/VS2003/libspeexdsp/Makefile
index 811419c..186d483 100644
--- a/win32/VS2003/libspeexdsp/Makefile
+++ b/win32/VS2003/libspeexdsp/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2003/libspeexdsp
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2003/libspeexdsp
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/VS2003/libspeexdsp/Makefile.in b/win32/VS2003/libspeexdsp/Makefile.in
index f793241..e67e599 100644
--- a/win32/VS2003/libspeexdsp/Makefile.in
+++ b/win32/VS2003/libspeexdsp/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2003/libspeexdsp/libspeexdsp.vcproj b/win32/VS2003/libspeexdsp/libspeexdsp.vcproj
index 1fc21ad..833a255 100755
--- a/win32/VS2003/libspeexdsp/libspeexdsp.vcproj
+++ b/win32/VS2003/libspeexdsp/libspeexdsp.vcproj
@@ -120,7 +120,7 @@
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
AdditionalIncludeDirectories="..\..\..\include;..\.."
- PreprocessorDefinitions="_USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H"
+ PreprocessorDefinitions="USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="0"
@@ -181,7 +181,7 @@
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
AdditionalIncludeDirectories="..\..\..\include;..\.."
- PreprocessorDefinitions="_USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H"
+ PreprocessorDefinitions="USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="2"
diff --git a/win32/VS2003/tests/Makefile b/win32/VS2003/tests/Makefile
index 94752e9..e4532e2 100644
--- a/win32/VS2003/tests/Makefile
+++ b/win32/VS2003/tests/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2003/tests
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2003/tests
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/VS2003/tests/Makefile.in b/win32/VS2003/tests/Makefile.in
index 6ff133a..f956f1b 100644
--- a/win32/VS2003/tests/Makefile.in
+++ b/win32/VS2003/tests/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2005/Makefile b/win32/VS2005/Makefile
index 354476d..f5b1867 100644
--- a/win32/VS2005/Makefile
+++ b/win32/VS2005/Makefile
@@ -216,6 +216,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -244,10 +245,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -260,11 +261,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2005
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2005
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/VS2005/Makefile.in b/win32/VS2005/Makefile.in
index 3932406..857acdd 100644
--- a/win32/VS2005/Makefile.in
+++ b/win32/VS2005/Makefile.in
@@ -216,6 +216,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2005/libspeexdsp/Makefile b/win32/VS2005/libspeexdsp/Makefile
index f47cf2b..ce60e76 100644
--- a/win32/VS2005/libspeexdsp/Makefile
+++ b/win32/VS2005/libspeexdsp/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2005/libspeexdsp
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2005/libspeexdsp
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/VS2005/libspeexdsp/Makefile.in b/win32/VS2005/libspeexdsp/Makefile.in
index 92c4d20..29c49a6 100644
--- a/win32/VS2005/libspeexdsp/Makefile.in
+++ b/win32/VS2005/libspeexdsp/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2005/libspeexdsp/libspeexdsp.vcproj b/win32/VS2005/libspeexdsp/libspeexdsp.vcproj
index 2d22d6a..407d036 100755
--- a/win32/VS2005/libspeexdsp/libspeexdsp.vcproj
+++ b/win32/VS2005/libspeexdsp/libspeexdsp.vcproj
@@ -696,7 +696,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\..\include;..\.."
- PreprocessorDefinitions="_USE_SSE;WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
+ PreprocessorDefinitions="USE_SSE;WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="0"
diff --git a/win32/VS2005/tests/Makefile b/win32/VS2005/tests/Makefile
index afe3728..5827e02 100644
--- a/win32/VS2005/tests/Makefile
+++ b/win32/VS2005/tests/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2005/tests
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2005/tests
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/VS2005/tests/Makefile.in b/win32/VS2005/tests/Makefile.in
index 9818840..b19b3c9 100644
--- a/win32/VS2005/tests/Makefile.in
+++ b/win32/VS2005/tests/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2008/Makefile b/win32/VS2008/Makefile
index 7198514..65e2056 100644
--- a/win32/VS2008/Makefile
+++ b/win32/VS2008/Makefile
@@ -216,6 +216,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -244,10 +245,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -260,11 +261,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2008
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2008
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/VS2008/Makefile.in b/win32/VS2008/Makefile.in
index c321697..c2dbed5 100644
--- a/win32/VS2008/Makefile.in
+++ b/win32/VS2008/Makefile.in
@@ -216,6 +216,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2008/libspeexdsp/Makefile b/win32/VS2008/libspeexdsp/Makefile
index 3f9d576..d034e63 100644
--- a/win32/VS2008/libspeexdsp/Makefile
+++ b/win32/VS2008/libspeexdsp/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2008/libspeexdsp
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2008/libspeexdsp
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/VS2008/libspeexdsp/Makefile.in b/win32/VS2008/libspeexdsp/Makefile.in
index 6d14842..f945664 100644
--- a/win32/VS2008/libspeexdsp/Makefile.in
+++ b/win32/VS2008/libspeexdsp/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2008/libspeexdsp/libspeexdsp.vcproj b/win32/VS2008/libspeexdsp/libspeexdsp.vcproj
index 5904b94..3cc16e4 100755
--- a/win32/VS2008/libspeexdsp/libspeexdsp.vcproj
+++ b/win32/VS2008/libspeexdsp/libspeexdsp.vcproj
@@ -182,7 +182,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\..\include;..\.."
- PreprocessorDefinitions="_USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H"
+ PreprocessorDefinitions="USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
@@ -269,7 +269,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\..\include;..\.."
- PreprocessorDefinitions="_USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H"
+ PreprocessorDefinitions="USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
@@ -320,47 +320,47 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath="..\..\..\libspeex\buffer.c"
+ RelativePath="..\..\..\libspeexdsp\buffer.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\fftwrap.c"
+ RelativePath="..\..\..\libspeexdsp\fftwrap.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\filterbank.c"
+ RelativePath="..\..\..\libspeexdsp\filterbank.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\jitter.c"
+ RelativePath="..\..\..\libspeexdsp\jitter.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\kiss_fft.c"
+ RelativePath="..\..\..\libspeexdsp\kiss_fft.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\kiss_fftr.c"
+ RelativePath="..\..\..\libspeexdsp\kiss_fftr.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\mdf.c"
+ RelativePath="..\..\..\libspeexdsp\mdf.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\preprocess.c"
+ RelativePath="..\..\..\libspeexdsp\preprocess.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\resample.c"
+ RelativePath="..\..\..\libspeexdsp\resample.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\scal.c"
+ RelativePath="..\..\..\libspeexdsp\scal.c"
>
</File>
<File
- RelativePath="..\..\..\libspeex\smallft.c"
+ RelativePath="..\..\..\libspeexdsp\smallft.c"
>
</File>
</Filter>
@@ -370,51 +370,51 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
- RelativePath="..\..\..\libspeex\_kiss_fft_guts.h"
+ RelativePath="..\..\..\libspeexdsp\_kiss_fft_guts.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\arch.h"
+ RelativePath="..\..\..\libspeexdsp\arch.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\fftwrap.h"
+ RelativePath="..\..\..\libspeexdsp\fftwrap.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\filterbank.h"
+ RelativePath="..\..\..\libspeexdsp\filterbank.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\fixed_debug.h"
+ RelativePath="..\..\..\libspeexdsp\fixed_debug.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\fixed_generic.h"
+ RelativePath="..\..\..\libspeexdsp\fixed_generic.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\kiss_fft.h"
+ RelativePath="..\..\..\libspeexdsp\kiss_fft.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\kiss_fftr.h"
+ RelativePath="..\..\..\libspeexdsp\kiss_fftr.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\math_approx.h"
+ RelativePath="..\..\..\libspeexdsp\math_approx.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\os_support.h"
+ RelativePath="..\..\..\libspeexdsp\os_support.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\pseudofloat.h"
+ RelativePath="..\..\..\libspeexdsp\pseudofloat.h"
>
</File>
<File
- RelativePath="..\..\..\libspeex\smallft.h"
+ RelativePath="..\..\..\libspeexdsp\smallft.h"
>
</File>
</Filter>
diff --git a/win32/VS2008/tests/Makefile b/win32/VS2008/tests/Makefile
index 6c18df2..96086dd 100644
--- a/win32/VS2008/tests/Makefile
+++ b/win32/VS2008/tests/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2008/tests
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/VS2008/tests
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/VS2008/tests/Makefile.in b/win32/VS2008/tests/Makefile.in
index 4bc6d6e..f42cd2b 100644
--- a/win32/VS2008/tests/Makefile.in
+++ b/win32/VS2008/tests/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/win32/VS2008/tests/testdenoise.vcproj b/win32/VS2008/tests/testdenoise.vcproj
index 1c0f8c1..bf345d4 100644
--- a/win32/VS2008/tests/testdenoise.vcproj
+++ b/win32/VS2008/tests/testdenoise.vcproj
@@ -283,7 +283,7 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath="..\..\..\libspeex\testdenoise.c"
+ RelativePath="..\..\..\libspeexdsp\testdenoise.c"
>
</File>
</Filter>
diff --git a/win32/VS2008/tests/testecho.vcproj b/win32/VS2008/tests/testecho.vcproj
index c2c4126..149886b 100644
--- a/win32/VS2008/tests/testecho.vcproj
+++ b/win32/VS2008/tests/testecho.vcproj
@@ -283,7 +283,7 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath="..\..\..\libspeex\testecho.c"
+ RelativePath="..\..\..\libspeexdsp\testecho.c"
>
</File>
</Filter>
diff --git a/win32/VS2008/tests/testresample.vcproj b/win32/VS2008/tests/testresample.vcproj
index 45565ed..6476915 100644
--- a/win32/VS2008/tests/testresample.vcproj
+++ b/win32/VS2008/tests/testresample.vcproj
@@ -283,7 +283,7 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath="..\..\..\libspeex\testresample.c"
+ RelativePath="..\..\..\libspeexdsp\testresample.c"
>
</File>
</Filter>
diff --git a/win32/config.h b/win32/config.h
index 6366d7b..22745b1 100644
--- a/win32/config.h
+++ b/win32/config.h
@@ -3,19 +3,19 @@
// In Visual Studio, _M_IX86_FP=1 means /arch:SSE was used, likewise
// _M_IX86_FP=2 means /arch:SSE2 was used.
-// Also, enable both _USE_SSE and _USE_SSE2 if we're compiling for x86-64
+// Also, enable both USE_SSE and USE_SSE2 if we're compiling for x86-64
#if _M_IX86_FP >= 1 || defined(_M_X64)
-#define _USE_SSE
+#define USE_SSE
#endif
#if _M_IX86_FP >= 2 || defined(_M_X64)
-#define _USE_SSE2
+#define USE_SSE2
#endif
// Visual Studio support alloca(), but it always align variables to 16-bit
// boundary, while SSE need 128-bit alignment. So we disable alloca() when
// SSE is enabled.
-#ifndef _USE_SSE
+#ifndef USE_SSE
# define USE_ALLOCA
#endif
diff --git a/win32/libspeexdsp/Makefile b/win32/libspeexdsp/Makefile
index b9bb21d..04e8678 100644
--- a/win32/libspeexdsp/Makefile
+++ b/win32/libspeexdsp/Makefile
@@ -158,6 +158,7 @@ FFT_PKGCONFIG =
FGREP = /usr/bin/grep -F
FILECMD = file
GREP = /usr/bin/grep
+INCLUDE_STDINT = #include <stdint.h>
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
@@ -186,10 +187,10 @@ OTOOL64 =
PACKAGE = speexdsp
PACKAGE_BUGREPORT = speex-dev@xiph.org
PACKAGE_NAME = speexdsp
-PACKAGE_STRING = speexdsp 1.2rc3
+PACKAGE_STRING = speexdsp 1.2.1
PACKAGE_TARNAME = speexdsp
PACKAGE_URL =
-PACKAGE_VERSION = 1.2rc3
+PACKAGE_VERSION = 1.2.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
@@ -202,11 +203,11 @@ SIZE16 = int16_t
SIZE32 = int32_t
SPEEXDSP_LT_AGE = 5
SPEEXDSP_LT_CURRENT = 6
-SPEEXDSP_LT_REVISION = 0
+SPEEXDSP_LT_REVISION = 2
STRIP = strip
USIZE16 = uint16_t
USIZE32 = uint32_t
-VERSION = 1.2rc3
+VERSION = 1.2.1
abs_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/libspeexdsp
abs_srcdir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex/win32/libspeexdsp
abs_top_builddir = /usr/local/google/home/sadafebrahimi/aosp/forupdatesonly/aosp-master-with-phones/external/speex
diff --git a/win32/libspeexdsp/Makefile.in b/win32/libspeexdsp/Makefile.in
index 53377c1..35b3fdd 100644
--- a/win32/libspeexdsp/Makefile.in
+++ b/win32/libspeexdsp/Makefile.in
@@ -158,6 +158,7 @@ FFT_PKGCONFIG = @FFT_PKGCONFIG@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
+INCLUDE_STDINT = @INCLUDE_STDINT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@