Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/speex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorslicer <slicer@mumble.hive.no>2009-12-23 04:21:07 +0300
committerslicer <slicer@mumble.hive.no>2009-12-23 04:21:07 +0300
commitbae128c14a6b7a3a4d932b8f127741d75fd0924e (patch)
tree93333a04aa75b7662c1e5f258bf0392e2c64d854
parent35ec65508343ec64627850673a6d2674c704371c (diff)
Remove a lot of leftover speexdsp references
-rw-r--r--TODO12
-rw-r--r--libspeex/buffer.c176
-rw-r--r--macosx/Speex.xcodeproj/project.pbxproj54
-rw-r--r--macosx/Speex_UB.xcodeproj/project.pbxproj22
-rw-r--r--symbian/bld.inf3
-rw-r--r--symbian/speex.mmp6
-rw-r--r--tmv/mdf_tm.h1192
-rw-r--r--tmv/preprocess_tm.h1135
-rw-r--r--win32/VS2008/libspeex/libspeex.vcproj24
-rw-r--r--win32/speex.iss3
10 files changed, 4 insertions, 2623 deletions
diff --git a/TODO b/TODO
index fd3c953..47be3f6 100644
--- a/TODO
+++ b/TODO
@@ -1,10 +1,7 @@
For 1.2:
Major points:
-- Make documentation match the actual code (especially jitter buffer, AEC and preprocessor)
-- Get AGC to work in fixed-point even if not totally converted
+- Make documentation match the actual code
- Stabilise all APIs (need feedback)
-- Short-term estimate in jitter buffer
-- Control delay in new AEC API.
- NaN checks?
- Better error reporting
- Make kiss-fft 32-bit safe
@@ -19,7 +16,6 @@ split encoder and decoder?
Merge TriMedia stuff
packet dump
Do VAD properly
---enable-{aec,preprocessor,jitter,resampler}
Optimisations
- Add restrict in a few places?
@@ -32,12 +28,6 @@ Implement wideband split as IIR instead of QMF?
Allocator override (speex_lib_ctl?)
Fixed-point:
- VBR
- - Jitter buffer
- - AGC
-Denoiser:
- - Better noise adaptation
-AGC:
- - Use median filtering instead of "non-linear mean"?
Standards
-Complete Speex RTP profile
diff --git a/libspeex/buffer.c b/libspeex/buffer.c
deleted file mode 100644
index e094804..0000000
--- a/libspeex/buffer.c
+++ /dev/null
@@ -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 "../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;
-}
diff --git a/macosx/Speex.xcodeproj/project.pbxproj b/macosx/Speex.xcodeproj/project.pbxproj
index 796402d..3c8faaa 100644
--- a/macosx/Speex.xcodeproj/project.pbxproj
+++ b/macosx/Speex.xcodeproj/project.pbxproj
@@ -9,18 +9,8 @@
/* Begin PBXBuildFile section */
37CA8DEB0DD73333005C8CB6 /* modes_wb.c in Sources */ = {isa = PBXBuildFile; fileRef = 37CA8DEA0DD73333005C8CB6 /* modes_wb.c */; };
37CA8DEC0DD73333005C8CB6 /* modes_wb.c in Sources */ = {isa = PBXBuildFile; fileRef = 37CA8DEA0DD73333005C8CB6 /* modes_wb.c */; };
- 37CA8DF00DD73408005C8CB6 /* buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 37CA8DED0DD73408005C8CB6 /* buffer.c */; };
- 37CA8DF10DD73408005C8CB6 /* resample.c in Sources */ = {isa = PBXBuildFile; fileRef = 37CA8DEE0DD73408005C8CB6 /* resample.c */; };
- 37CA8DF30DD73408005C8CB6 /* buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 37CA8DED0DD73408005C8CB6 /* buffer.c */; };
- 37CA8DF40DD73408005C8CB6 /* resample.c in Sources */ = {isa = PBXBuildFile; fileRef = 37CA8DEE0DD73408005C8CB6 /* resample.c */; };
- 37CA8DF60DD73424005C8CB6 /* resample_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = 37CA8DEF0DD73408005C8CB6 /* resample_sse.h */; };
- 37CA8DF90DD7347D005C8CB6 /* speex_buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 37CA8DF70DD7347D005C8CB6 /* speex_buffer.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 37CA8DFA0DD7347D005C8CB6 /* speex_resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 37CA8DF80DD7347D005C8CB6 /* speex_resampler.h */; settings = {ATTRIBUTES = (Public, ); }; };
37CA8E000DD7352A005C8CB6 /* os_support.h in Headers */ = {isa = PBXBuildFile; fileRef = 37CA8DFF0DD7352A005C8CB6 /* os_support.h */; };
- 73814AFF0907FB8200C478FC /* speex_echo.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF30907FB8200C478FC /* speex_echo.h */; settings = {ATTRIBUTES = (Public, ); }; };
73814B000907FB8200C478FC /* speex_header.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF40907FB8200C478FC /* speex_header.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 73814B010907FB8200C478FC /* speex_jitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF50907FB8200C478FC /* speex_jitter.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 73814B020907FB8200C478FC /* speex_preprocess.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF60907FB8200C478FC /* speex_preprocess.h */; settings = {ATTRIBUTES = (Public, ); }; };
73814B030907FB8200C478FC /* speex_stereo.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF70907FB8200C478FC /* speex_stereo.h */; settings = {ATTRIBUTES = (Public, ); }; };
73814B040907FB8200C478FC /* speex_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF80907FB8200C478FC /* speex_types.h */; settings = {ATTRIBUTES = (Public, ); }; };
73814B060907FBAB00C478FC /* speex_callbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF10907FB8200C478FC /* speex_callbacks.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -40,14 +30,12 @@
73814B720907FC9900C478FC /* hexc_10_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B250907FC9900C478FC /* hexc_10_32_table.c */; };
73814B730907FC9900C478FC /* hexc_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B260907FC9900C478FC /* hexc_table.c */; };
73814B740907FC9900C478FC /* high_lsp_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B270907FC9900C478FC /* high_lsp_tables.c */; };
- 73814B750907FC9900C478FC /* jitter.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B280907FC9900C478FC /* jitter.c */; };
73814B780907FC9900C478FC /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2B0907FC9900C478FC /* lpc.c */; };
73814B7A0907FC9900C478FC /* lsp_tables_nb.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */; };
73814B7B0907FC9900C478FC /* lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2E0907FC9900C478FC /* lsp.c */; };
73814B800907FC9900C478FC /* ltp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B330907FC9900C478FC /* ltp.c */; };
73814B8A0907FC9900C478FC /* modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3D0907FC9900C478FC /* modes.c */; };
73814B8C0907FC9900C478FC /* nb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3F0907FC9900C478FC /* nb_celp.c */; };
- 73814B8E0907FC9900C478FC /* preprocess.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B410907FC9900C478FC /* preprocess.c */; };
73814B8F0907FC9900C478FC /* quant_lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B420907FC9900C478FC /* quant_lsp.c */; };
73814B910907FC9900C478FC /* sb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B440907FC9900C478FC /* sb_celp.c */; };
73814B930907FC9900C478FC /* smallft.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B460907FC9900C478FC /* smallft.c */; };
@@ -57,7 +45,6 @@
73814B990907FC9900C478FC /* stereo.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B4C0907FC9900C478FC /* stereo.c */; };
73814B9F0907FC9900C478FC /* vbr.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B520907FC9900C478FC /* vbr.c */; };
73814BA40907FC9900C478FC /* vq.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B570907FC9900C478FC /* vq.c */; };
- 738837440B1934D0005C7A69 /* mdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B390907FC9900C478FC /* mdf.c */; };
738837540B193581005C7A69 /* _kiss_fft_guts.h in Headers */ = {isa = PBXBuildFile; fileRef = 738837460B193581005C7A69 /* _kiss_fft_guts.h */; };
738837550B193581005C7A69 /* fftwrap.c in Sources */ = {isa = PBXBuildFile; fileRef = 738837470B193581005C7A69 /* fftwrap.c */; };
738837560B193581005C7A69 /* fftwrap.h in Headers */ = {isa = PBXBuildFile; fileRef = 738837480B193581005C7A69 /* fftwrap.h */; };
@@ -88,17 +75,14 @@
738837880B193799005C7A69 /* hexc_10_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B250907FC9900C478FC /* hexc_10_32_table.c */; };
738837890B19379B005C7A69 /* hexc_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B260907FC9900C478FC /* hexc_table.c */; };
7388378A0B19379E005C7A69 /* high_lsp_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B270907FC9900C478FC /* high_lsp_tables.c */; };
- 7388378B0B1937A0005C7A69 /* jitter.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B280907FC9900C478FC /* jitter.c */; };
7388378C0B1937A4005C7A69 /* kiss_fft.c in Sources */ = {isa = PBXBuildFile; fileRef = 7388374B0B193581005C7A69 /* kiss_fft.c */; };
7388378D0B1937A9005C7A69 /* kiss_fftr.c in Sources */ = {isa = PBXBuildFile; fileRef = 7388374D0B193581005C7A69 /* kiss_fftr.c */; };
7388378F0B1937B0005C7A69 /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2B0907FC9900C478FC /* lpc.c */; };
738837900B1937B0005C7A69 /* lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2E0907FC9900C478FC /* lsp.c */; };
738837910B1937B5005C7A69 /* lsp_tables_nb.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */; };
738837920B1937B7005C7A69 /* ltp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B330907FC9900C478FC /* ltp.c */; };
- 738837940B1937BB005C7A69 /* mdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B390907FC9900C478FC /* mdf.c */; };
738837960B1937BE005C7A69 /* modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3D0907FC9900C478FC /* modes.c */; };
738837970B1937C0005C7A69 /* nb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3F0907FC9900C478FC /* nb_celp.c */; };
- 738837980B1937C2005C7A69 /* preprocess.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B410907FC9900C478FC /* preprocess.c */; };
738837990B1937C4005C7A69 /* quant_lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B420907FC9900C478FC /* quant_lsp.c */; };
7388379A0B1937C6005C7A69 /* sb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B440907FC9900C478FC /* sb_celp.c */; };
7388379B0B1937C9005C7A69 /* smallft.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B460907FC9900C478FC /* smallft.c */; };
@@ -118,19 +102,11 @@
089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
32BAE0B70371A74B00C91783 /* Speex_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Speex_Prefix.pch; sourceTree = "<group>"; };
37CA8DEA0DD73333005C8CB6 /* modes_wb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = modes_wb.c; path = ../libspeex/modes_wb.c; sourceTree = SOURCE_ROOT; };
- 37CA8DED0DD73408005C8CB6 /* buffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = buffer.c; path = ../libspeex/buffer.c; sourceTree = SOURCE_ROOT; };
- 37CA8DEE0DD73408005C8CB6 /* resample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = resample.c; path = ../libspeex/resample.c; sourceTree = SOURCE_ROOT; };
- 37CA8DEF0DD73408005C8CB6 /* resample_sse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = resample_sse.h; path = ../libspeex/resample_sse.h; sourceTree = SOURCE_ROOT; };
- 37CA8DF70DD7347D005C8CB6 /* speex_buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = speex_buffer.h; sourceTree = "<group>"; };
- 37CA8DF80DD7347D005C8CB6 /* speex_resampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = speex_resampler.h; sourceTree = "<group>"; };
37CA8DFF0DD7352A005C8CB6 /* os_support.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = os_support.h; path = ../libspeex/os_support.h; sourceTree = SOURCE_ROOT; };
73814AEF0907FB8200C478FC /* speex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex.h; sourceTree = "<group>"; };
73814AF00907FB8200C478FC /* speex_bits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_bits.h; sourceTree = "<group>"; };
73814AF10907FB8200C478FC /* speex_callbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_callbacks.h; sourceTree = "<group>"; };
- 73814AF30907FB8200C478FC /* speex_echo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_echo.h; sourceTree = "<group>"; };
73814AF40907FB8200C478FC /* speex_header.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_header.h; sourceTree = "<group>"; };
- 73814AF50907FB8200C478FC /* speex_jitter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_jitter.h; sourceTree = "<group>"; };
- 73814AF60907FB8200C478FC /* speex_preprocess.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_preprocess.h; sourceTree = "<group>"; };
73814AF70907FB8200C478FC /* speex_stereo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_stereo.h; sourceTree = "<group>"; };
73814AF80907FB8200C478FC /* speex_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_types.h; sourceTree = "<group>"; };
73814B0C0907FC9900C478FC /* arch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = arch.h; path = ../libspeex/arch.h; sourceTree = SOURCE_ROOT; };
@@ -161,7 +137,6 @@
73814B250907FC9900C478FC /* hexc_10_32_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hexc_10_32_table.c; path = ../libspeex/hexc_10_32_table.c; sourceTree = SOURCE_ROOT; };
73814B260907FC9900C478FC /* hexc_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hexc_table.c; path = ../libspeex/hexc_table.c; sourceTree = SOURCE_ROOT; };
73814B270907FC9900C478FC /* high_lsp_tables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = high_lsp_tables.c; path = ../libspeex/high_lsp_tables.c; sourceTree = SOURCE_ROOT; };
- 73814B280907FC9900C478FC /* jitter.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = jitter.c; path = ../libspeex/jitter.c; sourceTree = SOURCE_ROOT; };
73814B2A0907FC9900C478FC /* lpc_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lpc_bfin.h; path = ../libspeex/lpc_bfin.h; sourceTree = SOURCE_ROOT; };
73814B2B0907FC9900C478FC /* lpc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lpc.c; path = ../libspeex/lpc.c; sourceTree = SOURCE_ROOT; };
73814B2C0907FC9900C478FC /* lpc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lpc.h; path = ../libspeex/lpc.h; sourceTree = SOURCE_ROOT; };
@@ -174,13 +149,11 @@
73814B330907FC9900C478FC /* ltp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ltp.c; path = ../libspeex/ltp.c; sourceTree = SOURCE_ROOT; };
73814B340907FC9900C478FC /* ltp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp.h; path = ../libspeex/ltp.h; sourceTree = SOURCE_ROOT; };
73814B380907FC9900C478FC /* math_approx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = math_approx.h; path = ../libspeex/math_approx.h; sourceTree = SOURCE_ROOT; };
- 73814B390907FC9900C478FC /* mdf.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = mdf.c; path = ../libspeex/mdf.c; sourceTree = SOURCE_ROOT; };
73814B3A0907FC9900C478FC /* misc_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = misc_bfin.h; path = ../libspeex/misc_bfin.h; sourceTree = SOURCE_ROOT; };
73814B3D0907FC9900C478FC /* modes.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = modes.c; path = ../libspeex/modes.c; sourceTree = SOURCE_ROOT; };
73814B3E0907FC9900C478FC /* modes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = modes.h; path = ../libspeex/modes.h; sourceTree = SOURCE_ROOT; };
73814B3F0907FC9900C478FC /* nb_celp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = nb_celp.c; path = ../libspeex/nb_celp.c; sourceTree = SOURCE_ROOT; };
73814B400907FC9900C478FC /* nb_celp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = nb_celp.h; path = ../libspeex/nb_celp.h; sourceTree = SOURCE_ROOT; };
- 73814B410907FC9900C478FC /* preprocess.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = preprocess.c; path = ../libspeex/preprocess.c; sourceTree = SOURCE_ROOT; };
73814B420907FC9900C478FC /* quant_lsp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = quant_lsp.c; path = ../libspeex/quant_lsp.c; sourceTree = SOURCE_ROOT; };
73814B430907FC9900C478FC /* quant_lsp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = quant_lsp.h; path = ../libspeex/quant_lsp.h; sourceTree = SOURCE_ROOT; };
73814B440907FC9900C478FC /* sb_celp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sb_celp.c; path = ../libspeex/sb_celp.c; sourceTree = SOURCE_ROOT; };
@@ -283,9 +256,6 @@
isa = PBXGroup;
children = (
37CA8DFF0DD7352A005C8CB6 /* os_support.h */,
- 37CA8DED0DD73408005C8CB6 /* buffer.c */,
- 37CA8DEE0DD73408005C8CB6 /* resample.c */,
- 37CA8DEF0DD73408005C8CB6 /* resample_sse.h */,
37CA8DEA0DD73333005C8CB6 /* modes_wb.c */,
738837460B193581005C7A69 /* _kiss_fft_guts.h */,
738837470B193581005C7A69 /* fftwrap.c */,
@@ -330,7 +300,6 @@
73814B250907FC9900C478FC /* hexc_10_32_table.c */,
73814B260907FC9900C478FC /* hexc_table.c */,
73814B270907FC9900C478FC /* high_lsp_tables.c */,
- 73814B280907FC9900C478FC /* jitter.c */,
73814B2A0907FC9900C478FC /* lpc_bfin.h */,
73814B2B0907FC9900C478FC /* lpc.c */,
73814B2C0907FC9900C478FC /* lpc.h */,
@@ -343,13 +312,11 @@
73814B330907FC9900C478FC /* ltp.c */,
73814B340907FC9900C478FC /* ltp.h */,
73814B380907FC9900C478FC /* math_approx.h */,
- 73814B390907FC9900C478FC /* mdf.c */,
73814B3A0907FC9900C478FC /* misc_bfin.h */,
73814B3D0907FC9900C478FC /* modes.c */,
73814B3E0907FC9900C478FC /* modes.h */,
73814B3F0907FC9900C478FC /* nb_celp.c */,
73814B400907FC9900C478FC /* nb_celp.h */,
- 73814B410907FC9900C478FC /* preprocess.c */,
73814B420907FC9900C478FC /* quant_lsp.c */,
73814B430907FC9900C478FC /* quant_lsp.h */,
73814B440907FC9900C478FC /* sb_celp.c */,
@@ -391,13 +358,8 @@
children = (
73814AEF0907FB8200C478FC /* speex.h */,
73814AF00907FB8200C478FC /* speex_bits.h */,
- 37CA8DF70DD7347D005C8CB6 /* speex_buffer.h */,
73814AF10907FB8200C478FC /* speex_callbacks.h */,
- 73814AF30907FB8200C478FC /* speex_echo.h */,
73814AF40907FB8200C478FC /* speex_header.h */,
- 73814AF50907FB8200C478FC /* speex_jitter.h */,
- 73814AF60907FB8200C478FC /* speex_preprocess.h */,
- 37CA8DF80DD7347D005C8CB6 /* speex_resampler.h */,
73814AF70907FB8200C478FC /* speex_stereo.h */,
73814AF80907FB8200C478FC /* speex_types.h */,
);
@@ -419,10 +381,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- 73814AFF0907FB8200C478FC /* speex_echo.h in Headers */,
73814B000907FB8200C478FC /* speex_header.h in Headers */,
- 73814B010907FB8200C478FC /* speex_jitter.h in Headers */,
- 73814B020907FB8200C478FC /* speex_preprocess.h in Headers */,
73814B030907FB8200C478FC /* speex_stereo.h in Headers */,
73814B040907FB8200C478FC /* speex_types.h in Headers */,
73814B060907FBAB00C478FC /* speex_callbacks.h in Headers */,
@@ -437,9 +396,6 @@
7388375E0B193581005C7A69 /* pseudofloat.h in Headers */,
7388375F0B193581005C7A69 /* quant_lsp_bfin.h in Headers */,
738837610B193581005C7A69 /* vorbis_psy.h in Headers */,
- 37CA8DF60DD73424005C8CB6 /* resample_sse.h in Headers */,
- 37CA8DF90DD7347D005C8CB6 /* speex_buffer.h in Headers */,
- 37CA8DFA0DD7347D005C8CB6 /* speex_resampler.h in Headers */,
37CA8E000DD7352A005C8CB6 /* os_support.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -545,17 +501,14 @@
738837880B193799005C7A69 /* hexc_10_32_table.c in Sources */,
738837890B19379B005C7A69 /* hexc_table.c in Sources */,
7388378A0B19379E005C7A69 /* high_lsp_tables.c in Sources */,
- 7388378B0B1937A0005C7A69 /* jitter.c in Sources */,
7388378C0B1937A4005C7A69 /* kiss_fft.c in Sources */,
7388378D0B1937A9005C7A69 /* kiss_fftr.c in Sources */,
7388378F0B1937B0005C7A69 /* lpc.c in Sources */,
738837900B1937B0005C7A69 /* lsp.c in Sources */,
738837910B1937B5005C7A69 /* lsp_tables_nb.c in Sources */,
738837920B1937B7005C7A69 /* ltp.c in Sources */,
- 738837940B1937BB005C7A69 /* mdf.c in Sources */,
738837960B1937BE005C7A69 /* modes.c in Sources */,
738837970B1937C0005C7A69 /* nb_celp.c in Sources */,
- 738837980B1937C2005C7A69 /* preprocess.c in Sources */,
738837990B1937C4005C7A69 /* quant_lsp.c in Sources */,
7388379A0B1937C6005C7A69 /* sb_celp.c in Sources */,
7388379B0B1937C9005C7A69 /* smallft.c in Sources */,
@@ -568,8 +521,6 @@
738837A20B1937DF005C7A69 /* vq.c in Sources */,
738837A30B1937E1005C7A69 /* window.c in Sources */,
37CA8DEC0DD73333005C8CB6 /* modes_wb.c in Sources */,
- 37CA8DF30DD73408005C8CB6 /* buffer.c in Sources */,
- 37CA8DF40DD73408005C8CB6 /* resample.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -591,14 +542,12 @@
73814B720907FC9900C478FC /* hexc_10_32_table.c in Sources */,
73814B730907FC9900C478FC /* hexc_table.c in Sources */,
73814B740907FC9900C478FC /* high_lsp_tables.c in Sources */,
- 73814B750907FC9900C478FC /* jitter.c in Sources */,
73814B780907FC9900C478FC /* lpc.c in Sources */,
73814B7A0907FC9900C478FC /* lsp_tables_nb.c in Sources */,
73814B7B0907FC9900C478FC /* lsp.c in Sources */,
73814B800907FC9900C478FC /* ltp.c in Sources */,
73814B8A0907FC9900C478FC /* modes.c in Sources */,
73814B8C0907FC9900C478FC /* nb_celp.c in Sources */,
- 73814B8E0907FC9900C478FC /* preprocess.c in Sources */,
73814B8F0907FC9900C478FC /* quant_lsp.c in Sources */,
73814B910907FC9900C478FC /* sb_celp.c in Sources */,
73814B930907FC9900C478FC /* smallft.c in Sources */,
@@ -609,15 +558,12 @@
73814B9F0907FC9900C478FC /* vbr.c in Sources */,
73814BA40907FC9900C478FC /* vq.c in Sources */,
BFF73DD00A78AA170078A4A8 /* window.c in Sources */,
- 738837440B1934D0005C7A69 /* mdf.c in Sources */,
738837550B193581005C7A69 /* fftwrap.c in Sources */,
738837570B193581005C7A69 /* filterbank.c in Sources */,
738837590B193581005C7A69 /* kiss_fft.c in Sources */,
7388375B0B193581005C7A69 /* kiss_fftr.c in Sources */,
738837600B193581005C7A69 /* vorbis_psy.c in Sources */,
37CA8DEB0DD73333005C8CB6 /* modes_wb.c in Sources */,
- 37CA8DF00DD73408005C8CB6 /* buffer.c in Sources */,
- 37CA8DF10DD73408005C8CB6 /* resample.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/macosx/Speex_UB.xcodeproj/project.pbxproj b/macosx/Speex_UB.xcodeproj/project.pbxproj
index 14af035..8d06791 100644
--- a/macosx/Speex_UB.xcodeproj/project.pbxproj
+++ b/macosx/Speex_UB.xcodeproj/project.pbxproj
@@ -7,10 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
- 73814AFF0907FB8200C478FC /* speex_echo.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF30907FB8200C478FC /* speex_echo.h */; settings = {ATTRIBUTES = (Public, ); }; };
73814B000907FB8200C478FC /* speex_header.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF40907FB8200C478FC /* speex_header.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 73814B010907FB8200C478FC /* speex_jitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF50907FB8200C478FC /* speex_jitter.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 73814B020907FB8200C478FC /* speex_preprocess.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF60907FB8200C478FC /* speex_preprocess.h */; settings = {ATTRIBUTES = (Public, ); }; };
73814B030907FB8200C478FC /* speex_stereo.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF70907FB8200C478FC /* speex_stereo.h */; settings = {ATTRIBUTES = (Public, ); }; };
73814B040907FB8200C478FC /* speex_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF80907FB8200C478FC /* speex_types.h */; settings = {ATTRIBUTES = (Public, ); }; };
73814B060907FBAB00C478FC /* speex_callbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 73814AF10907FB8200C478FC /* speex_callbacks.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -30,7 +27,6 @@
73814B720907FC9900C478FC /* hexc_10_32_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B250907FC9900C478FC /* hexc_10_32_table.c */; };
73814B730907FC9900C478FC /* hexc_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B260907FC9900C478FC /* hexc_table.c */; };
73814B740907FC9900C478FC /* high_lsp_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B270907FC9900C478FC /* high_lsp_tables.c */; };
- 73814B750907FC9900C478FC /* jitter.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B280907FC9900C478FC /* jitter.c */; };
73814B760907FC9900C478FC /* lbr_48k_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B290907FC9900C478FC /* lbr_48k_tables.c */; };
73814B780907FC9900C478FC /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2B0907FC9900C478FC /* lpc.c */; };
73814B7A0907FC9900C478FC /* lsp_tables_nb.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B2D0907FC9900C478FC /* lsp_tables_nb.c */; };
@@ -40,7 +36,6 @@
73814B880907FC9900C478FC /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3B0907FC9900C478FC /* misc.c */; };
73814B8A0907FC9900C478FC /* modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3D0907FC9900C478FC /* modes.c */; };
73814B8C0907FC9900C478FC /* nb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B3F0907FC9900C478FC /* nb_celp.c */; };
- 73814B8E0907FC9900C478FC /* preprocess.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B410907FC9900C478FC /* preprocess.c */; };
73814B8F0907FC9900C478FC /* quant_lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B420907FC9900C478FC /* quant_lsp.c */; };
73814B910907FC9900C478FC /* sb_celp.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B440907FC9900C478FC /* sb_celp.c */; };
73814B930907FC9900C478FC /* smallft.c in Sources */ = {isa = PBXBuildFile; fileRef = 73814B460907FC9900C478FC /* smallft.c */; };
@@ -83,10 +78,7 @@
73814AEF0907FB8200C478FC /* speex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex.h; sourceTree = "<group>"; };
73814AF00907FB8200C478FC /* speex_bits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_bits.h; sourceTree = "<group>"; };
73814AF10907FB8200C478FC /* speex_callbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_callbacks.h; sourceTree = "<group>"; };
- 73814AF30907FB8200C478FC /* speex_echo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_echo.h; sourceTree = "<group>"; };
73814AF40907FB8200C478FC /* speex_header.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_header.h; sourceTree = "<group>"; };
- 73814AF50907FB8200C478FC /* speex_jitter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_jitter.h; sourceTree = "<group>"; };
- 73814AF60907FB8200C478FC /* speex_preprocess.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_preprocess.h; sourceTree = "<group>"; };
73814AF70907FB8200C478FC /* speex_stereo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_stereo.h; sourceTree = "<group>"; };
73814AF80907FB8200C478FC /* speex_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = speex_types.h; sourceTree = "<group>"; };
73814B0C0907FC9900C478FC /* arch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = arch.h; path = ../libspeex/arch.h; sourceTree = SOURCE_ROOT; };
@@ -117,7 +109,6 @@
73814B250907FC9900C478FC /* hexc_10_32_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hexc_10_32_table.c; path = ../libspeex/hexc_10_32_table.c; sourceTree = SOURCE_ROOT; };
73814B260907FC9900C478FC /* hexc_table.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hexc_table.c; path = ../libspeex/hexc_table.c; sourceTree = SOURCE_ROOT; };
73814B270907FC9900C478FC /* high_lsp_tables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = high_lsp_tables.c; path = ../libspeex/high_lsp_tables.c; sourceTree = SOURCE_ROOT; };
- 73814B280907FC9900C478FC /* jitter.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = jitter.c; path = ../libspeex/jitter.c; sourceTree = SOURCE_ROOT; };
73814B290907FC9900C478FC /* lbr_48k_tables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lbr_48k_tables.c; path = ../libspeex/lbr_48k_tables.c; sourceTree = SOURCE_ROOT; };
73814B2A0907FC9900C478FC /* lpc_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lpc_bfin.h; path = ../libspeex/lpc_bfin.h; sourceTree = SOURCE_ROOT; };
73814B2B0907FC9900C478FC /* lpc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lpc.c; path = ../libspeex/lpc.c; sourceTree = SOURCE_ROOT; };
@@ -132,7 +123,6 @@
73814B340907FC9900C478FC /* ltp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ltp.h; path = ../libspeex/ltp.h; sourceTree = SOURCE_ROOT; };
73814B370907FC9900C478FC /* math_approx.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = math_approx.c; path = ../libspeex/math_approx.c; sourceTree = SOURCE_ROOT; };
73814B380907FC9900C478FC /* math_approx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = math_approx.h; path = ../libspeex/math_approx.h; sourceTree = SOURCE_ROOT; };
- 73814B390907FC9900C478FC /* mdf.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = mdf.c; path = ../libspeex/mdf.c; sourceTree = SOURCE_ROOT; };
73814B3A0907FC9900C478FC /* misc_bfin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = misc_bfin.h; path = ../libspeex/misc_bfin.h; sourceTree = SOURCE_ROOT; };
73814B3B0907FC9900C478FC /* misc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = misc.c; path = ../libspeex/misc.c; sourceTree = SOURCE_ROOT; };
73814B3C0907FC9900C478FC /* misc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = misc.h; path = ../libspeex/misc.h; sourceTree = SOURCE_ROOT; };
@@ -140,7 +130,6 @@
73814B3E0907FC9900C478FC /* modes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = modes.h; path = ../libspeex/modes.h; sourceTree = SOURCE_ROOT; };
73814B3F0907FC9900C478FC /* nb_celp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = nb_celp.c; path = ../libspeex/nb_celp.c; sourceTree = SOURCE_ROOT; };
73814B400907FC9900C478FC /* nb_celp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = nb_celp.h; path = ../libspeex/nb_celp.h; sourceTree = SOURCE_ROOT; };
- 73814B410907FC9900C478FC /* preprocess.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = preprocess.c; path = ../libspeex/preprocess.c; sourceTree = SOURCE_ROOT; };
73814B420907FC9900C478FC /* quant_lsp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = quant_lsp.c; path = ../libspeex/quant_lsp.c; sourceTree = SOURCE_ROOT; };
73814B430907FC9900C478FC /* quant_lsp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = quant_lsp.h; path = ../libspeex/quant_lsp.h; sourceTree = SOURCE_ROOT; };
73814B440907FC9900C478FC /* sb_celp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sb_celp.c; path = ../libspeex/sb_celp.c; sourceTree = SOURCE_ROOT; };
@@ -246,7 +235,6 @@
73814B250907FC9900C478FC /* hexc_10_32_table.c */,
73814B260907FC9900C478FC /* hexc_table.c */,
73814B270907FC9900C478FC /* high_lsp_tables.c */,
- 73814B280907FC9900C478FC /* jitter.c */,
73814B290907FC9900C478FC /* lbr_48k_tables.c */,
73814B2A0907FC9900C478FC /* lpc_bfin.h */,
73814B2B0907FC9900C478FC /* lpc.c */,
@@ -261,7 +249,6 @@
73814B340907FC9900C478FC /* ltp.h */,
73814B370907FC9900C478FC /* math_approx.c */,
73814B380907FC9900C478FC /* math_approx.h */,
- 73814B390907FC9900C478FC /* mdf.c */,
73814B3A0907FC9900C478FC /* misc_bfin.h */,
73814B3B0907FC9900C478FC /* misc.c */,
73814B3C0907FC9900C478FC /* misc.h */,
@@ -269,7 +256,6 @@
73814B3E0907FC9900C478FC /* modes.h */,
73814B3F0907FC9900C478FC /* nb_celp.c */,
73814B400907FC9900C478FC /* nb_celp.h */,
- 73814B410907FC9900C478FC /* preprocess.c */,
73814B420907FC9900C478FC /* quant_lsp.c */,
73814B430907FC9900C478FC /* quant_lsp.h */,
73814B440907FC9900C478FC /* sb_celp.c */,
@@ -312,10 +298,7 @@
73814AEF0907FB8200C478FC /* speex.h */,
73814AF00907FB8200C478FC /* speex_bits.h */,
73814AF10907FB8200C478FC /* speex_callbacks.h */,
- 73814AF30907FB8200C478FC /* speex_echo.h */,
73814AF40907FB8200C478FC /* speex_header.h */,
- 73814AF50907FB8200C478FC /* speex_jitter.h */,
- 73814AF60907FB8200C478FC /* speex_preprocess.h */,
73814AF70907FB8200C478FC /* speex_stereo.h */,
73814AF80907FB8200C478FC /* speex_types.h */,
);
@@ -330,10 +313,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- 73814AFF0907FB8200C478FC /* speex_echo.h in Headers */,
73814B000907FB8200C478FC /* speex_header.h in Headers */,
- 73814B010907FB8200C478FC /* speex_jitter.h in Headers */,
- 73814B020907FB8200C478FC /* speex_preprocess.h in Headers */,
73814B030907FB8200C478FC /* speex_stereo.h in Headers */,
73814B040907FB8200C478FC /* speex_types.h in Headers */,
73814B060907FBAB00C478FC /* speex_callbacks.h in Headers */,
@@ -440,7 +420,6 @@
73814B720907FC9900C478FC /* hexc_10_32_table.c in Sources */,
73814B730907FC9900C478FC /* hexc_table.c in Sources */,
73814B740907FC9900C478FC /* high_lsp_tables.c in Sources */,
- 73814B750907FC9900C478FC /* jitter.c in Sources */,
73814B760907FC9900C478FC /* lbr_48k_tables.c in Sources */,
73814B780907FC9900C478FC /* lpc.c in Sources */,
73814B7A0907FC9900C478FC /* lsp_tables_nb.c in Sources */,
@@ -450,7 +429,6 @@
73814B880907FC9900C478FC /* misc.c in Sources */,
73814B8A0907FC9900C478FC /* modes.c in Sources */,
73814B8C0907FC9900C478FC /* nb_celp.c in Sources */,
- 73814B8E0907FC9900C478FC /* preprocess.c in Sources */,
73814B8F0907FC9900C478FC /* quant_lsp.c in Sources */,
73814B910907FC9900C478FC /* sb_celp.c in Sources */,
73814B930907FC9900C478FC /* smallft.c in Sources */,
diff --git a/symbian/bld.inf b/symbian/bld.inf
index f03a333..52450e9 100644
--- a/symbian/bld.inf
+++ b/symbian/bld.inf
@@ -35,11 +35,8 @@ PRJ_EXPORTS
..\include\speex\speex_bits.h \epoc32\include\speex\speex_bits.h
..\include\speex\speex_callbacks.h \epoc32\include\speex\speex_callbacks.h
..\include\speex\speex_config_types.h \epoc32\include\speex\speex_config_types.h
-..\include\speex\speex_echo.h \epoc32\include\speex\speex_echo.h
..\include\speex\speex.h \epoc32\include\speex\speex.h
..\include\speex\speex_header.h \epoc32\include\speex\speex_header.h
-..\include\speex\speex_jitter.h \epoc32\include\speex\speex_jitter.h
-..\include\speex\speex_preprocess.h \epoc32\include\speex\speex_preprocess.h
..\include\speex\speex_stereo.h \epoc32\include\speex\speex_stereo.h
..\include\speex\speex_types.h \epoc32\include\speex\speex_types.h
diff --git a/symbian/speex.mmp b/symbian/speex.mmp
index 67b096e..9733168 100644
--- a/symbian/speex.mmp
+++ b/symbian/speex.mmp
@@ -37,9 +37,9 @@ MACRO HAVE_CONFIG_H
SOURCEPATH ..\libspeex
SOURCE bits.c cb_search.c exc_5_64_table.c exc_5_256_table.c exc_8_128_table.c
SOURCE exc_10_16_table.c exc_10_32_table.c exc_20_32_table.c fftwrap.c kiss_fft.c kiss_fftr.c filterbank.c filters.c gain_table.c
-SOURCE gain_table_lbr.c hexc_10_32_table.c hexc_table.c high_lsp_tables.c jitter.c
-SOURCE lbr_48k_tables.c lpc.c lsp.c lsp_tables_nb.c ltp.c math_approx.c mdf.c misc.c
-SOURCE modes.c nb_celp.c preprocess.c quant_lsp.c sb_celp.c smallft.c
+SOURCE gain_table_lbr.c hexc_10_32_table.c hexc_table.c high_lsp_tables.c
+SOURCE lbr_48k_tables.c lpc.c lsp.c lsp_tables_nb.c ltp.c math_approx.c misc.c
+SOURCE modes.c nb_celp.c quant_lsp.c sb_celp.c smallft.c
SOURCE speex.c speex_callbacks.c speex_header.c stereo.c vbr.c vq.c window.c
USERINCLUDE . ..\include\speex
SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\include
diff --git a/tmv/mdf_tm.h b/tmv/mdf_tm.h
deleted file mode 100644
index cc82bf8..0000000
--- a/tmv/mdf_tm.h
+++ /dev/null
@@ -1,1192 +0,0 @@
-/* Copyright (C) 2007 Hong Zhiqian */
-/**
- @file mdf_tm.h
- @author Hong Zhiqian
- @brief Various compatibility routines for Speex (TriMedia 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 <ops/custom_defs.h>
-#include "profile_tm.h"
-
-// shifted power spectrum to fftwrap.c so that optimisation can be shared between mdf.c and preprocess.c
-#define OVERRIDE_POWER_SPECTRUM
-
-#ifdef FIXED_POINT
-
-#else
-
-#define OVERRIDE_FILTER_DC_NOTCH16
-void filter_dc_notch16(
- const spx_int16_t * restrict in,
- float radius,
- float * restrict out,
- int len,
- float * restrict mem
-)
-{
- register int i;
- register float den2, r1;
- register float mem0, mem1;
-
- FILTERDCNOTCH16_START();
-
- r1 = 1 - radius;
- den2 = (radius * radius) + (0.7 * r1 * r1);
- mem0 = mem[0];
- mem1 = mem[1];
-
-#if (TM_UNROLL && TM_UNROLL_FILTERDCNOTCH16)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<len ; ++i )
- {
- register float vin = in[i];
- register float vout = mem0 + vin;
- register float rvout = radius * vout;
-
- mem0 = mem1 + 2 * (-vin + rvout);
- mem1 = vin - (den2 * vout);
-
- out[i] = rvout;
- }
-#if (TM_UNROLL && TM_UNROLL_FILTERDCNOTCH16)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- mem[0] = mem0;
- mem[1] = mem1;
-
- FILTERDCNOTCH16_STOP();
-}
-
-#define OVERRIDE_MDF_INNER_PROD
-float mdf_inner_prod(
- const float * restrict x,
- const float * restrict y,
- int len
-)
-{
- register float sum = 0;
-
- MDFINNERPROD_START();
-
- len >>= 1;
-
-#if (TM_UNROLL && TM_UNROLL_MDFINNERPRODUCT)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- while(len--)
- {
- register float acc0, acc1;
-
- acc0 = (*x++) * (*y++);
- acc1 = (*x++) * (*y++);
-
- sum += acc0 + acc1;
- }
-#if (TM_UNROLL && TM_UNROLL_MDFINNERPRODUCT)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- MDFINNERPROD_STOP();
-
- return sum;
-}
-
-#define OVERRIDE_SPECTRAL_MUL_ACCUM
-void spectral_mul_accum(
- const float * restrict X,
- const float * restrict Y,
- float * restrict acc,
- int N, int M
-)
-{
- register int i, j;
- register float Xi, Yi, Xii, Yii;
- register int _N;
-
- SPECTRALMULACCUM_START();
-
- acc[0] = X[0] * Y[0];
- _N = N-1;
-
- for ( i=1 ; i<_N ; i+=2 )
- {
- Xi = X[i];
- Yi = Y[i];
- Xii = X[i+1];
- Yii = Y[i+1];
-
- acc[i] = (Xi * Yi - Xii * Yii);
- acc[i+1]= (Xii * Yi + Xi * Yii);
- }
-
- acc[_N] = X[_N] * Y[_N];
-
- for ( j=1,X+=N,Y+=N ; j<M ; j++ )
- {
- acc[0] += X[0] * Y[0];
-
- for ( i=1 ; i<N-1 ; i+=2 )
- {
- Xi = X[i];
- Yi = Y[i];
- Xii = X[i+1];
- Yii = Y[i+1];
-
- acc[i] += (Xi * Yi - Xii * Yii);
- acc[i+1]+= (Xii * Yi + Xi * Yii);
- }
-
- acc[_N] += X[_N] * Y[_N];
- X += N;
- Y += N;
- }
-
- SPECTRALMULACCUM_STOP();
-}
-
-#define OVERRIDE_WEIGHTED_SPECTRAL_MUL_CONJ
-void weighted_spectral_mul_conj(
- const float * restrict w,
- const float p,
- const float * restrict X,
- const float * restrict Y,
- float * restrict prod,
- int N
-)
-{
- register int i, j;
- register int _N;
-
- WEIGHTEDSPECTRALMULCONJ_START();
-
- prod[0] = p * w[0] * X[0] * Y[0];
- _N = N-1;
-
- for (i=1,j=1;i<_N;i+=2,j++)
- {
- register float W;
- register float Xi, Yi, Xii, Yii;
-
- Xi = X[i];
- Yi = Y[i];
- Xii = X[i+1];
- Yii = Y[i+1];
- W = p * w[j];
-
-
- prod[i] = W * (Xi * Yi + Xii * Yii);
- prod[i+1]= W * (Xi * Yii - Xii * Yi);
- }
-
- prod[_N] = p * w[j] * X[_N] * Y[_N];
-
- WEIGHTEDSPECTRALMULCONJ_STOP();
-}
-
-#define OVERRIDE_MDF_ADJUST_PROP
-void mdf_adjust_prop(
- const float * restrict W,
- int N,
- int M,
- float * restrict prop
-)
-{
- register int i, j;
- register float max_sum = 1;
- register float prop_sum = 1;
-
- MDFADJUSTPROP_START();
-
- for ( i=0 ; i<M ; ++i )
- {
- register float tmp = 1;
- register int k = i * N;
- register int l = k + N;
- register float propi;
-
-#if (TM_UNROLL && TM_UNROLL_MDFADJUSTPROP)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( j=k ; j<l ; ++j )
- {
- register float wi = W[j];
-
- tmp += wi * wi;
- }
-#if (TM_UNROLL && TM_UNROLL_MDFADJUSTPROP)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- propi = spx_sqrt(tmp);
- prop[i]= propi;
- max_sum= fmux(propi > max_sum, propi, max_sum);
- }
-
- for ( i=0 ; i<M ; ++i )
- {
- register float propi = prop[i];
-
- propi += .1f * max_sum;
- prop_sum += propi;
- prop[i] = propi;
- }
-
- prop_sum = 0.99f / prop_sum;
- for ( i=0 ; i<M ; ++i )
- { prop[i] = prop_sum * prop[i];
- }
-
- MDFADJUSTPROP_STOP();
-}
-
-
-#define OVERRIDE_SPEEX_ECHO_GET_RESIDUAL
-void speex_echo_get_residual(
- SpeexEchoState * restrict st,
- float * restrict residual_echo,
- int len
-)
-{
- register int i;
- register float leak2, leake;
- register int N;
- register float * restrict window;
- register float * restrict last_y;
- register float * restrict y;
-
- SPEEXECHOGETRESIDUAL_START();
-
- window = st->window;
- last_y = st->last_y;
- y = st->y;
- N = st->window_size;
-
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOGETRESIDUAL)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<N;i++)
- { y[i] = window[i] * last_y[i];
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOGETRESIDUAL)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- spx_fft(st->fft_table, st->y, st->Y);
- power_spectrum(st->Y, residual_echo, N);
-
- leake = st->leak_estimate;
- leak2 = fmux(leake > .5, 1, 2 * leake);
- N = st->frame_size;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOGETRESIDUAL)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N ; ++i )
- { residual_echo[i] *= leak2;
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOGETRESIDUAL)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- residual_echo[N] *= leak2;
-
-#ifndef NO_REMARK
- (void)len;
-#endif
-
- SPEEXECHOGETRESIDUAL_STOP();
-}
-#endif
-
-
-void mdf_preemph(
- SpeexEchoState * restrict st,
- spx_word16_t * restrict x,
- const spx_int16_t * restrict far_end,
- int framesize
-)
-{
- register spx_word16_t preemph = st->preemph;
- register spx_word16_t memX = st->memX;
- register spx_word16_t memD = st->memD;
- register spx_word16_t * restrict input = st->input;
- register int i;
-#ifdef FIXED_POINT
- register int saturated = st->saturated;
-#endif
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<framesize ; ++i )
- {
- register spx_int16_t far_endi = far_end[i];
- register spx_word32_t tmp32;
- register spx_word16_t inputi = input[i];
-
- tmp32 = SUB32(EXTEND32(far_endi), EXTEND32(MULT16_16_P15(preemph,memX)));
-
-#ifdef FIXED_POINT
- saturated = mux(iabs(tmp32) > 32767, M+1, saturated);
- tmp32 = iclipi(tmp32,32767);
-#endif
-
- x[i] = EXTRACT16(tmp32);
- memX = far_endi;
- tmp32 = SUB32(EXTEND32(inputi), EXTEND32(MULT16_16_P15(preemph, memD)));
-
-#ifdef FIXED_POINT
- saturated = mux( ((tmp32 > 32767) && (saturated == 0)), 1,
- mux( ((tmp32 <-32767) && (saturated == 0)), 1, saturated ));
- tmp32 = iclipi(tmp32,32767);
-#endif
- memD = inputi;
- input[i] = tmp32;
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- st->memD = memD;
- st->memX = memX;
-
-#ifdef FIXED_POINT
- st->saturated = saturated;
-#endif
-}
-
-void mdf_sub(
- spx_word16_t * restrict dest,
- const spx_word16_t * restrict src1,
- const spx_word16_t * restrict src2,
- int framesize
-)
-{
- register int i;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
-
-#ifdef FIXED_POINT
- for ( i=0,framesize<<=1 ; i<framesize ; i+=4 )
- { register int src1i, src2i, desti;
-
- src1i = ld32d(src1,i);
- src2i = ld32d(src2,i);
- desti = dspidualsub(src1i,src2i);
- st32d(i, dest, desti);
- }
-#else
- for ( i=0 ; i<framesize ; ++i )
- { dest[i] = src1[i] - src2[i];
- }
-#endif
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-}
-
-void mdf_sub_int(
- spx_word16_t * restrict dest,
- const spx_int16_t * restrict src1,
- const spx_int16_t * restrict src2,
- int framesize
-)
-{
- register int i, j;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
-
-#ifdef FIXED_POINT
- for ( i=0,framesize<<=1 ; i<framesize ; i+=4 )
- { register int src1i, src2i, desti;
-
- src1i = ld32d(src1,i);
- src2i = ld32d(src2,i);
- desti = dspidualsub(src1i,src2i);
- st32d(i, dest, desti);
- }
-#else
- for ( i=0,j=0 ; i<framesize ; i+=2,++j )
- { register int src1i, src2i, desti;
-
-
- src1i = ld32d(src1,j);
- src2i = ld32d(src2,j);
- desti = dspidualsub(src1i,src2i);
-
- dest[i] = sex16(desti);
- dest[i+1] = asri(16,desti);
- }
-#endif
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-}
-
-void mdf_compute_weight_gradient(
- SpeexEchoState * restrict st,
- spx_word16_t * restrict X,
- int N,
- int M
-)
-{
- register int i, j;
- register spx_word32_t * restrict PHI = st->PHI;
-
- for (j=M-1;j>=0;j--)
- {
- register spx_word32_t * restrict W = &(st->W[j*N]);
-
- weighted_spectral_mul_conj(
- st->power_1,
- FLOAT_SHL(PSEUDOFLOAT(st->prop[j]),-15),
- &X[(j+1)*N],
- st->E,
- st->PHI,
- N);
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<N;i++)
- { W[i] = ADD32(W[i],PHI[i]);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- }
-}
-
-void mdf_update_weight(
- SpeexEchoState * restrict st,
- int N,
- int M,
- int framesize
-)
-{
- register int j;
- register int cancel_count = st->cancel_count;
- register spx_word16_t * restrict wtmp = st->wtmp;
-#ifdef FIXED_POINT
- register spx_word16_t * restrict wtmp2 = st->wtmp2;
- register int i;
-#endif
-
- for ( j=0 ; j<M ; j++ )
- {
- register spx_word32_t * restrict W = &(st->W[j*N]);
-
- if (j==0 || cancel_count%(M-1) == j-1)
- {
-#ifdef FIXED_POINT
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N ; i++ )
- wtmp2[i] = EXTRACT16(PSHR32(W[i],NORMALIZE_SCALEDOWN+16));
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- spx_ifft(st->fft_table, wtmp2, wtmp);
- memset(wtmp, 0, framesize * sizeof(spx_word16_t));
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (j=framesize; j<N ; ++j)
- { wtmp[j]=SHL16(wtmp[j],NORMALIZE_SCALEUP);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- spx_fft(st->fft_table, wtmp, wtmp2);
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<N;i++)
- { W[i] -= SHL32(EXTEND32(wtmp2[i]),16+NORMALIZE_SCALEDOWN-NORMALIZE_SCALEUP-1);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
-#else
- spx_ifft(st->fft_table, W, wtmp);
- memset(&wtmp[framesize], 0, (N-framesize) * sizeof(spx_word16_t));
- spx_fft(st->fft_table, wtmp, W);
-#endif
- }
- }
-}
-
-#ifdef TWO_PATH
-// first four parameters is passed by registers
-// generate faster performance with 4 parameters functions
-spx_word32_t mdf_update_foreground(
- SpeexEchoState * restrict st,
- spx_word32_t Dbf,
- spx_word32_t Sff,
- spx_word32_t See
-)
-{
- register spx_word32_t Davg1 = st->Davg1;
- register spx_word32_t Davg2 = st->Davg2;
- register spx_word32_t Dvar1 = st->Dvar1;
- register spx_word32_t Dvar2 = st->Dvar2;
- register spx_word16_t * restrict input = st->input;
- register int framesize = st->frame_size;
- register spx_word16_t * restrict xx = st->x + framesize;
- register spx_word16_t * restrict y = st->y + framesize;
- register spx_word16_t * restrict ee = st->e + framesize;
- register int update_foreground;
- register int i;
- register int N = st->window_size;
- register int M = st->M;
-
-#ifdef FIXED_POINT
- register spx_word32_t sc0 = SUB32(Sff,See);
- register spx_float_t sc1 = FLOAT_MUL32U(Sff,Dbf);
-
- Davg1 = ADD32(MULT16_32_Q15(QCONST16(.6f,15),Davg1), MULT16_32_Q15(QCONST16(.4f,15),sc0));
- Davg2 = ADD32(MULT16_32_Q15(QCONST16(.85f,15),Davg2), MULT16_32_Q15(QCONST16(.15f,15),sc0));
- Dvar1 = FLOAT_ADD(
- FLOAT_MULT(VAR1_SMOOTH,Dvar1),
- FLOAT_MUL32U(MULT16_32_Q15(QCONST16(.4f,15),Sff),
- MULT16_32_Q15(QCONST16(.4f,15),Dbf)));
- Dvar2 = FLOAT_ADD(
- FLOAT_MULT(VAR2_SMOOTH,Dvar2),
- FLOAT_MUL32U(MULT16_32_Q15(QCONST16(.15f,15),Sff),
- MULT16_32_Q15(QCONST16(.15f,15),Dbf)));
-#else
- register spx_word32_t sc0 = Sff - See;
- register spx_word32_t sc1 = Sff * Dbf;
-
- Davg1 = .6*Davg1 + .4*sc0;
- Davg2 = .85*Davg2 + .15*sc0;
- Dvar1 = VAR1_SMOOTH*Dvar1 + .16*sc1;
- Dvar2 = VAR2_SMOOTH*Dvar2 + .0225*sc1;
-#endif
-
- update_foreground =
- mux( FLOAT_GT(FLOAT_MUL32U(sc0, VABS(sc0)), sc1), 1,
- mux( FLOAT_GT(FLOAT_MUL32U(Davg1, VABS(Davg1)), FLOAT_MULT(VAR1_UPDATE,(Dvar1))), 1,
- mux( FLOAT_GT(FLOAT_MUL32U(Davg2, VABS(Davg2)), FLOAT_MULT(VAR2_UPDATE,(Dvar2))), 1, 0)));
-
- if ( update_foreground )
- {
- register spx_word16_t * restrict windowf = st->window + framesize;
- register spx_word16_t * restrict window = st->window;
-
- st->Davg1 = st->Davg2 = 0;
- st->Dvar1 = st->Dvar2 = FLOAT_ZERO;
-
- memcpy(st->foreground, st->W, N*M*sizeof(spx_word32_t));
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<framesize ; ++i)
- { register spx_word16_t wi = window[i];
- register spx_word16_t wfi = windowf[i];
- register spx_word16_t ei = ee[i];
- register spx_word16_t yi = y[i];
-
- ee[i] = MULT16_16_Q15(wfi,ei) + MULT16_16_Q15(wi,yi);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- } else
- {
- register int reset_background;
-
- reset_background =
- mux( FLOAT_GT(FLOAT_MUL32U(-(sc0),VABS(sc0)), FLOAT_MULT(VAR_BACKTRACK,sc1)), 1,
- mux( FLOAT_GT(FLOAT_MUL32U(-(Davg1), VABS(Davg1)), FLOAT_MULT(VAR_BACKTRACK,Dvar1)), 1,
- mux( FLOAT_GT(FLOAT_MUL32U(-(Davg2), VABS(Davg2)), FLOAT_MULT(VAR_BACKTRACK,Dvar2)), 1, 0)));
-
- if ( reset_background )
- {
- memcpy(st->W, st->foreground, N*M*sizeof(spx_word32_t));
- memcpy(y, ee, framesize * sizeof(spx_word16_t));
- mdf_sub(xx,input,y,framesize);
- See = Sff;
- st->Davg1 = st->Davg2 = 0;
- st->Dvar1 = st->Dvar2 = FLOAT_ZERO;
- } else
- {
- st->Davg1 = Davg1;
- st->Davg2 = Davg2;
- st->Dvar1 = Dvar1;
- st->Dvar2 = Dvar2;
- }
- }
-
- return See;
-}
-#endif
-
-void mdf_compute_error_signal(
- SpeexEchoState * restrict st,
- const spx_int16_t * restrict in,
- spx_int16_t * restrict out,
- int framesize
-)
-{
- register spx_word16_t preemph = st->preemph;
- register spx_word16_t memE = st->memE;
- register int saturated = st->saturated;
- register spx_word16_t * restrict e = st->e;
- register spx_word16_t * restrict ee = st->e + framesize;
- register spx_word16_t * restrict input = st->input;
- register spx_word16_t * restrict xx = st->x + framesize;
- register int i;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<framesize ; ++i )
- {
- register spx_word32_t tmp_out;
- register spx_int16_t ini = in[i];
- register int flg;
-
-#ifdef FIXED_POINT
-
-#ifdef TWO_PATH
- tmp_out = SUB32(EXTEND32(input[i]), EXTEND32(ee[i]));
- tmp_out = iclipi(tmp_out,32767);
-#else
- tmp_out = SUB32(EXTEND32(input[i]), EXTEND32(y[i]));
- tmp_out = iclipi(tmp_out,32767);
-#endif
-
-#else
-#ifdef TWO_PATH
- tmp_out = SUB32(EXTEND32(input[i]), EXTEND32(ee[i]));
-#else
- tmp_out = SUB32(EXTEND32(input[i]), EXTEND32(y[i]));
-#endif
- tmp_out =
- fmux( tmp_out > 32767, 32767,
- fmux( tmp_out < -32768, -32768, tmp_out));
-#endif
-
- tmp_out = ADD32(tmp_out, EXTEND32(MULT16_16_P15(preemph,memE)));
- flg = iabs(ini) >= 32000;
- tmp_out = VMUX( flg, 0, tmp_out);
- saturated = mux( flg && (saturated == 0), 1, saturated);
-
- out[i] = (spx_int16_t)tmp_out;
- memE = tmp_out;
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- st->memE = memE;
- st->saturated = saturated;
- memset(e, 0, framesize * sizeof(spx_word16_t));
- memcpy(ee, xx, framesize * sizeof(spx_word16_t));
-}
-
-inline int mdf_check(
- SpeexEchoState * restrict st,
- spx_int16_t * out,
- spx_word32_t Syy,
- spx_word32_t Sxx,
- spx_word32_t See,
- spx_word32_t Sff,
- spx_word32_t Sdd
-)
-{
- register int N = st->window_size;
- register spx_word32_t N1e9 = N * 1e9;
- register int screwed_up = st->screwed_up;
- register int framesize = st->frame_size;
-
- if (!(Syy>=0 && Sxx>=0 && See >= 0)
-#ifndef FIXED_POINT
- || !(Sff < N1e9 && Syy < N1e9 && Sxx < N1e9 )
-#endif
- )
- {
- screwed_up += 50;
- memset(out, 0, framesize * sizeof(spx_int16_t));
-
- } else
- { screwed_up = mux( SHR32(Sff, 2) > ADD32(Sdd, SHR32(MULT16_16(N, 10000),6)), screwed_up+1, 0);
- }
-
- st->screwed_up = screwed_up;
-
- return screwed_up;
-}
-
-void mdf_smooth(
- spx_word32_t * restrict power,
- spx_word32_t * restrict Xf,
- int framesize,
- int M
-)
-{
- register spx_word16_t ss, ss_1, pf, xff;
- register int j;
-
-#ifdef FIXED_POINT
- ss=DIV32_16(11469,M);
- ss_1 = SUB16(32767,ss);
-#else
- ss=.35/M;
- ss_1 = 1-ss;
-#endif
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( j=0 ; j<framesize ; ++j )
- { register spx_word32_t pi = power[j];
- register spx_word32_t xfi = Xf[j];
-
- power[j] = MULT16_32_Q15(ss_1,pi) + 1 + MULT16_32_Q15(ss,xfi);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- pf = power[framesize];
- xff = Xf[framesize];
- power[framesize] = MULT16_32_Q15(ss_1,pf) + 1 + MULT16_32_Q15(ss,xff);
-}
-
-void mdf_compute_filtered_spectra_crosscorrelations(
- SpeexEchoState * restrict st,
- spx_word32_t Syy,
- spx_word32_t See,
- int framesize
-)
-{
- register spx_float_t Pey = FLOAT_ONE;
- register spx_float_t Pyy = FLOAT_ONE;
- register spx_word16_t spec_average = st->spec_average;
- register spx_word32_t * restrict pRf = st->Rf;
- register spx_word32_t * restrict pYf = st->Yf;
- register spx_word32_t * restrict pEh = st->Eh;
- register spx_word32_t * restrict pYh = st->Yh;
- register spx_word16_t beta0 = st->beta0;
- register spx_word16_t beta_max = st->beta_max;
- register spx_float_t alpha, alpha_1;
- register spx_word32_t tmp32, tmpx;
- register spx_float_t sPey = st->Pey;
- register spx_float_t sPyy = st->Pyy;
- register spx_float_t tmp;
- register spx_word16_t leak_estimate;
- register int j;
- register spx_float_t Eh, Yh;
- register spx_word32_t _Ehj, _Rfj, _Yfj, _Yhj;
-
-#ifdef FIXED_POINT
- register spx_word16_t spec_average1 = SUB16(32767,spec_average);
-#else
- register spx_word16_t spec_average1 = 1 - spec_average;
-#endif
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (j=framesize; j>0 ; --j)
- {
- _Ehj = pEh[j];
- _Rfj = pRf[j];
- _Yfj = pYf[j];
- _Yhj = pYh[j];
-
- Eh = PSEUDOFLOAT(_Rfj - _Ehj);
- Yh = PSEUDOFLOAT(_Yfj - _Yhj);
-
- Pey = FLOAT_ADD(Pey,FLOAT_MULT(Eh,Yh));
- Pyy = FLOAT_ADD(Pyy,FLOAT_MULT(Yh,Yh));
-
- pEh[j] = MAC16_32_Q15(MULT16_32_Q15(spec_average1, _Ehj), spec_average, _Rfj);
- pYh[j] = MAC16_32_Q15(MULT16_32_Q15(spec_average1, _Yhj), spec_average, _Yfj);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- _Ehj = pEh[0];
- _Rfj = pRf[0];
- _Yfj = pYf[0];
- _Yhj = pYh[0];
-
- Eh = PSEUDOFLOAT(_Rfj - _Ehj);
- Yh = PSEUDOFLOAT(_Yfj - _Yhj);
-
- Pey = FLOAT_ADD(Pey,FLOAT_MULT(Eh,Yh));
- Pyy = FLOAT_ADD(Pyy,FLOAT_MULT(Yh,Yh));
-
- pEh[0] = MAC16_32_Q15(MULT16_32_Q15(spec_average1, _Ehj), spec_average, _Rfj);
- pYh[0] = MAC16_32_Q15(MULT16_32_Q15(spec_average1, _Yhj), spec_average, _Yfj);
-
- Pyy = FLOAT_SQRT(Pyy);
- Pey = FLOAT_DIVU(Pey,Pyy);
-
- tmp32 = MULT16_32_Q15(beta0,Syy);
- tmpx = MULT16_32_Q15(beta_max,See);
- tmp32 = VMUX(tmp32 > tmpx, tmpx, tmp32);
- alpha = FLOAT_DIV32(tmp32, See);
- alpha_1 = FLOAT_SUB(FLOAT_ONE, alpha);
-
- sPey = FLOAT_ADD(FLOAT_MULT(alpha_1,sPey) , FLOAT_MULT(alpha,Pey));
- sPyy = FLOAT_ADD(FLOAT_MULT(alpha_1,sPyy) , FLOAT_MULT(alpha,Pyy));
- tmp = FLOAT_MULT(MIN_LEAK,sPyy);
-
-#ifndef FIXED_POINT
- sPyy = VMUX(FLOAT_LT(sPyy, FLOAT_ONE), FLOAT_ONE, sPyy);
- sPey = VMUX(FLOAT_LT(sPey, tmp), tmp, sPey);
- sPey = VMUX(FLOAT_LT(sPey, sPyy), sPey, sPyy);
-#else
- sPyy = FLOAT_LT(sPyy, FLOAT_ONE) ? FLOAT_ONE : sPyy;
- sPey = FLOAT_LT(sPey, tmp) ? tmp : sPey;
- sPey = FLOAT_LT(sPey, sPyy) ? sPey : sPyy;
-#endif
-
- leak_estimate = FLOAT_EXTRACT16(FLOAT_SHL(FLOAT_DIVU(sPey, sPyy),14));
-
- leak_estimate = VMUX( leak_estimate > 16383, 32767, SHL16(leak_estimate,1));
- st->Pey = sPey;
- st->Pyy = sPyy;
- st->leak_estimate = leak_estimate;
-}
-
-inline spx_word16_t mdf_compute_RER(
- spx_word32_t See,
- spx_word32_t Syy,
- spx_word32_t Sey,
- spx_word32_t Sxx,
- spx_word16_t leake
-)
-{
- register spx_word16_t RER;
-
-#ifdef FIXED_POINT
- register spx_word32_t tmp32;
- register spx_word32_t tmp;
- spx_float_t bound = PSEUDOFLOAT(Sey);
-
- tmp32 = MULT16_32_Q15(leake,Syy);
- tmp32 = ADD32(SHR32(Sxx,13), ADD32(tmp32, SHL32(tmp32,1)));
-
- bound = FLOAT_DIVU(FLOAT_MULT(bound, bound), PSEUDOFLOAT(ADD32(1,Syy)));
- tmp = FLOAT_EXTRACT32(bound);
- tmp32 = imux( FLOAT_GT(bound, PSEUDOFLOAT(See)), See,
- imux( tmp32 < tmp, tmp, tmp32));
-
- tmp = SHR32(See,1);
- tmp32 = imux(tmp32 > tmp, tmp, tmp32);
- RER = FLOAT_EXTRACT16(FLOAT_SHL(FLOAT_DIV32(tmp32,See),15));
-#else
- register spx_word32_t r0;
-
- r0 = (Sey * Sey)/(1 + See * Syy);
-
- RER = (.0001*Sxx + 3.* MULT16_32_Q15(leake,Syy)) / See;
- RER = fmux( RER < r0, r0, RER);
- RER = fmux( RER > .5, .5, RER);
-#endif
-
- return RER;
-}
-
-void mdf_adapt(
- SpeexEchoState * restrict st,
- spx_word16_t RER,
- spx_word32_t Syy,
- spx_word32_t See,
- spx_word32_t Sxx
-)
-{
- register spx_float_t * restrict power_1 = st->power_1;
- register spx_word32_t * restrict power = st->power;
- register int adapted = st->adapted;
- register spx_word32_t sum_adapt = st->sum_adapt;
- register spx_word16_t leake = st->leak_estimate;
- register int framesize = st->frame_size;
- register int i;
- register int M = st->M;
-
- adapted = mux( !adapted && sum_adapt > QCONST32(M,15) &&
- MULT16_32_Q15(leake,Syy) > MULT16_32_Q15(QCONST16(.03f,15),Syy), 1, adapted);
-
- if ( adapted )
- { register spx_word32_t * restrict Yf = st->Yf;
- register spx_word32_t * restrict Rf = st->Rf;
- register spx_word32_t r, e, e2;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<framesize ; ++i )
- {
- r = SHL32(Yf[i],3);
- r = MULT16_32_Q15(leake,r);
- e = SHL32(Rf[i],3)+1;
-
-#ifdef FIXED_POINT
- e2 = SHR32(e,1);
- r = mux( r > e2, e2, r);
-#else
- e2 = e * .5;
- r = fmux( r > e2, e2, r);
-#endif
-
- r = MULT16_32_Q15(QCONST16(.7,15),r) +
- MULT16_32_Q15(QCONST16(.3,15),(spx_word32_t)(MULT16_32_Q15(RER,e)));
-
- power_1[i] = FLOAT_SHL(FLOAT_DIV32_FLOAT(r,FLOAT_MUL32U(e,power[i]+10)),WEIGHT_SHIFT+16);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- r = SHL32(Yf[framesize],3);
- r = MULT16_32_Q15(leake,r);
- e = SHL32(Rf[framesize],3)+1;
-
-#ifdef FIXED_POINT
- e2 = SHR32(e,1);
- r = mux( r > e2, e2, r);
-#else
- e2 = e * .5;
- r = fmux( r > e2, e2, r);
-#endif
-
- r = MULT16_32_Q15(QCONST16(.7,15),r) +
- MULT16_32_Q15(QCONST16(.3,15),(spx_word32_t)(MULT16_32_Q15(RER,e)));
-
- power_1[framesize] = FLOAT_SHL(FLOAT_DIV32_FLOAT(r,FLOAT_MUL32U(e,power[framesize]+10)),WEIGHT_SHIFT+16);
-
- } else
- {
- register spx_word16_t adapt_rate=0;
- register int N = st->window_size;
-
- if ( Sxx > SHR32(MULT16_16(N, 1000),6) )
- { register spx_word32_t tmp32, tmp32q;
-
- tmp32 = MULT16_32_Q15(QCONST16(.25f, 15), Sxx);
-#ifdef FIXED_POINT
- tmp32q = SHR32(See,2);
- tmp32 = mux(tmp32 > tmp32q, tmp32q, tmp32);
-#else
- tmp32q = 0.25 * See;
- tmp32 = fmux(tmp32 > tmp32q, tmp32q, tmp32);
-#endif
- adapt_rate = FLOAT_EXTRACT16(FLOAT_SHL(FLOAT_DIV32(tmp32, See),15));
- }
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<framesize;i++)
- power_1[i] = FLOAT_SHL(FLOAT_DIV32(EXTEND32(adapt_rate),ADD32(power[i],10)),WEIGHT_SHIFT+1);
-#if (TM_UNROLL && TM_UNROLL_SPEEXECHOCANCELLATION)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- power_1[framesize] = FLOAT_SHL(FLOAT_DIV32(EXTEND32(adapt_rate),ADD32(power[framesize],10)),WEIGHT_SHIFT+1);
- sum_adapt = ADD32(sum_adapt,adapt_rate);
- }
-
- st->sum_adapt = sum_adapt;
- st->adapted = adapted;
-}
-
-#define OVERRIDE_ECHO_CANCELLATION
-void speex_echo_cancellation(
- SpeexEchoState * restrict st,
- const spx_int16_t * restrict in,
- const spx_int16_t * restrict far_end,
- spx_int16_t * restrict out
-)
-{
- register int framesize = st->frame_size;
- register spx_word16_t * restrict x = st->x;
- register spx_word16_t * restrict xx = st->x + framesize;
- register spx_word16_t * restrict yy = st->y + framesize;
- register spx_word16_t * restrict ee = st->e + framesize;
- register spx_word32_t Syy, See, Sxx, Sdd, Sff;
- register spx_word16_t RER;
- register spx_word32_t Sey;
- register int j;
- register int N,M;
-#ifdef TWO_PATH
- register spx_word32_t Dbf;
-#endif
-
- N = st->window_size;
- M = st->M;
- st->cancel_count++;
-
- filter_dc_notch16(in, st->notch_radius, st->input, framesize, st->notch_mem);
- mdf_preemph(st, xx, far_end, framesize);
-
- {
-
- register spx_word16_t * restrict X = st->X;
-
- for ( j=M-1 ; j>=0 ; j-- )
- { register spx_word16_t * restrict Xdes = &(X[(j+1)*N]);
- register spx_word16_t * restrict Xsrc = &(X[j*N]);
-
- memcpy(Xdes, Xsrc, N * sizeof(spx_word16_t));
- }
-
- spx_fft(st->fft_table, x, X);
- memcpy(st->last_y, st->x, N * sizeof(spx_word16_t));
- Sxx = mdf_inner_prod(xx, xx, framesize);
- memcpy(x, xx, framesize * sizeof(spx_word16_t));
-
-#ifdef TWO_PATH
- spectral_mul_accum(st->X, st->foreground, st->Y, N, M);
- spx_ifft(st->fft_table, st->Y, st->e);
- mdf_sub(xx, st->input, ee, framesize);
- Sff = mdf_inner_prod(xx, xx, framesize);
-#endif
-
- mdf_adjust_prop (st->W, N, M, st->prop);
-
- if (st->saturated == 0)
- { mdf_compute_weight_gradient(st, X, N, M);
- } else
- { st->saturated--;
- }
- }
-
- mdf_update_weight(st, N, M, framesize);
- spectral_mul_accum(st->X, st->W, st->Y, N, M);
- spx_ifft(st->fft_table, st->Y, st->y);
-
-#ifdef TWO_PATH
- mdf_sub(xx, ee, yy, framesize);
- Dbf = 10+mdf_inner_prod(xx, xx, framesize);
-#endif
-
- mdf_sub(xx, st->input, yy, framesize);
- See = mdf_inner_prod(xx, xx, framesize);
-
-#ifndef TWO_PATH
- Sff = See;
-#else
- See = mdf_update_foreground(st,Dbf,Sff,See);
-#endif
-
-
- mdf_compute_error_signal(st, in, out, framesize);
- Sey = mdf_inner_prod(ee, yy, framesize);
- Syy = mdf_inner_prod(yy, yy, framesize);
- Sdd = mdf_inner_prod(st->input, st->input, framesize);
-
- if ( mdf_check(st,out,Syy,Sxx,See,Sff,Sdd) >= 50 )
- { speex_warning("The echo canceller started acting funny and got slapped (reset). It swears it will behave now.");
- speex_echo_state_reset(st);
- return;
- }
-
- See = MAX32(See, SHR32(MULT16_16(N, 100),6));
- spx_fft(st->fft_table, st->e, st->E);
- memset(st->y, 0, framesize * sizeof(spx_word16_t));
- spx_fft(st->fft_table, st->y, st->Y);
- power_spectrum(st->E, st->Rf, N);
- power_spectrum(st->Y, st->Yf, N);
- power_spectrum(st->X, st->Xf, N);
-
- mdf_smooth(st->power,st->Xf,framesize, M);
- mdf_compute_filtered_spectra_crosscorrelations(st,Syy,See,framesize);
- RER = mdf_compute_RER(See,Syy,Sey,Sxx,st->leak_estimate);
- mdf_adapt(st, RER, Syy, See, Sxx);
-
- if ( st->adapted )
- { register spx_word16_t * restrict last_yy = st->last_y + framesize;
-
- memcpy(st->last_y, last_yy, framesize * sizeof(spx_word16_t));
- mdf_sub_int(last_yy, in, out, framesize);
-
- }
-}
-
-
-
diff --git a/tmv/preprocess_tm.h b/tmv/preprocess_tm.h
deleted file mode 100644
index f903b73..0000000
--- a/tmv/preprocess_tm.h
+++ /dev/null
@@ -1,1135 +0,0 @@
-/* Copyright (C) 2007 Hong Zhiqian */
-/**
- @file preprocess_tm.h
- @author Hong Zhiqian
- @brief Various compatibility routines for Speex (TriMedia 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 <ops/custom_defs.h>
-#include "profile_tm.h"
-
-#ifdef FIXED_POINT
-#define OVERRIDE_PREPROCESS_ANALYSIS
-static void preprocess_analysis(SpeexPreprocessState * restrict st, spx_int16_t * restrict x)
-{
- register int i, j, framesize = st->frame_size;
- register int N = st->ps_size;
- register int N3 = 2*N - framesize;
- register int N4 = framesize - N3;
- register int * restrict ps = st->ps;
- register int * restrict frame;
- register int * restrict inbuf;
- register int * restrict ptr;
- register int max_val;
-
- frame = (int*)(st->frame);
- inbuf = (int*)(st->inbuf);
- ptr = (int*)(st->frame+N3);
-
- TMDEBUG_ALIGNMEM(x);
- TMDEBUG_ALIGNMEM(frame);
- TMDEBUG_ALIGNMEM(inbuf);
-
- PREPROCESSANAYLSIS_START();
-
- N3 >>= 1;
- framesize >>= 1;
- max_val = 0;
-
- for ( i=0,j=0 ; i<N3 ; i+=2,j+=8 )
- { register int r1, r2;
-
- r1 = ld32x(inbuf,i);
- r2 = ld32x(inbuf,i+1);
-
- st32d(j, frame, r1);
- st32d(j+4, frame, r2);
- }
-
- for ( i=0,j=0 ; i<framesize ; i+=2,j+=8 )
- { register int r1, r2;
-
- r1 = ld32x(x, i);
- r2 = ld32x(x, i+1);
-
- st32d(j, ptr, r1);
- st32d(j+4,ptr, r2);
- }
-
- for ( i=0,j=0,ptr=(int*)(x+N4) ; i<N3 ; i+=2,j+=8 )
- { register int r1, r2;
-
- r1 = ld32x(ptr, i);
- r2 = ld32x(ptr, i+1);
-
- st32d(j, inbuf, r1);
- st32d(j+4,inbuf, r2);
- }
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unroll=2
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0,j=0,ptr=(int*)st->window ; i<N ; ++i,j+=4 )
- { register int f10, w10, r0, r1;
-
- f10 = ld32x(frame, i);
- w10 = ld32x(ptr, i);
-
- r0 = (sex16(f10) * sex16(w10)) >> 15;
- r1 = (asri(16,f10) * asri(16,w10)) >> 15;
-
- max_val = imax(iabs(sex16(r0)), max_val);
- max_val = imax(iabs(sex16(r1)), max_val);
-
- r0 = pack16lsb(r1, r0);
- st32d(j, frame, r0);
- }
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- max_val = 14 - spx_ilog2(max_val);
- st->frame_shift = max_val;
-
- if ( max_val != 0 )
- {
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0,j=0 ; i<N ; ++i,j+=4 )
- { register int f10;
-
- f10 = ld32x(frame, i);
- f10 = dualasl(f10, max_val);
- st32d(j, frame, f10);
-
- }
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- }
-
- spx_fft(st->fft_lookup, st->frame, st->ft);
- power_spectrum(st->ft, ps, N << 1);
-
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0,ptr=(int*)st->ps,max_val<<=1,j=((1<<((max_val))>>1)) ;i<N ; ++i )
- {
- ps[i] = (ps[i] + j) >> max_val;
- }
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- filterbank_compute_bank32(st->bank, ps, ps+N);
-
- PREPROCESSANAYLSIS_STOP();
-}
-
-#define _MULT16_32_Q15(a,b,c) ADD32(MULT16_16((a),(b)), SHR(MULT16_16((a),(c)),15))
-
-#define OVERRIDE_UPDATE_NOISE_PROB
-static void update_noise_prob(SpeexPreprocessState * restrict st)
-{
- register int i;
- register int min_range, nb_adapt;
- register int N = st->ps_size;
- register int * restrict Smin = (int*)st->Smin;
- register int * restrict Stmp = (int*)st->Stmp;
- register int * restrict S = (int*)st->S;
-
- UPDATENOISEPROB_START();
-
- {
- register int psi_lsb, psi_msb, ips_lsb, ips_msb, psii_lsb, psii_msb;
- register int psiii_lsb, psiii_msb;
- register int q8, q05, q2, q1;
- register int *ps = (int*)st->ps;
- register int si_lsb, si_msb, sii_lsb, sii_msb;
-
- q8 = QCONST16(.8f,15);
- q05 = QCONST16(.05f,15);
- q2 = QCONST16(.2f,15);
- q1 = QCONST16(.1f,15);
-
- ips_lsb = ps[0];
- psi_lsb = ps[1];
- si_lsb = S[0];
- ips_msb = ips_lsb >> 15;
- psi_msb = psi_lsb >> 15;
- si_msb = si_lsb >> 15;
-
- ips_lsb &= 0x00007fff;
- psi_lsb &= 0x00007fff;
- si_lsb &= 0x00007fff;
-
- S[0] = _MULT16_32_Q15(q8,si_msb,si_lsb) + _MULT16_32_Q15(q2,ips_msb,ips_lsb);
-
- for ( i=1 ; i<N-1 ; i+=2 )
- {
- psii_lsb = ps[i+1];
- si_lsb = S[i];
-
- psii_msb = psii_lsb >> 15;
- si_msb = si_lsb >> 15;
- si_lsb &= 0x00007fff;
- psii_lsb &= 0x00007fff;
-
- S[i]= _MULT16_32_Q15(q8,si_msb,si_lsb) +
- _MULT16_32_Q15(q05,ips_msb,ips_lsb) +
- _MULT16_32_Q15(q1,psi_msb,psi_lsb) +
- _MULT16_32_Q15(q05,psii_msb,psii_lsb);
-
- psiii_lsb = ps[i+2];
- sii_lsb = S[i+1];
-
- sii_msb = sii_lsb >> 15;
- psiii_msb= psiii_lsb >> 15;
- sii_lsb &= 0x00007fff;
- psiii_lsb&= 0x00007fff;
-
- S[i+1]= _MULT16_32_Q15(q8,sii_msb,sii_lsb) +
- _MULT16_32_Q15(q05,psi_msb,psi_lsb) +
- _MULT16_32_Q15(q1,psii_msb,psii_lsb) +
- _MULT16_32_Q15(q05,psiii_msb,psiii_lsb);
-
- ips_lsb = psii_lsb;
- ips_msb = psii_msb;
- psi_lsb = psiii_lsb;
- psi_msb = psiii_msb;
- }
-
- S[N-1] = MULT16_32_Q15(q8,S[N-1]) + MULT16_32_Q15(q2,ps[N-1]);
- }
-
- nb_adapt = st->nb_adapt;
-
- if ( nb_adapt==1 )
- { for ( i=0 ; i<N ; ++i )
- Smin[i] = Stmp[i] = 0;
-
- }
-
- min_range = mux(nb_adapt < 100, 15,
- mux(nb_adapt < 1000, 50,
- mux(nb_adapt < 10000, 150, 300)));
-
- if ( st->min_count > min_range )
- {
- st->min_count = 0;
-
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unroll=2
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N ; ++i )
- { register int si, stmpi;
-
- si = S[i];
- stmpi = Stmp[i];
-
- Smin[i] = imin(stmpi,si);
- Stmp[i] = si;
- }
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- } else
- {
-
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unroll=2
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N ; ++i )
- { register int si, stmpi, smini;
-
- si = S[i];
- stmpi = Stmp[i];
- smini = Smin[i];
-
- Smin[i] = imin(smini,si);
- Stmp[i] = imin(stmpi,si);
- }
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- }
-
-
- {
- register int q4;
- register int * restrict update_prob = (int*)st->update_prob;
-
- q4 = QCONST16(.4f,15);
-
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N ; ++i )
- { register int si;
- register int smini;
-
- si = S[i];
- smini = Smin[i];
- update_prob[i] = mux(MULT16_32_Q15(q4,si) > ADD32(smini,20), 1, 0);
- }
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- }
-
- UPDATENOISEPROB_STOP();
-}
-
-#else
-
-#define OVERRIDE_PREPROCESS_ANALYSIS
-static void preprocess_analysis(SpeexPreprocessState * restrict st, spx_int16_t * restrict x)
-{
- register int i;
- register int framesize = st->frame_size;
- register int N = st->ps_size;
- register int N3 = 2*N - framesize;
- register int N4 = framesize - N3;
- register float * restrict ps = st->ps;
- register float * restrict frame = st->frame;
- register float * restrict inbuf = st->inbuf;
-
- PREPROCESSANAYLSIS_START();
-
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N3 ; ++i )
- {
- frame[i] = inbuf[i];
- }
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<framesize ; ++i )
- { frame[N3+i] = x[i];
- }
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0,x+=N4 ; i<N3 ; ++i )
- { inbuf[i] = x[i];
- }
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- inbuf = st->window;
-
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<2*N ; ++i )
- {
- frame[i] = frame[i] * inbuf[i];
- }
-#if (TM_UNROLL && TM_UNROLL_PREPROCESSANALYSIS)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- spx_fft(st->fft_lookup, frame, st->ft);
- power_spectrum(st->ft, ps, N << 1);
- filterbank_compute_bank32(st->bank, ps, ps+N);
-
- PREPROCESSANAYLSIS_STOP();
-}
-
-
-#define OVERRIDE_UPDATE_NOISE_PROB
-static void update_noise_prob(SpeexPreprocessState * restrict st)
-{
-
- register float * restrict S = st->S;
- register float * restrict ps = st->ps;
- register int N = st->ps_size;
- register int min_range;
- register int i;
- register int nb_adapt;
- register float * restrict Smin = st->Smin;
- register float * restrict Stmp = st->Stmp;
-
- UPDATENOISEPROB_START();
-
- {
- register float ips, psi;
-
- ips = ps[0];
- psi = ps[1];
-
- S[0] = .8f * S[0] + .2f * ips;
-
- for ( i=1 ; i<N-1 ; i+=2 )
- {
- register float psii, psiii;
-
- psii = ps[i+1];
- psiii = ps[i+2];
- S[i] = .8f * S[i] + .05f * ips + .1f * psi + .05f * psii;
- S[i+1] = .8f * S[i+1] + .05f * psi + .1f * psii + .05f * psiii;
- ips = psii;
- psi = psiii;
- }
-
- S[N-1] = .8f * S[N-1] + .2f * ps[N-1];
- }
-
- nb_adapt = st->nb_adapt;
-
- if ( nb_adapt==1 )
- {
- for (i=0;i<N;i++)
- Smin[i] = st->Stmp[i] = 0;
- }
-
- min_range = mux(nb_adapt < 100, 15,
- mux(nb_adapt < 1000, 50,
- mux(nb_adapt < 10000, 150, 300)));
-
-
- if ( st->min_count > min_range )
- {
- st->min_count = 0;
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N ; ++i )
- {
- register float stmpi, si;
-
- stmpi = Stmp[i];
- si = S[i];
-
- Smin[i] = fmin(stmpi,si);
- Stmp[i] = si;
- }
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- } else
- {
- register float * restrict Smin = st->Smin;
-
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N ; ++i )
- {
- register float stmpi, si, smini;
-
- stmpi = Stmp[i];
- si = S[i];
- smini = Smin[i];
-
- Smin[i] = fmin(smini,si);
- Stmp[i] = fmin(stmpi,si);
- }
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- }
-
- {
- register int * restrict update_prob = (int*)st->update_prob;
-
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<N;i++)
- { register float si;
- register float smini;
-
- si = S[i];
- smini = Smin[i];
- update_prob[i] = mux( (.4 * si) > (smini + 20.f), 1, 0);
-
- }
-#if (TM_UNROLL && TM_UNROLL_UPDATENOISEPROB)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- }
-
- UPDATENOISEPROB_STOP();
-}
-
-
-#define OVERRIDE_COMPUTE_GAIN_FLOOR
-static void compute_gain_floor(
- int noise_suppress,
- int effective_echo_suppress,
- float * restrict noise,
- float * restrict echo,
- float * gain_floor,
- int len
-)
-{
- register int i;
- register float echo_floor;
- register float noise_floor;
-
- COMPUTEGAINFLOOR_START();
-
- noise_floor = exp(.2302585f*noise_suppress);
- echo_floor = exp(.2302585f*effective_echo_suppress);
-
-#if (TM_UNROLL && TM_UNROLL_COMPUTEGAINFLOOR)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<len;i++)
- { register float noisei, echoi;
-
- noisei = noise[i];
- echoi = echo[i];
-
- gain_floor[i] = FRAC_SCALING * sqrt(noise_floor * noisei + echo_floor * echoi) / sqrt(1+noisei+echoi);
-
- }
-#if (TM_UNROLL && TM_UNROLL_COMPUTEGAINFLOOR)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- COMPUTEGAINFLOOR_STOP();
-}
-
-#endif
-
-static inline spx_word32_t hypergeom_gain(spx_word32_t xx);
-static inline spx_word16_t qcurve(spx_word16_t x);
-static void compute_gain_floor(int noise_suppress, int effective_echo_suppress, spx_word32_t *noise, spx_word32_t *echo, spx_word16_t *gain_floor, int len);
-void speex_echo_get_residual(SpeexEchoState *st, spx_word32_t *Yout, int len);
-
-#ifndef FIXED_POINT
-static void speex_compute_agc(SpeexPreprocessState *st, spx_word16_t Pframe, spx_word16_t *ft);
-#endif
-
-void preprocess_residue_echo(
- SpeexPreprocessState * restrict st,
- int N,
- int NM
-)
-{
- if (st->echo_state)
- {
- register spx_word32_t * restrict r_echo = st->residual_echo;
- register spx_word32_t * restrict e_noise = st->echo_noise;
- register int i;
-
-#ifndef FIXED_POINT
- register spx_word32_t r;
-#endif
-
- speex_echo_get_residual(st->echo_state, r_echo, N);
-
-#ifndef FIXED_POINT
- r = r_echo[0];
- if (!(r >=0 && r < N*1e9f) )
- {
- memset(r_echo, 0, N * sizeof(spx_word32_t));
- }
-#endif
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<N;i++)
- { register spx_word32_t eni = e_noise[i];
- e_noise[i] = MAX32(MULT16_32_Q15(QCONST16(.6f,15),eni), r_echo[i]);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- filterbank_compute_bank32(st->bank, e_noise, e_noise+N);
-
- } else
- { memset(st->echo_noise, 0, (NM) * sizeof(spx_word32_t));
- }
-}
-
-void preprocess_update_noise(
- SpeexPreprocessState * restrict st,
- spx_word32_t * restrict ps,
- int N
-)
-{
- register spx_word16_t beta, beta_1;
- register int * restrict up = st->update_prob;
- register spx_word32_t * restrict noise = st->noise;
- register int i;
-
- beta = MAX16(QCONST16(.03,15),DIV32_16(Q15_ONE,st->nb_adapt));
- beta_1 = Q15_ONE-beta;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<N;i++)
- { register spx_word32_t ni = noise[i];
- register spx_word32_t psi = ps[i];
-
- if ( !up[i] || psi < PSHR32(ni, NOISE_SHIFT) )
- { noise[i] = MAX32(EXTEND32(0),MULT16_32_Q15(beta_1,ni) +
- MULT16_32_Q15(beta,SHL32(psi,NOISE_SHIFT)));
- }
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- filterbank_compute_bank32(st->bank, noise, noise+N);
-}
-
-void preprocess_compute_SNR(
- SpeexPreprocessState * restrict st,
- spx_word32_t * restrict ps,
- int NM
-)
-{
- register spx_word32_t * restrict noise = st->noise;
- register spx_word32_t * restrict echo = st->echo_noise;
- register spx_word32_t * restrict reverb = st->reverb_estimate;
- register spx_word16_t * restrict post = st->post;
- register spx_word32_t * restrict old_ps = st->old_ps;
- register spx_word16_t * restrict prior = st->prior;
- register int i;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<NM ; i++)
- {
- register spx_word16_t gamma;
- register spx_word32_t tot_noise;
- register spx_word16_t posti;
- register spx_word32_t opsi;
- register spx_word16_t priori;
-
- tot_noise = ADD32(ADD32(ADD32(EXTEND32(1), PSHR32(noise[i],NOISE_SHIFT)), echo[i]) , reverb[i]);
-
- posti = SUB16(DIV32_16_Q8(ps[i],tot_noise), QCONST16(1.f,SNR_SHIFT));
- posti = MIN16(posti, QCONST16(100.f,SNR_SHIFT));
- post[i] = posti;
-
- opsi = old_ps[i];
-
- gamma = QCONST16(.1f,15)+MULT16_16_Q15(QCONST16(.89f,15),SQR16_Q15(DIV32_16_Q15(opsi,ADD32(opsi,tot_noise))));
-
- priori = EXTRACT16(PSHR32(ADD32(MULT16_16(gamma,MAX16(0,posti)), MULT16_16(Q15_ONE-gamma,DIV32_16_Q8(opsi,tot_noise))), 15));
- prior[i]=MIN16(priori, QCONST16(100.f,SNR_SHIFT));
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-}
-
-spx_word32_t preprocess_smooth_SNR(
- SpeexPreprocessState * restrict st,
- int N,
- int NM
-)
-{
- register spx_word16_t * restrict zeta = st->zeta;
- register spx_word16_t * restrict prior = st->prior;
- register spx_word32_t Zframe;
- register spx_word16_t iprior, priori;
- register int _N = N-1;
- register int i;
-
- iprior = prior[0];
- priori = prior[1];
- zeta[0] = PSHR32(ADD32(MULT16_16(QCONST16(.7f,15),zeta[0]), MULT16_16(QCONST16(.3f,15),iprior)),15);
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=2
-#pragma TCS_unrollexact=1
-#endif
- for ( i=1 ; i<_N ; i++)
- { register spx_word16_t zetai = zeta[i];
- register spx_word16_t priorii = prior[i+1];
-
- zeta[i] = PSHR32(ADD32(ADD32(ADD32(MULT16_16(QCONST16(.7f,15),zetai), MULT16_16(QCONST16(.15f,15),priori)),
- MULT16_16(QCONST16(.075f,15),iprior)), MULT16_16(QCONST16(.075f,15),priorii)),15);
-
- iprior = priori;
- priori = priorii;
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- for (i=_N; i<NM ; i++)
- { register spx_word16_t zetai = zeta[i];
-
- priori = prior[i];
- zeta[i] = PSHR32(ADD32(MULT16_16(QCONST16(.7f,15),zetai), MULT16_16(QCONST16(.3f,15),priori)),15);
- }
-
- Zframe = 0;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=N ; i<NM ; i++ )
- { Zframe = ADD32(Zframe, EXTEND32(zeta[i]));
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- return Zframe;
-}
-
-void preprocess_compute_emgain(
- SpeexPreprocessState * restrict st,
- spx_word32_t * restrict ps,
- spx_word16_t Pframe,
- int NM
-)
-{
- register spx_word16_t * restrict zeta = st->zeta;
- register spx_word16_t * restrict prior = st->prior;
- register spx_word16_t * restrict gain = st->gain;
- register spx_word32_t * restrict old_ps = st->old_ps;
- register spx_word16_t * restrict post = st->post;
- register spx_word16_t * restrict gain2 = st->gain2;
- register int i;
- register int N=st->ps_size;
-
- for ( i=N ; i<NM ; ++i )
- {
- register spx_word32_t theta;
- register spx_word32_t MM;
- register spx_word16_t prior_ratio;
- register spx_word16_t P1;
- register spx_word16_t q;
-
-#ifdef FIXED_POINT
- register spx_word16_t tmp;
-#endif
- register spx_word16_t priori = prior[i];
-
- prior_ratio = PDIV32_16(SHL32(EXTEND32(priori), 15), ADD16(priori, SHL32(1,SNR_SHIFT)));
- theta = MULT16_32_P15(prior_ratio, QCONST32(1.f,EXPIN_SHIFT)+SHL32(EXTEND32(post[i]),EXPIN_SHIFT-SNR_SHIFT));
-
- MM = hypergeom_gain(theta);
- gain[i] = EXTRACT16(MIN32(Q15_ONE, MULT16_32_Q15(prior_ratio, MM)));
- old_ps[i] = MULT16_32_P15(QCONST16(.2f,15),old_ps[i]) + MULT16_32_P15(MULT16_16_P15(QCONST16(.8f,15),SQR16_Q15(gain[i])),ps[i]);
-
- P1 = QCONST16(.199f,15)+MULT16_16_Q15(QCONST16(.8f,15),qcurve (zeta[i]));
- q = Q15_ONE-MULT16_16_Q15(Pframe,P1);
-
-#ifdef FIXED_POINT
- theta = MIN32(theta, EXTEND32(32767));
- tmp = MULT16_16_Q15((SHL32(1,SNR_SHIFT)+priori),EXTRACT16(MIN32(Q15ONE,SHR32(spx_exp(-EXTRACT16(theta)),1))));
- tmp = MIN16(QCONST16(3.,SNR_SHIFT), tmp);
- tmp = EXTRACT16(PSHR32(MULT16_16(PDIV32_16(SHL32(EXTEND32(q),8),(Q15_ONE-q)),tmp),8));
- gain2[i]=DIV32_16(SHL32(EXTEND32(32767),SNR_SHIFT), ADD16(256,tmp));
-#else
- gain2[i]=1/(1.f + (q/(1.f-q))*(1+priori)*exp(-theta));
-#endif
- }
-
- filterbank_compute_psd16(st->bank,gain2+N, gain2);
- filterbank_compute_psd16(st->bank,gain+N, gain);
-}
-
-void preprocess_compute_linear_gain(
- SpeexPreprocessState * restrict st,
- spx_word32_t * restrict ps,
- int N
-)
-{
- register spx_word16_t * restrict gain_floor = st->gain_floor;
- register spx_word16_t * restrict prior = st->prior;
- register spx_word16_t * restrict gain = st->gain;
- register spx_word32_t * restrict old_ps = st->old_ps;
- register spx_word16_t * restrict post = st->post;
- register spx_word16_t * restrict gain2 = st->gain2;
- register int i;
-
- filterbank_compute_psd16(st->bank,gain_floor+N,gain_floor);
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<N;i++)
- {
- register spx_word32_t MM;
- register spx_word32_t theta;
- register spx_word16_t prior_ratio;
- register spx_word16_t tmp;
- register spx_word16_t p;
- register spx_word16_t g;
- register spx_word16_t gfi = gain_floor[i];
-
- prior_ratio = PDIV32_16(SHL32(EXTEND32(st->prior[i]), 15), ADD16(prior[i], SHL32(1,SNR_SHIFT)));
- theta = MULT16_32_P15(prior_ratio, QCONST32(1.f,EXPIN_SHIFT)+SHL32(EXTEND32(post[i]),EXPIN_SHIFT-SNR_SHIFT));
- MM = hypergeom_gain(theta);
-
- g = EXTRACT16(MIN32(Q15_ONE, MULT16_32_Q15(prior_ratio, MM)));
- p = gain2[i];
-
- g = VMUX( MULT16_16_Q15(QCONST16(.333f,15),g) > gain[i], MULT16_16(3,gain[i]), g);
-
- old_ps[i]= MULT16_32_P15(QCONST16(.2f,15),old_ps[i]) +
- MULT16_32_P15(MULT16_16_P15(QCONST16(.8f,15),SQR16_Q15(g)),ps[i]);
-
- g = VMUX( g < gfi, gfi, g );
- gain[i] = g;
-
- tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(g),15))) +
- MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(gfi),15)));
-
- gain2[i]=SQR16_Q15(tmp);
-
- /* Use this if you want a log-domain MMSE estimator instead */
- /* gain2[i] = pow(g, p) * pow(gfi,1.f-p);*/
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-}
-
-
-#if 0
-void preprocess_compute_bark_gain(
- SpeexPreprocessState * restrict st,
- int N,
- int NM
-)
-{
- register spx_word16_t * restrict gain_floor = st->gain_floor;
- register spx_word16_t * restrict gain = st->gain;
- register spx_word16_t * restrict gain2 = st->gain2;
- register int i;
-
- for (i=N;i<NM;i++)
- {
- register spx_word16_t tmp;
- register spx_word16_t p = gain2[i];
- register spx_word16_t gaini;
- register spx_word16_t gfi = gain_floor[i];
-
- gaini = MAX16(gain[i], gfi);
-
- gain[i] = gaini;
-
- tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(gaini),15))) +
- MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(gfi),15)));
-
- gain2[i]=SQR16_Q15(tmp);
- }
-
- filterbank_compute_psd16(st->bank,gain2+N, gain2);
-}
-#endif
-
-void preprocess_apply_gain(
- SpeexPreprocessState * restrict st,
- int N
-)
-{
- register spx_word16_t * restrict ft = st->ft;
- register spx_word16_t * restrict gain2 = st->gain2;
- register int j, i;
-
- ft[0] = MULT16_16_P15(gain2[0],ft[0]);
-
- for (i=1,j=1; i<N ; i++,j+=2)
- {
- register spx_word16_t gain2i = gain2[i];
- register spx_word16_t ftj = ft[j];
- register spx_word16_t ftjj = ft[j+1];
-
- ft[j] = MULT16_16_P15(gain2i,ftj);
- ft[j+1] = MULT16_16_P15(gain2i,ftjj);
- }
-
- ft[(N<<1)-1] = MULT16_16_P15(gain2[N-1],ft[(N<<1)-1]);
-}
-
-#ifdef FIXED_POINT
-void preprocess_scale(
- SpeexPreprocessState * restrict st,
- int N
-)
-{
- register spx_word16_t * restrict frame = st->frame;
- register int shift = st->frame_shift;
- register int i;
- register int N2 = N << 1;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N2 ;i++)
- { register spx_word16_t framei = frame[i];
-
- frame[i] = PSHR16(framei,shift);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-}
-
-#else
-
-void preprocess_apply_agc(
- SpeexPreprocessState * restrict st,
- int N
-)
-{
- register spx_word16_t max_sample=0;
- register spx_word16_t * restrict frame = st->frame;
- register int i;
- register int N2 = N << 1;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for (i=0;i<N2;i++)
- { register spx_word16_t framei = VABS(frame[i]);
-
- max_sample = VMUX( framei > max_sample, framei, max_sample);
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- if ( max_sample > 28000.f )
- {
- float damp = 28000.f/max_sample;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i< N2 ; i++ )
- { frame[i] *= damp;
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- }
-}
-#endif
-
-
-void preprocess_update(
- SpeexPreprocessState * restrict st,
- spx_int16_t * restrict x,
- int N
-)
-{
- register spx_word16_t * restrict frame = st->frame;
- register spx_word16_t * restrict window = st->window;
- register spx_word16_t * restrict outbuf = st->outbuf;
- register int framesize = st->frame_size;
- register int N2 = N << 1;
- register int N3 = N2 - framesize;
- register int N4 = (framesize) - N3;
- register int i;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<N2 ; i++)
- { register spx_word16_t fi = frame[i];
- register spx_word16_t wi = window[i];
-
- frame[i] = MULT16_16_Q15(fi, wi);
- }
- for (i=0;i<N3;i++)
- { x[i] = outbuf[i] + frame[i];
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
-
- for ( i=0;i<N4;i++)
- { x[N3+i] = frame[N3+i];
- }
-
- memcpy(outbuf, frame+framesize, (N3) * sizeof(spx_word16_t));
-}
-
-#define OVERRIDE_SPEEX_PREPROCESS_RUN
-int speex_preprocess_run(SpeexPreprocessState * restrict st, spx_int16_t * restrict x)
-{
- register int i, N, M, NM;
- register spx_word32_t * restrict ps=st->ps;
- register spx_word32_t Zframe;
- register spx_word16_t Pframe;
-
- st->nb_adapt++;
- st->min_count++;
- N = st->ps_size;
- M = st->nbands;
- NM = N + M;
-
- preprocess_residue_echo(st, N, NM);
- preprocess_analysis(st, x);
- update_noise_prob(st);
- preprocess_update_noise(st, ps, N);
-
- if ( st->nb_adapt == 1 )
- { memcpy(st->old_ps, ps, (NM) * sizeof(spx_word32_t));
- }
-
- preprocess_compute_SNR(st, ps, NM);
- Zframe = preprocess_smooth_SNR(st, N, NM);
-
-
- {
- register spx_word16_t effective_echo_suppress;
-
- Pframe = QCONST16(.1f,15)+MULT16_16_Q15(QCONST16(.899f,15),qcurve(DIV32_16(Zframe,M)));
- effective_echo_suppress = EXTRACT16(PSHR32(ADD32(MULT16_16(SUB16(Q15_ONE,Pframe), st->echo_suppress),
- MULT16_16(Pframe, st->echo_suppress_active)),15));
- compute_gain_floor(st->noise_suppress, effective_echo_suppress, st->noise+N, st->echo_noise+N, st->gain_floor+N, M);
-
- }
-
- preprocess_compute_emgain(st, ps, Pframe, NM);
- preprocess_compute_linear_gain(st, ps, N);
-
-
- if (!st->denoise_enabled)
- {
- register spx_word16_t * restrict gain2 = st->gain2;
-
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unroll=4
-#pragma TCS_unrollexact=1
-#endif
- for ( i=0 ; i<NM ; i++ )
- { gain2[i] = Q15_ONE;
- }
-#if (TM_UNROLL && TM_UNROLL_SPEEXPREPROCESSRUN)
-#pragma TCS_unrollexact=0
-#pragma TCS_unroll=0
-#endif
- }
-
- preprocess_apply_gain(st, N);
-
-#ifndef FIXED_POINT
- if (st->agc_enabled)
- { speex_compute_agc(st, Pframe, st->ft);
- }
-#endif
-
-
- spx_ifft(st->fft_lookup, st->ft, st->frame);
-
-#ifdef FIXED_POINT
- preprocess_scale(st, N);
-#endif
-
-#ifndef FIXED_POINT
- if ( st->agc_enabled )
- { preprocess_apply_agc(st, N);
- }
-#endif
-
- preprocess_update(st, x, N);
-
- if ( st->vad_enabled )
- {
- if (Pframe > st->speech_prob_start || (st->was_speech && Pframe > st->speech_prob_continue))
- { st->was_speech=1;
- return 1;
-
- } else
- { st->was_speech=0;
- return 0;
- }
- } else
- { return 1;
- }
-}
diff --git a/win32/VS2008/libspeex/libspeex.vcproj b/win32/VS2008/libspeex/libspeex.vcproj
index ef5a36f..ef53c57 100644
--- a/win32/VS2008/libspeex/libspeex.vcproj
+++ b/win32/VS2008/libspeex/libspeex.vcproj
@@ -1466,10 +1466,6 @@
>
</File>
<File
- RelativePath="..\..\..\libspeex\jitter.c"
- >
- </File>
- <File
RelativePath="..\..\..\libspeex\kiss_fft.c"
>
</File>
@@ -1498,10 +1494,6 @@
>
</File>
<File
- RelativePath="..\..\..\libspeex\mdf.c"
- >
- </File>
- <File
RelativePath="..\..\..\libspeex\modes.c"
>
</File>
@@ -1514,10 +1506,6 @@
>
</File>
<File
- RelativePath="..\..\..\libspeex\preprocess.c"
- >
- </File>
- <File
RelativePath="..\..\..\libspeex\quant_lsp.c"
>
</File>
@@ -1648,26 +1636,14 @@
>
</File>
<File
- RelativePath="..\..\..\include\speex\speex_echo.h"
- >
- </File>
- <File
RelativePath="..\..\..\include\speex\speex_header.h"
>
</File>
<File
- RelativePath="..\..\..\include\speex\speex_jitter.h"
- >
- </File>
- <File
RelativePath="..\..\..\include\speex\speex_noglobals.h"
>
</File>
<File
- RelativePath="..\..\..\include\speex\speex_preprocess.h"
- >
- </File>
- <File
RelativePath="..\..\..\include\speex\speex_stereo.h"
>
</File>
diff --git a/win32/speex.iss b/win32/speex.iss
index 8f2a398..b102646 100644
--- a/win32/speex.iss
+++ b/win32/speex.iss
@@ -36,10 +36,7 @@ Source: "libspeex\Release\libspeex.dll"; DestDir: "{app}\libspeex"; Flags: ignor
Source: "..\include\speex\speex.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion
Source: "..\include\speex\speex_bits.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion
Source: "..\include\speex\speex_callbacks.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion
-Source: "..\include\speex\speex_echo.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion
Source: "..\include\speex\speex_header.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion
-Source: "..\include\speex\speex_jitter.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion
-Source: "..\include\speex\speex_preprocess.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion
Source: "..\include\speex\speex_stereo.h"; DestDir: "{app}\libspeex\include"; Flags: ignoreversion
Source: "..\doc\manual.pdf"; DestDir: "{app}\doc"; Flags: ignoreversion