parent
2f46c6ca1f
commit
94964474b2
@ -1,53 +0,0 @@
|
||||
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
#
|
||||
# Use of this source code is governed by a BSD-style license
|
||||
# that can be found in the LICENSE file in the root of the source
|
||||
# tree. An additional intellectual property rights grant can be found
|
||||
# in the file PATENTS. All contributing project authors may
|
||||
# be found in the AUTHORS file in the root of the source tree.
|
||||
|
||||
# These defines will apply to all source files
|
||||
# Think again before changing it
|
||||
MY_WEBRTC_COMMON_DEFS := \
|
||||
'-DWEBRTC_TARGET_PC' \
|
||||
'-DWEBRTC_LINUX' \
|
||||
'-DWEBRTC_THREAD_RR' \
|
||||
'-DWEBRTC_CLOCK_TYPE_REALTIME' \
|
||||
'-DWEBRTC_ANDROID'
|
||||
# The following macros are used by modules,
|
||||
# we might need to re-organize them
|
||||
# '-DWEBRTC_ANDROID_OPENSLES' [module audio_device]
|
||||
# '-DNETEQ_VOICEENGINE_CODECS' [module audio_coding neteq]
|
||||
# '-DWEBRTC_MODULE_UTILITY_VIDEO' [module media_file] [module utility]
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
MY_WEBRTC_COMMON_DEFS += \
|
||||
'-DWEBRTC_ARCH_ARM'
|
||||
# '-DWEBRTC_DETECT_ARM_NEON' # only used in a build configuration without Neon
|
||||
# TODO(kma): figure out if the above define could be moved to NDK build only.
|
||||
|
||||
# TODO(kma): test if the code under next two macros works with generic GCC compilers
|
||||
ifeq ($(ARCH_ARM_HAVE_NEON),true)
|
||||
MY_WEBRTC_COMMON_DEFS += \
|
||||
'-DWEBRTC_ARCH_ARM_NEON'
|
||||
endif
|
||||
|
||||
ifneq (,$(filter '-DWEBRTC_DETECT_ARM_NEON' '-DWEBRTC_ARCH_ARM_NEON', \
|
||||
$(MY_WEBRTC_COMMON_DEFS)))
|
||||
WEBRTC_BUILD_NEON_LIBS := true
|
||||
# TODO(kma): Use MY_ARM_CFLAGS_NEON for Neon libraies in AECM, NS, and iSAC.
|
||||
MY_ARM_CFLAGS_NEON := \
|
||||
-mfpu=neon \
|
||||
-mfloat-abi=softfp \
|
||||
-flax-vector-conversions
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH_ARM_HAVE_ARMV7A),true)
|
||||
MY_WEBRTC_COMMON_DEFS += \
|
||||
'-DWEBRTC_ARCH_ARM_V7A'
|
||||
endif
|
||||
|
||||
endif # ifeq ($(TARGET_ARCH),arm)
|
||||
|
||||
#added for redphone
|
||||
|
||||
#MY_WEBRTC_COMMON_DEFS += '-DNDEBUG'
|
@ -1,52 +0,0 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libspeex
|
||||
LOCAL_CFLAGS := -DFIXED_POINT -DUSE_KISS_FFT -DEXPORT="" -UHAVE_CONFIG_H
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(LOCAL_PATH)/bits.c \
|
||||
$(LOCAL_PATH)/buffer.c \
|
||||
$(LOCAL_PATH)/cb_search.c \
|
||||
$(LOCAL_PATH)/exc_10_16_table.c \
|
||||
$(LOCAL_PATH)/exc_10_32_table.c \
|
||||
$(LOCAL_PATH)/exc_20_32_table.c \
|
||||
$(LOCAL_PATH)/exc_5_256_table.c \
|
||||
$(LOCAL_PATH)/exc_5_64_table.c \
|
||||
$(LOCAL_PATH)/exc_8_128_table.c \
|
||||
$(LOCAL_PATH)/fftwrap.c \
|
||||
$(LOCAL_PATH)/filterbank.c \
|
||||
$(LOCAL_PATH)/filters.c \
|
||||
$(LOCAL_PATH)/gain_table.c \
|
||||
$(LOCAL_PATH)/gain_table_lbr.c \
|
||||
$(LOCAL_PATH)/hexc_10_32_table.c \
|
||||
$(LOCAL_PATH)/hexc_table.c \
|
||||
$(LOCAL_PATH)/high_lsp_tables.c \
|
||||
$(LOCAL_PATH)/jitter.c \
|
||||
$(LOCAL_PATH)/kiss_fft.c \
|
||||
$(LOCAL_PATH)/kiss_fftr.c \
|
||||
$(LOCAL_PATH)/lpc.c \
|
||||
$(LOCAL_PATH)/lsp.c \
|
||||
$(LOCAL_PATH)/lsp_tables_nb.c \
|
||||
$(LOCAL_PATH)/ltp.c \
|
||||
$(LOCAL_PATH)/mdf.c \
|
||||
$(LOCAL_PATH)/modes.c \
|
||||
$(LOCAL_PATH)/modes_wb.c \
|
||||
$(LOCAL_PATH)/nb_celp.c \
|
||||
$(LOCAL_PATH)/preprocess.c \
|
||||
$(LOCAL_PATH)/quant_lsp.c \
|
||||
$(LOCAL_PATH)/resample.c \
|
||||
$(LOCAL_PATH)/sb_celp.c \
|
||||
$(LOCAL_PATH)/scal.c \
|
||||
$(LOCAL_PATH)/smallft.c \
|
||||
$(LOCAL_PATH)/speex.c \
|
||||
$(LOCAL_PATH)/speex_callbacks.c \
|
||||
$(LOCAL_PATH)/speex_header.c \
|
||||
$(LOCAL_PATH)/stereo.c \
|
||||
$(LOCAL_PATH)/vbr.c \
|
||||
$(LOCAL_PATH)/vq.c \
|
||||
$(LOCAL_PATH)/window.c
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
@ -1,667 +0,0 @@
|
||||
# Makefile.in generated by automake 1.8.5 from Makefile.am.
|
||||
# libspeex/Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
|
||||
# Disable automatic dependency tracking if using other tools than gcc and gmake
|
||||
#AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
|
||||
|
||||
SOURCES = $(libspeex_la_SOURCES) $(libspeexdsp_la_SOURCES) $(testdenoise_SOURCES) $(testecho_SOURCES) $(testenc_SOURCES) $(testenc_uwb_SOURCES) $(testenc_wb_SOURCES) $(testjitter_SOURCES)
|
||||
|
||||
srcdir = .
|
||||
top_srcdir = ..
|
||||
|
||||
pkgdatadir = $(datadir)/speex
|
||||
pkglibdir = $(libdir)/speex
|
||||
pkgincludedir = $(includedir)/speex
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = /usr/bin/install -c
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = x86_64-unknown-linux-gnu
|
||||
noinst_PROGRAMS = testenc$(EXEEXT) testenc_wb$(EXEEXT) \
|
||||
testenc_uwb$(EXEEXT) testdenoise$(EXEEXT) testecho$(EXEEXT) \
|
||||
testjitter$(EXEEXT)
|
||||
subdir = libspeex
|
||||
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(mkdir_p)
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libspeex_la_LIBADD =
|
||||
am_libspeex_la_OBJECTS = cb_search.lo exc_10_32_table.lo \
|
||||
exc_8_128_table.lo filters.lo gain_table.lo hexc_table.lo \
|
||||
high_lsp_tables.lo lsp.lo ltp.lo speex.lo stereo.lo vbr.lo \
|
||||
vq.lo bits.lo exc_10_16_table.lo exc_20_32_table.lo \
|
||||
exc_5_256_table.lo exc_5_64_table.lo gain_table_lbr.lo \
|
||||
hexc_10_32_table.lo lpc.lo lsp_tables_nb.lo modes.lo \
|
||||
modes_wb.lo nb_celp.lo quant_lsp.lo sb_celp.lo \
|
||||
speex_callbacks.lo speex_header.lo window.lo
|
||||
libspeex_la_OBJECTS = $(am_libspeex_la_OBJECTS)
|
||||
libspeexdsp_la_LIBADD =
|
||||
am__libspeexdsp_la_SOURCES_DIST = preprocess.c jitter.c mdf.c \
|
||||
fftwrap.c filterbank.c resample.c buffer.c scal.c smallft.c \
|
||||
kiss_fft.c _kiss_fft_guts.h kiss_fft.h kiss_fftr.c kiss_fftr.h
|
||||
am__objects_1 = smallft.lo
|
||||
#am__objects_1 = kiss_fft.lo kiss_fftr.lo
|
||||
am_libspeexdsp_la_OBJECTS = preprocess.lo jitter.lo mdf.lo fftwrap.lo \
|
||||
filterbank.lo resample.lo buffer.lo scal.lo $(am__objects_1)
|
||||
libspeexdsp_la_OBJECTS = $(am_libspeexdsp_la_OBJECTS)
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_testdenoise_OBJECTS = testdenoise.$(OBJEXT)
|
||||
testdenoise_OBJECTS = $(am_testdenoise_OBJECTS)
|
||||
testdenoise_DEPENDENCIES = libspeexdsp.la
|
||||
am_testecho_OBJECTS = testecho.$(OBJEXT)
|
||||
testecho_OBJECTS = $(am_testecho_OBJECTS)
|
||||
testecho_DEPENDENCIES = libspeexdsp.la
|
||||
am_testenc_OBJECTS = testenc.$(OBJEXT)
|
||||
testenc_OBJECTS = $(am_testenc_OBJECTS)
|
||||
testenc_DEPENDENCIES = libspeex.la
|
||||
am_testenc_uwb_OBJECTS = testenc_uwb.$(OBJEXT)
|
||||
testenc_uwb_OBJECTS = $(am_testenc_uwb_OBJECTS)
|
||||
testenc_uwb_DEPENDENCIES = libspeex.la
|
||||
am_testenc_wb_OBJECTS = testenc_wb.$(OBJEXT)
|
||||
testenc_wb_OBJECTS = $(am_testenc_wb_OBJECTS)
|
||||
testenc_wb_DEPENDENCIES = libspeex.la
|
||||
am_testjitter_OBJECTS = testjitter.$(OBJEXT)
|
||||
testjitter_OBJECTS = $(am_testjitter_OBJECTS)
|
||||
testjitter_DEPENDENCIES = libspeexdsp.la
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
DEP_FILES = ./$(DEPDIR)/bits.Plo ./$(DEPDIR)/buffer.Plo \
|
||||
./$(DEPDIR)/cb_search.Plo \
|
||||
./$(DEPDIR)/exc_10_16_table.Plo \
|
||||
./$(DEPDIR)/exc_10_32_table.Plo \
|
||||
./$(DEPDIR)/exc_20_32_table.Plo \
|
||||
./$(DEPDIR)/exc_5_256_table.Plo \
|
||||
./$(DEPDIR)/exc_5_64_table.Plo \
|
||||
./$(DEPDIR)/exc_8_128_table.Plo \
|
||||
./$(DEPDIR)/fftwrap.Plo ./$(DEPDIR)/filterbank.Plo \
|
||||
./$(DEPDIR)/filters.Plo ./$(DEPDIR)/gain_table.Plo \
|
||||
./$(DEPDIR)/gain_table_lbr.Plo \
|
||||
./$(DEPDIR)/hexc_10_32_table.Plo \
|
||||
./$(DEPDIR)/hexc_table.Plo \
|
||||
./$(DEPDIR)/high_lsp_tables.Plo \
|
||||
./$(DEPDIR)/jitter.Plo ./$(DEPDIR)/kiss_fft.Plo \
|
||||
./$(DEPDIR)/kiss_fftr.Plo ./$(DEPDIR)/lpc.Plo \
|
||||
./$(DEPDIR)/lsp.Plo ./$(DEPDIR)/lsp_tables_nb.Plo \
|
||||
./$(DEPDIR)/ltp.Plo ./$(DEPDIR)/mdf.Plo \
|
||||
./$(DEPDIR)/modes.Plo ./$(DEPDIR)/modes_wb.Plo \
|
||||
./$(DEPDIR)/nb_celp.Plo ./$(DEPDIR)/preprocess.Plo \
|
||||
./$(DEPDIR)/quant_lsp.Plo ./$(DEPDIR)/resample.Plo \
|
||||
./$(DEPDIR)/sb_celp.Plo ./$(DEPDIR)/scal.Plo \
|
||||
./$(DEPDIR)/smallft.Plo ./$(DEPDIR)/speex.Plo \
|
||||
./$(DEPDIR)/speex_callbacks.Plo \
|
||||
./$(DEPDIR)/speex_header.Plo \
|
||||
./$(DEPDIR)/stereo.Plo ./$(DEPDIR)/testdenoise.Po \
|
||||
./$(DEPDIR)/testecho.Po ./$(DEPDIR)/testenc.Po \
|
||||
./$(DEPDIR)/testenc_uwb.Po \
|
||||
./$(DEPDIR)/testenc_wb.Po \
|
||||
./$(DEPDIR)/testjitter.Po ./$(DEPDIR)/vbr.Plo \
|
||||
./$(DEPDIR)/vq.Plo ./$(DEPDIR)/window.Plo
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(libspeex_la_SOURCES) $(libspeexdsp_la_SOURCES) \
|
||||
$(testdenoise_SOURCES) $(testecho_SOURCES) $(testenc_SOURCES) \
|
||||
$(testenc_uwb_SOURCES) $(testenc_wb_SOURCES) \
|
||||
$(testjitter_SOURCES)
|
||||
DIST_SOURCES = $(libspeex_la_SOURCES) \
|
||||
$(am__libspeexdsp_la_SOURCES_DIST) $(testdenoise_SOURCES) \
|
||||
$(testecho_SOURCES) $(testenc_SOURCES) $(testenc_uwb_SOURCES) \
|
||||
$(testenc_wb_SOURCES) $(testjitter_SOURCES)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = ${SHELL} /home/moxie/Downloads/speex-1.2rc1/missing --run aclocal-1.8
|
||||
AMDEP_FALSE = #
|
||||
AMDEP_TRUE =
|
||||
AMTAR = ${SHELL} /home/moxie/Downloads/speex-1.2rc1/missing --run tar
|
||||
AR = ar
|
||||
AS = as
|
||||
AUTOCONF = ${SHELL} /home/moxie/Downloads/speex-1.2rc1/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /home/moxie/Downloads/speex-1.2rc1/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /home/moxie/Downloads/speex-1.2rc1/missing --run automake-1.8
|
||||
AWK = gawk
|
||||
BUILD_KISS_FFT_FALSE =
|
||||
BUILD_KISS_FFT_TRUE = #
|
||||
BUILD_SMALLFT_FALSE = #
|
||||
BUILD_SMALLFT_TRUE =
|
||||
CC = gcc
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -g -O2 -fvisibility=hidden
|
||||
CPP = gcc -E
|
||||
CPPFLAGS =
|
||||
CXX = g++
|
||||
CXXCPP = g++ -E
|
||||
CXXDEPMODE = depmode=gcc3
|
||||
CXXFLAGS = -g -O2
|
||||
CYGPATH_W = echo
|
||||
DEFS = -DHAVE_CONFIG_H
|
||||
DEPDIR = .deps
|
||||
DLLTOOL = dlltool
|
||||
DSYMUTIL =
|
||||
ECHO = echo
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = /bin/grep -E
|
||||
EXEEXT =
|
||||
F77 =
|
||||
FFLAGS =
|
||||
FFT_CFLAGS =
|
||||
FFT_LIBS =
|
||||
FFT_PKGCONFIG =
|
||||
GREP = /bin/grep
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
|
||||
LDFLAGS =
|
||||
LIBOBJS =
|
||||
LIBS = -lm
|
||||
LIBTOOL = $(SHELL) $(top_builddir)/libtool
|
||||
LN_S = ln -s
|
||||
LTLIBOBJS =
|
||||
MAINT = #
|
||||
MAINTAINER_MODE_FALSE =
|
||||
MAINTAINER_MODE_TRUE = #
|
||||
MAKEINFO = ${SHELL} /home/moxie/Downloads/speex-1.2rc1/missing --run makeinfo
|
||||
NMEDIT =
|
||||
OBJDUMP = objdump
|
||||
OBJEXT = o
|
||||
OGG_CFLAGS =
|
||||
OGG_LIBS =
|
||||
PACKAGE = speex
|
||||
PACKAGE_BUGREPORT =
|
||||
PACKAGE_NAME =
|
||||
PACKAGE_STRING =
|
||||
PACKAGE_TARNAME =
|
||||
PACKAGE_VERSION =
|
||||
PATH_SEPARATOR = :
|
||||
PKG_CONFIG = /usr/bin/pkg-config
|
||||
RANLIB = ranlib
|
||||
SED = /bin/sed
|
||||
SET_MAKE =
|
||||
SHELL = /bin/bash
|
||||
SIZE16 = short
|
||||
SIZE32 = int
|
||||
SPEEX_LT_AGE = 5
|
||||
SPEEX_LT_CURRENT = 6
|
||||
SPEEX_LT_REVISION = 0
|
||||
SPEEX_VERSION = 1.2rc1
|
||||
STRIP = strip
|
||||
VERSION = 1.2rc1
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_CXX = g++
|
||||
ac_ct_F77 =
|
||||
am__fastdepCC_FALSE = #
|
||||
am__fastdepCC_TRUE =
|
||||
am__fastdepCXX_FALSE = #
|
||||
am__fastdepCXX_TRUE =
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
am__quote =
|
||||
bindir = ${exec_prefix}/bin
|
||||
build = x86_64-unknown-linux-gnu
|
||||
build_alias =
|
||||
build_cpu = x86_64
|
||||
build_os = linux-gnu
|
||||
build_vendor = unknown
|
||||
datadir = ${datarootdir}
|
||||
datarootdir = ${prefix}/share
|
||||
docdir = ${datarootdir}/doc/${PACKAGE}
|
||||
dvidir = ${docdir}
|
||||
exec_prefix = ${prefix}
|
||||
host = x86_64-unknown-linux-gnu
|
||||
host_alias =
|
||||
host_cpu = x86_64
|
||||
host_os = linux-gnu
|
||||
host_vendor = unknown
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = /home/moxie/Downloads/speex-1.2rc1/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${datarootdir}/man
|
||||
mkdir_p = mkdir -p -- .
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
prefix = /usr/local
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
src =
|
||||
sysconfdir = ${prefix}/etc
|
||||
target_alias =
|
||||
EXTRA_DIST = echo_diagnostic.m
|
||||
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir)
|
||||
lib_LTLIBRARIES = libspeex.la libspeexdsp.la
|
||||
|
||||
# Sources for compilation in the library
|
||||
libspeex_la_SOURCES = cb_search.c exc_10_32_table.c exc_8_128_table.c \
|
||||
filters.c gain_table.c hexc_table.c high_lsp_tables.c lsp.c \
|
||||
ltp.c speex.c stereo.c vbr.c vq.c bits.c exc_10_16_table.c \
|
||||
exc_20_32_table.c exc_5_256_table.c exc_5_64_table.c gain_table_lbr.c hexc_10_32_table.c \
|
||||
lpc.c lsp_tables_nb.c modes.c modes_wb.c nb_celp.c quant_lsp.c sb_celp.c \
|
||||
speex_callbacks.c speex_header.c window.c
|
||||
|
||||
#FFTSRC =
|
||||
FFTSRC = smallft.c
|
||||
#FFTSRC = kiss_fft.c _kiss_fft_guts.h kiss_fft.h kiss_fftr.c kiss_fftr.h
|
||||
libspeexdsp_la_SOURCES = preprocess.c jitter.c mdf.c fftwrap.c filterbank.c resample.c buffer.c scal.c $(FFTSRC)
|
||||
noinst_HEADERS = arch.h cb_search_arm4.h cb_search_bfin.h cb_search_sse.h \
|
||||
filters.h filters_arm4.h filters_bfin.h filters_sse.h fixed_arm4.h \
|
||||
fixed_arm5e.h fixed_bfin.h fixed_debug.h lpc.h lpc_bfin.h ltp.h ltp_arm4.h \
|
||||
ltp_sse.h math_approx.h misc_bfin.h nb_celp.h quant_lsp.h sb_celp.h \
|
||||
stack_alloc.h vbr.h vq.h vq_arm4.h vq_bfin.h vq_sse.h cb_search.h fftwrap.h \
|
||||
filterbank.h fixed_generic.h lsp.h lsp_bfin.h ltp_bfin.h modes.h os_support.h \
|
||||
pseudofloat.h quant_lsp_bfin.h smallft.h vorbis_psy.h resample_sse.h
|
||||
|
||||
libspeex_la_LDFLAGS = -no-undefined -version-info 6:0:5
|
||||
libspeexdsp_la_LDFLAGS = -no-undefined -version-info 6:0:5
|
||||
testenc_SOURCES = testenc.c
|
||||
testenc_LDADD = libspeex.la
|
||||
testenc_wb_SOURCES = testenc_wb.c
|
||||
testenc_wb_LDADD = libspeex.la
|
||||
testenc_uwb_SOURCES = testenc_uwb.c
|
||||
testenc_uwb_LDADD = libspeex.la
|
||||
testdenoise_SOURCES = testdenoise.c
|
||||
testdenoise_LDADD = libspeexdsp.la
|
||||
testecho_SOURCES = testecho.c
|
||||
testecho_LDADD = libspeexdsp.la
|
||||
testjitter_SOURCES = testjitter.c
|
||||
testjitter_LDADD = libspeexdsp.la
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libspeex/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu libspeex/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: # $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libspeex.la: $(libspeex_la_OBJECTS) $(libspeex_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libspeex_la_LDFLAGS) $(libspeex_la_OBJECTS) $(libspeex_la_LIBADD) $(LIBS)
|
||||
libspeexdsp.la: $(libspeexdsp_la_OBJECTS) $(libspeexdsp_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libspeexdsp_la_LDFLAGS) $(libspeexdsp_la_OBJECTS) $(libspeexdsp_la_LIBADD) $(LIBS)
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
testdenoise$(EXEEXT): $(testdenoise_OBJECTS) $(testdenoise_DEPENDENCIES)
|
||||
@rm -f testdenoise$(EXEEXT)
|
||||
$(LINK) $(testdenoise_LDFLAGS) $(testdenoise_OBJECTS) $(testdenoise_LDADD) $(LIBS)
|
||||
testecho$(EXEEXT): $(testecho_OBJECTS) $(testecho_DEPENDENCIES)
|
||||
@rm -f testecho$(EXEEXT)
|
||||
$(LINK) $(testecho_LDFLAGS) $(testecho_OBJECTS) $(testecho_LDADD) $(LIBS)
|
||||
testenc$(EXEEXT): $(testenc_OBJECTS) $(testenc_DEPENDENCIES)
|
||||
@rm -f testenc$(EXEEXT)
|
||||
$(LINK) $(testenc_LDFLAGS) $(testenc_OBJECTS) $(testenc_LDADD) $(LIBS)
|
||||
testenc_uwb$(EXEEXT): $(testenc_uwb_OBJECTS) $(testenc_uwb_DEPENDENCIES)
|
||||
@rm -f testenc_uwb$(EXEEXT)
|
||||
$(LINK) $(testenc_uwb_LDFLAGS) $(testenc_uwb_OBJECTS) $(testenc_uwb_LDADD) $(LIBS)
|
||||
testenc_wb$(EXEEXT): $(testenc_wb_OBJECTS) $(testenc_wb_DEPENDENCIES)
|
||||
@rm -f testenc_wb$(EXEEXT)
|
||||
$(LINK) $(testenc_wb_LDFLAGS) $(testenc_wb_OBJECTS) $(testenc_wb_LDADD) $(LIBS)
|
||||
testjitter$(EXEEXT): $(testjitter_OBJECTS) $(testjitter_DEPENDENCIES)
|
||||
@rm -f testjitter$(EXEEXT)
|
||||
$(LINK) $(testjitter_LDFLAGS) $(testjitter_OBJECTS) $(testjitter_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
include ./$(DEPDIR)/bits.Plo
|
||||
include ./$(DEPDIR)/buffer.Plo
|
||||
include ./$(DEPDIR)/cb_search.Plo
|
||||
include ./$(DEPDIR)/exc_10_16_table.Plo
|
||||
include ./$(DEPDIR)/exc_10_32_table.Plo
|
||||
include ./$(DEPDIR)/exc_20_32_table.Plo
|
||||
include ./$(DEPDIR)/exc_5_256_table.Plo
|
||||
include ./$(DEPDIR)/exc_5_64_table.Plo
|
||||
include ./$(DEPDIR)/exc_8_128_table.Plo
|
||||
include ./$(DEPDIR)/fftwrap.Plo
|
||||
include ./$(DEPDIR)/filterbank.Plo
|
||||
include ./$(DEPDIR)/filters.Plo
|
||||
include ./$(DEPDIR)/gain_table.Plo
|
||||
include ./$(DEPDIR)/gain_table_lbr.Plo
|
||||
include ./$(DEPDIR)/hexc_10_32_table.Plo
|
||||
include ./$(DEPDIR)/hexc_table.Plo
|
||||
include ./$(DEPDIR)/high_lsp_tables.Plo
|
||||
include ./$(DEPDIR)/jitter.Plo
|
||||
include ./$(DEPDIR)/kiss_fft.Plo
|
||||
include ./$(DEPDIR)/kiss_fftr.Plo
|
||||
include ./$(DEPDIR)/lpc.Plo
|
||||
include ./$(DEPDIR)/lsp.Plo
|
||||
include ./$(DEPDIR)/lsp_tables_nb.Plo
|
||||
include ./$(DEPDIR)/ltp.Plo
|
||||
include ./$(DEPDIR)/mdf.Plo
|
||||
include ./$(DEPDIR)/modes.Plo
|
||||
include ./$(DEPDIR)/modes_wb.Plo
|
||||
include ./$(DEPDIR)/nb_celp.Plo
|
||||
include ./$(DEPDIR)/preprocess.Plo
|
||||
include ./$(DEPDIR)/quant_lsp.Plo
|
||||
include ./$(DEPDIR)/resample.Plo
|
||||
include ./$(DEPDIR)/sb_celp.Plo
|
||||
include ./$(DEPDIR)/scal.Plo
|
||||
include ./$(DEPDIR)/smallft.Plo
|
||||
include ./$(DEPDIR)/speex.Plo
|
||||
include ./$(DEPDIR)/speex_callbacks.Plo
|
||||
include ./$(DEPDIR)/speex_header.Plo
|
||||
include ./$(DEPDIR)/stereo.Plo
|
||||
include ./$(DEPDIR)/testdenoise.Po
|
||||
include ./$(DEPDIR)/testecho.Po
|
||||
include ./$(DEPDIR)/testenc.Po
|
||||
include ./$(DEPDIR)/testenc_uwb.Po
|
||||
include ./$(DEPDIR)/testenc_wb.Po
|
||||
include ./$(DEPDIR)/testjitter.Po
|
||||
include ./$(DEPDIR)/vbr.Plo
|
||||
include ./$(DEPDIR)/vq.Plo
|
||||
include ./$(DEPDIR)/window.Plo
|
||||
|
||||
.c.o:
|
||||
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
|
||||
# $(CCDEPMODE) $(depcomp) \
|
||||
# $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
|
||||
# $(CCDEPMODE) $(depcomp) \
|
||||
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
# source='$<' object='$@' libtool=yes \
|
||||
# depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \
|
||||
# $(CCDEPMODE) $(depcomp) \
|
||||
# $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
clean-noinstPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS ctags \
|
||||
distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-libLTLIBRARIES install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am \
|
||||
uninstall-info-am uninstall-libLTLIBRARIES
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
@ -1,55 +0,0 @@
|
||||
# Disable automatic dependency tracking if using other tools than gcc and gmake
|
||||
#AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
|
||||
EXTRA_DIST=echo_diagnostic.m
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) @OGG_CFLAGS@ @FFT_CFLAGS@
|
||||
|
||||
lib_LTLIBRARIES = libspeex.la libspeexdsp.la
|
||||
|
||||
# Sources for compilation in the library
|
||||
libspeex_la_SOURCES = cb_search.c exc_10_32_table.c exc_8_128_table.c \
|
||||
filters.c gain_table.c hexc_table.c high_lsp_tables.c lsp.c \
|
||||
ltp.c speex.c stereo.c vbr.c vq.c bits.c exc_10_16_table.c \
|
||||
exc_20_32_table.c exc_5_256_table.c exc_5_64_table.c gain_table_lbr.c hexc_10_32_table.c \
|
||||
lpc.c lsp_tables_nb.c modes.c modes_wb.c nb_celp.c quant_lsp.c sb_celp.c \
|
||||
speex_callbacks.c speex_header.c window.c
|
||||
|
||||
if BUILD_KISS_FFT
|
||||
FFTSRC=kiss_fft.c _kiss_fft_guts.h kiss_fft.h kiss_fftr.c kiss_fftr.h
|
||||
else
|
||||
if BUILD_SMALLFT
|
||||
FFTSRC=smallft.c
|
||||
else
|
||||
FFTSRC=
|
||||
endif
|
||||
endif
|
||||
|
||||
libspeexdsp_la_SOURCES = preprocess.c jitter.c mdf.c fftwrap.c filterbank.c resample.c buffer.c scal.c $(FFTSRC)
|
||||
|
||||
noinst_HEADERS = arch.h cb_search_arm4.h cb_search_bfin.h cb_search_sse.h \
|
||||
filters.h filters_arm4.h filters_bfin.h filters_sse.h fixed_arm4.h \
|
||||
fixed_arm5e.h fixed_bfin.h fixed_debug.h lpc.h lpc_bfin.h ltp.h ltp_arm4.h \
|
||||
ltp_sse.h math_approx.h misc_bfin.h nb_celp.h quant_lsp.h sb_celp.h \
|
||||
stack_alloc.h vbr.h vq.h vq_arm4.h vq_bfin.h vq_sse.h cb_search.h fftwrap.h \
|
||||
filterbank.h fixed_generic.h lsp.h lsp_bfin.h ltp_bfin.h modes.h os_support.h \
|
||||
pseudofloat.h quant_lsp_bfin.h smallft.h vorbis_psy.h resample_sse.h
|
||||
|
||||
|
||||
libspeex_la_LDFLAGS = -no-undefined -version-info @SPEEX_LT_CURRENT@:@SPEEX_LT_REVISION@:@SPEEX_LT_AGE@
|
||||
libspeexdsp_la_LDFLAGS = -no-undefined -version-info @SPEEX_LT_CURRENT@:@SPEEX_LT_REVISION@:@SPEEX_LT_AGE@
|
||||
|
||||
noinst_PROGRAMS = testenc testenc_wb testenc_uwb testdenoise testecho testjitter
|
||||
testenc_SOURCES = testenc.c
|
||||
testenc_LDADD = libspeex.la
|
||||
testenc_wb_SOURCES = testenc_wb.c
|
||||
testenc_wb_LDADD = libspeex.la
|
||||
testenc_uwb_SOURCES = testenc_uwb.c
|
||||
testenc_uwb_LDADD = libspeex.la
|
||||
testdenoise_SOURCES = testdenoise.c
|
||||
testdenoise_LDADD = libspeexdsp.la @FFT_LIBS@
|
||||
testecho_SOURCES = testecho.c
|
||||
testecho_LDADD = libspeexdsp.la @FFT_LIBS@
|
||||
testjitter_SOURCES = testjitter.c
|
||||
testjitter_LDADD = libspeexdsp.la @FFT_LIBS@
|
@ -1,667 +0,0 @@
|
||||
# Makefile.in generated by automake 1.8.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# Disable automatic dependency tracking if using other tools than gcc and gmake
|
||||
#AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
|
||||
|
||||
SOURCES = $(libspeex_la_SOURCES) $(libspeexdsp_la_SOURCES) $(testdenoise_SOURCES) $(testecho_SOURCES) $(testenc_SOURCES) $(testenc_uwb_SOURCES) $(testenc_wb_SOURCES) $(testjitter_SOURCES)
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
noinst_PROGRAMS = testenc$(EXEEXT) testenc_wb$(EXEEXT) \
|
||||
testenc_uwb$(EXEEXT) testdenoise$(EXEEXT) testecho$(EXEEXT) \
|
||||
testjitter$(EXEEXT)
|
||||
subdir = libspeex
|
||||
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(mkdir_p)
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libspeex_la_LIBADD =
|
||||
am_libspeex_la_OBJECTS = cb_search.lo exc_10_32_table.lo \
|
||||
exc_8_128_table.lo filters.lo gain_table.lo hexc_table.lo \
|
||||
high_lsp_tables.lo lsp.lo ltp.lo speex.lo stereo.lo vbr.lo \
|
||||
vq.lo bits.lo exc_10_16_table.lo exc_20_32_table.lo \
|
||||
exc_5_256_table.lo exc_5_64_table.lo gain_table_lbr.lo \
|
||||
hexc_10_32_table.lo lpc.lo lsp_tables_nb.lo modes.lo \
|
||||
modes_wb.lo nb_celp.lo quant_lsp.lo sb_celp.lo \
|
||||
speex_callbacks.lo speex_header.lo window.lo
|
||||
libspeex_la_OBJECTS = $(am_libspeex_la_OBJECTS)
|
||||
libspeexdsp_la_LIBADD =
|
||||
am__libspeexdsp_la_SOURCES_DIST = preprocess.c jitter.c mdf.c \
|
||||
fftwrap.c filterbank.c resample.c buffer.c scal.c smallft.c \
|
||||
kiss_fft.c _kiss_fft_guts.h kiss_fft.h kiss_fftr.c kiss_fftr.h
|
||||
@BUILD_KISS_FFT_FALSE@@BUILD_SMALLFT_TRUE@am__objects_1 = smallft.lo
|
||||
@BUILD_KISS_FFT_TRUE@am__objects_1 = kiss_fft.lo kiss_fftr.lo
|
||||
am_libspeexdsp_la_OBJECTS = preprocess.lo jitter.lo mdf.lo fftwrap.lo \
|
||||
filterbank.lo resample.lo buffer.lo scal.lo $(am__objects_1)
|
||||
libspeexdsp_la_OBJECTS = $(am_libspeexdsp_la_OBJECTS)
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_testdenoise_OBJECTS = testdenoise.$(OBJEXT)
|
||||
testdenoise_OBJECTS = $(am_testdenoise_OBJECTS)
|
||||
testdenoise_DEPENDENCIES = libspeexdsp.la
|
||||
am_testecho_OBJECTS = testecho.$(OBJEXT)
|
||||
testecho_OBJECTS = $(am_testecho_OBJECTS)
|
||||
testecho_DEPENDENCIES = libspeexdsp.la
|
||||
am_testenc_OBJECTS = testenc.$(OBJEXT)
|
||||
testenc_OBJECTS = $(am_testenc_OBJECTS)
|
||||
testenc_DEPENDENCIES = libspeex.la
|
||||
am_testenc_uwb_OBJECTS = testenc_uwb.$(OBJEXT)
|
||||
testenc_uwb_OBJECTS = $(am_testenc_uwb_OBJECTS)
|
||||
testenc_uwb_DEPENDENCIES = libspeex.la
|
||||
am_testenc_wb_OBJECTS = testenc_wb.$(OBJEXT)
|
||||
testenc_wb_OBJECTS = $(am_testenc_wb_OBJECTS)
|
||||
testenc_wb_DEPENDENCIES = libspeex.la
|
||||
am_testjitter_OBJECTS = testjitter.$(OBJEXT)
|
||||
testjitter_OBJECTS = $(am_testjitter_OBJECTS)
|
||||
testjitter_DEPENDENCIES = libspeexdsp.la
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bits.Plo ./$(DEPDIR)/buffer.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/cb_search.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/exc_10_16_table.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/exc_10_32_table.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/exc_20_32_table.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/exc_5_256_table.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/exc_5_64_table.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/exc_8_128_table.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/fftwrap.Plo ./$(DEPDIR)/filterbank.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/filters.Plo ./$(DEPDIR)/gain_table.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/gain_table_lbr.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/hexc_10_32_table.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/hexc_table.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/high_lsp_tables.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/jitter.Plo ./$(DEPDIR)/kiss_fft.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/kiss_fftr.Plo ./$(DEPDIR)/lpc.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/lsp.Plo ./$(DEPDIR)/lsp_tables_nb.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/ltp.Plo ./$(DEPDIR)/mdf.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/modes.Plo ./$(DEPDIR)/modes_wb.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/nb_celp.Plo ./$(DEPDIR)/preprocess.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/quant_lsp.Plo ./$(DEPDIR)/resample.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/sb_celp.Plo ./$(DEPDIR)/scal.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/smallft.Plo ./$(DEPDIR)/speex.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/speex_callbacks.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/speex_header.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/stereo.Plo ./$(DEPDIR)/testdenoise.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/testecho.Po ./$(DEPDIR)/testenc.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/testenc_uwb.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/testenc_wb.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/testjitter.Po ./$(DEPDIR)/vbr.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/vq.Plo ./$(DEPDIR)/window.Plo
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(libspeex_la_SOURCES) $(libspeexdsp_la_SOURCES) \
|
||||
$(testdenoise_SOURCES) $(testecho_SOURCES) $(testenc_SOURCES) \
|
||||
$(testenc_uwb_SOURCES) $(testenc_wb_SOURCES) \
|
||||
$(testjitter_SOURCES)
|
||||
DIST_SOURCES = $(libspeex_la_SOURCES) \
|
||||
$(am__libspeexdsp_la_SOURCES_DIST) $(testdenoise_SOURCES) \
|
||||
$(testecho_SOURCES) $(testenc_SOURCES) $(testenc_uwb_SOURCES) \
|
||||
$(testenc_wb_SOURCES) $(testjitter_SOURCES)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_KISS_FFT_FALSE = @BUILD_KISS_FFT_FALSE@
|
||||
BUILD_KISS_FFT_TRUE = @BUILD_KISS_FFT_TRUE@
|
||||
BUILD_SMALLFT_FALSE = @BUILD_SMALLFT_FALSE@
|
||||
BUILD_SMALLFT_TRUE = @BUILD_SMALLFT_TRUE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FFT_CFLAGS = @FFT_CFLAGS@
|
||||
FFT_LIBS = @FFT_LIBS@
|
||||
FFT_PKGCONFIG = @FFT_PKGCONFIG@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OGG_CFLAGS = @OGG_CFLAGS@
|
||||
OGG_LIBS = @OGG_LIBS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SIZE16 = @SIZE16@
|
||||
SIZE32 = @SIZE32@
|
||||
SPEEX_LT_AGE = @SPEEX_LT_AGE@
|
||||
SPEEX_LT_CURRENT = @SPEEX_LT_CURRENT@
|
||||
SPEEX_LT_REVISION = @SPEEX_LT_REVISION@
|
||||
SPEEX_VERSION = @SPEEX_VERSION@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
src = @src@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
EXTRA_DIST = echo_diagnostic.m
|
||||
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) @OGG_CFLAGS@ @FFT_CFLAGS@
|
||||
lib_LTLIBRARIES = libspeex.la libspeexdsp.la
|
||||
|
||||
# Sources for compilation in the library
|
||||
libspeex_la_SOURCES = cb_search.c exc_10_32_table.c exc_8_128_table.c \
|
||||
filters.c gain_table.c hexc_table.c high_lsp_tables.c lsp.c \
|
||||
ltp.c speex.c stereo.c vbr.c vq.c bits.c exc_10_16_table.c \
|
||||
exc_20_32_table.c exc_5_256_table.c exc_5_64_table.c gain_table_lbr.c hexc_10_32_table.c \
|
||||
lpc.c lsp_tables_nb.c modes.c modes_wb.c nb_celp.c quant_lsp.c sb_celp.c \
|
||||
speex_callbacks.c speex_header.c window.c
|
||||
|
||||
@BUILD_KISS_FFT_FALSE@@BUILD_SMALLFT_FALSE@FFTSRC =
|
||||
@BUILD_KISS_FFT_FALSE@@BUILD_SMALLFT_TRUE@FFTSRC = smallft.c
|
||||
@BUILD_KISS_FFT_TRUE@FFTSRC = kiss_fft.c _kiss_fft_guts.h kiss_fft.h kiss_fftr.c kiss_fftr.h
|
||||
libspeexdsp_la_SOURCES = preprocess.c jitter.c mdf.c fftwrap.c filterbank.c resample.c buffer.c scal.c $(FFTSRC)
|
||||
noinst_HEADERS = arch.h cb_search_arm4.h cb_search_bfin.h cb_search_sse.h \
|
||||
filters.h filters_arm4.h filters_bfin.h filters_sse.h fixed_arm4.h \
|
||||
fixed_arm5e.h fixed_bfin.h fixed_debug.h lpc.h lpc_bfin.h ltp.h ltp_arm4.h \
|
||||
ltp_sse.h math_approx.h misc_bfin.h nb_celp.h quant_lsp.h sb_celp.h \
|
||||
stack_alloc.h vbr.h vq.h vq_arm4.h vq_bfin.h vq_sse.h cb_search.h fftwrap.h \
|
||||
filterbank.h fixed_generic.h lsp.h lsp_bfin.h ltp_bfin.h modes.h os_support.h \
|
||||
pseudofloat.h quant_lsp_bfin.h smallft.h vorbis_psy.h resample_sse.h
|
||||
|
||||
libspeex_la_LDFLAGS = -no-undefined -version-info @SPEEX_LT_CURRENT@:@SPEEX_LT_REVISION@:@SPEEX_LT_AGE@
|
||||
libspeexdsp_la_LDFLAGS = -no-undefined -version-info @SPEEX_LT_CURRENT@:@SPEEX_LT_REVISION@:@SPEEX_LT_AGE@
|
||||
testenc_SOURCES = testenc.c
|
||||
testenc_LDADD = libspeex.la
|
||||
testenc_wb_SOURCES = testenc_wb.c
|
||||
testenc_wb_LDADD = libspeex.la
|
||||
testenc_uwb_SOURCES = testenc_uwb.c
|
||||
testenc_uwb_LDADD = libspeex.la
|
||||
testdenoise_SOURCES = testdenoise.c
|
||||
testdenoise_LDADD = libspeexdsp.la @FFT_LIBS@
|
||||
testecho_SOURCES = testecho.c
|
||||
testecho_LDADD = libspeexdsp.la @FFT_LIBS@
|
||||
testjitter_SOURCES = testjitter.c
|
||||
testjitter_LDADD = libspeexdsp.la @FFT_LIBS@
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libspeex/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu libspeex/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libspeex.la: $(libspeex_la_OBJECTS) $(libspeex_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libspeex_la_LDFLAGS) $(libspeex_la_OBJECTS) $(libspeex_la_LIBADD) $(LIBS)
|
||||
libspeexdsp.la: $(libspeexdsp_la_OBJECTS) $(libspeexdsp_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libspeexdsp_la_LDFLAGS) $(libspeexdsp_la_OBJECTS) $(libspeexdsp_la_LIBADD) $(LIBS)
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
testdenoise$(EXEEXT): $(testdenoise_OBJECTS) $(testdenoise_DEPENDENCIES)
|
||||
@rm -f testdenoise$(EXEEXT)
|
||||
$(LINK) $(testdenoise_LDFLAGS) $(testdenoise_OBJECTS) $(testdenoise_LDADD) $(LIBS)
|
||||
testecho$(EXEEXT): $(testecho_OBJECTS) $(testecho_DEPENDENCIES)
|
||||
@rm -f testecho$(EXEEXT)
|
||||
$(LINK) $(testecho_LDFLAGS) $(testecho_OBJECTS) $(testecho_LDADD) $(LIBS)
|
||||
testenc$(EXEEXT): $(testenc_OBJECTS) $(testenc_DEPENDENCIES)
|
||||
@rm -f testenc$(EXEEXT)
|
||||
$(LINK) $(testenc_LDFLAGS) $(testenc_OBJECTS) $(testenc_LDADD) $(LIBS)
|
||||
testenc_uwb$(EXEEXT): $(testenc_uwb_OBJECTS) $(testenc_uwb_DEPENDENCIES)
|
||||
@rm -f testenc_uwb$(EXEEXT)
|
||||
$(LINK) $(testenc_uwb_LDFLAGS) $(testenc_uwb_OBJECTS) $(testenc_uwb_LDADD) $(LIBS)
|
||||
testenc_wb$(EXEEXT): $(testenc_wb_OBJECTS) $(testenc_wb_DEPENDENCIES)
|
||||
@rm -f testenc_wb$(EXEEXT)
|
||||
$(LINK) $(testenc_wb_LDFLAGS) $(testenc_wb_OBJECTS) $(testenc_wb_LDADD) $(LIBS)
|
||||
testjitter$(EXEEXT): $(testjitter_OBJECTS) $(testjitter_DEPENDENCIES)
|
||||
@rm -f testjitter$(EXEEXT)
|
||||
$(LINK) $(testjitter_LDFLAGS) $(testjitter_OBJECTS) $(testjitter_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bits.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cb_search.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exc_10_16_table.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exc_10_32_table.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exc_20_32_table.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exc_5_256_table.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exc_5_64_table.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exc_8_128_table.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fftwrap.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filterbank.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filters.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gain_table.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gain_table_lbr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hexc_10_32_table.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hexc_table.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/high_lsp_tables.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jitter.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kiss_fft.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kiss_fftr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsp_tables_nb.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ltp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mdf.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modes.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modes_wb.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nb_celp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preprocess.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quant_lsp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resample.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sb_celp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scal.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smallft.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speex.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speex_callbacks.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speex_header.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stereo.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdenoise.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testecho.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testenc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testenc_uwb.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testenc_wb.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testjitter.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vbr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vq.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/window.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
clean-noinstPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS ctags \
|
||||
distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-libLTLIBRARIES install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am \
|
||||
uninstall-info-am uninstall-libLTLIBRARIES
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
@ -1,160 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2003-2004, Mark Borgerding
|
||||
|
||||
All rights reserved.
|
||||
|
||||
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 author nor the names of any 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 COPYRIGHT OWNER 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.
|
||||
*/
|
||||
|
||||
#define MIN(a,b) ((a)<(b) ? (a):(b))
|
||||
#define MAX(a,b) ((a)>(b) ? (a):(b))
|
||||
|
||||
/* kiss_fft.h
|
||||
defines kiss_fft_scalar as either short or a float type
|
||||
and defines
|
||||
typedef struct { kiss_fft_scalar r; kiss_fft_scalar i; }kiss_fft_cpx; */
|
||||
#include "kiss_fft.h"
|
||||
#include "math_approx.h"
|
||||
|
||||
#define MAXFACTORS 32
|
||||
/* e.g. an fft of length 128 has 4 factors
|
||||
as far as kissfft is concerned
|
||||
4*4*4*2
|
||||
*/
|
||||
|
||||
struct kiss_fft_state{
|
||||
int nfft;
|
||||
int inverse;
|
||||
int factors[2*MAXFACTORS];
|
||||
kiss_fft_cpx twiddles[1];
|
||||
};
|
||||
|
||||
/*
|
||||
Explanation of macros dealing with complex math:
|
||||
|
||||
C_MUL(m,a,b) : m = a*b
|
||||
C_FIXDIV( c , div ) : if a fixed point impl., c /= div. noop otherwise
|
||||
C_SUB( res, a,b) : res = a - b
|
||||
C_SUBFROM( res , a) : res -= a
|
||||
C_ADDTO( res , a) : res += a
|
||||
* */
|
||||
#ifdef FIXED_POINT
|
||||
#include "arch.h"
|
||||
# define FRACBITS 15
|
||||
# define SAMPPROD spx_int32_t
|
||||
#define SAMP_MAX 32767
|
||||
|
||||
#define SAMP_MIN -SAMP_MAX
|
||||
|
||||
#if defined(CHECK_OVERFLOW)
|
||||
# define CHECK_OVERFLOW_OP(a,op,b) \
|
||||
if ( (SAMPPROD)(a) op (SAMPPROD)(b) > SAMP_MAX || (SAMPPROD)(a) op (SAMPPROD)(b) < SAMP_MIN ) { \
|
||||
fprintf(stderr,"WARNING:overflow @ " __FILE__ "(%d): (%d " #op" %d) = %ld\n",__LINE__,(a),(b),(SAMPPROD)(a) op (SAMPPROD)(b) ); }
|
||||
#endif
|
||||
|
||||
|
||||
# define smul(a,b) ( (SAMPPROD)(a)*(b) )
|
||||
# define sround( x ) (kiss_fft_scalar)( ( (x) + (1<<(FRACBITS-1)) ) >> FRACBITS )
|
||||
|
||||
# define S_MUL(a,b) sround( smul(a,b) )
|
||||
|
||||
# define C_MUL(m,a,b) \
|
||||
do{ (m).r = sround( smul((a).r,(b).r) - smul((a).i,(b).i) ); \
|
||||
(m).i = sround( smul((a).r,(b).i) + smul((a).i,(b).r) ); }while(0)
|
||||
|
||||
# define C_MUL4(m,a,b) \
|
||||
do{ (m).r = PSHR32( smul((a).r,(b).r) - smul((a).i,(b).i),17 ); \
|
||||
(m).i = PSHR32( smul((a).r,(b).i) + smul((a).i,(b).r),17 ); }while(0)
|
||||
|
||||
# define DIVSCALAR(x,k) \
|
||||
(x) = sround( smul( x, SAMP_MAX/k ) )
|
||||
|
||||
# define C_FIXDIV(c,div) \
|
||||
do { DIVSCALAR( (c).r , div); \
|
||||
DIVSCALAR( (c).i , div); }while (0)
|
||||
|
||||
# define C_MULBYSCALAR( c, s ) \
|
||||
do{ (c).r = sround( smul( (c).r , s ) ) ;\
|
||||
(c).i = sround( smul( (c).i , s ) ) ; }while(0)
|
||||
|
||||
#else /* not FIXED_POINT*/
|
||||
|
||||
# define S_MUL(a,b) ( (a)*(b) )
|
||||
#define C_MUL(m,a,b) \
|
||||
do{ (m).r = (a).r*(b).r - (a).i*(b).i;\
|
||||
(m).i = (a).r*(b).i + (a).i*(b).r; }while(0)
|
||||
|
||||
#define C_MUL4(m,a,b) C_MUL(m,a,b)
|
||||
|
||||
# define C_FIXDIV(c,div) /* NOOP */
|
||||
# define C_MULBYSCALAR( c, s ) \
|
||||
do{ (c).r *= (s);\
|
||||
(c).i *= (s); }while(0)
|
||||
#endif
|
||||
|
||||
#ifndef CHECK_OVERFLOW_OP
|
||||
# define CHECK_OVERFLOW_OP(a,op,b) /* noop */
|
||||
#endif
|
||||
|
||||
#define C_ADD( res, a,b)\
|
||||
do { \
|
||||
CHECK_OVERFLOW_OP((a).r,+,(b).r)\
|
||||
CHECK_OVERFLOW_OP((a).i,+,(b).i)\
|
||||
(res).r=(a).r+(b).r; (res).i=(a).i+(b).i; \
|
||||
}while(0)
|
||||
#define C_SUB( res, a,b)\
|
||||
do { \
|
||||
CHECK_OVERFLOW_OP((a).r,-,(b).r)\
|
||||
CHECK_OVERFLOW_OP((a).i,-,(b).i)\
|
||||
(res).r=(a).r-(b).r; (res).i=(a).i-(b).i; \
|
||||
}while(0)
|
||||
#define C_ADDTO( res , a)\
|
||||
do { \
|
||||
CHECK_OVERFLOW_OP((res).r,+,(a).r)\
|
||||
CHECK_OVERFLOW_OP((res).i,+,(a).i)\
|
||||
(res).r += (a).r; (res).i += (a).i;\
|
||||
}while(0)
|
||||
|
||||
#define C_SUBFROM( res , a)\
|
||||
do {\
|
||||
CHECK_OVERFLOW_OP((res).r,-,(a).r)\
|
||||
CHECK_OVERFLOW_OP((res).i,-,(a).i)\
|
||||
(res).r -= (a).r; (res).i -= (a).i; \
|
||||
}while(0)
|
||||
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
# define KISS_FFT_COS(phase) floor(MIN(32767,MAX(-32767,.5+32768 * cos (phase))))
|
||||
# define KISS_FFT_SIN(phase) floor(MIN(32767,MAX(-32767,.5+32768 * sin (phase))))
|
||||
# define HALF_OF(x) ((x)>>1)
|
||||
#elif defined(USE_SIMD)
|
||||
# define KISS_FFT_COS(phase) _mm_set1_ps( cos(phase) )
|
||||
# define KISS_FFT_SIN(phase) _mm_set1_ps( sin(phase) )
|
||||
# define HALF_OF(x) ((x)*_mm_set1_ps(.5))
|
||||
#else
|
||||
# define KISS_FFT_COS(phase) (kiss_fft_scalar) cos(phase)
|
||||
# define KISS_FFT_SIN(phase) (kiss_fft_scalar) sin(phase)
|
||||
# define HALF_OF(x) ((x)*.5)
|
||||
#endif
|
||||
|
||||
#define kf_cexp(x,phase) \
|
||||
do{ \
|
||||
(x)->r = KISS_FFT_COS(phase);\
|
||||
(x)->i = KISS_FFT_SIN(phase);\
|
||||
}while(0)
|
||||
#define kf_cexp2(x,phase) \
|
||||
do{ \
|
||||
(x)->r = spx_cos_norm((phase));\
|
||||
(x)->i = spx_cos_norm((phase)-32768);\
|
||||
}while(0)
|
||||
|
||||
|
||||
/* a debugging function */
|
||||
#define pcpx(c)\
|
||||
fprintf(stderr,"%g + %gi\n",(double)((c)->r),(double)((c)->i) )
|
@ -1,239 +0,0 @@
|
||||
/* Copyright (C) 2003 Jean-Marc Valin */
|
||||
/**
|
||||
@file arch.h
|
||||
@brief Various architecture definitions Speex
|
||||
*/
|
||||
/*
|
||||
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 ARCH_H
|
||||
#define ARCH_H
|
||||
|
||||
#ifndef SPEEX_VERSION
|
||||
#define SPEEX_MAJOR_VERSION 1 /**< Major Speex version. */
|
||||
#define SPEEX_MINOR_VERSION 1 /**< Minor Speex version. */
|
||||
#define SPEEX_MICRO_VERSION 15 /**< Micro Speex version. */
|
||||
#define SPEEX_EXTRA_VERSION "" /**< Extra Speex version. */
|
||||
#define SPEEX_VERSION "speex-1.2beta3" /**< Speex version string. */
|
||||
#endif
|
||||
|
||||
/* A couple test to catch stupid option combinations */
|
||||
#ifdef FIXED_POINT
|
||||
|
||||
#ifdef FLOATING_POINT
|
||||
#error You cannot compile as floating point and fixed point at the same time
|
||||
#endif
|
||||
#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))
|
||||
#error Make up your mind. What CPU do you have?
|
||||
#endif
|
||||
#ifdef VORBIS_PSYCHO
|
||||
#error Vorbis-psy model currently not implemented in fixed-point
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#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)
|
||||
#error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
|
||||
#endif
|
||||
#ifdef FIXED_POINT_DEBUG
|
||||
#error "Don't you think enabling fixed-point is a good thing to do if you want to debug that?"
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef OUTSIDE_SPEEX
|
||||
#include "speex/speex_types.h"
|
||||
#endif
|
||||
|
||||
#define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */
|
||||
#define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */
|
||||
#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */
|
||||
#define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */
|
||||
#define ABS32(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 32-bit value. */
|
||||
#define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 32-bit value. */
|
||||
#define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
|
||||
typedef spx_int16_t spx_word16_t;
|
||||
typedef spx_int32_t spx_word32_t;
|
||||
typedef spx_word32_t spx_mem_t;
|
||||
typedef spx_word16_t spx_coef_t;
|
||||
typedef spx_word16_t spx_lsp_t;
|
||||
typedef spx_word32_t spx_sig_t;
|
||||
|
||||
#define Q15ONE 32767
|
||||
|
||||
#define LPC_SCALING 8192
|
||||
#define SIG_SCALING 16384
|
||||
#define LSP_SCALING 8192.
|
||||
#define GAMMA_SCALING 32768.
|
||||
#define GAIN_SCALING 64
|
||||
#define GAIN_SCALING_1 0.015625
|
||||
|
||||
#define LPC_SHIFT 13
|
||||
#define LSP_SHIFT 13
|
||||
#define SIG_SHIFT 14
|
||||
#define GAIN_SHIFT 6
|
||||
|
||||
#define VERY_SMALL 0
|
||||
#define VERY_LARGE32 ((spx_word32_t)2147483647)
|
||||
#define VERY_LARGE16 ((spx_word16_t)32767)
|
||||
#define Q15_ONE ((spx_word16_t)32767)
|
||||
|
||||
|
||||
#ifdef FIXED_DEBUG
|
||||
#include "fixed_debug.h"
|
||||
#else
|
||||
|
||||
#include "fixed_generic.h"
|
||||
|
||||
#ifdef ARM5E_ASM
|
||||
#include "fixed_arm5e.h"
|
||||
#elif defined (ARM4_ASM)
|
||||
#include "fixed_arm4.h"
|
||||
#elif defined (BFIN_ASM)
|
||||
#include "fixed_bfin.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#else
|
||||
|
||||
typedef float spx_mem_t;
|
||||
typedef float spx_coef_t;
|
||||
typedef float spx_lsp_t;
|
||||
typedef float spx_sig_t;
|
||||
typedef float spx_word16_t;
|
||||
typedef float spx_word32_t;
|
||||
|
||||
#define Q15ONE 1.0f
|
||||
#define LPC_SCALING 1.f
|
||||
#define SIG_SCALING 1.f
|
||||
#define LSP_SCALING 1.f
|
||||
#define GAMMA_SCALING 1.f
|
||||
#define GAIN_SCALING 1.f
|
||||
#define GAIN_SCALING_1 1.f
|
||||
|
||||
|
||||
#define VERY_SMALL 1e-15f
|
||||
#define VERY_LARGE32 1e15f
|
||||
#define VERY_LARGE16 1e15f
|
||||
#define Q15_ONE ((spx_word16_t)1.f)
|
||||
|
||||
#define QCONST16(x,bits) (x)
|
||||
#define QCONST32(x,bits) (x)
|
||||
|
||||
#define NEG16(x) (-(x))
|
||||
#define NEG32(x) (-(x))
|
||||
#define EXTRACT16(x) (x)
|
||||
#define EXTEND32(x) (x)
|
||||
#define SHR16(a,shift) (a)
|
||||
#define SHL16(a,shift) (a)
|
||||
#define SHR32(a,shift) (a)
|
||||
#define SHL32(a,shift) (a)
|
||||
#define PSHR16(a,shift) (a)
|
||||
#define PSHR32(a,shift) (a)
|
||||
#define VSHR32(a,shift) (a)
|
||||
#define SATURATE16(x,a) (x)
|
||||
#define SATURATE32(x,a) (x)
|
||||
|
||||
#define PSHR(a,shift) (a)
|
||||
#define SHR(a,shift) (a)
|
||||
#define SHL(a,shift) (a)
|
||||
#define SATURATE(x,a) (x)
|
||||
|
||||
#define ADD16(a,b) ((a)+(b))
|
||||
#define SUB16(a,b) ((a)-(b))
|
||||
#define ADD32(a,b) ((a)+(b))
|
||||
#define SUB32(a,b) ((a)-(b))
|
||||
#define MULT16_16_16(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))
|
||||
#define MAC16_16_Q13(c,a,b) ((c)+(a)*(b))
|
||||
#define MAC16_16_P13(c,a,b) ((c)+(a)*(b))
|
||||
#define MULT16_16_Q11_32(a,b) ((a)*(b))
|
||||
#define MULT16_16_Q13(a,b) ((a)*(b))
|
||||
#define MULT16_16_Q14(a,b) ((a)*(b))
|
||||
#define MULT16_16_Q15(a,b) ((a)*(b))
|
||||
#define MULT16_16_P15(a,b) ((a)*(b))
|
||||
#define MULT16_16_P13(a,b) ((a)*(b))
|
||||
#define MULT16_16_P14(a,b) ((a)*(b))
|
||||
|
||||
#define DIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
|
||||
#define PDIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
|
||||
#define DIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
|
||||
#define PDIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
|
||||
|
||||
/* 2 on TI C5x DSP */
|
||||
#define BYTES_PER_CHAR 2
|
||||
#define BITS_PER_CHAR 16
|
||||
#define LOG2_BITS_PER_CHAR 4
|
||||
|
||||
#else
|
||||
|
||||
#define BYTES_PER_CHAR 1
|
||||
#define BITS_PER_CHAR 8
|
||||
#define LOG2_BITS_PER_CHAR 3
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef FIXED_DEBUG
|
||||
extern long long spx_mips;
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
@ -1,372 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin
|
||||
File: speex_bits.c
|
||||
|
||||
Handles bit packing/unpacking
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <speex/speex_bits.h>
|
||||
#include "arch.h"
|
||||
#include "os_support.h"
|
||||
|
||||
/* Maximum size of the bit-stream (for fixed-size allocation) */
|
||||
#ifndef MAX_CHARS_PER_FRAME
|
||||
#define MAX_CHARS_PER_FRAME (2000/BYTES_PER_CHAR)
|
||||
#endif
|
||||
|
||||
EXPORT void speex_bits_init(SpeexBits *bits)
|
||||
{
|
||||
bits->chars = (char*)speex_alloc(MAX_CHARS_PER_FRAME);
|
||||
if (!bits->chars)
|
||||
return;
|
||||
|
||||
bits->buf_size = MAX_CHARS_PER_FRAME;
|
||||
|
||||
bits->owner=1;
|
||||
|
||||
speex_bits_reset(bits);
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size)
|
||||
{
|
||||
bits->chars = (char*)buff;
|
||||
bits->buf_size = buf_size;
|
||||
|
||||
bits->owner=0;
|
||||
|
||||
speex_bits_reset(bits);
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size)
|
||||
{
|
||||
bits->chars = (char*)buff;
|
||||
bits->buf_size = buf_size;
|
||||
|
||||
bits->owner=0;
|
||||
|
||||
bits->nbBits=buf_size<<LOG2_BITS_PER_CHAR;
|
||||
bits->charPtr=0;
|
||||
bits->bitPtr=0;
|
||||
bits->overflow=0;
|
||||
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_destroy(SpeexBits *bits)
|
||||
{
|
||||
if (bits->owner)
|
||||
speex_free(bits->chars);
|
||||
/* Will do something once the allocation is dynamic */
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_reset(SpeexBits *bits)
|
||||
{
|
||||
/* We only need to clear the first byte now */
|
||||
bits->chars[0]=0;
|
||||
bits->nbBits=0;
|
||||
bits->charPtr=0;
|
||||
bits->bitPtr=0;
|
||||
bits->overflow=0;
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_rewind(SpeexBits *bits)
|
||||
{
|
||||
bits->charPtr=0;
|
||||
bits->bitPtr=0;
|
||||
bits->overflow=0;
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_read_from(SpeexBits *bits, char *chars, int len)
|
||||
{
|
||||
int i;
|
||||
int nchars = len / BYTES_PER_CHAR;
|
||||
if (nchars > bits->buf_size)
|
||||
{
|
||||
speex_notify("Packet is larger than allocated buffer");
|
||||
if (bits->owner)
|
||||
{
|
||||
char *tmp = (char*)speex_realloc(bits->chars, nchars);
|
||||
if (tmp)
|
||||
{
|
||||
bits->buf_size=nchars;
|
||||
bits->chars=tmp;
|
||||
} else {
|
||||
nchars=bits->buf_size;
|
||||
speex_warning("Could not resize input buffer: truncating input");
|
||||
}
|
||||
} else {
|
||||
speex_warning("Do not own input buffer: truncating oversize input");
|
||||
nchars=bits->buf_size;
|
||||
}
|
||||
}
|
||||
#if (BYTES_PER_CHAR==2)
|
||||
/* Swap bytes to proper endian order (could be done externally) */
|
||||
#define HTOLS(A) ((((A) >> 8)&0xff)|(((A) & 0xff)<<8))
|
||||
#else
|
||||
#define HTOLS(A) (A)
|
||||
#endif
|
||||
for (i=0;i<nchars;i++)
|
||||
bits->chars[i]=HTOLS(chars[i]);
|
||||
|
||||
bits->nbBits=nchars<<LOG2_BITS_PER_CHAR;
|
||||
bits->charPtr=0;
|
||||
bits->bitPtr=0;
|
||||
bits->overflow=0;
|
||||
}
|
||||
|
||||
static void speex_bits_flush(SpeexBits *bits)
|
||||
{
|
||||
int nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR);
|
||||
if (bits->charPtr>0)
|
||||
SPEEX_MOVE(bits->chars, &bits->chars[bits->charPtr], nchars-bits->charPtr);
|
||||
bits->nbBits -= bits->charPtr<<LOG2_BITS_PER_CHAR;
|
||||
bits->charPtr=0;
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_read_whole_bytes(SpeexBits *bits, char *chars, int nbytes)
|
||||
{
|
||||
int i,pos;
|
||||
int nchars = nbytes/BYTES_PER_CHAR;
|
||||
|
||||
if (((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR)+nchars > bits->buf_size)
|
||||
{
|
||||
/* Packet is larger than allocated buffer */
|
||||
if (bits->owner)
|
||||
{
|
||||
char *tmp = (char*)speex_realloc(bits->chars, (bits->nbBits>>LOG2_BITS_PER_CHAR)+nchars+1);
|
||||
if (tmp)
|
||||
{
|
||||
bits->buf_size=(bits->nbBits>>LOG2_BITS_PER_CHAR)+nchars+1;
|
||||
bits->chars=tmp;
|
||||
} else {
|
||||
nchars=bits->buf_size-(bits->nbBits>>LOG2_BITS_PER_CHAR)-1;
|
||||
speex_warning("Could not resize input buffer: truncating oversize input");
|
||||
}
|
||||
} else {
|
||||
speex_warning("Do not own input buffer: truncating oversize input");
|
||||
nchars=bits->buf_size;
|
||||
}
|
||||
}
|
||||
|
||||
speex_bits_flush(bits);
|
||||
pos=bits->nbBits>>LOG2_BITS_PER_CHAR;
|
||||
for (i=0;i<nchars;i++)
|
||||
bits->chars[pos+i]=HTOLS(chars[i]);
|
||||
bits->nbBits+=nchars<<LOG2_BITS_PER_CHAR;
|
||||
}
|
||||
|
||||
EXPORT int speex_bits_write(SpeexBits *bits, char *chars, int max_nbytes)
|
||||
{
|
||||
int i;
|
||||
int max_nchars = max_nbytes/BYTES_PER_CHAR;
|
||||
int charPtr, bitPtr, nbBits;
|
||||
|
||||
/* Insert terminator, but save the data so we can put it back after */
|
||||
bitPtr=bits->bitPtr;
|
||||
charPtr=bits->charPtr;
|
||||
nbBits=bits->nbBits;
|
||||
speex_bits_insert_terminator(bits);
|
||||
bits->bitPtr=bitPtr;
|
||||
bits->charPtr=charPtr;
|
||||
bits->nbBits=nbBits;
|
||||
|
||||
if (max_nchars > ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR))
|
||||
max_nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR);
|
||||
|
||||
for (i=0;i<max_nchars;i++)
|
||||
chars[i]=HTOLS(bits->chars[i]);
|
||||
return max_nchars*BYTES_PER_CHAR;
|
||||
}
|
||||
|
||||
EXPORT int speex_bits_write_whole_bytes(SpeexBits *bits, char *chars, int max_nbytes)
|
||||
{
|
||||
int max_nchars = max_nbytes/BYTES_PER_CHAR;
|
||||
int i;
|
||||
if (max_nchars > ((bits->nbBits)>>LOG2_BITS_PER_CHAR))
|
||||
max_nchars = ((bits->nbBits)>>LOG2_BITS_PER_CHAR);
|
||||
for (i=0;i<max_nchars;i++)
|
||||
chars[i]=HTOLS(bits->chars[i]);
|
||||
|
||||
if (bits->bitPtr>0)
|
||||
bits->chars[0]=bits->chars[max_nchars];
|
||||
else
|
||||
bits->chars[0]=0;
|
||||
bits->charPtr=0;
|
||||
bits->nbBits &= (BITS_PER_CHAR-1);
|
||||
return max_nchars*BYTES_PER_CHAR;
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_pack(SpeexBits *bits, int data, int nbBits)
|
||||
{
|
||||
unsigned int d=data;
|
||||
|
||||
if (bits->charPtr+((nbBits+bits->bitPtr)>>LOG2_BITS_PER_CHAR) >= bits->buf_size)
|
||||
{
|
||||
speex_notify("Buffer too small to pack bits");
|
||||
if (bits->owner)
|
||||
{
|
||||
int new_nchars = ((bits->buf_size+5)*3)>>1;
|
||||
char *tmp = (char*)speex_realloc(bits->chars, new_nchars);
|
||||
if (tmp)
|
||||
{
|
||||
bits->buf_size=new_nchars;
|
||||
bits->chars=tmp;
|
||||
} else {
|
||||
speex_warning("Could not resize input buffer: not packing");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
speex_warning("Do not own input buffer: not packing");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
while(nbBits)
|
||||
{
|
||||
int bit;
|
||||
bit = (d>>(nbBits-1))&1;
|
||||
bits->chars[bits->charPtr] |= bit<<(BITS_PER_CHAR-1-bits->bitPtr);
|
||||
bits->bitPtr++;
|
||||
|
||||
if (bits->bitPtr==BITS_PER_CHAR)
|
||||
{
|
||||
bits->bitPtr=0;
|
||||
bits->charPtr++;
|
||||
bits->chars[bits->charPtr] = 0;
|
||||
}
|
||||
bits->nbBits++;
|
||||
nbBits--;
|
||||
}
|
||||
}
|
||||
|
||||
EXPORT int speex_bits_unpack_signed(SpeexBits *bits, int nbBits)
|
||||
{
|
||||
unsigned int d=speex_bits_unpack_unsigned(bits,nbBits);
|
||||
/* If number is negative */
|
||||
if (d>>(nbBits-1))
|
||||
{
|
||||
d |= (-1)<<nbBits;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
EXPORT unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits)
|
||||
{
|
||||
unsigned int d=0;
|
||||
if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+nbBits>bits->nbBits)
|
||||
bits->overflow=1;
|
||||
if (bits->overflow)
|
||||
return 0;
|
||||
while(nbBits)
|
||||
{
|
||||
d<<=1;
|
||||
d |= (bits->chars[bits->charPtr]>>(BITS_PER_CHAR-1 - bits->bitPtr))&1;
|
||||
bits->bitPtr++;
|
||||
if (bits->bitPtr==BITS_PER_CHAR)
|
||||
{
|
||||
bits->bitPtr=0;
|
||||
bits->charPtr++;
|
||||
}
|
||||
nbBits--;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
EXPORT unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits)
|
||||
{
|
||||
unsigned int d=0;
|
||||
int bitPtr, charPtr;
|
||||
char *chars;
|
||||
|
||||
if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+nbBits>bits->nbBits)
|
||||
bits->overflow=1;
|
||||
if (bits->overflow)
|
||||
return 0;
|
||||
|
||||
bitPtr=bits->bitPtr;
|
||||
charPtr=bits->charPtr;
|
||||
chars = bits->chars;
|
||||
while(nbBits)
|
||||
{
|
||||
d<<=1;
|
||||
d |= (chars[charPtr]>>(BITS_PER_CHAR-1 - bitPtr))&1;
|
||||
bitPtr++;
|
||||
if (bitPtr==BITS_PER_CHAR)
|
||||
{
|
||||
bitPtr=0;
|
||||
charPtr++;
|
||||
}
|
||||
nbBits--;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
EXPORT int speex_bits_peek(SpeexBits *bits)
|
||||
{
|
||||
if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+1>bits->nbBits)
|
||||
bits->overflow=1;
|
||||
if (bits->overflow)
|
||||
return 0;
|
||||
return (bits->chars[bits->charPtr]>>(BITS_PER_CHAR-1 - bits->bitPtr))&1;
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_advance(SpeexBits *bits, int n)
|
||||
{
|
||||
if (((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+n>bits->nbBits) || bits->overflow){
|
||||
bits->overflow=1;
|
||||
return;
|
||||
}
|
||||
bits->charPtr += (bits->bitPtr+n) >> LOG2_BITS_PER_CHAR; /* divide by BITS_PER_CHAR */
|
||||
bits->bitPtr = (bits->bitPtr+n) & (BITS_PER_CHAR-1); /* modulo by BITS_PER_CHAR */
|
||||
}
|
||||
|
||||
EXPORT int speex_bits_remaining(SpeexBits *bits)
|
||||
{
|
||||
if (bits->overflow)
|
||||
return -1;
|
||||
else
|
||||
return bits->nbBits-((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr);
|
||||
}
|
||||
|
||||
EXPORT int speex_bits_nbytes(SpeexBits *bits)
|
||||
{
|
||||
return ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR);
|
||||
}
|
||||
|
||||
EXPORT void speex_bits_insert_terminator(SpeexBits *bits)
|
||||
{
|
||||
if (bits->bitPtr)
|
||||
speex_bits_pack(bits, 0, 1);
|
||||
while (bits->bitPtr)
|
||||
speex_bits_pack(bits, 1, 1);
|
||||
}
|
@ -1,176 +0,0 @@
|
||||
/* 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.
|
||||
|
||||
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 "os_support.h"
|
||||
#include "arch.h"
|
||||
#include <speex/speex_buffer.h>
|
||||
|
||||
struct SpeexBuffer_ {
|
||||
char *data;
|
||||
int size;
|
||||
int read_ptr;
|
||||
int write_ptr;
|
||||
int available;
|
||||
};
|
||||
|
||||
EXPORT SpeexBuffer *speex_buffer_init(int size)
|
||||
{
|
||||
SpeexBuffer *st = speex_alloc(sizeof(SpeexBuffer));
|
||||
st->data = speex_alloc(size);
|
||||
st->size = size;
|
||||
st->read_ptr = 0;
|
||||
st->write_ptr = 0;
|
||||
st->available = 0;
|
||||
return st;
|
||||
}
|
||||
|
||||
EXPORT void speex_buffer_destroy(SpeexBuffer *st)
|
||||
{
|
||||
speex_free(st->data);
|
||||
speex_free(st);
|
||||
}
|
||||
|
||||
EXPORT int speex_buffer_write(SpeexBuffer *st, void *_data, int len)
|
||||
{
|
||||
int end;
|
||||
int end1;
|
||||
char *data = _data;
|
||||
if (len > st->size)
|
||||
{
|
||||
data += len-st->size;
|
||||
len = st->size;
|
||||
}
|
||||
end = st->write_ptr + len;
|
||||
end1 = end;
|
||||
if (end1 > st->size)
|
||||
end1 = st->size;
|
||||
SPEEX_COPY(st->data + st->write_ptr, data, end1 - st->write_ptr);
|
||||
if (end > st->size)
|
||||
{
|
||||
end -= st->size;
|
||||
SPEEX_COPY(st->data, data+end1 - st->write_ptr, end);
|
||||
}
|
||||
st->available += len;
|
||||
if (st->available > st->size)
|
||||
{
|
||||
st->available = st->size;
|
||||
st->read_ptr = st->write_ptr;
|
||||
}
|
||||
st->write_ptr += len;
|
||||
if (st->write_ptr > st->size)
|
||||
st->write_ptr -= st->size;
|
||||
return len;
|
||||
}
|
||||
|
||||
EXPORT int speex_buffer_writezeros(SpeexBuffer *st, int len)
|
||||
{
|
||||
/* This is almost the same as for speex_buffer_write() but using
|
||||
SPEEX_MEMSET() instead of SPEEX_COPY(). Update accordingly. */
|
||||
int end;
|
||||
int end1;
|
||||
if (len > st->size)
|
||||
{
|
||||
len = st->size;
|
||||
}
|
||||
end = st->write_ptr + len;
|
||||
end1 = end;
|
||||
if (end1 > st->size)
|
||||
end1 = st->size;
|
||||
SPEEX_MEMSET(st->data + st->write_ptr, 0, end1 - st->write_ptr);
|
||||
if (end > st->size)
|
||||
{
|
||||
end -= st->size;
|
||||
SPEEX_MEMSET(st->data, 0, end);
|
||||
}
|
||||
st->available += len;
|
||||
if (st->available > st->size)
|
||||
{
|
||||
st->available = st->size;
|
||||
st->read_ptr = st->write_ptr;
|
||||
}
|
||||
st->write_ptr += len;
|
||||
if (st->write_ptr > st->size)
|
||||
st->write_ptr -= st->size;
|
||||
return len;
|
||||
}
|
||||
|
||||
EXPORT int speex_buffer_read(SpeexBuffer *st, void *_data, int len)
|
||||
{
|
||||
int end, end1;
|
||||
char *data = _data;
|
||||
if (len > st->available)
|
||||
{
|
||||
SPEEX_MEMSET(data+st->available, 0, st->size-st->available);
|
||||
len = st->available;
|
||||
}
|
||||
end = st->read_ptr + len;
|
||||
end1 = end;
|
||||
if (end1 > st->size)
|
||||
end1 = st->size;
|
||||
SPEEX_COPY(data, st->data + st->read_ptr, end1 - st->read_ptr);
|
||||
|
||||
if (end > st->size)
|
||||
{
|
||||
end -= st->size;
|
||||
SPEEX_COPY(data+end1 - st->read_ptr, st->data, end);
|
||||
}
|
||||
st->available -= len;
|
||||
st->read_ptr += len;
|
||||
if (st->read_ptr > st->size)
|
||||
st->read_ptr -= st->size;
|
||||
return len;
|
||||
}
|
||||
|
||||
EXPORT int speex_buffer_get_available(SpeexBuffer *st)
|
||||
{
|
||||
return st->available;
|
||||
}
|
||||
|
||||
EXPORT int speex_buffer_resize(SpeexBuffer *st, int len)
|
||||
{
|
||||
int old_len = st->size;
|
||||
if (len > old_len)
|
||||
{
|
||||
st->data = speex_realloc(st->data, len);
|
||||
/* FIXME: move data/pointers properly for growing the buffer */
|
||||
} else {
|
||||
/* FIXME: move data/pointers properly for shrinking the buffer */
|
||||
st->data = speex_realloc(st->data, len);
|
||||
}
|
||||
return len;
|
||||
}
|
@ -1,612 +0,0 @@
|
||||
/* Copyright (C) 2002-2006 Jean-Marc Valin
|
||||
File: cb_search.c
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "cb_search.h"
|
||||
#include "filters.h"
|
||||
#include "stack_alloc.h"
|
||||
#include "vq.h"
|
||||
#include "arch.h"
|
||||
#include "math_approx.h"
|
||||
#include "os_support.h"
|
||||
|
||||
#ifdef _USE_SSE
|
||||
#include "cb_search_sse.h"
|
||||
#elif defined(ARM4_ASM) || defined(ARM5E_ASM)
|
||||
#include "cb_search_arm4.h"
|
||||
#elif defined(BFIN_ASM)
|
||||
#include "cb_search_bfin.h"
|
||||
#endif
|
||||
|
||||
#ifndef OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK
|
||||
static void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t *r, spx_word16_t *resp, spx_word16_t *resp2, spx_word32_t *E, int shape_cb_size, int subvect_size, char *stack)
|
||||
{
|
||||
int i, j, k;
|
||||
VARDECL(spx_word16_t *shape);
|
||||
ALLOC(shape, subvect_size, spx_word16_t);
|
||||
for (i=0;i<shape_cb_size;i++)
|
||||
{
|
||||
spx_word16_t *res;
|
||||
|
||||
res = resp+i*subvect_size;
|
||||
for (k=0;k<subvect_size;k++)
|
||||
shape[k] = (spx_word16_t)shape_cb[i*subvect_size+k];
|
||||
E[i]=0;
|
||||
|
||||
/* Compute codeword response using convolution with impulse response */
|
||||
for(j=0;j<subvect_size;j++)
|
||||
{
|
||||
spx_word32_t resj=0;
|
||||
spx_word16_t res16;
|
||||
for (k=0;k<=j;k++)
|
||||
resj = MAC16_16(resj,shape[k],r[j-k]);
|
||||
#ifdef FIXED_POINT
|
||||
res16 = EXTRACT16(SHR32(resj, 13));
|
||||
#else
|
||||
res16 = 0.03125f*resj;
|
||||
#endif
|
||||
/* Compute codeword energy */
|
||||
E[i]=MAC16_16(E[i],res16,res16);
|
||||
res[j] = res16;
|
||||
/*printf ("%d\n", (int)res[j]);*/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef OVERRIDE_TARGET_UPDATE
|
||||
static inline void target_update(spx_word16_t *t, spx_word16_t g, spx_word16_t *r, int len)
|
||||
{
|
||||
int n;
|
||||
for (n=0;n<len;n++)
|
||||
t[n] = SUB16(t[n],PSHR32(MULT16_16(g,r[n]),13));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static void split_cb_search_shape_sign_N1(
|
||||
spx_word16_t target[], /* target vector */
|
||||
spx_coef_t ak[], /* LPCs for this subframe */
|
||||
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
|
||||
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
|
||||
const void *par, /* Codebook/search parameters*/
|
||||
int p, /* number of LPC coeffs */
|
||||
int nsf, /* number of samples in subframe */
|
||||
spx_sig_t *exc,
|
||||
spx_word16_t *r,
|
||||
SpeexBits *bits,
|
||||
char *stack,
|
||||
int update_target
|
||||
)
|
||||
{
|
||||
int i,j,m,q;
|
||||
VARDECL(spx_word16_t *resp);
|
||||
#ifdef _USE_SSE
|
||||
VARDECL(__m128 *resp2);
|
||||
VARDECL(__m128 *E);
|
||||
#else
|
||||
spx_word16_t *resp2;
|
||||
VARDECL(spx_word32_t *E);
|
||||
#endif
|
||||
VARDECL(spx_word16_t *t);
|
||||
VARDECL(spx_sig_t *e);
|
||||
const signed char *shape_cb;
|
||||
int shape_cb_size, subvect_size, nb_subvect;
|
||||
const split_cb_params *params;
|
||||
int best_index;
|
||||
spx_word32_t best_dist;
|
||||
int have_sign;
|
||||
|
||||
params = (const split_cb_params *) par;
|
||||
subvect_size = params->subvect_size;
|
||||
nb_subvect = params->nb_subvect;
|
||||
shape_cb_size = 1<<params->shape_bits;
|
||||
shape_cb = params->shape_cb;
|
||||
have_sign = params->have_sign;
|
||||
ALLOC(resp, shape_cb_size*subvect_size, spx_word16_t);
|
||||
#ifdef _USE_SSE
|
||||
ALLOC(resp2, (shape_cb_size*subvect_size)>>2, __m128);
|
||||
ALLOC(E, shape_cb_size>>2, __m128);
|
||||
#else
|
||||
resp2 = resp;
|
||||
ALLOC(E, shape_cb_size, spx_word32_t);
|
||||
#endif
|
||||
ALLOC(t, nsf, spx_word16_t);
|
||||
ALLOC(e, nsf, spx_sig_t);
|
||||
|
||||
/* FIXME: Do we still need to copy the target? */
|
||||
SPEEX_COPY(t, target, nsf);
|
||||
|
||||
compute_weighted_codebook(shape_cb, r, resp, resp2, E, shape_cb_size, subvect_size, stack);
|
||||
|
||||
for (i=0;i<nb_subvect;i++)
|
||||
{
|
||||
spx_word16_t *x=t+subvect_size*i;
|
||||
/*Find new n-best based on previous n-best j*/
|
||||
if (have_sign)
|
||||
vq_nbest_sign(x, resp2, subvect_size, shape_cb_size, E, 1, &best_index, &best_dist, stack);
|
||||
else
|
||||
vq_nbest(x, resp2, subvect_size, shape_cb_size, E, 1, &best_index, &best_dist, stack);
|
||||
|
||||
speex_bits_pack(bits,best_index,params->shape_bits+have_sign);
|
||||
|
||||
{
|
||||
int rind;
|
||||
spx_word16_t *res;
|
||||
spx_word16_t sign=1;
|
||||
rind = best_index;
|
||||
if (rind>=shape_cb_size)
|
||||
{
|
||||
sign=-1;
|
||||
rind-=shape_cb_size;
|
||||
}
|
||||
res = resp+rind*subvect_size;
|
||||
if (sign>0)
|
||||
for (m=0;m<subvect_size;m++)
|
||||
t[subvect_size*i+m] = SUB16(t[subvect_size*i+m], res[m]);
|
||||
else
|
||||
for (m=0;m<subvect_size;m++)
|
||||
t[subvect_size*i+m] = ADD16(t[subvect_size*i+m], res[m]);
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
if (sign==1)
|
||||
{
|
||||
for (j=0;j<subvect_size;j++)
|
||||
e[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5);
|
||||
} else {
|
||||
for (j=0;j<subvect_size;j++)
|
||||
e[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5));
|
||||
}
|
||||
#else
|
||||
for (j=0;j<subvect_size;j++)
|
||||
e[subvect_size*i+j]=sign*0.03125*shape_cb[rind*subvect_size+j];
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
for (m=0;m<subvect_size;m++)
|
||||
{
|
||||
spx_word16_t g;
|
||||
int rind;
|
||||
spx_word16_t sign=1;
|
||||
rind = best_index;
|
||||
if (rind>=shape_cb_size)
|
||||
{
|
||||
sign=-1;
|
||||
rind-=shape_cb_size;
|
||||
}
|
||||
|
||||
q=subvect_size-m;
|
||||
#ifdef FIXED_POINT
|
||||
g=sign*shape_cb[rind*subvect_size+m];
|
||||
#else
|
||||
g=sign*0.03125*shape_cb[rind*subvect_size+m];
|
||||
#endif
|
||||
target_update(t+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1));
|
||||
}
|
||||
}
|
||||
|
||||
/* Update excitation */
|
||||
/* FIXME: We could update the excitation directly above */
|
||||
for (j=0;j<nsf;j++)
|
||||
exc[j]=ADD32(exc[j],e[j]);
|
||||
|
||||
/* Update target: only update target if necessary */
|
||||
if (update_target)
|
||||
{
|
||||
VARDECL(spx_word16_t *r2);
|
||||
ALLOC(r2, nsf, spx_word16_t);
|
||||
for (j=0;j<nsf;j++)
|
||||
r2[j] = EXTRACT16(PSHR32(e[j] ,6));
|
||||
syn_percep_zero16(r2, ak, awk1, awk2, r2, nsf,p, stack);
|
||||
for (j=0;j<nsf;j++)
|
||||
target[j]=SUB16(target[j],PSHR16(r2[j],2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void split_cb_search_shape_sign(
|
||||
spx_word16_t target[], /* target vector */
|
||||
spx_coef_t ak[], /* LPCs for this subframe */
|
||||
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
|
||||
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
|
||||
const void *par, /* Codebook/search parameters*/
|
||||
int p, /* number of LPC coeffs */
|
||||
int nsf, /* number of samples in subframe */
|
||||
spx_sig_t *exc,
|
||||
spx_word16_t *r,
|
||||
SpeexBits *bits,
|
||||
char *stack,
|
||||
int complexity,
|
||||
int update_target
|
||||
)
|
||||
{
|
||||
int i,j,k,m,n,q;
|
||||
VARDECL(spx_word16_t *resp);
|
||||
#ifdef _USE_SSE
|
||||
VARDECL(__m128 *resp2);
|
||||
VARDECL(__m128 *E);
|
||||
#else
|
||||
spx_word16_t *resp2;
|
||||
VARDECL(spx_word32_t *E);
|
||||
#endif
|
||||
VARDECL(spx_word16_t *t);
|
||||
VARDECL(spx_sig_t *e);
|
||||
VARDECL(spx_word16_t *tmp);
|
||||
VARDECL(spx_word32_t *ndist);
|
||||
VARDECL(spx_word32_t *odist);
|
||||
VARDECL(int *itmp);
|
||||
VARDECL(spx_word16_t **ot2);
|
||||
VARDECL(spx_word16_t **nt2);
|
||||
spx_word16_t **ot, **nt;
|
||||
VARDECL(int **nind);
|
||||
VARDECL(int **oind);
|
||||
VARDECL(int *ind);
|
||||
const signed char *shape_cb;
|
||||
int shape_cb_size, subvect_size, nb_subvect;
|
||||
const split_cb_params *params;
|
||||
int N=2;
|
||||
VARDECL(int *best_index);
|
||||
VARDECL(spx_word32_t *best_dist);
|
||||
VARDECL(int *best_nind);
|
||||
VARDECL(int *best_ntarget);
|
||||
int have_sign;
|
||||
N=complexity;
|
||||
if (N>10)
|
||||
N=10;
|
||||
/* Complexity isn't as important for the codebooks as it is for the pitch */
|
||||
N=(2*N)/3;
|
||||
if (N<1)
|
||||
N=1;
|
||||
if (N==1)
|
||||
{
|
||||
split_cb_search_shape_sign_N1(target,ak,awk1,awk2,par,p,nsf,exc,r,bits,stack,update_target);
|
||||
return;
|
||||
}
|
||||
ALLOC(ot2, N, spx_word16_t*);
|
||||
ALLOC(nt2, N, spx_word16_t*);
|
||||
ALLOC(oind, N, int*);
|
||||
ALLOC(nind, N, int*);
|
||||
|
||||
params = (const split_cb_params *) par;
|
||||
subvect_size = params->subvect_size;
|
||||
nb_subvect = params->nb_subvect;
|
||||
shape_cb_size = 1<<params->shape_bits;
|
||||
shape_cb = params->shape_cb;
|
||||
have_sign = params->have_sign;
|
||||
ALLOC(resp, shape_cb_size*subvect_size, spx_word16_t);
|
||||
#ifdef _USE_SSE
|
||||
ALLOC(resp2, (shape_cb_size*subvect_size)>>2, __m128);
|
||||
ALLOC(E, shape_cb_size>>2, __m128);
|
||||
#else
|
||||
resp2 = resp;
|
||||
ALLOC(E, shape_cb_size, spx_word32_t);
|
||||
#endif
|
||||
ALLOC(t, nsf, spx_word16_t);
|
||||
ALLOC(e, nsf, spx_sig_t);
|
||||
ALLOC(ind, nb_subvect, int);
|
||||
|
||||
ALLOC(tmp, 2*N*nsf, spx_word16_t);
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
ot2[i]=tmp+2*i*nsf;
|
||||
nt2[i]=tmp+(2*i+1)*nsf;
|
||||
}
|
||||
ot=ot2;
|
||||
nt=nt2;
|
||||
ALLOC(best_index, N, int);
|
||||
ALLOC(best_dist, N, spx_word32_t);
|
||||
ALLOC(best_nind, N, int);
|
||||
ALLOC(best_ntarget, N, int);
|
||||
ALLOC(ndist, N, spx_word32_t);
|
||||
ALLOC(odist, N, spx_word32_t);
|
||||
|
||||
ALLOC(itmp, 2*N*nb_subvect, int);
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
nind[i]=itmp+2*i*nb_subvect;
|
||||
oind[i]=itmp+(2*i+1)*nb_subvect;
|
||||
}
|
||||
|
||||
SPEEX_COPY(t, target, nsf);
|
||||
|
||||
for (j=0;j<N;j++)
|
||||
SPEEX_COPY(&ot[j][0], t, nsf);
|
||||
|
||||
/* Pre-compute codewords response and energy */
|
||||
compute_weighted_codebook(shape_cb, r, resp, resp2, E, shape_cb_size, subvect_size, stack);
|
||||
|
||||
for (j=0;j<N;j++)
|
||||
odist[j]=0;
|
||||
|
||||
/*For all subvectors*/
|
||||
for (i=0;i<nb_subvect;i++)
|
||||
{
|
||||
/*"erase" nbest list*/
|
||||
for (j=0;j<N;j++)
|
||||
ndist[j]=VERY_LARGE32;
|
||||
/* This is not strictly necessary, but it provides an additonal safety
|
||||
to prevent crashes in case something goes wrong in the previous
|
||||
steps (e.g. NaNs) */
|
||||
for (j=0;j<N;j++)
|
||||
best_nind[j] = best_ntarget[j] = 0;
|
||||
/*For all n-bests of previous subvector*/
|
||||
for (j=0;j<N;j++)
|
||||
{
|
||||
spx_word16_t *x=ot[j]+subvect_size*i;
|
||||
spx_word32_t tener = 0;
|
||||
for (m=0;m<subvect_size;m++)
|
||||
tener = MAC16_16(tener, x[m],x[m]);
|
||||
#ifdef FIXED_POINT
|
||||
tener = SHR32(tener,1);
|
||||
#else
|
||||
tener *= .5;
|
||||
#endif
|
||||
/*Find new n-best based on previous n-best j*/
|
||||
if (have_sign)
|
||||
vq_nbest_sign(x, resp2, subvect_size, shape_cb_size, E, N, best_index, best_dist, stack);
|
||||
else
|
||||
vq_nbest(x, resp2, subvect_size, shape_cb_size, E, N, best_index, best_dist, stack);
|
||||
|
||||
/*For all new n-bests*/
|
||||
for (k=0;k<N;k++)
|
||||
{
|
||||
/* Compute total distance (including previous sub-vectors */
|
||||
spx_word32_t err = ADD32(ADD32(odist[j],best_dist[k]),tener);
|
||||
|
||||
/*update n-best list*/
|
||||
if (err<ndist[N-1])
|
||||
{
|
||||
for (m=0;m<N;m++)
|
||||
{
|
||||
if (err < ndist[m])
|
||||
{
|
||||
for (n=N-1;n>m;n--)
|
||||
{
|
||||
ndist[n] = ndist[n-1];
|
||||
best_nind[n] = best_nind[n-1];
|
||||
best_ntarget[n] = best_ntarget[n-1];
|
||||
}
|
||||
/* n is equal to m here, so they're interchangeable */
|
||||
ndist[m] = err;
|
||||
best_nind[n] = best_index[k];
|
||||
best_ntarget[n] = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i==0)
|
||||
break;
|
||||
}
|
||||
for (j=0;j<N;j++)
|
||||
{
|
||||
/*previous target (we don't care what happened before*/
|
||||
for (m=(i+1)*subvect_size;m<nsf;m++)
|
||||
nt[j][m]=ot[best_ntarget[j]][m];
|
||||
|
||||
/* New code: update the rest of the target only if it's worth it */
|
||||
for (m=0;m<subvect_size;m++)
|
||||
{
|
||||
spx_word16_t g;
|
||||
int rind;
|
||||
spx_word16_t sign=1;
|
||||
rind = best_nind[j];
|
||||
if (rind>=shape_cb_size)
|
||||
{
|
||||
sign=-1;
|
||||
rind-=shape_cb_size;
|
||||
}
|
||||
|
||||
q=subvect_size-m;
|
||||
#ifdef FIXED_POINT
|
||||
g=sign*shape_cb[rind*subvect_size+m];
|
||||
#else
|
||||
g=sign*0.03125*shape_cb[rind*subvect_size+m];
|
||||
#endif
|
||||
target_update(nt[j]+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1));
|
||||
}
|
||||
|
||||
for (q=0;q<nb_subvect;q++)
|
||||
nind[j][q]=oind[best_ntarget[j]][q];
|
||||
nind[j][i]=best_nind[j];
|
||||
}
|
||||
|
||||
/*update old-new data*/
|
||||
/* just swap pointers instead of a long copy */
|
||||
{
|
||||
spx_word16_t **tmp2;
|
||||
tmp2=ot;
|
||||
ot=nt;
|
||||
nt=tmp2;
|
||||
}
|
||||
for (j=0;j<N;j++)
|
||||
for (m=0;m<nb_subvect;m++)
|
||||
oind[j][m]=nind[j][m];
|
||||
for (j=0;j<N;j++)
|
||||
odist[j]=ndist[j];
|
||||
}
|
||||
|
||||
/*save indices*/
|
||||
for (i=0;i<nb_subvect;i++)
|
||||
{
|
||||
ind[i]=nind[0][i];
|
||||
speex_bits_pack(bits,ind[i],params->shape_bits+have_sign);
|
||||
}
|
||||
|
||||
/* Put everything back together */
|
||||
for (i=0;i<nb_subvect;i++)
|
||||
{
|
||||
int rind;
|
||||
spx_word16_t sign=1;
|
||||
rind = ind[i];
|
||||
if (rind>=shape_cb_size)
|
||||
{
|
||||
sign=-1;
|
||||
rind-=shape_cb_size;
|
||||
}
|
||||
#ifdef FIXED_POINT
|
||||
if (sign==1)
|
||||
{
|
||||
for (j=0;j<subvect_size;j++)
|
||||
e[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5);
|
||||
} else {
|
||||
for (j=0;j<subvect_size;j++)
|
||||
e[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5));
|
||||
}
|
||||
#else
|
||||
for (j=0;j<subvect_size;j++)
|
||||
e[subvect_size*i+j]=sign*0.03125*shape_cb[rind*subvect_size+j];
|
||||
#endif
|
||||
}
|
||||
/* Update excitation */
|
||||
for (j=0;j<nsf;j++)
|
||||
exc[j]=ADD32(exc[j],e[j]);
|
||||
|
||||
/* Update target: only update target if necessary */
|
||||
if (update_target)
|
||||
{
|
||||
VARDECL(spx_word16_t *r2);
|
||||
ALLOC(r2, nsf, spx_word16_t);
|
||||
for (j=0;j<nsf;j++)
|
||||
r2[j] = EXTRACT16(PSHR32(e[j] ,6));
|
||||
syn_percep_zero16(r2, ak, awk1, awk2, r2, nsf,p, stack);
|
||||
for (j=0;j<nsf;j++)
|
||||
target[j]=SUB16(target[j],PSHR16(r2[j],2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void split_cb_shape_sign_unquant(
|
||||
spx_sig_t *exc,
|
||||
const void *par, /* non-overlapping codebook */
|
||||
int nsf, /* number of samples in subframe */
|
||||
SpeexBits *bits,
|
||||
char *stack,
|
||||
spx_int32_t *seed
|
||||
)
|
||||
{
|
||||
int i,j;
|
||||
VARDECL(int *ind);
|
||||
VARDECL(int *signs);
|
||||
const signed char *shape_cb;
|
||||
int shape_cb_size, subvect_size, nb_subvect;
|
||||
const split_cb_params *params;
|
||||
int have_sign;
|
||||
|
||||
params = (const split_cb_params *) par;
|
||||
subvect_size = params->subvect_size;
|
||||
nb_subvect = params->nb_subvect;
|
||||
shape_cb_size = 1<<params->shape_bits;
|
||||
shape_cb = params->shape_cb;
|
||||
have_sign = params->have_sign;
|
||||
|
||||
ALLOC(ind, nb_subvect, int);
|
||||
ALLOC(signs, nb_subvect, int);
|
||||
|
||||
/* Decode codewords and gains */
|
||||
for (i=0;i<nb_subvect;i++)
|
||||
{
|
||||
if (have_sign)
|
||||
signs[i] = speex_bits_unpack_unsigned(bits, 1);
|
||||
else
|
||||
signs[i] = 0;
|
||||
ind[i] = speex_bits_unpack_unsigned(bits, params->shape_bits);
|
||||
}
|
||||
/* Compute decoded excitation */
|
||||
for (i=0;i<nb_subvect;i++)
|
||||
{
|
||||
spx_word16_t s=1;
|
||||
if (signs[i])
|
||||
s=-1;
|
||||
#ifdef FIXED_POINT
|
||||
if (s==1)
|
||||
{
|
||||
for (j=0;j<subvect_size;j++)
|
||||
exc[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[ind[i]*subvect_size+j]),SIG_SHIFT-5);
|
||||
} else {
|
||||
for (j=0;j<subvect_size;j++)
|
||||
exc[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[ind[i]*subvect_size+j]),SIG_SHIFT-5));
|
||||
}
|
||||
#else
|
||||
for (j=0;j<subvect_size;j++)
|
||||
exc[subvect_size*i+j]+=s*0.03125*shape_cb[ind[i]*subvect_size+j];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void noise_codebook_quant(
|
||||
spx_word16_t target[], /* target vector */
|
||||
spx_coef_t ak[], /* LPCs for this subframe */
|
||||
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
|
||||
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
|
||||
const void *par, /* Codebook/search parameters*/
|
||||
int p, /* number of LPC coeffs */
|
||||
int nsf, /* number of samples in subframe */
|
||||
spx_sig_t *exc,
|
||||
spx_word16_t *r,
|
||||
SpeexBits *bits,
|
||||
char *stack,
|
||||
int complexity,
|
||||
int update_target
|
||||
)
|
||||
{
|
||||
int i;
|
||||
VARDECL(spx_word16_t *tmp);
|
||||
ALLOC(tmp, nsf, spx_word16_t);
|
||||
residue_percep_zero16(target, ak, awk1, awk2, tmp, nsf, p, stack);
|
||||
|
||||
for (i=0;i<nsf;i++)
|
||||
exc[i]+=SHL32(EXTEND32(tmp[i]),8);
|
||||
SPEEX_MEMSET(target, 0, nsf);
|
||||
}
|
||||
|
||||
|
||||
void noise_codebook_unquant(
|
||||
spx_sig_t *exc,
|
||||
const void *par, /* non-overlapping codebook */
|
||||
int nsf, /* number of samples in subframe */
|
||||
SpeexBits *bits,
|
||||
char *stack,
|
||||
spx_int32_t *seed
|
||||
)
|
||||
{
|
||||
int i;
|
||||
/* FIXME: This is bad, but I don't think the function ever gets called anyway */
|
||||
for (i=0;i<nsf;i++)
|
||||
exc[i]=SHL32(EXTEND32(speex_rand(1, seed)),SIG_SHIFT);
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin & David Rowe */
|
||||
/**
|
||||
@file cb_search.h
|
||||
@brief Overlapped codebook search
|
||||
*/
|
||||
/*
|
||||
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 CB_SEARCH_H
|
||||
#define CB_SEARCH_H
|
||||
|
||||
#include <speex/speex_bits.h>
|
||||
#include "arch.h"
|
||||
|
||||
/** Split codebook parameters. */
|
||||
typedef struct split_cb_params {
|
||||
int subvect_size;
|
||||
int nb_subvect;
|
||||
const signed char *shape_cb;
|
||||
int shape_bits;
|
||||
int have_sign;
|
||||
} split_cb_params;
|
||||
|
||||
|
||||
void split_cb_search_shape_sign(
|
||||
spx_word16_t target[], /* target vector */
|
||||
spx_coef_t ak[], /* LPCs for this subframe */
|
||||
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
|
||||
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
|
||||
const void *par, /* Codebook/search parameters */
|
||||
int p, /* number of LPC coeffs */
|
||||
int nsf, /* number of samples in subframe */
|
||||
spx_sig_t *exc,
|
||||
spx_word16_t *r,
|
||||
SpeexBits *bits,
|
||||
char *stack,
|
||||
int complexity,
|
||||
int update_target
|
||||
);
|
||||
|
||||
void split_cb_shape_sign_unquant(
|
||||
spx_sig_t *exc,
|
||||
const void *par, /* non-overlapping codebook */
|
||||
int nsf, /* number of samples in subframe */
|
||||
SpeexBits *bits,
|
||||
char *stack,
|
||||
spx_int32_t *seed
|
||||
);
|
||||
|
||||
|
||||
void noise_codebook_quant(
|
||||
spx_word16_t target[], /* target vector */
|
||||
spx_coef_t ak[], /* LPCs for this subframe */
|
||||
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
|
||||
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
|
||||
const void *par, /* Codebook/search parameters */
|
||||
int p, /* number of LPC coeffs */
|
||||
int nsf, /* number of samples in subframe */
|
||||
spx_sig_t *exc,
|
||||
spx_word16_t *r,
|
||||
SpeexBits *bits,
|
||||
char *stack,
|
||||
int complexity,
|
||||
int update_target
|
||||
);
|
||||
|
||||
|
||||
void noise_codebook_unquant(
|
||||
spx_sig_t *exc,
|
||||
const void *par, /* non-overlapping codebook */
|
||||
int nsf, /* number of samples in subframe */
|
||||
SpeexBits *bits,
|
||||
char *stack,
|
||||
spx_int32_t *seed
|
||||
);
|
||||
|
||||
#endif
|
@ -1,137 +0,0 @@
|
||||
/* Copyright (C) 2004 Jean-Marc Valin */
|
||||
/**
|
||||
@file cb_search_arm4.h
|
||||
@brief Fixed codebook functions (ARM4 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
|
||||
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.
|
||||
*/
|
||||
|
||||
/* This optimization is temporaly disabled until it is fixed to account for the fact
|
||||
that "r" is now a 16-bit array */
|
||||
#if 0
|
||||
#define OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK
|
||||
static void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t *r, spx_word16_t *resp, spx_word16_t *resp2, spx_word32_t *E, int shape_cb_size, int subvect_size, char *stack)
|
||||
{
|
||||
int i, j, k;
|
||||
//const signed char *shape;
|
||||
for (i=0;i<shape_cb_size;i+=4)
|
||||
{
|
||||
|
||||
//shape = shape_cb;
|
||||
E[0]=0;
|
||||
E[1]=0;
|
||||
E[2]=0;
|
||||
E[3]=0;
|
||||
|
||||
/* Compute codeword response using convolution with impulse response */
|
||||
for(j=0;j<subvect_size;j++)
|
||||
{
|
||||
#if 1
|
||||
spx_word16_t *res;
|
||||
res = resp+j;
|
||||
spx_word32_t resj0,resj1,resj2,resj3;
|
||||
spx_word32_t dead1, dead2, dead3, dead4, dead5, dead6, dead7, dead8;
|
||||
__asm__ __volatile__ (
|
||||
"mov %0, #0 \n\t"
|
||||
"mov %1, #0 \n\t"
|
||||
"mov %2, #0 \n\t"
|
||||
"mov %3, #0 \n\t"
|
||||
".weighted%=: \n\t"
|
||||
"ldrsb %8, [%6] \n\t"
|
||||
"ldr %10, [%5], #-4 \n\t"
|
||||
"mov %9, %6 \n\t"
|
||||
"ldrsb %11, [%9, %7]! \n\t"
|
||||
"mla %0, %10, %8, %0 \n\t"
|
||||
"ldrsb %8, [%9, %7]! \n\t"
|
||||
"mla %1, %10, %11, %1 \n\t"
|
||||
"ldrsb %11, [%9, %7]! \n\t"
|
||||
"mla %2, %10, %8, %2 \n\t"
|
||||
"subs %4, %4, #1 \n\t"
|
||||
"mla %3, %10, %11, %3 \n\t"
|
||||
"add %6, %6, #1 \n\t"
|
||||
"bne .weighted%= \n\t"
|
||||
: "=r" (resj0), "=r" (resj1), "=r" (resj2), "=r" (resj3),
|
||||
"=r" (dead1), "=r" (dead2), "=r" (dead3), "=r" (dead4),
|
||||
"=r" (dead5), "=r" (dead6), "=r" (dead7), "=r" (dead8)
|
||||
: "4" (j+1), "5" (r+j), "6" (shape_cb), "7" (subvect_size)
|
||||
: "cc", "memory");
|
||||
#else
|
||||
spx_word16_t *res;
|
||||
res = resp+j;
|
||||
spx_word32_t resj0=0;
|
||||
spx_word32_t resj1=0;
|
||||
spx_word32_t resj2=0;
|
||||
spx_word32_t resj3=0;
|
||||
for (k=0;k<=j;k++)
|
||||
{
|
||||
const signed char *shape=shape_cb+k;
|
||||
resj0 = MAC16_16(resj0,*shape,r[j-k]);
|
||||
shape += subvect_size;
|
||||
resj1 = MAC16_16(resj1,*shape,r[j-k]);
|
||||
shape += subvect_size;
|
||||
resj2 = MAC16_16(resj2,*shape,r[j-k]);
|
||||
shape += subvect_size;
|
||||
resj3 = MAC16_16(resj3,*shape,r[j-k]);
|
||||
shape += subvect_size;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
resj0 = SHR(resj0, 11);
|
||||
resj1 = SHR(resj1, 11);
|
||||
resj2 = SHR(resj2, 11);
|
||||
resj3 = SHR(resj3, 11);
|
||||
#else
|
||||
resj0 *= 0.03125;
|
||||
resj1 *= 0.03125;
|
||||
resj2 *= 0.03125;
|
||||
resj3 *= 0.03125;
|
||||
#endif
|
||||
|
||||
/* Compute codeword energy */
|
||||
E[0]=ADD32(E[0],MULT16_16(resj0,resj0));
|
||||
E[1]=ADD32(E[1],MULT16_16(resj1,resj1));
|
||||
E[2]=ADD32(E[2],MULT16_16(resj2,resj2));
|
||||
E[3]=ADD32(E[3],MULT16_16(resj3,resj3));
|
||||
*res = resj0;
|
||||
res += subvect_size;
|
||||
*res = resj1;
|
||||
res += subvect_size;
|
||||
*res = resj2;
|
||||
res += subvect_size;
|
||||
*res = resj3;
|
||||
res += subvect_size;
|
||||
}
|
||||
resp += subvect_size<<2;
|
||||
shape_cb += subvect_size<<2;
|
||||
E+=4;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,112 +0,0 @@
|
||||
/* Copyright (C) 2005 Analog Devices */
|
||||
/**
|
||||
@author Jean-Marc Valin
|
||||
@file cb_search_bfin.h
|
||||
@brief Fixed codebook functions (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
|
||||
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.
|
||||
*/
|
||||
|
||||
#define OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK
|
||||
void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t *r, spx_word16_t *resp, spx_word16_t *resp2, spx_word32_t *E, int shape_cb_size, int subvect_size, char *stack)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<shape_cb_size;i++)
|
||||
{
|
||||
__asm__ __volatile__ (
|
||||
"P0 = %0;\n\t"
|
||||
"LC0 = P0;\n\t"
|
||||
"P1 = %1;\n\t"
|
||||
"P2 = %2;\n\t"
|
||||
"P3 = %3;\n\t"
|
||||
"P0 = 1;\n\t"
|
||||
"L0 = 0;\n\t"
|
||||
"L1 = 0;\n\t"
|
||||
"R2 = 0;\n\t"
|
||||
"A1 = 0;\n\t"
|
||||
"LOOP outter%= LC0;\n\t"
|
||||
"LOOP_BEGIN outter%=;\n\t"
|
||||
"A0 = 0;\n\t"
|
||||
"P4 = P1;\n\t"
|
||||
"I1 = P2;\n\t"
|
||||
"R0 = B[P4++] (X) || R1.L = W[I1--];\n\t"
|
||||
"LOOP inner%= LC1 = P0;\n\t"
|
||||
"LOOP_BEGIN inner%=;\n\t"
|
||||
"A0 += R0.L*R1.L (IS) || R0 = B[P4++] (X) || R1.L = W[I1--];\n\t"
|
||||
"LOOP_END inner%=;\n\t"
|
||||
"R0 = A0;\n\t"
|
||||
"R0 >>>= 13;\n\t"
|
||||
"A1 += R0.L*R0.L (IS);\n\t"
|
||||
"W[P3++] = R0;\n\t"
|
||||
"P0 += 1;\n\t"
|
||||
"P2 += 2;\n\t"
|
||||
"LOOP_END outter%=;\n\t"
|
||||
"P4 = %4;\n\t"
|
||||
"R1 = A1;\n\t"
|
||||
"[P4] = R1;\n\t"
|
||||
:
|
||||
: "m" (subvect_size), "m" (shape_cb), "m" (r), "m" (resp), "m" (E)
|
||||
: "A0", "P0", "P1", "P2", "P3", "P4", "R0", "R1", "R2", "I0", "I1", "L0",
|
||||
"L1", "A0", "A1", "memory"
|
||||
#if !(__GNUC__ == 3)
|
||||
, "LC0", "LC1" /* gcc 3.4 doesn't know about LC registers */
|
||||
#endif
|
||||
);
|
||||
shape_cb += subvect_size;
|
||||
resp += subvect_size;
|
||||
E++;
|
||||
}
|
||||
}
|
||||
|
||||
#define OVERRIDE_TARGET_UPDATE
|
||||
static inline void target_update(spx_word16_t *t, spx_word16_t g, spx_word16_t *r, int len)
|
||||
{
|
||||
if (!len)
|
||||
return;
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"I0 = %0;\n\t"
|
||||
"I1 = %1;\n\t"
|
||||
"L0 = 0;\n\t"
|
||||
"L1 = 0;\n\t"
|
||||
"R2 = 4096;\n\t"
|
||||
"LOOP tupdate%= LC0 = %3;\n\t"
|
||||
"LOOP_BEGIN tupdate%=;\n\t"
|
||||
"R0.L = W[I0] || R1.L = W[I1++];\n\t"
|
||||
"R1 = (A1 = R1.L*%2.L) (IS);\n\t"
|
||||
"R1 = R1 + R2;\n\t"
|
||||
"R1 >>>= 13;\n\t"
|
||||
"R0.L = R0.L - R1.L;\n\t"
|
||||
"W[I0++] = R0.L;\n\t"
|
||||
"LOOP_END tupdate%=;\n\t"
|
||||
:
|
||||
: "a" (t), "a" (r), "d" (g), "a" (len)
|
||||
: "R0", "R1", "R2", "A1", "I0", "I1", "L0", "L1"
|
||||
);
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
/* Copyright (C) 2004 Jean-Marc Valin */
|
||||
/**
|
||||
@file cb_search_sse.h
|
||||
@brief Fixed codebook functions (SSE 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
|
||||
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.
|
||||
*/
|
||||
|
||||
#include <xmmintrin.h>
|
||||
|
||||
static inline void _spx_mm_getr_ps (__m128 U, float *__Z, float *__Y, float *__X, float *__W)
|
||||
{
|
||||
union {
|
||||
float __a[4];
|
||||
__m128 __v;
|
||||
} __u;
|
||||
|
||||
__u.__v = U;
|
||||
|
||||
*__Z = __u.__a[0];
|
||||
*__Y = __u.__a[1];
|
||||
*__X = __u.__a[2];
|
||||
*__W = __u.__a[3];
|
||||
|
||||
}
|
||||
|
||||
#define OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK
|
||||
static void compute_weighted_codebook(const signed char *shape_cb, const spx_sig_t *_r, float *resp, __m128 *resp2, __m128 *E, int shape_cb_size, int subvect_size, char *stack)
|
||||
{
|
||||
int i, j, k;
|
||||
__m128 resj, EE;
|
||||
VARDECL(__m128 *r);
|
||||
VARDECL(__m128 *shape);
|
||||
ALLOC(r, subvect_size, __m128);
|
||||
ALLOC(shape, subvect_size, __m128);
|
||||
for(j=0;j<subvect_size;j++)
|
||||
r[j] = _mm_load_ps1(_r+j);
|
||||
for (i=0;i<shape_cb_size;i+=4)
|
||||
{
|
||||
float *_res = resp+i*subvect_size;
|
||||
const signed char *_shape = shape_cb+i*subvect_size;
|
||||
EE = _mm_setzero_ps();
|
||||
for(j=0;j<subvect_size;j++)
|
||||
{
|
||||
shape[j] = _mm_setr_ps(0.03125*_shape[j], 0.03125*_shape[subvect_size+j], 0.03125*_shape[2*subvect_size+j], 0.03125*_shape[3*subvect_size+j]);
|
||||
}
|
||||
for(j=0;j<subvect_size;j++)
|
||||
{
|
||||
resj = _mm_setzero_ps();
|
||||
for (k=0;k<=j;k++)
|
||||
resj = _mm_add_ps(resj, _mm_mul_ps(shape[k],r[j-k]));
|
||||
_spx_mm_getr_ps(resj, _res+j, _res+subvect_size+j, _res+2*subvect_size+j, _res+3*subvect_size+j);
|
||||
*resp2++ = resj;
|
||||
EE = _mm_add_ps(EE, _mm_mul_ps(resj, resj));
|
||||
}
|
||||
E[i>>2] = EE;
|
||||
}
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
% Attempts to diagnose AEC problems from recorded samples
|
||||
%
|
||||
% out = echo_diagnostic(rec_file, play_file, out_file, tail_length)
|
||||
%
|
||||
% Computes the full matrix inversion to cancel echo from the
|
||||
% recording 'rec_file' using the far end signal 'play_file' using
|
||||
% a filter length of 'tail_length'. The output is saved to 'out_file'.
|
||||
function out = echo_diagnostic(rec_file, play_file, out_file, tail_length)
|
||||
|
||||
F=fopen(rec_file,'rb');
|
||||
rec=fread(F,Inf,'short');
|
||||
fclose (F);
|
||||
F=fopen(play_file,'rb');
|
||||
play=fread(F,Inf,'short');
|
||||
fclose (F);
|
||||
|
||||
rec = [rec; zeros(1024,1)];
|
||||
play = [play; zeros(1024,1)];
|
||||
|
||||
N = length(rec);
|
||||
corr = real(ifft(fft(rec).*conj(fft(play))));
|
||||
acorr = real(ifft(fft(play).*conj(fft(play))));
|
||||
|
||||
[a,b] = max(corr);
|
||||
|
||||
if b > N/2
|
||||
b = b-N;
|
||||
end
|
||||
printf ("Far end to near end delay is %d samples\n", b);
|
||||
if (b > .3*tail_length)
|
||||
printf ('This is too much delay, try delaying the far-end signal a bit\n');
|
||||
else if (b < 0)
|
||||
printf ('You have a negative delay, the echo canceller has no chance to cancel anything!\n');
|
||||
else
|
||||
printf ('Delay looks OK.\n');
|
||||
end
|
||||
end
|
||||
end
|
||||
N2 = round(N/2);
|
||||
corr1 = real(ifft(fft(rec(1:N2)).*conj(fft(play(1:N2)))));
|
||||
corr2 = real(ifft(fft(rec(N2+1:end)).*conj(fft(play(N2+1:end)))));
|
||||
|
||||
[a,b1] = max(corr1);
|
||||
if b1 > N2/2
|
||||
b1 = b1-N2;
|
||||
end
|
||||
[a,b2] = max(corr2);
|
||||
if b2 > N2/2
|
||||
b2 = b2-N2;
|
||||
end
|
||||
drift = (b1-b2)/N2;
|
||||
printf ('Drift estimate is %f%% (%d samples)\n', 100*drift, b1-b2);
|
||||
if abs(b1-b2) < 10
|
||||
printf ('A drift of a few (+-10) samples is normal.\n');
|
||||
else
|
||||
if abs(b1-b2) < 30
|
||||
printf ('There may be (not sure) excessive clock drift. Is the capture and playback done on the same soundcard?\n');
|
||||
else
|
||||
printf ('Your clock is drifting! No way the AEC will be able to do anything with that. Most likely, you''re doing capture and playback from two different cards.\n');
|
||||
end
|
||||
end
|
||||
end
|
||||
acorr(1) = .001+1.00001*acorr(1);
|
||||
AtA = toeplitz(acorr(1:tail_length));
|
||||
bb = corr(1:tail_length);
|
||||
h = AtA\bb;
|
||||
|
||||
out = (rec - filter(h, 1, play));
|
||||
|
||||
F=fopen(out_file,'w');
|
||||
fwrite(F,out,'short');
|
||||
fclose (F);
|
@ -1,50 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin
|
||||
File: exc_10_16_table.c
|
||||
Codebook for excitation in narrowband CELP mode (3200 bps)
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
const signed char exc_10_16_table[160] = {
|
||||
22,39,14,44,11,35,-2,23,-4,6,
|
||||
46,-28,13,-27,-23,12,4,20,-5,9,
|
||||
37,-18,-23,23,0,9,-6,-20,4,-1,
|
||||
-17,-5,-4,17,0,1,9,-2,1,2,
|
||||
2,-12,8,-25,39,15,9,16,-55,-11,
|
||||
9,11,5,10,-2,-60,8,13,-6,11,
|
||||
-16,27,-47,-12,11,1,16,-7,9,-3,
|
||||
-29,9,-14,25,-19,34,36,12,40,-10,
|
||||
-3,-24,-14,-37,-21,-35,-2,-36,3,-6,
|
||||
67,28,6,-17,-3,-12,-16,-15,-17,-7,
|
||||
-59,-36,-13,1,7,1,2,10,2,11,
|
||||
13,10,8,-2,7,3,5,4,2,2,
|
||||
-3,-8,4,-5,6,7,-42,15,35,-2,
|
||||
-46,38,28,-20,-9,1,7,-3,0,-2,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
-15,-28,52,32,5,-5,-17,-20,-10,-1};
|
@ -1,66 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin
|
||||
File: exc_10_32_table.c
|
||||
Codebook for excitation in narrowband CELP mode (4000 bps)
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
const signed char exc_10_32_table[320] = {
|
||||
7,17,17,27,25,22,12,4,-3,0,
|
||||
28,-36,39,-24,-15,3,-9,15,-5,10,
|
||||
31,-28,11,31,-21,9,-11,-11,-2,-7,
|
||||
-25,14,-22,31,4,-14,19,-12,14,-5,
|
||||
4,-7,4,-5,9,0,-2,42,-47,-16,
|
||||
1,8,0,9,23,-57,0,28,-11,6,
|
||||
-31,55,-45,3,-5,4,2,-2,4,-7,
|
||||
-3,6,-2,7,-3,12,5,8,54,-10,
|
||||
8,-7,-8,-24,-25,-27,-14,-5,8,5,
|
||||
44,23,5,-9,-11,-11,-13,-9,-12,-8,
|
||||
-29,-8,-22,6,-15,3,-12,-1,-5,-3,
|
||||
34,-1,29,-16,17,-4,12,2,1,4,
|
||||
-2,-4,2,-1,11,-3,-52,28,30,-9,
|
||||
-32,25,44,-20,-24,4,6,-1,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
-25,-10,22,29,13,-13,-22,-13,-4,0,
|
||||
-4,-16,10,15,-36,-24,28,25,-1,-3,
|
||||
66,-33,-11,-15,6,0,3,4,-2,5,
|
||||
24,-20,-47,29,19,-2,-4,-1,0,-1,
|
||||
-2,3,1,8,-11,5,5,-57,28,28,
|
||||
0,-16,4,-4,12,-6,-1,2,-20,61,
|
||||
-9,24,-22,-42,29,6,17,8,4,2,
|
||||
-65,15,8,10,5,6,5,3,2,-2,
|
||||
-3,5,-9,4,-5,23,13,23,-3,-63,
|
||||
3,-5,-4,-6,0,-3,23,-36,-46,9,
|
||||
5,5,8,4,9,-5,1,-3,10,1,
|
||||
-6,10,-11,24,-47,31,22,-12,14,-10,
|
||||
6,11,-7,-7,7,-31,51,-12,-6,7,
|
||||
6,-17,9,-11,-20,52,-19,3,-6,-6,
|
||||
-8,-5,23,-41,37,1,-21,10,-14,8,
|
||||
7,5,-15,-15,23,39,-26,-33,7,2,
|
||||
-32,-30,-21,-8,4,12,17,15,14,11};
|
@ -1,66 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin
|
||||
File: exc_20_32_table.c
|
||||
Codebook for excitation in narrowband CELP mode (2000 bps)
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
const signed char exc_20_32_table[640] = {
|
||||
12,32,25,46,36,33,9,14,-3,6,1,-8,0,-10,-5,-7,-7,-7,-5,-5,
|
||||
31,-27,24,-32,-4,10,-11,21,-3,19,23,-9,22,24,-10,-1,-10,-13,-7,-11,
|
||||
42,-33,31,19,-8,0,-10,-16,1,-21,-17,10,-8,14,8,4,11,-2,5,-2,
|
||||
-33,11,-16,33,11,-4,9,-4,11,2,6,-5,8,-5,11,-4,-6,26,-36,-16,
|
||||
0,4,-2,-8,12,6,-1,34,-46,-22,9,9,21,9,5,-66,-5,26,2,10,
|
||||
13,2,19,9,12,-81,3,13,13,0,-14,22,-35,6,-7,-4,6,-6,10,-6,
|
||||
-31,38,-33,0,-10,-11,5,-12,12,-17,5,0,-6,13,-9,10,8,25,33,2,
|
||||
-12,8,-6,10,-2,21,7,17,43,5,11,-7,-9,-20,-36,-20,-23,-4,-4,-3,
|
||||
27,-9,-9,-49,-39,-38,-11,-9,6,5,23,25,5,3,3,4,1,2,-3,-1,
|
||||
87,39,17,-21,-9,-19,-9,-15,-13,-14,-17,-11,-10,-11,-8,-6,-1,-3,-3,-1,
|
||||
-54,-34,-27,-8,-11,-4,-5,0,0,4,8,6,9,7,9,7,6,5,5,5,
|
||||
48,10,19,-10,12,-1,9,-3,2,5,-3,2,-2,-2,0,-2,-26,6,9,-7,
|
||||
-16,-9,2,7,7,-5,-43,11,22,-11,-9,34,37,-15,-13,-6,1,-1,1,1,
|
||||
-64,56,52,-11,-27,5,4,3,1,2,1,3,-1,-4,-4,-10,-7,-4,-4,2,
|
||||
-1,-7,-7,-12,-10,-15,-9,-5,-5,-11,-16,-13,6,16,4,-13,-16,-10,-4,2,
|
||||
-47,-13,25,47,19,-14,-20,-8,-17,0,-3,-13,1,6,-17,-14,15,1,10,6,
|
||||
-24,0,-10,19,-69,-8,14,49,17,-5,33,-29,3,-4,0,2,-8,5,-6,2,
|
||||
120,-56,-12,-47,23,-9,6,-5,1,2,-5,1,-10,4,-1,-1,4,-1,0,-3,
|
||||
30,-52,-67,30,22,11,-1,-4,3,0,7,2,0,1,-10,-4,-8,-13,5,1,
|
||||
1,-1,5,13,-9,-3,-10,-62,22,48,-4,-6,2,3,5,1,1,4,1,13,
|
||||
3,-20,10,-9,13,-2,-4,9,-20,44,-1,20,-32,-67,19,0,28,11,8,2,
|
||||
-11,15,-19,-53,31,2,34,10,6,-4,-58,8,10,13,14,1,12,2,0,0,
|
||||
-128,37,-8,44,-9,26,-3,18,2,6,11,-1,9,1,5,3,0,1,1,2,
|
||||
12,3,-2,-3,7,25,9,18,-6,-37,3,-8,-16,3,-10,-7,17,-34,-44,11,
|
||||
17,-15,-3,-16,-1,-13,11,-46,-65,-2,8,13,2,4,4,5,15,5,9,6,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
-9,19,-12,12,-28,38,29,-1,12,2,5,23,-10,3,4,-15,21,-4,3,3,
|
||||
6,17,-9,-4,-8,-20,26,5,-10,6,1,-19,18,-15,-12,47,-6,-2,-7,-9,
|
||||
-1,-17,-2,-2,-14,30,-14,2,-7,-4,-1,-12,11,-25,16,-3,-12,11,-7,7,
|
||||
-17,1,19,-28,31,-7,-10,7,-10,3,12,5,-16,6,24,41,-29,-54,0,1,
|
||||
7,-1,5,-6,13,10,-4,-8,8,-9,-27,-53,-38,-1,10,19,17,16,12,12,
|
||||
0,3,-7,-4,13,12,-31,-14,6,-5,3,5,17,43,50,25,10,1,-6,-2};
|
@ -1,290 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin
|
||||
File: exc_5_256_table.c
|
||||
Codebook for excitation in narrowband CELP mode (12800 bps)
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
const signed char exc_5_256_table[1280] = {
|
||||
-8,-37,5,-43,5,
|
||||
73,61,39,12,-3,
|
||||
-61,-32,2,42,30,
|
||||
-3,17,-27,9,34,
|
||||
20,-1,-5,2,23,
|
||||
-7,-46,26,53,-47,
|
||||
20,-2,-33,-89,-51,
|
||||
-64,27,11,15,-34,
|
||||
-5,-56,25,-9,-1,
|
||||
-29,1,40,67,-23,
|
||||
-16,16,33,19,7,
|
||||
14,85,22,-10,-10,
|
||||
-12,-7,-1,52,89,
|
||||
29,11,-20,-37,-46,
|
||||
-15,17,-24,-28,24,
|
||||
2,1,0,23,-101,
|
||||
23,14,-1,-23,-18,
|
||||
9,5,-13,38,1,
|
||||
-28,-28,4,27,51,
|
||||
-26,34,-40,35,47,
|
||||
54,38,-54,-26,-6,
|
||||
42,-25,13,-30,-36,
|
||||
18,41,-4,-33,23,
|
||||
-32,-7,-4,51,-3,
|
||||
17,-52,56,-47,36,
|
||||
-2,-21,36,10,8,
|
||||
-33,31,19,9,-5,
|
||||
-40,10,-9,-21,19,
|
||||
18,-78,-18,-5,0,
|
||||
-26,-36,-47,-51,-44,
|
||||
18,40,27,-2,29,
|
||||
49,-26,2,32,-54,
|
||||
30,-73,54,3,-5,
|
||||
36,22,53,10,-1,
|
||||
-84,-53,-29,-5,3,
|
||||
-44,53,-51,4,22,
|
||||
71,-35,-1,33,-5,
|
||||
-27,-7,36,17,-23,
|
||||
-39,16,-9,-55,-15,
|
||||
-20,39,-35,6,-39,
|
||||
-14,18,48,-64,-17,
|
||||
-15,9,39,81,37,
|
||||
-68,37,47,-21,-6,
|
||||
-104,13,6,9,-2,
|
||||
35,8,-23,18,42,
|
||||
45,21,33,-5,-49,
|
||||
9,-6,-43,-56,39,
|
||||
2,-16,-25,87,1,
|
||||
-3,-9,17,-25,-11,
|
||||
-9,-1,10,2,-14,
|
||||
-14,4,-1,-10,28,
|
||||
-23,40,-32,26,-9,
|
||||
26,4,-27,-23,3,
|
||||
42,-60,1,49,-3,
|
||||
27,10,-52,-40,-2,
|
||||
18,45,-23,17,-44,
|
||||
3,-3,17,-46,52,
|
||||
-40,-47,25,75,31,
|
||||
-49,53,30,-30,-32,
|
||||
-36,38,-6,-15,-16,
|
||||
54,-27,-48,3,38,
|
||||
-29,-32,-22,-14,-4,
|
||||
-23,-13,32,-39,9,
|
||||
8,-45,-13,34,-16,
|
||||
49,40,32,31,28,
|
||||
23,23,32,47,59,
|
||||
-68,8,62,44,25,
|
||||
-14,-24,-65,-16,36,
|
||||
67,-25,-38,-21,4,
|
||||
-33,-2,42,5,-63,
|
||||
40,11,26,-42,-23,
|
||||
-61,79,-31,23,-20,
|
||||
10,-32,53,-25,-36,
|
||||
10,-26,-5,3,0,
|
||||
-71,5,-10,-37,1,
|
||||
-24,21,-54,-17,1,
|
||||
-29,-25,-15,-27,32,
|
||||
68,45,-16,-37,-18,
|
||||
-5,1,0,-77,71,
|
||||
-6,3,-20,71,-67,
|
||||
29,-35,10,-30,19,
|
||||
4,16,17,5,0,
|
||||
-14,19,2,28,26,
|
||||
59,3,2,24,39,
|
||||
55,-50,-45,-18,-17,
|
||||
33,-35,14,-1,1,
|
||||
8,87,-35,-29,0,
|
||||
-27,13,-7,23,-13,
|
||||
37,-40,50,-35,14,
|
||||
19,-7,-14,49,54,
|
||||
-5,22,-2,-29,-8,
|
||||
-27,38,13,27,48,
|
||||
12,-41,-21,-15,28,
|
||||
7,-16,-24,-19,-20,
|
||||
11,-20,9,2,13,
|
||||
23,-20,11,27,-27,
|
||||
71,-69,8,2,-6,
|
||||
22,12,16,16,9,
|
||||
-16,-8,-17,1,25,
|
||||
1,40,-37,-33,66,
|
||||
94,53,4,-22,-25,
|
||||
-41,-42,25,35,-16,
|
||||
-15,57,31,-29,-32,
|
||||
21,16,-60,45,15,
|
||||
-1,7,57,-26,-47,
|
||||
-29,11,8,15,19,
|
||||
-105,-8,54,27,10,
|
||||
-17,6,-12,-1,-10,
|
||||
4,0,23,-10,31,
|
||||
13,11,10,12,-64,
|
||||
23,-3,-8,-19,16,
|
||||
52,24,-40,16,10,
|
||||
40,5,9,0,-13,
|
||||
-7,-21,-8,-6,-7,
|
||||
-21,59,16,-53,18,
|
||||
-60,11,-47,14,-18,
|
||||
25,-13,-24,4,-39,
|
||||
16,-28,54,26,-67,
|
||||
30,27,-20,-52,20,
|
||||
-12,55,12,18,-16,
|
||||
39,-14,-6,-26,56,
|
||||
-88,-55,12,25,26,
|
||||
-37,6,75,0,-34,
|
||||
-81,54,-30,1,-7,
|
||||
49,-23,-14,21,10,
|
||||
-62,-58,-57,-47,-34,
|
||||
15,-4,34,-78,31,
|
||||
25,-11,7,50,-10,
|
||||
42,-63,14,-36,-4,
|
||||
57,55,57,53,42,
|
||||
-42,-1,15,40,37,
|
||||
15,25,-11,6,1,
|
||||
31,-2,-6,-1,-7,
|
||||
-64,34,28,30,-1,
|
||||
3,21,0,-88,-12,
|
||||
-56,25,-28,40,8,
|
||||
-28,-14,9,12,2,
|
||||
-6,-17,22,49,-6,
|
||||
-26,14,28,-20,4,
|
||||
-12,50,35,40,13,
|
||||
-38,-58,-29,17,30,
|
||||
22,60,26,-54,-39,
|
||||
-12,58,-28,-63,10,
|
||||
-21,-8,-12,26,-62,
|
||||
6,-10,-11,-22,-6,
|
||||
-7,4,1,18,2,
|
||||
-70,11,14,4,13,
|
||||
19,-24,-34,24,67,
|
||||
17,51,-21,13,23,
|
||||
54,-30,48,1,-13,
|
||||
80,26,-16,-2,13,
|
||||
-4,6,-30,29,-24,
|
||||
73,-58,30,-27,20,
|
||||
-2,-21,41,45,30,
|
||||
-27,-3,-5,-18,-20,
|
||||
-49,-3,-35,10,42,
|
||||
-19,-67,-53,-11,9,
|
||||
13,-15,-33,-51,-30,
|
||||
15,7,25,-30,4,
|
||||
28,-22,-34,54,-29,
|
||||
39,-46,20,16,34,
|
||||
-4,47,75,1,-44,
|
||||
-55,-24,7,-1,9,
|
||||
-42,50,-8,-36,41,
|
||||
68,0,-4,-10,-23,
|
||||
-15,-50,64,36,-9,
|
||||
-27,12,25,-38,-47,
|
||||
-37,32,-49,51,-36,
|
||||
2,-4,69,-26,19,
|
||||
7,45,67,46,13,
|
||||
-63,46,15,-47,4,
|
||||
-41,13,-6,5,-21,
|
||||
37,26,-55,-7,33,
|
||||
-1,-28,10,-17,-64,
|
||||
-14,0,-36,-17,93,
|
||||
-3,-9,-66,44,-21,
|
||||
3,-12,38,-6,-13,
|
||||
-12,19,13,43,-43,
|
||||
-10,-12,6,-5,9,
|
||||
-49,32,-5,2,4,
|
||||
5,15,-16,10,-21,
|
||||
8,-62,-8,64,8,
|
||||
79,-1,-66,-49,-18,
|
||||
5,40,-5,-30,-45,
|
||||
1,-6,21,-32,93,
|
||||
-18,-30,-21,32,21,
|
||||
-18,22,8,5,-41,
|
||||
-54,80,22,-10,-7,
|
||||
-8,-23,-64,66,56,
|
||||
-14,-30,-41,-46,-14,
|
||||
-29,-37,27,-14,42,
|
||||
-2,-9,-29,34,14,
|
||||
33,-14,22,4,10,
|
||||
26,26,28,32,23,
|
||||
-72,-32,3,0,-14,
|
||||
35,-42,-78,-32,6,
|
||||
29,-18,-45,-5,7,
|
||||
-33,-45,-3,-22,-34,
|
||||
8,-8,4,-51,-25,
|
||||
-9,59,-78,21,-5,
|
||||
-25,-48,66,-15,-17,
|
||||
-24,-49,-13,25,-23,
|
||||
-64,-6,40,-24,-19,
|
||||
-11,57,-33,-8,1,
|
||||
10,-52,-54,28,39,
|
||||
49,34,-11,-61,-41,
|
||||
-43,10,15,-15,51,
|
||||
30,15,-51,32,-34,
|
||||
-2,-34,14,18,16,
|
||||
1,1,-3,-3,1,
|
||||
1,-18,6,16,48,
|
||||
12,-5,-42,7,36,
|
||||
48,7,-20,-10,7,
|
||||
12,2,54,39,-38,
|
||||
37,54,4,-11,-8,
|
||||
-46,-10,5,-10,-34,
|
||||
46,-12,29,-37,39,
|
||||
36,-11,24,56,17,
|
||||
14,20,25,0,-25,
|
||||
-28,55,-7,-5,27,
|
||||
3,9,-26,-8,6,
|
||||
-24,-10,-30,-31,-34,
|
||||
18,4,22,21,40,
|
||||
-1,-29,-37,-8,-21,
|
||||
92,-29,11,-3,11,
|
||||
73,23,22,7,4,
|
||||
-44,-9,-11,21,-13,
|
||||
11,9,-78,-1,47,
|
||||
114,-12,-37,-19,-5,
|
||||
-11,-22,19,12,-30,
|
||||
7,38,45,-21,-8,
|
||||
-9,55,-45,56,-21,
|
||||
7,17,46,-57,-87,
|
||||
-6,27,31,31,7,
|
||||
-56,-12,46,21,-5,
|
||||
-12,36,3,3,-21,
|
||||
43,19,12,-7,9,
|
||||
-14,0,-9,-33,-91,
|
||||
7,26,3,-11,64,
|
||||
83,-31,-46,25,2,
|
||||
9,5,2,2,-1,
|
||||
20,-17,10,-5,-27,
|
||||
-8,20,8,-19,16,
|
||||
-21,-13,-31,5,5,
|
||||
42,24,9,34,-20,
|
||||
28,-61,22,11,-39,
|
||||
64,-20,-1,-30,-9,
|
||||
-20,24,-25,-24,-29,
|
||||
22,-60,6,-5,41,
|
||||
-9,-87,14,34,15,
|
||||
-57,52,69,15,-3,
|
||||
-102,58,16,3,6,
|
||||
60,-75,-32,26,7,
|
||||
-57,-27,-32,-24,-21,
|
||||
-29,-16,62,-46,31,
|
||||
30,-27,-15,7,15};
|
@ -1,98 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin
|
||||
File: exc_5_64_table.c
|
||||
Codebook for excitation in narrowband CELP mode (9600 bps)
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
const signed char exc_5_64_table[320]={
|
||||
1,5,-15,49,-66,
|
||||
-48,-4,50,-44,7,
|
||||
37,16,-18,25,-26,
|
||||
-26,-15,19,19,-27,
|
||||
-47,28,57,5,-17,
|
||||
-32,-41,68,21,-2,
|
||||
64,56,8,-16,-13,
|
||||
-26,-9,-16,11,6,
|
||||
-39,25,-19,22,-31,
|
||||
20,-45,55,-43,10,
|
||||
-16,47,-40,40,-20,
|
||||
-51,3,-17,-14,-15,
|
||||
-24,53,-20,-46,46,
|
||||
27,-68,32,3,-18,
|
||||
-5,9,-31,16,-9,
|
||||
-10,-1,-23,48,95,
|
||||
47,25,-41,-32,-3,
|
||||
15,-25,-55,36,41,
|
||||
-27,20,5,13,14,
|
||||
-22,5,2,-23,18,
|
||||
46,-15,17,-18,-34,
|
||||
-5,-8,27,-55,73,
|
||||
16,2,-1,-17,40,
|
||||
-78,33,0,2,19,
|
||||
4,53,-16,-15,-16,
|
||||
-28,-3,-13,49,8,
|
||||
-7,-29,27,-13,32,
|
||||
20,32,-61,16,14,
|
||||
41,44,40,24,20,
|
||||
7,4,48,-60,-77,
|
||||
17,-6,-48,65,-15,
|
||||
32,-30,-71,-10,-3,
|
||||
-6,10,-2,-7,-29,
|
||||
-56,67,-30,7,-5,
|
||||
86,-6,-10,0,5,
|
||||
-31,60,34,-38,-3,
|
||||
24,10,-2,30,23,
|
||||
24,-41,12,70,-43,
|
||||
15,-17,6,13,16,
|
||||
-13,8,30,-15,-8,
|
||||
5,23,-34,-98,-4,
|
||||
-13,13,-48,-31,70,
|
||||
12,31,25,24,-24,
|
||||
26,-7,33,-16,8,
|
||||
5,-11,-14,-8,-65,
|
||||
13,10,-2,-9,0,
|
||||
-3,-68,5,35,7,
|
||||
0,-31,-1,-17,-9,
|
||||
-9,16,-37,-18,-1,
|
||||
69,-48,-28,22,-21,
|
||||
-11,5,49,55,23,
|
||||
-86,-36,16,2,13,
|
||||
63,-51,30,-11,13,
|
||||
24,-18,-6,14,-19,
|
||||
1,41,9,-5,27,
|
||||
-36,-44,-34,-37,-21,
|
||||
-26,31,-39,15,43,
|
||||
5,-8,29,20,-8,
|
||||
-20,-52,-28,-1,13,
|
||||
26,-34,-10,-9,27,
|
||||
-8,8,27,-66,4,
|
||||
12,-22,49,10,-77,
|
||||
32,-18,3,-38,12,
|
||||
-3,-1,2,2,0};
|
@ -1,162 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin
|
||||
File: exc_8_128_table.c
|
||||
Codebook for excitation in narrowband CELP mode (7000 bps)
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
const signed char exc_8_128_table[1024] = {
|
||||
-14,9,13,-32,2,-10,31,-10,
|
||||
-8,-8,6,-4,-1,10,-64,23,
|
||||
6,20,13,6,8,-22,16,34,
|
||||
7,42,-49,-28,5,26,4,-15,
|
||||
41,34,41,32,33,24,23,14,
|
||||
8,40,34,4,-24,-41,-19,-15,
|
||||
13,-13,33,-54,24,27,-44,33,
|
||||
27,-15,-15,24,-19,14,-36,14,
|
||||
-9,24,-12,-4,37,-5,16,-34,
|
||||
5,10,33,-15,-54,-16,12,25,
|
||||
12,1,2,0,3,-1,-4,-4,
|
||||
11,2,-56,54,27,-20,13,-6,
|
||||
-46,-41,-33,-11,-5,7,12,14,
|
||||
-14,-5,8,20,6,3,4,-8,
|
||||
-5,-42,11,8,-14,25,-2,2,
|
||||
13,11,-22,39,-9,9,5,-45,
|
||||
-9,7,-9,12,-7,34,-17,-102,
|
||||
7,2,-42,18,35,-9,-34,11,
|
||||
-5,-2,3,22,46,-52,-25,-9,
|
||||
-94,8,11,-5,-5,-5,4,-7,
|
||||
-35,-7,54,5,-32,3,24,-9,
|
||||
-22,8,65,37,-1,-12,-23,-6,
|
||||
-9,-28,55,-33,14,-3,2,18,
|
||||
-60,41,-17,8,-16,17,-11,0,
|
||||
-11,29,-28,37,9,-53,33,-14,
|
||||
-9,7,-25,-7,-11,26,-32,-8,
|
||||
24,-21,22,-19,19,-10,29,-14,
|
||||
0,0,0,0,0,0,0,0,
|
||||
-5,-52,10,41,6,-30,-4,16,
|
||||
32,22,-27,-22,32,-3,-28,-3,
|
||||
3,-35,6,17,23,21,8,2,
|
||||
4,-45,-17,14,23,-4,-31,-11,
|
||||
-3,14,1,19,-11,2,61,-8,
|
||||
9,-12,7,-10,12,-3,-24,99,
|
||||
-48,23,50,-37,-5,-23,0,8,
|
||||
-14,35,-64,-5,46,-25,13,-1,
|
||||
-49,-19,-15,9,34,50,25,11,
|
||||
-6,-9,-16,-20,-32,-33,-32,-27,
|
||||
10,-8,12,-15,56,-14,-32,33,
|
||||
3,-9,1,65,-9,-9,-10,-2,
|
||||
-6,-23,9,17,3,-28,13,-32,
|
||||
4,-2,-10,4,-16,76,12,-52,
|
||||
6,13,33,-6,4,-14,-9,-3,
|
||||
1,-15,-16,28,1,-15,11,16,
|
||||
9,4,-21,-37,-40,-6,22,12,
|
||||
-15,-23,-14,-17,-16,-9,-10,-9,
|
||||
13,-39,41,5,-9,16,-38,25,
|
||||
46,-47,4,49,-14,17,-2,6,
|
||||
18,5,-6,-33,-22,44,50,-2,
|
||||
1,3,-6,7,7,-3,-21,38,
|
||||
-18,34,-14,-41,60,-13,6,16,
|
||||
-24,35,19,-13,-36,24,3,-17,
|
||||
-14,-10,36,44,-44,-29,-3,3,
|
||||
-54,-8,12,55,26,4,-2,-5,
|
||||
2,-11,22,-23,2,22,1,-25,
|
||||
-39,66,-49,21,-8,-2,10,-14,
|
||||
-60,25,6,10,27,-25,16,5,
|
||||
-2,-9,26,-13,-20,58,-2,7,
|
||||
52,-9,2,5,-4,-15,23,-1,
|
||||
-38,23,8,27,-6,0,-27,-7,
|
||||
39,-10,-14,26,11,-45,-12,9,
|
||||
-5,34,4,-35,10,43,-22,-11,
|
||||
56,-7,20,1,10,1,-26,9,
|
||||
94,11,-27,-14,-13,1,-11,0,
|
||||
14,-5,-6,-10,-4,-15,-8,-41,
|
||||
21,-5,1,-28,-8,22,-9,33,
|
||||
-23,-4,-4,-12,39,4,-7,3,
|
||||
-60,80,8,-17,2,-6,12,-5,
|
||||
1,9,15,27,31,30,27,23,
|
||||
61,47,26,10,-5,-8,-12,-13,
|
||||
5,-18,25,-15,-4,-15,-11,12,
|
||||
-2,-2,-16,-2,-6,24,12,11,
|
||||
-4,9,1,-9,14,-45,57,12,
|
||||
20,-35,26,11,-64,32,-10,-10,
|
||||
42,-4,-9,-16,32,24,7,10,
|
||||
52,-11,-57,29,0,8,0,-6,
|
||||
17,-17,-56,-40,7,20,18,12,
|
||||
-6,16,5,7,-1,9,1,10,
|
||||
29,12,16,13,-2,23,7,9,
|
||||
-3,-4,-5,18,-64,13,55,-25,
|
||||
9,-9,24,14,-25,15,-11,-40,
|
||||
-30,37,1,-19,22,-5,-31,13,
|
||||
-2,0,7,-4,16,-67,12,66,
|
||||
-36,24,-8,18,-15,-23,19,0,
|
||||
-45,-7,4,3,-13,13,35,5,
|
||||
13,33,10,27,23,0,-7,-11,
|
||||
43,-74,36,-12,2,5,-8,6,
|
||||
-33,11,-16,-14,-5,-7,-3,17,
|
||||
-34,27,-16,11,-9,15,33,-31,
|
||||
8,-16,7,-6,-7,63,-55,-17,
|
||||
11,-1,20,-46,34,-30,6,9,
|
||||
19,28,-9,5,-24,-8,-23,-2,
|
||||
31,-19,-16,-5,-15,-18,0,26,
|
||||
18,37,-5,-15,-2,17,5,-27,
|
||||
21,-33,44,12,-27,-9,17,11,
|
||||
25,-21,-31,-7,13,33,-8,-25,
|
||||
-7,7,-10,4,-6,-9,48,-82,
|
||||
-23,-8,6,11,-23,3,-3,49,
|
||||
-29,25,31,4,14,16,9,-4,
|
||||
-18,10,-26,3,5,-44,-9,9,
|
||||
-47,-55,15,9,28,1,4,-3,
|
||||
46,6,-6,-38,-29,-31,-15,-6,
|
||||
3,0,14,-6,8,-54,-50,33,
|
||||
-5,1,-14,33,-48,26,-4,-5,
|
||||
-3,-5,-3,-5,-28,-22,77,55,
|
||||
-1,2,10,10,-9,-14,-66,-49,
|
||||
11,-36,-6,-20,10,-10,16,12,
|
||||
4,-1,-16,45,-44,-50,31,-2,
|
||||
25,42,23,-32,-22,0,11,20,
|
||||
-40,-35,-40,-36,-32,-26,-21,-13,
|
||||
52,-22,6,-24,-20,17,-5,-8,
|
||||
36,-25,-11,21,-26,6,34,-8,
|
||||
7,20,-3,5,-25,-8,18,-5,
|
||||
-9,-4,1,-9,20,20,39,48,
|
||||
-24,9,5,-65,22,29,4,3,
|
||||
-43,-11,32,-6,9,19,-27,-10,
|
||||
-47,-14,24,10,-7,-36,-7,-1,
|
||||
-4,-5,-5,16,53,25,-26,-29,
|
||||
-4,-12,45,-58,-34,33,-5,2,
|
||||
-1,27,-48,31,-15,22,-5,4,
|
||||
7,7,-25,-3,11,-22,16,-12,
|
||||
8,-3,7,-11,45,14,-73,-19,
|
||||
56,-46,24,-20,28,-12,-2,-1,
|
||||
-36,-3,-33,19,-6,7,2,-15,
|
||||
5,-31,-45,8,35,13,20,0,
|
||||
-9,48,-13,-43,-3,-13,2,-5,
|
||||
72,-68,-27,2,1,-2,-7,5,
|
||||
36,33,-40,-12,-4,-5,23,19};
|
@ -1,397 +0,0 @@
|
||||
/* Copyright (C) 2005-2006 Jean-Marc Valin
|
||||
File: fftwrap.c
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "arch.h"
|
||||
#include "os_support.h"
|
||||
|
||||
#define MAX_FFT_SIZE 2048
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
static int maximize_range(spx_word16_t *in, spx_word16_t *out, spx_word16_t bound, int len)
|
||||
{
|
||||
int i, shift;
|
||||
spx_word16_t max_val = 0;
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
if (in[i]>max_val)
|
||||
max_val = in[i];
|
||||
if (-in[i]>max_val)
|
||||
max_val = -in[i];
|
||||
}
|
||||
shift=0;
|
||||
while (max_val <= (bound>>1) && max_val != 0)
|
||||
{
|
||||
max_val <<= 1;
|
||||
shift++;
|
||||
}
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
out[i] = SHL16(in[i], shift);
|
||||
}
|
||||
return shift;
|
||||
}
|
||||
|
||||
static void renorm_range(spx_word16_t *in, spx_word16_t *out, int shift, int len)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
out[i] = PSHR16(in[i], shift);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_SMALLFT
|
||||
|
||||
#include "smallft.h"
|
||||
#include <math.h>
|
||||
|
||||
void *spx_fft_init(int size)
|
||||
{
|
||||
struct drft_lookup *table;
|
||||
table = speex_alloc(sizeof(struct drft_lookup));
|
||||
spx_drft_init((struct drft_lookup *)table, size);
|
||||
return (void*)table;
|
||||
}
|
||||
|
||||
void spx_fft_destroy(void *table)
|
||||
{
|
||||
spx_drft_clear(table);
|
||||
speex_free(table);
|
||||
}
|
||||
|
||||
void spx_fft(void *table, float *in, float *out)
|
||||
{
|
||||
if (in==out)
|
||||
{
|
||||
int i;
|
||||
float scale = 1./((struct drft_lookup *)table)->n;
|
||||
speex_warning("FFT should not be done in-place");
|
||||
for (i=0;i<((struct drft_lookup *)table)->n;i++)
|
||||
out[i] = scale*in[i];
|
||||
} else {
|
||||
int i;
|
||||
float scale = 1./((struct drft_lookup *)table)->n;
|
||||
for (i=0;i<((struct drft_lookup *)table)->n;i++)
|
||||
out[i] = scale*in[i];
|
||||
}
|
||||
spx_drft_forward((struct drft_lookup *)table, out);
|
||||
}
|
||||
|
||||
void spx_ifft(void *table, float *in, float *out)
|
||||
{
|
||||
if (in==out)
|
||||
{
|
||||
speex_warning("FFT should not be done in-place");
|
||||
} else {
|
||||
int i;
|
||||
for (i=0;i<((struct drft_lookup *)table)->n;i++)
|
||||
out[i] = in[i];
|
||||
}
|
||||
spx_drft_backward((struct drft_lookup *)table, out);
|
||||
}
|
||||
|
||||
#elif defined(USE_INTEL_MKL)
|
||||
#include <mkl.h>
|
||||
|
||||
struct mkl_config {
|
||||
DFTI_DESCRIPTOR_HANDLE desc;
|
||||
int N;
|
||||
};
|
||||
|
||||
void *spx_fft_init(int size)
|
||||
{
|
||||
struct mkl_config *table = (struct mkl_config *) speex_alloc(sizeof(struct mkl_config));
|
||||
table->N = size;
|
||||
DftiCreateDescriptor(&table->desc, DFTI_SINGLE, DFTI_REAL, 1, size);
|
||||
DftiSetValue(table->desc, DFTI_PACKED_FORMAT, DFTI_PACK_FORMAT);
|
||||
DftiSetValue(table->desc, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
|
||||
DftiSetValue(table->desc, DFTI_FORWARD_SCALE, 1.0f / size);
|
||||
DftiCommitDescriptor(table->desc);
|
||||
return table;
|
||||
}
|
||||
|
||||
void spx_fft_destroy(void *table)
|
||||
{
|
||||
struct mkl_config *t = (struct mkl_config *) table;
|
||||
DftiFreeDescriptor(t->desc);
|
||||
speex_free(table);
|
||||
}
|
||||
|
||||
void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out)
|
||||
{
|
||||
struct mkl_config *t = (struct mkl_config *) table;
|
||||
DftiComputeForward(t->desc, in, out);
|
||||
}
|
||||
|
||||
void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out)
|
||||
{
|
||||
struct mkl_config *t = (struct mkl_config *) table;
|
||||
DftiComputeBackward(t->desc, in, out);
|
||||
}
|
||||
|
||||
#elif defined(USE_GPL_FFTW3)
|
||||
|
||||
#include <fftw3.h>
|
||||
|
||||
struct fftw_config {
|
||||
float *in;
|
||||
float *out;
|
||||
fftwf_plan fft;
|
||||
fftwf_plan ifft;
|
||||
int N;
|
||||
};
|
||||
|
||||
void *spx_fft_init(int size)
|
||||
{
|
||||
struct fftw_config *table = (struct fftw_config *) speex_alloc(sizeof(struct fftw_config));
|
||||
table->in = fftwf_malloc(sizeof(float) * (size+2));
|
||||
table->out = fftwf_malloc(sizeof(float) * (size+2));
|
||||
|
||||
table->fft = fftwf_plan_dft_r2c_1d(size, table->in, (fftwf_complex *) table->out, FFTW_PATIENT);
|
||||
table->ifft = fftwf_plan_dft_c2r_1d(size, (fftwf_complex *) table->in, table->out, FFTW_PATIENT);
|
||||
|
||||
table->N = size;
|
||||
return table;
|
||||
}
|
||||
|
||||
void spx_fft_destroy(void *table)
|
||||
{
|
||||
struct fftw_config *t = (struct fftw_config *) table;
|
||||
fftwf_destroy_plan(t->fft);
|
||||
fftwf_destroy_plan(t->ifft);
|
||||
fftwf_free(t->in);
|
||||
fftwf_free(t->out);
|
||||
speex_free(table);
|
||||
}
|
||||
|
||||
|
||||
void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out)
|
||||
{
|
||||
int i;
|
||||
struct fftw_config *t = (struct fftw_config *) table;
|
||||
const int N = t->N;
|
||||
float *iptr = t->in;
|
||||
float *optr = t->out;
|
||||
const float m = 1.0 / N;
|
||||
for(i=0;i<N;++i)
|
||||
iptr[i]=in[i] * m;
|
||||
|
||||
fftwf_execute(t->fft);
|
||||
|
||||
out[0] = optr[0];
|
||||
for(i=1;i<N;++i)
|
||||
out[i] = optr[i+1];
|
||||
}
|
||||
|
||||
void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out)
|
||||
{
|
||||
int i;
|
||||
struct fftw_config *t = (struct fftw_config *) table;
|
||||
const int N = t->N;
|
||||
float *iptr = t->in;
|
||||
float *optr = t->out;
|
||||
|
||||
iptr[0] = in[0];
|
||||
iptr[1] = 0.0f;
|
||||
for(i=1;i<N;++i)
|
||||
iptr[i+1] = in[i];
|
||||
iptr[N+1] = 0.0f;
|
||||
|
||||
fftwf_execute(t->ifft);
|
||||
|
||||
for(i=0;i<N;++i)
|
||||
out[i] = optr[i];
|
||||
}
|
||||
|
||||
#elif defined(USE_KISS_FFT)
|
||||
|
||||
#include "kiss_fftr.h"
|
||||
#include "kiss_fft.h"
|
||||
|
||||
struct kiss_config {
|
||||
kiss_fftr_cfg forward;
|
||||
kiss_fftr_cfg backward;
|
||||
int N;
|
||||
};
|
||||
|
||||
void *spx_fft_init(int size)
|
||||
{
|
||||
struct kiss_config *table;
|
||||
table = (struct kiss_config*)speex_alloc(sizeof(struct kiss_config));
|
||||
table->forward = kiss_fftr_alloc(size,0,NULL,NULL);
|
||||
table->backward = kiss_fftr_alloc(size,1,NULL,NULL);
|
||||
table->N = size;
|
||||
return table;
|
||||
}
|
||||
|
||||
void spx_fft_destroy(void *table)
|
||||
{
|
||||
struct kiss_config *t = (struct kiss_config *)table;
|
||||
kiss_fftr_free(t->forward);
|
||||
kiss_fftr_free(t->backward);
|
||||
speex_free(table);
|
||||
}
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
|
||||
void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out)
|
||||
{
|
||||
int shift;
|
||||
struct kiss_config *t = (struct kiss_config *)table;
|
||||
shift = maximize_range(in, in, 32000, t->N);
|
||||
kiss_fftr2(t->forward, in, out);
|
||||
renorm_range(in, in, shift, t->N);
|
||||
renorm_range(out, out, shift, t->N);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out)
|
||||
{
|
||||
int i;
|
||||
float scale;
|
||||
struct kiss_config *t = (struct kiss_config *)table;
|
||||
scale = 1./t->N;
|
||||
kiss_fftr2(t->forward, in, out);
|
||||
for (i=0;i<t->N;i++)
|
||||
out[i] *= scale;
|
||||
}
|
||||
#endif
|
||||
|
||||
void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out)
|
||||
{
|
||||
struct kiss_config *t = (struct kiss_config *)table;
|
||||
kiss_fftri2(t->backward, in, out);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#error No other FFT implemented
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
/*#include "smallft.h"*/
|
||||
|
||||
|
||||
void spx_fft_float(void *table, float *in, float *out)
|
||||
{
|
||||
int i;
|
||||
#ifdef USE_SMALLFT
|
||||
int N = ((struct drft_lookup *)table)->n;
|
||||
#elif defined(USE_KISS_FFT)
|
||||
int N = ((struct kiss_config *)table)->N;
|
||||
#else
|
||||
#endif
|
||||
#ifdef VAR_ARRAYS
|
||||
spx_word16_t _in[N];
|
||||
spx_word16_t _out[N];
|
||||
#else
|
||||
spx_word16_t _in[MAX_FFT_SIZE];
|
||||
spx_word16_t _out[MAX_FFT_SIZE];
|
||||
#endif
|
||||
for (i=0;i<N;i++)
|
||||
_in[i] = (int)floor(.5+in[i]);
|
||||
spx_fft(table, _in, _out);
|
||||
for (i=0;i<N;i++)
|
||||
out[i] = _out[i];
|
||||
#if 0
|
||||
if (!fixed_point)
|
||||
{
|
||||
float scale;
|
||||
struct drft_lookup t;
|
||||
spx_drft_init(&t, ((struct kiss_config *)table)->N);
|
||||
scale = 1./((struct kiss_config *)table)->N;
|
||||
for (i=0;i<((struct kiss_config *)table)->N;i++)
|
||||
out[i] = scale*in[i];
|
||||
spx_drft_forward(&t, out);
|
||||
spx_drft_clear(&t);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void spx_ifft_float(void *table, float *in, float *out)
|
||||
{
|
||||
int i;
|
||||
#ifdef USE_SMALLFT
|
||||
int N = ((struct drft_lookup *)table)->n;
|
||||
#elif defined(USE_KISS_FFT)
|
||||
int N = ((struct kiss_config *)table)->N;
|
||||
#else
|
||||
#endif
|
||||
#ifdef VAR_ARRAYS
|
||||
spx_word16_t _in[N];
|
||||
spx_word16_t _out[N];
|
||||
#else
|
||||
spx_word16_t _in[MAX_FFT_SIZE];
|
||||
spx_word16_t _out[MAX_FFT_SIZE];
|
||||
#endif
|
||||
for (i=0;i<N;i++)
|
||||
_in[i] = (int)floor(.5+in[i]);
|
||||
spx_ifft(table, _in, _out);
|
||||
for (i=0;i<N;i++)
|
||||
out[i] = _out[i];
|
||||
#if 0
|
||||
if (!fixed_point)
|
||||
{
|
||||
int i;
|
||||
struct drft_lookup t;
|
||||
spx_drft_init(&t, ((struct kiss_config *)table)->N);
|
||||
for (i=0;i<((struct kiss_config *)table)->N;i++)
|
||||
out[i] = in[i];
|
||||
spx_drft_backward(&t, out);
|
||||
spx_drft_clear(&t);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void spx_fft_float(void *table, float *in, float *out)
|
||||
{
|
||||
spx_fft(table, in, out);
|
||||
}
|
||||
void spx_ifft_float(void *table, float *in, float *out)
|
||||
{
|
||||
spx_ifft(table, in, out);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,58 +0,0 @@
|
||||
/* Copyright (C) 2005 Jean-Marc Valin
|
||||
File: fftwrap.h
|
||||
|
||||
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
|
||||
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 FFTWRAP_H
|
||||
#define FFTWRAP_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
/** Compute tables for an FFT */
|
||||
void *spx_fft_init(int size);
|
||||
|
||||
/** Destroy tables for an FFT */
|
||||
void spx_fft_destroy(void *table);
|
||||
|
||||
/** Forward (real to half-complex) transform */
|
||||
void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out);
|
||||
|
||||
/** Backward (half-complex to real) transform */
|
||||
void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out);
|
||||
|
||||
/** Forward (real to half-complex) transform of float data */
|
||||
void spx_fft_float(void *table, float *in, float *out);
|
||||
|
||||
/** Backward (half-complex to real) transform of float data */
|
||||
void spx_ifft_float(void *table, float *in, float *out);
|
||||
|
||||
#endif
|
@ -1,227 +0,0 @@
|
||||
/* Copyright (C) 2006 Jean-Marc Valin */
|
||||
/**
|
||||
@file filterbank.c
|
||||
@brief Converting between psd and filterbank
|
||||
*/
|
||||
/*
|
||||
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 "filterbank.h"
|
||||
#include "arch.h"
|
||||
#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)
|
||||
{
|
||||
FilterBank *bank;
|
||||
spx_word32_t df;
|
||||
spx_word32_t max_mel, mel_interval;
|
||||
int i;
|
||||
int id1;
|
||||
int id2;
|
||||
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;
|
||||
bank->bank_left = (int*)speex_alloc(len*sizeof(int));
|
||||
bank->bank_right = (int*)speex_alloc(len*sizeof(int));
|
||||
bank->filter_left = (spx_word16_t*)speex_alloc(len*sizeof(spx_word16_t));
|
||||
bank->filter_right = (spx_word16_t*)speex_alloc(len*sizeof(spx_word16_t));
|
||||
/* Think I can safely disable normalisation that for fixed-point (and probably float as well) */
|
||||
#ifndef FIXED_POINT
|
||||
bank->scaling = (float*)speex_alloc(banks*sizeof(float));
|
||||
#endif
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
spx_word16_t curr_freq;
|
||||
spx_word32_t mel;
|
||||
spx_word16_t val;
|
||||
curr_freq = EXTRACT16(MULT16_32_P15(i,df));
|
||||
mel = toBARK(curr_freq);
|
||||
if (mel > max_mel)
|
||||
break;
|
||||
#ifdef FIXED_POINT
|
||||
id1 = DIV32(mel,mel_interval);
|
||||
#else
|
||||
id1 = (int)(floor(mel/mel_interval));
|
||||
#endif
|
||||
if (id1>banks-2)
|
||||
{
|
||||
id1 = banks-2;
|
||||
val = Q15_ONE;
|
||||
} else {
|
||||
val = DIV32_16(mel - id1*mel_interval,EXTRACT16(PSHR32(mel_interval,15)));
|
||||
}
|
||||
id2 = id1+1;
|
||||
bank->bank_left[i] = id1;
|
||||
bank->filter_left[i] = SUB16(Q15_ONE,val);
|
||||
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++)
|
||||
bank->scaling[i] = 0;
|
||||
for (i=0;i<bank->len;i++)
|
||||
{
|
||||
int id = bank->bank_left[i];
|
||||
bank->scaling[id] += bank->filter_left[i];
|
||||
id = bank->bank_right[i];
|
||||
bank->scaling[id] += bank->filter_right[i];
|
||||
}
|
||||
for (i=0;i<bank->nb_banks;i++)
|
||||
bank->scaling[i] = Q15_ONE/(bank->scaling[i]);
|
||||
#endif
|
||||
return bank;
|
||||
}
|
||||
|
||||
void filterbank_destroy(FilterBank *bank)
|
||||
{
|
||||
speex_free(bank->bank_left);
|
||||
speex_free(bank->bank_right);
|
||||
speex_free(bank->filter_left);
|
||||
speex_free(bank->filter_right);
|
||||
#ifndef FIXED_POINT
|
||||
speex_free(bank->scaling);
|
||||
#endif
|
||||
speex_free(bank);
|
||||
}
|
||||
|
||||
void filterbank_compute_bank32(FilterBank *bank, spx_word32_t *ps, spx_word32_t *mel)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<bank->nb_banks;i++)
|
||||
mel[i] = 0;
|
||||
|
||||
for (i=0;i<bank->len;i++)
|
||||
{
|
||||
int id;
|
||||
id = bank->bank_left[i];
|
||||
mel[id] += MULT16_32_P15(bank->filter_left[i],ps[i]);
|
||||
id = bank->bank_right[i];
|
||||
mel[id] += MULT16_32_P15(bank->filter_right[i],ps[i]);
|
||||
}
|
||||
/* Think I can safely disable normalisation that for fixed-point (and probably float as well) */
|
||||
#ifndef FIXED_POINT
|
||||
/*for (i=0;i<bank->nb_banks;i++)
|
||||
mel[i] = MULT16_32_P15(Q15(bank->scaling[i]),mel[i]);
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
void filterbank_compute_psd16(FilterBank *bank, spx_word16_t *mel, spx_word16_t *ps)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<bank->len;i++)
|
||||
{
|
||||
spx_word32_t tmp;
|
||||
int id1, id2;
|
||||
id1 = bank->bank_left[i];
|
||||
id2 = bank->bank_right[i];
|
||||
tmp = MULT16_16(mel[id1],bank->filter_left[i]);
|
||||
tmp += MULT16_16(mel[id2],bank->filter_right[i]);
|
||||
ps[i] = EXTRACT16(PSHR32(tmp,15));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef FIXED_POINT
|
||||
void filterbank_compute_bank(FilterBank *bank, float *ps, float *mel)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<bank->nb_banks;i++)
|
||||
mel[i] = 0;
|
||||
|
||||
for (i=0;i<bank->len;i++)
|
||||
{
|
||||
int id = bank->bank_left[i];
|
||||
mel[id] += bank->filter_left[i]*ps[i];
|
||||
id = bank->bank_right[i];
|
||||
mel[id] += bank->filter_right[i]*ps[i];
|
||||
}
|
||||
for (i=0;i<bank->nb_banks;i++)
|
||||
mel[i] *= bank->scaling[i];
|
||||
}
|
||||
|
||||
void filterbank_compute_psd(FilterBank *bank, float *mel, float *ps)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<bank->len;i++)
|
||||
{
|
||||
int id = bank->bank_left[i];
|
||||
ps[i] = mel[id]*bank->filter_left[i];
|
||||
id = bank->bank_right[i];
|
||||
ps[i] += mel[id]*bank->filter_right[i];
|
||||
}
|
||||
}
|
||||
|
||||
void filterbank_psy_smooth(FilterBank *bank, float *ps, float *mask)
|
||||
{
|
||||
/* Low freq slope: 14 dB/Bark*/
|
||||
/* High freq slope: 9 dB/Bark*/
|
||||
/* Noise vs tone: 5 dB difference */
|
||||
/* FIXME: Temporary kludge */
|
||||
float bark[100];
|
||||
int i;
|
||||
/* Assumes 1/3 Bark resolution */
|
||||
float decay_low = 0.34145f;
|
||||
float decay_high = 0.50119f;
|
||||
filterbank_compute_bank(bank, ps, bark);
|
||||
for (i=1;i<bank->nb_banks;i++)
|
||||
{
|
||||
/*float decay_high = 13-1.6*log10(bark[i-1]);
|
||||
decay_high = pow(10,(-decay_high/30.f));*/
|
||||
bark[i] = bark[i] + decay_high*bark[i-1];
|
||||
}
|
||||
for (i=bank->nb_banks-2;i>=0;i--)
|
||||
{
|
||||
bark[i] = bark[i] + decay_low*bark[i+1];
|
||||
}
|
||||
filterbank_compute_psd(bank, bark, mask);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,66 +0,0 @@
|
||||
/* Copyright (C) 2006 Jean-Marc Valin */
|
||||
/**
|
||||
@file filterbank.h
|
||||
@brief Converting between psd and filterbank
|
||||
*/
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef FILTERBANK_H
|
||||
#define FILTERBANK_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
typedef struct {
|
||||
int *bank_left;
|
||||
int *bank_right;
|
||||
spx_word16_t *filter_left;
|
||||
spx_word16_t *filter_right;
|
||||
#ifndef FIXED_POINT
|
||||
float *scaling;
|
||||
#endif
|
||||
int nb_banks;
|
||||
int len;
|
||||
} FilterBank;
|
||||
|
||||
|
||||
FilterBank *filterbank_new(int banks, spx_word32_t sampling, int len, int type);
|
||||
|
||||
void filterbank_destroy(FilterBank *bank);
|
||||
|
||||
void filterbank_compute_bank32(FilterBank *bank, spx_word32_t *ps, spx_word32_t *mel);
|
||||
|
||||
void filterbank_compute_psd16(FilterBank *bank, spx_word16_t *mel, spx_word16_t *psd);
|
||||
|
||||
#ifndef FIXED_POINT
|
||||
void filterbank_compute_bank(FilterBank *bank, float *psd, float *mel);
|
||||
void filterbank_compute_psd(FilterBank *bank, float *mel, float *psd);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
@ -1,821 +0,0 @@
|
||||
/* Copyright (C) 2002-2006 Jean-Marc Valin
|
||||
File: filters.c
|
||||
Various analysis/synthesis filters
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "filters.h"
|
||||
#include "stack_alloc.h"
|
||||
#include "arch.h"
|
||||
#include "math_approx.h"
|
||||
#include "ltp.h"
|
||||
#include <math.h>
|
||||
|
||||
#ifdef _USE_SSE
|
||||
#include "filters_sse.h"
|
||||
#elif defined (ARM4_ASM) || defined(ARM5E_ASM)
|
||||
#include "filters_arm4.h"
|
||||
#elif defined (BFIN_ASM)
|
||||
#include "filters_bfin.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void bw_lpc(spx_word16_t gamma, const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order)
|
||||
{
|
||||
int i;
|
||||
spx_word16_t tmp=gamma;
|
||||
for (i=0;i<order;i++)
|
||||
{
|
||||
lpc_out[i] = MULT16_16_P15(tmp,lpc_in[i]);
|
||||
tmp = MULT16_16_P15(tmp, gamma);
|
||||
}
|
||||
}
|
||||
|
||||
void sanitize_values32(spx_word32_t *vec, spx_word32_t min_val, spx_word32_t max_val, int len)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
/* It's important we do the test that way so we can catch NaNs, which are neither greater nor smaller */
|
||||
if (!(vec[i]>=min_val && vec[i] <= max_val))
|
||||
{
|
||||
if (vec[i] < min_val)
|
||||
vec[i] = min_val;
|
||||
else if (vec[i] > max_val)
|
||||
vec[i] = max_val;
|
||||
else /* Has to be NaN */
|
||||
vec[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void highpass(const spx_word16_t *x, spx_word16_t *y, int len, int filtID, spx_mem_t *mem)
|
||||
{
|
||||
int i;
|
||||
#ifdef FIXED_POINT
|
||||
const spx_word16_t Pcoef[5][3] = {{16384, -31313, 14991}, {16384, -31569, 15249}, {16384, -31677, 15328}, {16384, -32313, 15947}, {16384, -22446, 6537}};
|
||||
const spx_word16_t Zcoef[5][3] = {{15672, -31344, 15672}, {15802, -31601, 15802}, {15847, -31694, 15847}, {16162, -32322, 16162}, {14418, -28836, 14418}};
|
||||
#else
|
||||
const spx_word16_t Pcoef[5][3] = {{1.00000f, -1.91120f, 0.91498f}, {1.00000f, -1.92683f, 0.93071f}, {1.00000f, -1.93338f, 0.93553f}, {1.00000f, -1.97226f, 0.97332f}, {1.00000f, -1.37000f, 0.39900f}};
|
||||
const spx_word16_t Zcoef[5][3] = {{0.95654f, -1.91309f, 0.95654f}, {0.96446f, -1.92879f, 0.96446f}, {0.96723f, -1.93445f, 0.96723f}, {0.98645f, -1.97277f, 0.98645f}, {0.88000f, -1.76000f, 0.88000f}};
|
||||
#endif
|
||||
const spx_word16_t *den, *num;
|
||||
if (filtID>4)
|
||||
filtID=4;
|
||||
|
||||
den = Pcoef[filtID]; num = Zcoef[filtID];
|
||||
/*return;*/
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
spx_word16_t yi;
|
||||
spx_word32_t vout = ADD32(MULT16_16(num[0], x[i]),mem[0]);
|
||||
yi = EXTRACT16(SATURATE(PSHR32(vout,14),32767));
|
||||
mem[0] = ADD32(MAC16_16(mem[1], num[1],x[i]), SHL32(MULT16_32_Q15(-den[1],vout),1));
|
||||
mem[1] = ADD32(MULT16_16(num[2],x[i]), SHL32(MULT16_32_Q15(-den[2],vout),1));
|
||||
y[i] = yi;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
|
||||
/* FIXME: These functions are ugly and probably introduce too much error */
|
||||
void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
y[i] = SHL32(MULT16_32_Q14(EXTRACT16(SHR32(x[i],7)),scale),7);
|
||||
}
|
||||
}
|
||||
|
||||
void signal_div(const spx_word16_t *x, spx_word16_t *y, spx_word32_t scale, int len)
|
||||
{
|
||||
int i;
|
||||
if (scale > SHL32(EXTEND32(SIG_SCALING), 8))
|
||||
{
|
||||
spx_word16_t scale_1;
|
||||
scale = PSHR32(scale, SIG_SHIFT);
|
||||
scale_1 = EXTRACT16(PDIV32_16(SHL32(EXTEND32(SIG_SCALING),7),scale));
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
y[i] = MULT16_16_P15(scale_1, x[i]);
|
||||
}
|
||||
} else if (scale > SHR32(EXTEND32(SIG_SCALING), 2)) {
|
||||
spx_word16_t scale_1;
|
||||
scale = PSHR32(scale, SIG_SHIFT-5);
|
||||
scale_1 = DIV32_16(SHL32(EXTEND32(SIG_SCALING),3),scale);
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
y[i] = PSHR32(MULT16_16(scale_1, SHL16(x[i],2)),8);
|
||||
}
|
||||
} else {
|
||||
spx_word16_t scale_1;
|
||||
scale = PSHR32(scale, SIG_SHIFT-7);
|
||||
if (scale < 5)
|
||||
scale = 5;
|
||||
scale_1 = DIV32_16(SHL32(EXTEND32(SIG_SCALING),3),scale);
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
y[i] = PSHR32(MULT16_16(scale_1, SHL16(x[i],2)),6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<len;i++)
|
||||
y[i] = scale*x[i];
|
||||
}
|
||||
|
||||
void signal_div(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len)
|
||||
{
|
||||
int i;
|
||||
float scale_1 = 1/scale;
|
||||
for (i=0;i<len;i++)
|
||||
y[i] = scale_1*x[i];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
|
||||
|
||||
|
||||
spx_word16_t compute_rms(const spx_sig_t *x, int len)
|
||||
{
|
||||
int i;
|
||||
spx_word32_t sum=0;
|
||||
spx_sig_t max_val=1;
|
||||
int sig_shift;
|
||||
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
spx_sig_t tmp = x[i];
|
||||
if (tmp<0)
|
||||
tmp = -tmp;
|
||||
if (tmp > max_val)
|
||||
max_val = tmp;
|
||||
}
|
||||
|
||||
sig_shift=0;
|
||||
while (max_val>16383)
|
||||
{
|
||||
sig_shift++;
|
||||
max_val >>= 1;
|
||||
}
|
||||
|
||||
for (i=0;i<len;i+=4)
|
||||
{
|
||||
spx_word32_t sum2=0;
|
||||
spx_word16_t tmp;
|
||||
tmp = EXTRACT16(SHR32(x[i],sig_shift));
|
||||
sum2 = MAC16_16(sum2,tmp,tmp);
|
||||
tmp = EXTRACT16(SHR32(x[i+1],sig_shift));
|
||||
sum2 = MAC16_16(sum2,tmp,tmp);
|
||||
tmp = EXTRACT16(SHR32(x[i+2],sig_shift));
|
||||
sum2 = MAC16_16(sum2,tmp,tmp);
|
||||
tmp = EXTRACT16(SHR32(x[i+3],sig_shift));
|
||||
sum2 = MAC16_16(sum2,tmp,tmp);
|
||||
sum = ADD32(sum,SHR32(sum2,6));
|
||||
}
|
||||
|
||||
return EXTRACT16(PSHR32(SHL32(EXTEND32(spx_sqrt(DIV32(sum,len))),(sig_shift+3)),SIG_SHIFT));
|
||||
}
|
||||
|
||||
spx_word16_t compute_rms16(const spx_word16_t *x, int len)
|
||||
{
|
||||
int i;
|
||||
spx_word16_t max_val=10;
|
||||
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
spx_sig_t tmp = x[i];
|
||||
if (tmp<0)
|
||||
tmp = -tmp;
|
||||
if (tmp > max_val)
|
||||
max_val = tmp;
|
||||
}
|
||||
if (max_val>16383)
|
||||
{
|
||||
spx_word32_t sum=0;
|
||||
for (i=0;i<len;i+=4)
|
||||
{
|
||||
spx_word32_t sum2=0;
|
||||
sum2 = MAC16_16(sum2,SHR16(x[i],1),SHR16(x[i],1));
|
||||
sum2 = MAC16_16(sum2,SHR16(x[i+1],1),SHR16(x[i+1],1));
|
||||
sum2 = MAC16_16(sum2,SHR16(x[i+2],1),SHR16(x[i+2],1));
|
||||
sum2 = MAC16_16(sum2,SHR16(x[i+3],1),SHR16(x[i+3],1));
|
||||
sum = ADD32(sum,SHR32(sum2,6));
|
||||
}
|
||||
return SHL16(spx_sqrt(DIV32(sum,len)),4);
|
||||
} else {
|
||||
spx_word32_t sum=0;
|
||||
int sig_shift=0;
|
||||
if (max_val < 8192)
|
||||
sig_shift=1;
|
||||
if (max_val < 4096)
|
||||
sig_shift=2;
|
||||
if (max_val < 2048)
|
||||
sig_shift=3;
|
||||
for (i=0;i<len;i+=4)
|
||||
{
|
||||
spx_word32_t sum2=0;
|
||||
sum2 = MAC16_16(sum2,SHL16(x[i],sig_shift),SHL16(x[i],sig_shift));
|
||||
sum2 = MAC16_16(sum2,SHL16(x[i+1],sig_shift),SHL16(x[i+1],sig_shift));
|
||||
sum2 = MAC16_16(sum2,SHL16(x[i+2],sig_shift),SHL16(x[i+2],sig_shift));
|
||||
sum2 = MAC16_16(sum2,SHL16(x[i+3],sig_shift),SHL16(x[i+3],sig_shift));
|
||||
sum = ADD32(sum,SHR32(sum2,6));
|
||||
}
|
||||
return SHL16(spx_sqrt(DIV32(sum,len)),3-sig_shift);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef OVERRIDE_NORMALIZE16
|
||||
int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len)
|
||||
{
|
||||
int i;
|
||||
spx_sig_t max_val=1;
|
||||
int sig_shift;
|
||||
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
spx_sig_t tmp = x[i];
|
||||
if (tmp<0)
|
||||
tmp = NEG32(tmp);
|
||||
if (tmp >= max_val)
|
||||
max_val = tmp;
|
||||
}
|
||||
|
||||
sig_shift=0;
|
||||
while (max_val>max_scale)
|
||||
{
|
||||
sig_shift++;
|
||||
max_val >>= 1;
|
||||
}
|
||||
|
||||
for (i=0;i<len;i++)
|
||||
y[i] = EXTRACT16(SHR32(x[i], sig_shift));
|
||||
|
||||
return sig_shift;
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
spx_word16_t compute_rms(const spx_sig_t *x, int len)
|
||||
{
|
||||
int i;
|
||||
float sum=0;
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
sum += x[i]*x[i];
|
||||
}
|
||||
return sqrt(.1+sum/len);
|
||||
}
|
||||
spx_word16_t compute_rms16(const spx_word16_t *x, int len)
|
||||
{
|
||||
return compute_rms(x, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef OVERRIDE_FILTER_MEM16
|
||||
void filter_mem16(const spx_word16_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack)
|
||||
{
|
||||
int i,j;
|
||||
spx_word16_t xi,yi,nyi;
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
xi= x[i];
|
||||
yi = EXTRACT16(SATURATE(ADD32(EXTEND32(x[i]),PSHR32(mem[0],LPC_SHIFT)),32767));
|
||||
nyi = NEG16(yi);
|
||||
for (j=0;j<ord-1;j++)
|
||||
{
|
||||
mem[j] = MAC16_16(MAC16_16(mem[j+1], num[j],xi), den[j],nyi);
|
||||
}
|
||||
mem[ord-1] = ADD32(MULT16_16(num[ord-1],xi), MULT16_16(den[ord-1],nyi));
|
||||
y[i] = yi;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef OVERRIDE_IIR_MEM16
|
||||
void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack)
|
||||
{
|
||||
int i,j;
|
||||
spx_word16_t yi,nyi;
|
||||
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
yi = EXTRACT16(SATURATE(ADD32(EXTEND32(x[i]),PSHR32(mem[0],LPC_SHIFT)),32767));
|
||||
nyi = NEG16(yi);
|
||||
for (j=0;j<ord-1;j++)
|
||||
{
|
||||
mem[j] = MAC16_16(mem[j+1],den[j],nyi);
|
||||
}
|
||||
mem[ord-1] = MULT16_16(den[ord-1],nyi);
|
||||
y[i] = yi;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef OVERRIDE_FIR_MEM16
|
||||
void fir_mem16(const spx_word16_t *x, const spx_coef_t *num, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack)
|
||||
{
|
||||
int i,j;
|
||||
spx_word16_t xi,yi;
|
||||
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
xi=x[i];
|
||||
yi = EXTRACT16(SATURATE(ADD32(EXTEND32(x[i]),PSHR32(mem[0],LPC_SHIFT)),32767));
|
||||
for (j=0;j<ord-1;j++)
|
||||
{
|
||||
mem[j] = MAC16_16(mem[j+1], num[j],xi);
|
||||
}
|
||||
mem[ord-1] = MULT16_16(num[ord-1],xi);
|
||||
y[i] = yi;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void syn_percep_zero16(const spx_word16_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack)
|
||||
{
|
||||
int i;
|
||||
VARDECL(spx_mem_t *mem);
|
||||
ALLOC(mem, ord, spx_mem_t);
|
||||
for (i=0;i<ord;i++)
|
||||
mem[i]=0;
|
||||
iir_mem16(xx, ak, y, N, ord, mem, stack);
|
||||
for (i=0;i<ord;i++)
|
||||
mem[i]=0;
|
||||
filter_mem16(y, awk1, awk2, y, N, ord, mem, stack);
|
||||
}
|
||||
void residue_percep_zero16(const spx_word16_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack)
|
||||
{
|
||||
int i;
|
||||
VARDECL(spx_mem_t *mem);
|
||||
ALLOC(mem, ord, spx_mem_t);
|
||||
for (i=0;i<ord;i++)
|
||||
mem[i]=0;
|
||||
filter_mem16(xx, ak, awk1, y, N, ord, mem, stack);
|
||||
for (i=0;i<ord;i++)
|
||||
mem[i]=0;
|
||||
fir_mem16(y, awk2, y, N, ord, mem, stack);
|
||||
}
|
||||
|
||||
|
||||
#ifndef OVERRIDE_COMPUTE_IMPULSE_RESPONSE
|
||||
void compute_impulse_response(const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack)
|
||||
{
|
||||
int i,j;
|
||||
spx_word16_t y1, ny1i, ny2i;
|
||||
VARDECL(spx_mem_t *mem1);
|
||||
VARDECL(spx_mem_t *mem2);
|
||||
ALLOC(mem1, ord, spx_mem_t);
|
||||
ALLOC(mem2, ord, spx_mem_t);
|
||||
|
||||
y[0] = LPC_SCALING;
|
||||
for (i=0;i<ord;i++)
|
||||
y[i+1] = awk1[i];
|
||||
i++;
|
||||
for (;i<N;i++)
|
||||
y[i] = VERY_SMALL;
|
||||
for (i=0;i<ord;i++)
|
||||
mem1[i] = mem2[i] = 0;
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
y1 = ADD16(y[i], EXTRACT16(PSHR32(mem1[0],LPC_SHIFT)));
|
||||
ny1i = NEG16(y1);
|
||||
y[i] = PSHR32(ADD32(SHL32(EXTEND32(y1),LPC_SHIFT+1),mem2[0]),LPC_SHIFT);
|
||||
ny2i = NEG16(y[i]);
|
||||
for (j=0;j<ord-1;j++)
|
||||
{
|
||||
mem1[j] = MAC16_16(mem1[j+1], awk2[j],ny1i);
|
||||
mem2[j] = MAC16_16(mem2[j+1], ak[j],ny2i);
|
||||
}
|
||||
mem1[ord-1] = MULT16_16(awk2[ord-1],ny1i);
|
||||
mem2[ord-1] = MULT16_16(ak[ord-1],ny2i);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Decomposes a signal into low-band and high-band using a QMF */
|
||||
void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_word16_t *y1, spx_word16_t *y2, int N, int M, spx_word16_t *mem, char *stack)
|
||||
{
|
||||
int i,j,k,M2;
|
||||
VARDECL(spx_word16_t *a);
|
||||
VARDECL(spx_word16_t *x);
|
||||
spx_word16_t *x2;
|
||||
|
||||
ALLOC(a, M, spx_word16_t);
|
||||
ALLOC(x, N+M-1, spx_word16_t);
|
||||
x2=x+M-1;
|
||||
M2=M>>1;
|
||||
for (i=0;i<M;i++)
|
||||
a[M-i-1]= aa[i];
|
||||
for (i=0;i<M-1;i++)
|
||||
x[i]=mem[M-i-2];
|
||||
for (i=0;i<N;i++)
|
||||
x[i+M-1]=SHR16(xx[i],1);
|
||||
for (i=0;i<M-1;i++)
|
||||
mem[i]=SHR16(xx[N-i-1],1);
|
||||
for (i=0,k=0;i<N;i+=2,k++)
|
||||
{
|
||||
spx_word32_t y1k=0, y2k=0;
|
||||
for (j=0;j<M2;j++)
|
||||
{
|
||||
y1k=ADD32(y1k,MULT16_16(a[j],ADD16(x[i+j],x2[i-j])));
|
||||
y2k=SUB32(y2k,MULT16_16(a[j],SUB16(x[i+j],x2[i-j])));
|
||||
j++;
|
||||
y1k=ADD32(y1k,MULT16_16(a[j],ADD16(x[i+j],x2[i-j])));
|
||||
y2k=ADD32(y2k,MULT16_16(a[j],SUB16(x[i+j],x2[i-j])));
|
||||
}
|
||||
y1[k] = EXTRACT16(SATURATE(PSHR32(y1k,15),32767));
|
||||
y2[k] = EXTRACT16(SATURATE(PSHR32(y2k,15),32767));
|
||||
}
|
||||
}
|
||||
|
||||
/* Re-synthesised a signal from the QMF low-band and high-band signals */
|
||||
void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word16_t *mem1, spx_word16_t *mem2, char *stack)
|
||||
/* assumptions:
|
||||
all odd x[i] are zero -- well, actually they are left out of the array now
|
||||
N and M are multiples of 4 */
|
||||
{
|
||||
int i, j;
|
||||
int M2, N2;
|
||||
VARDECL(spx_word16_t *xx1);
|
||||
VARDECL(spx_word16_t *xx2);
|
||||
|
||||
M2 = M>>1;
|
||||
N2 = N>>1;
|
||||
ALLOC(xx1, M2+N2, spx_word16_t);
|
||||
ALLOC(xx2, M2+N2, spx_word16_t);
|
||||
|
||||
for (i = 0; i < N2; i++)
|
||||
xx1[i] = x1[N2-1-i];
|
||||
for (i = 0; i < M2; i++)
|
||||
xx1[N2+i] = mem1[2*i+1];
|
||||
for (i = 0; i < N2; i++)
|
||||
xx2[i] = x2[N2-1-i];
|
||||
for (i = 0; i < M2; i++)
|
||||
xx2[N2+i] = mem2[2*i+1];
|
||||
|
||||
for (i = 0; i < N2; i += 2) {
|
||||
spx_sig_t y0, y1, y2, y3;
|
||||
spx_word16_t x10, x20;
|
||||
|
||||
y0 = y1 = y2 = y3 = 0;
|
||||
x10 = xx1[N2-2-i];
|
||||
x20 = xx2[N2-2-i];
|
||||
|
||||
for (j = 0; j < M2; j += 2) {
|
||||
spx_word16_t x11, x21;
|
||||
spx_word16_t a0, a1;
|
||||
|
||||
a0 = a[2*j];
|
||||
a1 = a[2*j+1];
|
||||
x11 = xx1[N2-1+j-i];
|
||||
x21 = xx2[N2-1+j-i];
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
/* We multiply twice by the same coef to avoid overflows */
|
||||
y0 = MAC16_16(MAC16_16(y0, a0, x11), NEG16(a0), x21);
|
||||
y1 = MAC16_16(MAC16_16(y1, a1, x11), a1, x21);
|
||||
y2 = MAC16_16(MAC16_16(y2, a0, x10), NEG16(a0), x20);
|
||||
y3 = MAC16_16(MAC16_16(y3, a1, x10), a1, x20);
|
||||
#else
|
||||
y0 = ADD32(y0,MULT16_16(a0, x11-x21));
|
||||
y1 = ADD32(y1,MULT16_16(a1, x11+x21));
|
||||
y2 = ADD32(y2,MULT16_16(a0, x10-x20));
|
||||
y3 = ADD32(y3,MULT16_16(a1, x10+x20));
|
||||
#endif
|
||||
a0 = a[2*j+2];
|
||||
a1 = a[2*j+3];
|
||||
x10 = xx1[N2+j-i];
|
||||
x20 = xx2[N2+j-i];
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
/* We multiply twice by the same coef to avoid overflows */
|
||||
y0 = MAC16_16(MAC16_16(y0, a0, x10), NEG16(a0), x20);
|
||||
y1 = MAC16_16(MAC16_16(y1, a1, x10), a1, x20);
|
||||
y2 = MAC16_16(MAC16_16(y2, a0, x11), NEG16(a0), x21);
|
||||
y3 = MAC16_16(MAC16_16(y3, a1, x11), a1, x21);
|
||||
#else
|
||||
y0 = ADD32(y0,MULT16_16(a0, x10-x20));
|
||||
y1 = ADD32(y1,MULT16_16(a1, x10+x20));
|
||||
y2 = ADD32(y2,MULT16_16(a0, x11-x21));
|
||||
y3 = ADD32(y3,MULT16_16(a1, x11+x21));
|
||||
#endif
|
||||
}
|
||||
#ifdef FIXED_POINT
|
||||
y[2*i] = EXTRACT16(SATURATE32(PSHR32(y0,15),32767));
|
||||
y[2*i+1] = EXTRACT16(SATURATE32(PSHR32(y1,15),32767));
|
||||
y[2*i+2] = EXTRACT16(SATURATE32(PSHR32(y2,15),32767));
|
||||
y[2*i+3] = EXTRACT16(SATURATE32(PSHR32(y3,15),32767));
|
||||
#else
|
||||
/* Normalize up explicitly if we're in float */
|
||||
y[2*i] = 2.f*y0;
|
||||
y[2*i+1] = 2.f*y1;
|
||||
y[2*i+2] = 2.f*y2;
|
||||
y[2*i+3] = 2.f*y3;
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i = 0; i < M2; i++)
|
||||
mem1[2*i+1] = xx1[i];
|
||||
for (i = 0; i < M2; i++)
|
||||
mem2[2*i+1] = xx2[i];
|
||||
}
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
#if 0
|
||||
const spx_word16_t shift_filt[3][7] = {{-33, 1043, -4551, 19959, 19959, -4551, 1043},
|
||||
{-98, 1133, -4425, 29179, 8895, -2328, 444},
|
||||
{444, -2328, 8895, 29179, -4425, 1133, -98}};
|
||||
#else
|
||||
const spx_word16_t shift_filt[3][7] = {{-390, 1540, -4993, 20123, 20123, -4993, 1540},
|
||||
{-1064, 2817, -6694, 31589, 6837, -990, -209},
|
||||
{-209, -990, 6837, 31589, -6694, 2817, -1064}};
|
||||
#endif
|
||||
#else
|
||||
#if 0
|
||||
const float shift_filt[3][7] = {{-9.9369e-04, 3.1831e-02, -1.3889e-01, 6.0910e-01, 6.0910e-01, -1.3889e-01, 3.1831e-02},
|
||||
{-0.0029937, 0.0345613, -0.1350474, 0.8904793, 0.2714479, -0.0710304, 0.0135403},
|
||||
{0.0135403, -0.0710304, 0.2714479, 0.8904793, -0.1350474, 0.0345613, -0.0029937}};
|
||||
#else
|
||||
const float shift_filt[3][7] = {{-0.011915f, 0.046995f, -0.152373f, 0.614108f, 0.614108f, -0.152373f, 0.046995f},
|
||||
{-0.0324855f, 0.0859768f, -0.2042986f, 0.9640297f, 0.2086420f, -0.0302054f, -0.0063646f},
|
||||
{-0.0063646f, -0.0302054f, 0.2086420f, 0.9640297f, -0.2042986f, 0.0859768f, -0.0324855f}};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int interp_pitch(
|
||||
spx_word16_t *exc, /*decoded excitation*/
|
||||
spx_word16_t *interp, /*decoded excitation*/
|
||||
int pitch, /*pitch period*/
|
||||
int len
|
||||
)
|
||||
{
|
||||
int i,j,k;
|
||||
spx_word32_t corr[4][7];
|
||||
spx_word32_t maxcorr;
|
||||
int maxi, maxj;
|
||||
for (i=0;i<7;i++)
|
||||
{
|
||||
corr[0][i] = inner_prod(exc, exc-pitch-3+i, len);
|
||||
}
|
||||
for (i=0;i<3;i++)
|
||||
{
|
||||
for (j=0;j<7;j++)
|
||||
{
|
||||
int i1, i2;
|
||||
spx_word32_t tmp=0;
|
||||
i1 = 3-j;
|
||||
if (i1<0)
|
||||
i1 = 0;
|
||||
i2 = 10-j;
|
||||
if (i2>7)
|
||||
i2 = 7;
|
||||
for (k=i1;k<i2;k++)
|
||||
tmp += MULT16_32_Q15(shift_filt[i][k],corr[0][j+k-3]);
|
||||
corr[i+1][j] = tmp;
|
||||
}
|
||||
}
|
||||
maxi=maxj=0;
|
||||
maxcorr = corr[0][0];
|
||||
for (i=0;i<4;i++)
|
||||
{
|
||||
for (j=0;j<7;j++)
|
||||
{
|
||||
if (corr[i][j] > maxcorr)
|
||||
{
|
||||
maxcorr = corr[i][j];
|
||||
maxi=i;
|
||||
maxj=j;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
spx_word32_t tmp = 0;
|
||||
if (maxi>0)
|
||||
{
|
||||
for (k=0;k<7;k++)
|
||||
{
|
||||
tmp += MULT16_16(exc[i-(pitch-maxj+3)+k-3],shift_filt[maxi-1][k]);
|
||||
}
|
||||
} else {
|
||||
tmp = SHL32(exc[i-(pitch-maxj+3)],15);
|
||||
}
|
||||
interp[i] = PSHR32(tmp,15);
|
||||
}
|
||||
return pitch-maxj+3;
|
||||
}
|
||||
|
||||
void multicomb(
|
||||
spx_word16_t *exc, /*decoded excitation*/
|
||||
spx_word16_t *new_exc, /*enhanced excitation*/
|
||||
spx_coef_t *ak, /*LPC filter coefs*/
|
||||
int p, /*LPC order*/
|
||||
int nsf, /*sub-frame size*/
|
||||
int pitch, /*pitch period*/
|
||||
int max_pitch,
|
||||
spx_word16_t comb_gain, /*gain of comb filter*/
|
||||
char *stack
|
||||
)
|
||||
{
|
||||
int i;
|
||||
VARDECL(spx_word16_t *iexc);
|
||||
spx_word16_t old_ener, new_ener;
|
||||
int corr_pitch;
|
||||
|
||||
spx_word16_t iexc0_mag, iexc1_mag, exc_mag;
|
||||
spx_word32_t corr0, corr1;
|
||||
spx_word16_t gain0, gain1;
|
||||
spx_word16_t pgain1, pgain2;
|
||||
spx_word16_t c1, c2;
|
||||
spx_word16_t g1, g2;
|
||||
spx_word16_t ngain;
|
||||
spx_word16_t gg1, gg2;
|
||||
#ifdef FIXED_POINT
|
||||
int scaledown=0;
|
||||
#endif
|
||||
#if 0 /* Set to 1 to enable full pitch search */
|
||||
int nol_pitch[6];
|
||||
spx_word16_t nol_pitch_coef[6];
|
||||
spx_word16_t ol_pitch_coef;
|
||||
open_loop_nbest_pitch(exc, 20, 120, nsf,
|
||||
nol_pitch, nol_pitch_coef, 6, stack);
|
||||
corr_pitch=nol_pitch[0];
|
||||
ol_pitch_coef = nol_pitch_coef[0];
|
||||
/*Try to remove pitch multiples*/
|
||||
for (i=1;i<6;i++)
|
||||
{
|
||||
#ifdef FIXED_POINT
|
||||
if ((nol_pitch_coef[i]>MULT16_16_Q15(nol_pitch_coef[0],19661)) &&
|
||||
#else
|
||||
if ((nol_pitch_coef[i]>.6*nol_pitch_coef[0]) &&
|
||||
#endif
|
||||
(ABS(2*nol_pitch[i]-corr_pitch)<=2 || ABS(3*nol_pitch[i]-corr_pitch)<=3 ||
|
||||
ABS(4*nol_pitch[i]-corr_pitch)<=4 || ABS(5*nol_pitch[i]-corr_pitch)<=5))
|
||||
{
|
||||
corr_pitch = nol_pitch[i];
|
||||
}
|
||||
}
|
||||
#else
|
||||
corr_pitch = pitch;
|
||||
#endif
|
||||
|
||||
ALLOC(iexc, 2*nsf, spx_word16_t);
|
||||
|
||||
interp_pitch(exc, iexc, corr_pitch, 80);
|
||||
if (corr_pitch>max_pitch)
|
||||
interp_pitch(exc, iexc+nsf, 2*corr_pitch, 80);
|
||||
else
|
||||
interp_pitch(exc, iexc+nsf, -corr_pitch, 80);
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
for (i=0;i<nsf;i++)
|
||||
{
|
||||
if (ABS16(exc[i])>16383)
|
||||
{
|
||||
scaledown = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (scaledown)
|
||||
{
|
||||
for (i=0;i<nsf;i++)
|
||||
exc[i] = SHR16(exc[i],1);
|
||||
for (i=0;i<2*nsf;i++)
|
||||
iexc[i] = SHR16(iexc[i],1);
|
||||
}
|
||||
#endif
|
||||
/*interp_pitch(exc, iexc+2*nsf, 2*corr_pitch, 80);*/
|
||||
|
||||
/*printf ("%d %d %f\n", pitch, corr_pitch, max_corr*ener_1);*/
|
||||
iexc0_mag = spx_sqrt(1000+inner_prod(iexc,iexc,nsf));
|
||||
iexc1_mag = spx_sqrt(1000+inner_prod(iexc+nsf,iexc+nsf,nsf));
|
||||
exc_mag = spx_sqrt(1+inner_prod(exc,exc,nsf));
|
||||
corr0 = inner_prod(iexc,exc,nsf);
|
||||
if (corr0<0)
|
||||
corr0=0;
|
||||
corr1 = inner_prod(iexc+nsf,exc,nsf);
|
||||
if (corr1<0)
|
||||
corr1=0;
|
||||
#ifdef FIXED_POINT
|
||||
/* Doesn't cost much to limit the ratio and it makes the rest easier */
|
||||
if (SHL32(EXTEND32(iexc0_mag),6) < EXTEND32(exc_mag))
|
||||
iexc0_mag = ADD16(1,PSHR16(exc_mag,6));
|
||||
if (SHL32(EXTEND32(iexc1_mag),6) < EXTEND32(exc_mag))
|
||||
iexc1_mag = ADD16(1,PSHR16(exc_mag,6));
|
||||
#endif
|
||||
if (corr0 > MULT16_16(iexc0_mag,exc_mag))
|
||||
pgain1 = QCONST16(1., 14);
|
||||
else
|
||||
pgain1 = PDIV32_16(SHL32(PDIV32(corr0, exc_mag),14),iexc0_mag);
|
||||
if (corr1 > MULT16_16(iexc1_mag,exc_mag))
|
||||
pgain2 = QCONST16(1., 14);
|
||||
else
|
||||
pgain2 = PDIV32_16(SHL32(PDIV32(corr1, exc_mag),14),iexc1_mag);
|
||||
gg1 = PDIV32_16(SHL32(EXTEND32(exc_mag),8), iexc0_mag);
|
||||
gg2 = PDIV32_16(SHL32(EXTEND32(exc_mag),8), iexc1_mag);
|
||||
if (comb_gain>0)
|
||||
{
|
||||
#ifdef FIXED_POINT
|
||||
c1 = (MULT16_16_Q15(QCONST16(.4,15),comb_gain)+QCONST16(.07,15));
|
||||
c2 = QCONST16(.5,15)+MULT16_16_Q14(QCONST16(1.72,14),(c1-QCONST16(.07,15)));
|
||||
#else
|
||||
c1 = .4*comb_gain+.07;
|
||||
c2 = .5+1.72*(c1-.07);
|
||||
#endif
|
||||
} else
|
||||
{
|
||||
c1=c2=0;
|
||||
}
|
||||
#ifdef FIXED_POINT
|
||||
g1 = 32767 - MULT16_16_Q13(MULT16_16_Q15(c2, pgain1),pgain1);
|
||||
g2 = 32767 - MULT16_16_Q13(MULT16_16_Q15(c2, pgain2),pgain2);
|
||||
#else
|
||||
g1 = 1-c2*pgain1*pgain1;
|
||||
g2 = 1-c2*pgain2*pgain2;
|
||||
#endif
|
||||
if (g1<c1)
|
||||
g1 = c1;
|
||||
if (g2<c1)
|
||||
g2 = c1;
|
||||
g1 = (spx_word16_t)PDIV32_16(SHL32(EXTEND32(c1),14),(spx_word16_t)g1);
|
||||
g2 = (spx_word16_t)PDIV32_16(SHL32(EXTEND32(c1),14),(spx_word16_t)g2);
|
||||
if (corr_pitch>max_pitch)
|
||||
{
|
||||
gain0 = MULT16_16_Q15(QCONST16(.7,15),MULT16_16_Q14(g1,gg1));
|
||||
gain1 = MULT16_16_Q15(QCONST16(.3,15),MULT16_16_Q14(g2,gg2));
|
||||
} else {
|
||||
gain0 = MULT16_16_Q15(QCONST16(.6,15),MULT16_16_Q14(g1,gg1));
|
||||
gain1 = MULT16_16_Q15(QCONST16(.6,15),MULT16_16_Q14(g2,gg2));
|
||||
}
|
||||
for (i=0;i<nsf;i++)
|
||||
new_exc[i] = ADD16(exc[i], EXTRACT16(PSHR32(ADD32(MULT16_16(gain0,iexc[i]), MULT16_16(gain1,iexc[i+nsf])),8)));
|
||||
/* FIXME: compute_rms16 is currently not quite accurate enough (but close) */
|
||||
new_ener = compute_rms16(new_exc, nsf);
|
||||
old_ener = compute_rms16(exc, nsf);
|
||||
|
||||
if (old_ener < 1)
|
||||
old_ener = 1;
|
||||
if (new_ener < 1)
|
||||
new_ener = 1;
|
||||
if (old_ener > new_ener)
|
||||
old_ener = new_ener;
|
||||
ngain = PDIV32_16(SHL32(EXTEND32(old_ener),14),new_ener);
|
||||
|
||||
for (i=0;i<nsf;i++)
|
||||
new_exc[i] = MULT16_16_Q14(ngain, new_exc[i]);
|
||||
#ifdef FIXED_POINT
|
||||
if (scaledown)
|
||||
{
|
||||
for (i=0;i<nsf;i++)
|
||||
exc[i] = SHL16(exc[i],1);
|
||||
for (i=0;i<nsf;i++)
|
||||
new_exc[i] = SHL16(SATURATE16(new_exc[i],16383),1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1,90 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin */
|
||||
/**
|
||||
@file filters.h
|
||||
@brief Various analysis/synthesis filters
|
||||
*/
|
||||
/*
|
||||
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 FILTERS_H
|
||||
#define FILTERS_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
spx_word16_t compute_rms(const spx_sig_t *x, int len);
|
||||
spx_word16_t compute_rms16(const spx_word16_t *x, int len);
|
||||
void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
|
||||
void signal_div(const spx_word16_t *x, spx_word16_t *y, spx_word32_t scale, int len);
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
|
||||
int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define HIGHPASS_NARROWBAND 0
|
||||
#define HIGHPASS_WIDEBAND 2
|
||||
#define HIGHPASS_INPUT 0
|
||||
#define HIGHPASS_OUTPUT 1
|
||||
#define HIGHPASS_IRS 4
|
||||
|
||||
void highpass(const spx_word16_t *x, spx_word16_t *y, int len, int filtID, spx_mem_t *mem);
|
||||
|
||||
|
||||
void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_word16_t *, spx_word16_t *y2, int N, int M, spx_word16_t *mem, char *stack);
|
||||
void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word16_t *mem1, spx_word16_t *mem2, char *stack);
|
||||
|
||||
void filter_mem16(const spx_word16_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
|
||||
void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
|
||||
void fir_mem16(const spx_word16_t *x, const spx_coef_t *num, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
|
||||
|
||||
/* Apply bandwidth expansion on LPC coef */
|
||||
void bw_lpc(spx_word16_t , const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
|
||||
void sanitize_values32(spx_word32_t *vec, spx_word32_t min_val, spx_word32_t max_val, int len);
|
||||
|
||||
|
||||
void syn_percep_zero16(const spx_word16_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack);
|
||||
void residue_percep_zero16(const spx_word16_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack);
|
||||
|
||||
void compute_impulse_response(const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack);
|
||||
|
||||
void multicomb(
|
||||
spx_word16_t *exc, /*decoded excitation*/
|
||||
spx_word16_t *new_exc, /*enhanced excitation*/
|
||||
spx_coef_t *ak, /*LPC filter coefs*/
|
||||
int p, /*LPC order*/
|
||||
int nsf, /*sub-frame size*/
|
||||
int pitch, /*pitch period*/
|
||||
int max_pitch, /*pitch gain (3-tap)*/
|
||||
spx_word16_t comb_gain, /*gain of comb filter*/
|
||||
char *stack
|
||||
);
|
||||
|
||||
#endif
|
@ -1,96 +0,0 @@
|
||||
/* Copyright (C) 2004 Jean-Marc Valin */
|
||||
/**
|
||||
@file filters_arm4.h
|
||||
@brief Various analysis/synthesis filters (ARM4 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
|
||||
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.
|
||||
*/
|
||||
|
||||
#define OVERRIDE_NORMALIZE16
|
||||
int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len)
|
||||
{
|
||||
spx_sig_t max_val=1;
|
||||
int sig_shift;
|
||||
int dead1, dead2, dead3, dead4, dead5, dead6;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"\tmov %1, #1 \n"
|
||||
"\tmov %3, #0 \n"
|
||||
|
||||
".normalize16loop1%=: \n"
|
||||
|
||||
"\tldr %4, [%0], #4 \n"
|
||||
"\tcmps %4, %1 \n"
|
||||
"\tmovgt %1, %4 \n"
|
||||
"\tcmps %4, %3 \n"
|
||||
"\tmovlt %3, %4 \n"
|
||||
|
||||
"\tsubs %2, %2, #1 \n"
|
||||
"\tbne .normalize16loop1%=\n"
|
||||
|
||||
"\trsb %3, %3, #0 \n"
|
||||
"\tcmp %1, %3 \n"
|
||||
"\tmovlt %1, %3 \n"
|
||||
: "=r" (dead1), "=r" (max_val), "=r" (dead3), "=r" (dead4),
|
||||
"=r" (dead5), "=r" (dead6)
|
||||
: "0" (x), "2" (len)
|
||||
: "cc");
|
||||
|
||||
sig_shift=0;
|
||||
while (max_val>max_scale)
|
||||
{
|
||||
sig_shift++;
|
||||
max_val >>= 1;
|
||||
}
|
||||
|
||||
__asm__ __volatile__ (
|
||||
".normalize16loop%=: \n"
|
||||
|
||||
"\tldr %4, [%0], #4 \n"
|
||||
"\tldr %5, [%0], #4 \n"
|
||||
"\tmov %4, %4, asr %3 \n"
|
||||
"\tstrh %4, [%1], #2 \n"
|
||||
"\tldr %4, [%0], #4 \n"
|
||||
"\tmov %5, %5, asr %3 \n"
|
||||
"\tstrh %5, [%1], #2 \n"
|
||||
"\tldr %5, [%0], #4 \n"
|
||||
"\tmov %4, %4, asr %3 \n"
|
||||
"\tstrh %4, [%1], #2 \n"
|
||||
"\tsubs %2, %2, #1 \n"
|
||||
"\tmov %5, %5, asr %3 \n"
|
||||
"\tstrh %5, [%1], #2 \n"
|
||||
|
||||
"\tbgt .normalize16loop%=\n"
|
||||
: "=r" (dead1), "=r" (dead2), "=r" (dead3), "=r" (dead4),
|
||||
"=r" (dead5), "=r" (dead6)
|
||||
: "0" (x), "1" (y), "2" (len>>2), "3" (sig_shift)
|
||||
: "cc", "memory");
|
||||
return sig_shift;
|
||||
}
|
||||
|
@ -1,515 +0,0 @@
|
||||
/* Copyright (C) 2005 Analog Devices */
|
||||
/**
|
||||
@file filters_bfin.h
|
||||
@brief Various analysis/synthesis filters (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
|
||||
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.
|
||||
*/
|
||||
|
||||
#define OVERRIDE_NORMALIZE16
|
||||
int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len)
|
||||
{
|
||||
spx_sig_t max_val=1;
|
||||
int sig_shift;
|
||||
__asm__
|
||||
(
|
||||
"%0 = 0;\n\t"
|
||||
"I0 = %1;\n\t"
|
||||
"L0 = 0;\n\t"
|
||||
"R1 = [I0++];\n\t"
|
||||
"LOOP norm_max%= LC0 = %2;\n\t"
|
||||
"LOOP_BEGIN norm_max%=;\n\t"
|
||||
"R2 = ABS R1 || R1 = [I0++];\n\t"
|
||||
"%0 = MAX(%0, R2);\n\t"
|
||||
"LOOP_END norm_max%=;\n\t"
|
||||
: "=&d" (max_val)
|
||||
: "a" (x), "a" (len)
|
||||
: "R1", "R2"
|
||||
);
|
||||
|
||||
sig_shift=0;
|
||||
while (max_val>max_scale)
|
||||
{
|
||||
sig_shift++;
|
||||
max_val >>= 1;
|
||||
}
|
||||
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"I0 = %0;\n\t"
|
||||
"L0 = 0;\n\t"
|
||||
"P1 = %1;\n\t"
|
||||
"R0 = [I0++];\n\t"
|
||||
"LOOP norm_shift%= LC0 = %3;\n\t"
|
||||
"LOOP_BEGIN norm_shift%=;\n\t"
|
||||
"R1 = ASHIFT R0 by %2.L || R0 = [I0++];\n\t"
|
||||
"W[P1++] = R1;\n\t"
|
||||
"LOOP_END norm_shift%=;\n\t"
|
||||
"R1 = ASHIFT R0 by %2.L;\n\t"
|
||||
"W[P1++] = R1;\n\t"
|
||||
: : "a" (x), "a" (y), "d" (-sig_shift), "a" (len-1)
|
||||
: "I0", "L0", "P1", "R0", "R1", "memory"
|
||||
);
|
||||
return sig_shift;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define OVERRIDE_FILTER_MEM16
|
||||
void filter_mem16(const spx_word16_t *_x, const spx_coef_t *num, const spx_coef_t *den, spx_word16_t *_y, int N, int ord, spx_mem_t *mem, char *stack)
|
||||
{
|
||||
VARDECL(spx_word32_t *xy2);
|
||||
VARDECL(spx_word32_t *numden_a);
|
||||
spx_word32_t *xy;
|
||||
spx_word16_t *numden;
|
||||
int i;
|
||||
|
||||
ALLOC(xy2, (N+1), spx_word32_t);
|
||||
ALLOC(numden_a, (2*ord+2), spx_word32_t);
|
||||
xy = xy2+1;
|
||||
numden = (spx_word16_t*) numden_a;
|
||||
|
||||
for (i=0;i<ord;i++)
|
||||
{
|
||||
numden[2*i] = num[i];
|
||||
numden[2*i+1] = den[i];
|
||||
}
|
||||
__asm__ __volatile__
|
||||
(
|
||||
/* Register setup */
|
||||
"R0 = %5;\n\t" /*ord */
|
||||
|
||||
"P0 = %3;\n\t"
|
||||
"I0 = P0;\n\t"
|
||||
"B0 = P0;\n\t" /* numden */
|
||||
"L0 = 0;\n\t"
|
||||
|
||||
"P2 = %0;\n\t" /* Fused xy */
|
||||
"I2 = P2;\n\t"
|
||||
"L2 = 0;\n\t"
|
||||
|
||||
"P4 = %6;\n\t" /* mem */
|
||||
"P0 = %1;\n\t" /* _x */
|
||||
"P1 = %2;\n\t" /* _y */
|
||||
|
||||
/* First sample */
|
||||
"R1 = [P4++];\n\t"
|
||||
"R1 <<= 3;\n\t" /* shift mem */
|
||||
"R1.L = R1 (RND);\n\t"
|
||||
"R2 = W[P0++];\n\t" /* load x[0] */
|
||||
"R1.L = R1.L + R2.L;\n\t"
|
||||
"W[P1++] = R1;\n\t" /* store y[0] */
|
||||
"R2 = PACK(R1.L, R2.L);\n\t" /* pack x16 and y16 */
|
||||
"[P2] = R2;\n\t"
|
||||
|
||||
/* Samples 1 to ord-1 (using memory) */
|
||||
"R0 += -1;\n\t"
|
||||
"R3 = 0;\n\t"
|
||||
"LC0 = R0;\n\t"
|
||||
"LOOP filter_start%= LC0;\n\t"
|
||||
"LOOP_BEGIN filter_start%=;\n\t"
|
||||
"R3 += 1;\n\t"
|
||||
"LC1 = R3;\n\t"
|
||||
|
||||
"R1 = [P4++];\n\t"
|
||||
"A1 = R1;\n\t"
|
||||
"A0 = 0;\n\t"
|
||||
"I0 = B0;\n\t"
|
||||
"I2 = P2;\n\t"
|
||||
"P2 += 4;\n\t"
|
||||
"R4 = [I0++] || R5 = [I2--];\n\t"
|
||||
"LOOP filter_start_inner%= LC1;\n\t"
|
||||
"LOOP_BEGIN filter_start_inner%=;\n\t"
|
||||
"A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
|
||||
"LOOP_END filter_start_inner%=;\n\t"
|
||||
"A0 += A1;\n\t"
|
||||
"R4 = A0;\n\t"
|
||||
"R4 <<= 3;\n\t" /* shift mem */
|
||||
"R4.L = R4 (RND);\n\t"
|
||||
"R2 = W[P0++];\n\t" /* load x */
|
||||
"R4.L = R4.L + R2.L;\n\t"
|
||||
"W[P1++] = R4;\n\t" /* store y */
|
||||
//"R4 <<= 2;\n\t"
|
||||
//"R2 <<= 2;\n\t"
|
||||
"R2 = PACK(R4.L, R2.L);\n\t" /* pack x16 and y16 */
|
||||
"[P2] = R2;\n\t"
|
||||
|
||||
"LOOP_END filter_start%=;\n\t"
|
||||
|
||||
/* Samples ord to N*/
|
||||
"R0 = %5;\n\t"
|
||||
"R0 <<= 1;\n\t"
|
||||
"I0 = B0;\n\t" /* numden */
|
||||
"R0 <<= 1;\n\t"
|
||||
"L0 = R0;\n\t"
|
||||
|
||||
"R0 = %5;\n\t" /* org */
|
||||
"R2 = %4;\n\t" /* N */
|
||||
"R2 = R2 - R0;\n\t"
|
||||
"R4 = [I0++];\n\t" /* numden */
|
||||
"LC0 = R2;\n\t"
|
||||
"P3 = R0;\n\t"
|
||||
"R0 <<= 2;\n\t"
|
||||
"R0 += 8;\n\t"
|
||||
"I2 = P2;\n\t"
|
||||
"M0 = R0;\n\t"
|
||||
"A1 = A0 = 0;\n\t"
|
||||
"R5 = [I2--];\n\t" /* load xy */
|
||||
"LOOP filter_mid%= LC0;\n\t"
|
||||
"LOOP_BEGIN filter_mid%=;\n\t"
|
||||
"LOOP filter_mid_inner%= LC1=P3;\n\t"
|
||||
"LOOP_BEGIN filter_mid_inner%=;\n\t"
|
||||
"A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
|
||||
"LOOP_END filter_mid_inner%=;\n\t"
|
||||
"R0 = (A0 += A1) || I2 += M0;\n\t"
|
||||
"R0 = R0 << 3 || R5 = W[P0++];\n\t" /* load x */
|
||||
"R0.L = R0 (RND);\n\t"
|
||||
"R0.L = R0.L + R5.L;\n\t"
|
||||
"R5 = PACK(R0.L, R5.L) || W[P1++] = R0;\n\t" /* shift y | store y */
|
||||
"A1 = A0 = 0 || [I2--] = R5\n\t"
|
||||
"LOOP_END filter_mid%=;\n\t"
|
||||
"I2 += 4;\n\t"
|
||||
"P2 = I2;\n\t"
|
||||
/* Update memory */
|
||||
"P4 = %6;\n\t"
|
||||
"R0 = %5;\n\t"
|
||||
"LC0 = R0;\n\t"
|
||||
"P0 = B0;\n\t"
|
||||
"A1 = A0 = 0;\n\t"
|
||||
"LOOP mem_update%= LC0;\n\t"
|
||||
"LOOP_BEGIN mem_update%=;\n\t"
|
||||
"I2 = P2;\n\t"
|
||||
"I0 = P0;\n\t"
|
||||
"P0 += 4;\n\t"
|
||||
"R0 = LC0;\n\t"
|
||||
"LC1 = R0;\n\t"
|
||||
"R5 = [I2--] || R4 = [I0++];\n\t"
|
||||
"LOOP mem_accum%= LC1;\n\t"
|
||||
"LOOP_BEGIN mem_accum%=;\n\t"
|
||||
"A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
|
||||
"LOOP_END mem_accum%=;\n\t"
|
||||
"R0 = (A0 += A1);\n\t"
|
||||
"A1 = A0 = 0 || [P4++] = R0;\n\t"
|
||||
"LOOP_END mem_update%=;\n\t"
|
||||
"L0 = 0;\n\t"
|
||||
: : "m" (xy), "m" (_x), "m" (_y), "m" (numden), "m" (N), "m" (ord), "m" (mem)
|
||||
: "A0", "A1", "R0", "R1", "R2", "R3", "R4", "R5", "P0", "P1", "P2", "P3", "P4", "B0", "I0", "I2", "L0", "L2", "M0", "memory"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define OVERRIDE_IIR_MEM16
|
||||
void iir_mem16(const spx_word16_t *_x, const spx_coef_t *den, spx_word16_t *_y, int N, int ord, spx_mem_t *mem, char *stack)
|
||||
{
|
||||
VARDECL(spx_word16_t *y);
|
||||
spx_word16_t *yy;
|
||||
|
||||
ALLOC(y, (N+2), spx_word16_t);
|
||||
yy = y+2;
|
||||
|
||||
__asm__ __volatile__
|
||||
(
|
||||
/* Register setup */
|
||||
"R0 = %5;\n\t" /*ord */
|
||||
|
||||
"P1 = %3;\n\t"
|
||||
"I1 = P1;\n\t"
|
||||
"B1 = P1;\n\t"
|
||||
"L1 = 0;\n\t"
|
||||
|
||||
"P3 = %0;\n\t"
|
||||
"I3 = P3;\n\t"
|
||||
"L3 = 0;\n\t"
|
||||
|
||||
"P4 = %6;\n\t"
|
||||
"P0 = %1;\n\t"
|
||||
"P1 = %2;\n\t"
|
||||
|
||||
/* First sample */
|
||||
"R1 = [P4++];\n\t"
|
||||
"R1 = R1 << 3 (S);\n\t"
|
||||
"R1.L = R1 (RND);\n\t"
|
||||
"R2 = W[P0++];\n\t"
|
||||
"R1 = R1 + R2;\n\t"
|
||||
"W[P1++] = R1;\n\t"
|
||||
"W[P3] = R1;\n\t"
|
||||
|
||||
/* Samples 1 to ord-1 (using memory) */
|
||||
"R0 += -1;\n\t"
|
||||
"R3 = 0;\n\t"
|
||||
"LC0 = R0;\n\t"
|
||||
"LOOP filter_start%= LC0;\n\t"
|
||||
"LOOP_BEGIN filter_start%=;\n\t"
|
||||
"R3 += 1;\n\t"
|
||||
"LC1 = R3;\n\t"
|
||||
|
||||
"R1 = [P4++];\n\t"
|
||||
"A1 = R1;\n\t"
|
||||
"I1 = B1;\n\t"
|
||||
"I3 = P3;\n\t"
|
||||
"P3 += 2;\n\t"
|
||||
"LOOP filter_start_inner%= LC1;\n\t"
|
||||
"LOOP_BEGIN filter_start_inner%=;\n\t"
|
||||
"R4.L = W[I1++];\n\t"
|
||||
"R5.L = W[I3--];\n\t"
|
||||
"A1 -= R4.L*R5.L (IS);\n\t"
|
||||
"LOOP_END filter_start_inner%=;\n\t"
|
||||
|
||||
"R1 = A1;\n\t"
|
||||
"R1 <<= 3;\n\t"
|
||||
"R1.L = R1 (RND);\n\t"
|
||||
"R2 = W[P0++];\n\t"
|
||||
"R1 = R1 + R2;\n\t"
|
||||
"W[P1++] = R1;\n\t"
|
||||
"W[P3] = R1;\n\t"
|
||||
"LOOP_END filter_start%=;\n\t"
|
||||
|
||||
/* Samples ord to N*/
|
||||
"R0 = %5;\n\t"
|
||||
"R0 <<= 1;\n\t"
|
||||
"I1 = B1;\n\t"
|
||||
"L1 = R0;\n\t"
|
||||
|
||||
"R0 = %5;\n\t"
|
||||
"R2 = %4;\n\t"
|
||||
"R2 = R2 - R0;\n\t"
|
||||
"R4.L = W[I1++];\n\t"
|
||||
"LC0 = R2;\n\t"
|
||||
"LOOP filter_mid%= LC0;\n\t"
|
||||
"LOOP_BEGIN filter_mid%=;\n\t"
|
||||
"LC1 = R0;\n\t"
|
||||
"A1 = 0;\n\t"
|
||||
"I3 = P3;\n\t"
|
||||
"P3 += 2;\n\t"
|
||||
"R5.L = W[I3--];\n\t"
|
||||
"LOOP filter_mid_inner%= LC1;\n\t"
|
||||
"LOOP_BEGIN filter_mid_inner%=;\n\t"
|
||||
"A1 -= R4.L*R5.L (IS) || R4.L = W[I1++] || R5.L = W[I3--];\n\t"
|
||||
"LOOP_END filter_mid_inner%=;\n\t"
|
||||
"R1 = A1;\n\t"
|
||||
"R1 = R1 << 3 || R2 = W[P0++];\n\t"
|
||||
"R1.L = R1 (RND);\n\t"
|
||||
"R1 = R1 + R2;\n\t"
|
||||
"W[P1++] = R1;\n\t"
|
||||
"W[P3] = R1;\n\t"
|
||||
"LOOP_END filter_mid%=;\n\t"
|
||||
|
||||
/* Update memory */
|
||||
"P4 = %6;\n\t"
|
||||
"R0 = %5;\n\t"
|
||||
"LC0 = R0;\n\t"
|
||||
"P1 = B1;\n\t"
|
||||
"LOOP mem_update%= LC0;\n\t"
|
||||
"LOOP_BEGIN mem_update%=;\n\t"
|
||||
"A0 = 0;\n\t"
|
||||
"I3 = P3;\n\t"
|
||||
"I1 = P1;\n\t"
|
||||
"P1 += 2;\n\t"
|
||||
"R0 = LC0;\n\t"
|
||||
"LC1=R0;\n\t"
|
||||
"R5.L = W[I3--] || R4.L = W[I1++];\n\t"
|
||||
"LOOP mem_accum%= LC1;\n\t"
|
||||
"LOOP_BEGIN mem_accum%=;\n\t"
|
||||
"A0 -= R4.L*R5.L (IS) || R4.L = W[I1++] || R5.L = W[I3--];\n\t"
|
||||
"LOOP_END mem_accum%=;\n\t"
|
||||
"R0 = A0;\n\t"
|
||||
"[P4++] = R0;\n\t"
|
||||
"LOOP_END mem_update%=;\n\t"
|
||||
"L1 = 0;\n\t"
|
||||
: : "m" (yy), "m" (_x), "m" (_y), "m" (den), "m" (N), "m" (ord), "m" (mem)
|
||||
: "A0", "A1", "R0", "R1", "R2", "R3", "R4", "R5", "P0", "P1", "P2", "P3", "P4", "B1", "I1", "I3", "L1", "L3", "memory"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#define OVERRIDE_FIR_MEM16
|
||||
void fir_mem16(const spx_word16_t *x, const spx_coef_t *num, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack)
|
||||
{
|
||||
int i;
|
||||
spx_coef_t den2[12];
|
||||
spx_coef_t *den;
|
||||
den = (spx_coef_t*)((((int)den2)+4)&0xfffffffc);
|
||||
for (i=0;i<10;i++)
|
||||
den[i] = 0;
|
||||
filter_mem16(x, num, den, y, N, ord, mem, stack);
|
||||
}
|
||||
|
||||
|
||||
#define OVERRIDE_COMPUTE_IMPULSE_RESPONSE
|
||||
void compute_impulse_response(const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack)
|
||||
{
|
||||
int i;
|
||||
VARDECL(spx_word16_t *ytmp);
|
||||
ALLOC(ytmp, N, spx_word16_t);
|
||||
spx_word16_t *ytmp2 = ytmp;
|
||||
y[0] = LPC_SCALING;
|
||||
for (i=0;i<ord;i++)
|
||||
y[i+1] = awk1[i];
|
||||
i++;
|
||||
for (;i<N;i++)
|
||||
y[i] = 0;
|
||||
|
||||
N-=1;
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"I0 = %0;\n\t"
|
||||
"I1 = %1;\n\t"
|
||||
"L0 = 0;\n\t"
|
||||
"L1 = 0;\n\t"
|
||||
"L2 = 0;\n\t"
|
||||
"L3 = 0;\n\t"
|
||||
"R0 = 1;\n\t"
|
||||
"R0 <<= 13;\n\t"
|
||||
"W[I0] = R0.L;\n\t"
|
||||
"R0 <<= 1;\n\t"
|
||||
"W[I1] = R0.L;\n\t"
|
||||
"R0 = %5;\n\t"
|
||||
"LC0 = R0;\n\t"
|
||||
"R2 = 0;\n\t"
|
||||
"LOOP samples%= LC0;\n\t"
|
||||
"LOOP_BEGIN samples%=;\n\t"
|
||||
"R2 += 1;\n\t"
|
||||
"R2 = MIN(R2, %4);\n\t"
|
||||
"I0 = %0;\n\t"
|
||||
"I1 = %1;\n\t"
|
||||
"I2 = %2;\n\t"
|
||||
"I3 = %3;\n\t"
|
||||
"%0 += 2;\n\t"
|
||||
"%1 += 2;\n\t"
|
||||
"A1 = A0 = 0;\n\t"
|
||||
"R0.L = W[I0--] || R1.L = W[I2++];\n\t"
|
||||
"LC1 = R2;\n\t"
|
||||
"LOOP filter%= LC1;\n\t"
|
||||
"LOOP_BEGIN filter%=;\n\t"
|
||||
"A0 -= R0.L*R1.L (IS) || R0.L = W[I1--] || R1.L = W[I3++];\n\t"
|
||||
"A1 -= R0.L*R1.L (IS) || R0.L = W[I0--] || R1.L = W[I2++];\n\t"
|
||||
"LOOP_END filter%=;\n\t"
|
||||
"R0 = A0, R1 = A1;\n\t"
|
||||
"R3 = W[%1] (X);\n\t"
|
||||
"R3 <<= 13;\n\t"
|
||||
"R0 = R0 + R3;\n\t"
|
||||
"R3 = R0 >>> 13;\n\t"
|
||||
"W[%0] = R3.L;\n\t"
|
||||
"R0 <<= 1;\n\t"
|
||||
"R1 = R1 + R0;\n\t"
|
||||
"R1 >>>= 13;\n\t"
|
||||
"W[%1] = R1.L;\n\t"
|
||||
"LOOP_END samples%=;\n\t"
|
||||
: "=a" (ytmp2), "=a" (y)
|
||||
: "a" (awk2), "a" (ak), "d" (ord), "m" (N), "0" (ytmp2), "1" (y)
|
||||
: "A0", "A1", "R0", "R1", "R2", "R3", "I0", "I1", "I2", "I3", "L0", "L1", "L2", "L3", "A0", "A1"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if 0 /* Equivalent C function for filter_mem2 and compute_impulse_response */
|
||||
#define min(a,b) ((a)<(b) ? (a):(b))
|
||||
|
||||
void compute_impulse_response(const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack)
|
||||
{
|
||||
int i,j;
|
||||
VARDECL(spx_word16_t *ytmp);
|
||||
ALLOC(ytmp, N, spx_word16_t);
|
||||
|
||||
y[0] = LPC_SCALING;
|
||||
for (i=0;i<ord;i++)
|
||||
y[i+1] = awk1[i];
|
||||
i++;
|
||||
for (;i<N;i++)
|
||||
y[i] = 0;
|
||||
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
spx_word32_t yi = SHL32(EXTEND32(y[i]),LPC_SHIFT);
|
||||
spx_word32_t yi2 = 0;
|
||||
for (j=0;j<min(i,ord);j++)
|
||||
{
|
||||
yi = MAC16_16(yi, awk2[j], -ytmp[i-j-1]);
|
||||
yi2 = MAC16_16(yi2, ak[j], -y[i-j-1]);
|
||||
}
|
||||
ytmp[i] = EXTRACT16(SHR32(yi,LPC_SHIFT));
|
||||
yi2 = ADD32(yi2,SHL32(yi,1));
|
||||
y[i] = EXTRACT16(SHR32(yi2,LPC_SHIFT));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void filter_mem2(const spx_sig_t *_x, const spx_coef_t *num, const spx_coef_t *den, spx_sig_t *_y, int N, int ord, spx_mem_t *mem)
|
||||
{
|
||||
int i,j;
|
||||
spx_word16_t xi,yi,nyi;
|
||||
spx_word16_t x[N],y[N];
|
||||
spx_word16_t *xx, *yy;
|
||||
xx = x;
|
||||
yy = y;
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
x[i] = EXTRACT16(SHR32(_x[i],SIG_SHIFT));
|
||||
}
|
||||
|
||||
for (i=0;i<ord;i++)
|
||||
{
|
||||
spx_word32_t yi = mem[i];
|
||||
for (j=0;j<i;j++)
|
||||
{
|
||||
yi = MAC16_16(yi, num[j], x[i-j-1]);
|
||||
yi = MAC16_16(yi, den[j], -y[i-j-1]);
|
||||
}
|
||||
_y[i] = ADD32(_x[i],SHL32(yi,1));
|
||||
y[i] = EXTRACT16(SHR32(_y[i],SIG_SHIFT));
|
||||
}
|
||||
for (i=ord;i<N;i++)
|
||||
{
|
||||
spx_word32_t yi = 0;
|
||||
for (j=0;j<ord;j++)
|
||||
{
|
||||
yi = MAC16_16(yi, num[j], x[i-j-1]);
|
||||
yi = MAC16_16(yi, den[j], -y[i-j-1]);
|
||||
}
|
||||
_y[i] = ADD32(_x[i],SHL32(yi,1));
|
||||
y[i] = EXTRACT16(SHR32(_y[i],SIG_SHIFT));
|
||||
}
|
||||
|
||||
for (i=0;i<ord;i++)
|
||||
{
|
||||
spx_mem_t m = 0;
|
||||
for (j=0;j<ord-i;j++)
|
||||
{
|
||||
m = MAC16_16(m, x[N-1-j], num[j+i]);
|
||||
m = MAC16_16(m, -y[N-1-j], den[j+i]);
|
||||
}
|
||||
mem[i] = m;
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,336 +0,0 @@
|
||||
/* Copyright (C) 2002 Jean-Marc Valin */
|
||||
/**
|
||||
@file filters_sse.h
|
||||
@brief Various analysis/synthesis filters (SSE 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
|
||||
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.
|
||||
*/
|
||||
|
||||
#include <xmmintrin.h>
|
||||
|
||||
void filter_mem16_10(const float *x, const float *_num, const float *_den, float *y, int N, int ord, float *_mem)
|
||||
{
|
||||
__m128 num[3], den[3], mem[3];
|
||||
|
||||
int i;
|
||||
|
||||
/* Copy numerator, denominator and memory to aligned xmm */
|
||||
for (i=0;i<2;i++)
|
||||
{
|
||||
mem[i] = _mm_loadu_ps(_mem+4*i);
|
||||
num[i] = _mm_loadu_ps(_num+4*i);
|
||||
den[i] = _mm_loadu_ps(_den+4*i);
|
||||
}
|
||||
mem[2] = _mm_setr_ps(_mem[8], _mem[9], 0, 0);
|
||||
num[2] = _mm_setr_ps(_num[8], _num[9], 0, 0);
|
||||
den[2] = _mm_setr_ps(_den[8], _den[9], 0, 0);
|
||||
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
__m128 xx;
|
||||
__m128 yy;
|
||||
/* Compute next filter result */
|
||||
xx = _mm_load_ps1(x+i);
|
||||
yy = _mm_add_ss(xx, mem[0]);
|
||||
_mm_store_ss(y+i, yy);
|
||||
yy = _mm_shuffle_ps(yy, yy, 0);
|
||||
|
||||
/* Update memory */
|
||||
mem[0] = _mm_move_ss(mem[0], mem[1]);
|
||||
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
|
||||
|
||||
mem[0] = _mm_add_ps(mem[0], _mm_mul_ps(xx, num[0]));
|
||||
mem[0] = _mm_sub_ps(mem[0], _mm_mul_ps(yy, den[0]));
|
||||
|
||||
mem[1] = _mm_move_ss(mem[1], mem[2]);
|
||||
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
|
||||
|
||||
mem[1] = _mm_add_ps(mem[1], _mm_mul_ps(xx, num[1]));
|
||||
mem[1] = _mm_sub_ps(mem[1], _mm_mul_ps(yy, den[1]));
|
||||
|
||||
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0xfd);
|
||||
|
||||
mem[2] = _mm_add_ps(mem[2], _mm_mul_ps(xx, num[2]));
|
||||
mem[2] = _mm_sub_ps(mem[2], _mm_mul_ps(yy, den[2]));
|
||||
}
|
||||
/* Put memory back in its place */
|
||||
_mm_storeu_ps(_mem, mem[0]);
|
||||
_mm_storeu_ps(_mem+4, mem[1]);
|
||||
_mm_store_ss(_mem+8, mem[2]);
|
||||
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0x55);
|
||||
_mm_store_ss(_mem+9, mem[2]);
|
||||
}
|
||||
|
||||
void filter_mem16_8(const float *x, const float *_num, const float *_den, float *y, int N, int ord, float *_mem)
|
||||
{
|
||||
__m128 num[2], den[2], mem[2];
|
||||
|
||||
int i;
|
||||
|
||||
/* Copy numerator, denominator and memory to aligned xmm */
|
||||
for (i=0;i<2;i++)
|
||||
{
|
||||
mem[i] = _mm_loadu_ps(_mem+4*i);
|
||||
num[i] = _mm_loadu_ps(_num+4*i);
|
||||
den[i] = _mm_loadu_ps(_den+4*i);
|
||||
}
|
||||
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
__m128 xx;
|
||||
__m128 yy;
|
||||
/* Compute next filter result */
|
||||
xx = _mm_load_ps1(x+i);
|
||||
yy = _mm_add_ss(xx, mem[0]);
|
||||
_mm_store_ss(y+i, yy);
|
||||
yy = _mm_shuffle_ps(yy, yy, 0);
|
||||
|
||||
/* Update memory */
|
||||
mem[0] = _mm_move_ss(mem[0], mem[1]);
|
||||
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
|
||||
|
||||
mem[0] = _mm_add_ps(mem[0], _mm_mul_ps(xx, num[0]));
|
||||
mem[0] = _mm_sub_ps(mem[0], _mm_mul_ps(yy, den[0]));
|
||||
|
||||
mem[1] = _mm_sub_ss(mem[1], mem[1]);
|
||||
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
|
||||
|
||||
mem[1] = _mm_add_ps(mem[1], _mm_mul_ps(xx, num[1]));
|
||||
mem[1] = _mm_sub_ps(mem[1], _mm_mul_ps(yy, den[1]));
|
||||
}
|
||||
/* Put memory back in its place */
|
||||
_mm_storeu_ps(_mem, mem[0]);
|
||||
_mm_storeu_ps(_mem+4, mem[1]);
|
||||
}
|
||||
|
||||
|
||||
#define OVERRIDE_FILTER_MEM16
|
||||
void filter_mem16(const float *x, const float *_num, const float *_den, float *y, int N, int ord, float *_mem, char *stack)
|
||||
{
|
||||
if(ord==10)
|
||||
filter_mem16_10(x, _num, _den, y, N, ord, _mem);
|
||||
else if (ord==8)
|
||||
filter_mem16_8(x, _num, _den, y, N, ord, _mem);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void iir_mem16_10(const float *x, const float *_den, float *y, int N, int ord, float *_mem)
|
||||
{
|
||||
__m128 den[3], mem[3];
|
||||
|
||||
int i;
|
||||
|
||||
/* Copy numerator, denominator and memory to aligned xmm */
|
||||
for (i=0;i<2;i++)
|
||||
{
|
||||
mem[i] = _mm_loadu_ps(_mem+4*i);
|
||||
den[i] = _mm_loadu_ps(_den+4*i);
|
||||
}
|
||||
mem[2] = _mm_setr_ps(_mem[8], _mem[9], 0, 0);
|
||||
den[2] = _mm_setr_ps(_den[8], _den[9], 0, 0);
|
||||
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
__m128 xx;
|
||||
__m128 yy;
|
||||
/* Compute next filter result */
|
||||
xx = _mm_load_ps1(x+i);
|
||||
yy = _mm_add_ss(xx, mem[0]);
|
||||
_mm_store_ss(y+i, yy);
|
||||
yy = _mm_shuffle_ps(yy, yy, 0);
|
||||
|
||||
/* Update memory */
|
||||
mem[0] = _mm_move_ss(mem[0], mem[1]);
|
||||
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
|
||||
|
||||
mem[0] = _mm_sub_ps(mem[0], _mm_mul_ps(yy, den[0]));
|
||||
|
||||
mem[1] = _mm_move_ss(mem[1], mem[2]);
|
||||
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
|
||||
|
||||
mem[1] = _mm_sub_ps(mem[1], _mm_mul_ps(yy, den[1]));
|
||||
|
||||
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0xfd);
|
||||
|
||||
mem[2] = _mm_sub_ps(mem[2], _mm_mul_ps(yy, den[2]));
|
||||
}
|
||||
/* Put memory back in its place */
|
||||
_mm_storeu_ps(_mem, mem[0]);
|
||||
_mm_storeu_ps(_mem+4, mem[1]);
|
||||
_mm_store_ss(_mem+8, mem[2]);
|
||||
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0x55);
|
||||
_mm_store_ss(_mem+9, mem[2]);
|
||||
}
|
||||
|
||||
|
||||
void iir_mem16_8(const float *x, const float *_den, float *y, int N, int ord, float *_mem)
|
||||
{
|
||||
__m128 den[2], mem[2];
|
||||
|
||||
int i;
|
||||
|
||||
/* Copy numerator, denominator and memory to aligned xmm */
|
||||
for (i=0;i<2;i++)
|
||||
{
|
||||
mem[i] = _mm_loadu_ps(_mem+4*i);
|
||||
den[i] = _mm_loadu_ps(_den+4*i);
|
||||
}
|
||||
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
__m128 xx;
|
||||
__m128 yy;
|
||||
/* Compute next filter result */
|
||||
xx = _mm_load_ps1(x+i);
|
||||
yy = _mm_add_ss(xx, mem[0]);
|
||||
_mm_store_ss(y+i, yy);
|
||||
yy = _mm_shuffle_ps(yy, yy, 0);
|
||||
|
||||
/* Update memory */
|
||||
mem[0] = _mm_move_ss(mem[0], mem[1]);
|
||||
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
|
||||
|
||||
mem[0] = _mm_sub_ps(mem[0], _mm_mul_ps(yy, den[0]));
|
||||
|
||||
mem[1] = _mm_sub_ss(mem[1], mem[1]);
|
||||
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
|
||||
|
||||
mem[1] = _mm_sub_ps(mem[1], _mm_mul_ps(yy, den[1]));
|
||||
}
|
||||
/* Put memory back in its place */
|
||||
_mm_storeu_ps(_mem, mem[0]);
|
||||
_mm_storeu_ps(_mem+4, mem[1]);
|
||||
}
|
||||
|
||||
#define OVERRIDE_IIR_MEM16
|
||||
void iir_mem16(const float *x, const float *_den, float *y, int N, int ord, float *_mem, char *stack)
|
||||
{
|
||||
if(ord==10)
|
||||
iir_mem16_10(x, _den, y, N, ord, _mem);
|
||||
else if (ord==8)
|
||||
iir_mem16_8(x, _den, y, N, ord, _mem);
|
||||
}
|
||||
|
||||
|
||||
void fir_mem16_10(const float *x, const float *_num, float *y, int N, int ord, float *_mem)
|
||||
{
|
||||
__m128 num[3], mem[3];
|
||||
|
||||
int i;
|
||||
|
||||
/* Copy numerator, denominator and memory to aligned xmm */
|
||||
for (i=0;i<2;i++)
|
||||
{
|
||||
mem[i] = _mm_loadu_ps(_mem+4*i);
|
||||
num[i] = _mm_loadu_ps(_num+4*i);
|
||||
}
|
||||
mem[2] = _mm_setr_ps(_mem[8], _mem[9], 0, 0);
|
||||
num[2] = _mm_setr_ps(_num[8], _num[9], 0, 0);
|
||||
|
||||
for (i=0;i<N;i++)
|
||||
{
|
||||
__m128 xx;
|
||||
__m128 yy;
|
||||
/* Compute next filter result */
|
||||
xx = _mm_load_ps1(x+i);
|
||||
yy = _mm_add_ss(xx, mem[0]);
|
||||
_mm_store_ss(y+i, yy);
|
||||
yy = _mm_shuffle_ps(yy, yy, 0);
|
||||
|
||||
/* Update memory */
|
||||
mem[0] = _mm_move_ss(mem[0], mem[1]);
|
||||
mem[0] = _mm_shuffle_ps(mem[0], mem[0], 0x39);
|
||||
|
||||
mem[0] = _mm_add_ps(mem[0], _mm_mul_ps(xx, num[0]));
|
||||
|
||||
mem[1] = _mm_move_ss(mem[1], mem[2]);
|
||||
mem[1] = _mm_shuffle_ps(mem[1], mem[1], 0x39);
|
||||
|
||||
mem[1] = _mm_add_ps(mem[1], _mm_mul_ps(xx, num[1]));
|
||||
|
||||
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0xfd);
|
||||
|
||||
mem[2] = _mm_add_ps(mem[2], _mm_mul_ps(xx, num[2]));
|
||||
}
|
||||
/* Put memory back in its place */
|
||||
_mm_storeu_ps(_mem, mem[0]);
|
||||
_mm_storeu_ps(_mem+4, mem[1]);
|
||||
_mm_store_ss(_mem+8, mem[2]);
|
||||
mem[2] = _mm_shuffle_ps(mem[2], mem[2], 0x55);
|
||||
_mm_store_ss(_mem+9, mem[2]);
|
||||
}
|
||||
|
||||
void fir_mem16_8(const float *x, const float *_num, float *y, int N, int ord, float *_mem)
|
||||
{
|
||||
__m128 num[2], mem[2];
|
||||
|
||||
int i;
|
||||
|
||||
/* Copy numerator, denominator and memory to aligned xmm */
|
||||
for (i=0;i<2;i++)
|
||||