[xiph-commits] r11968 - in tags/speex-1-2beta1.1: libspeex symbian
jm at svn.xiph.org
jm at svn.xiph.org
Sat Oct 28 05:32:44 PDT 2006
Author: jm
Date: 2006-10-28 05:32:37 -0700 (Sat, 28 Oct 2006)
New Revision: 11968
Modified:
tags/speex-1-2beta1.1/libspeex/fftwrap.c
tags/speex-1-2beta1.1/libspeex/filters.c
tags/speex-1-2beta1.1/libspeex/lbr_48k_tables.c
tags/speex-1-2beta1.1/libspeex/mdf.c
tags/speex-1-2beta1.1/libspeex/pseudofloat.h
tags/speex-1-2beta1.1/symbian/speex.mmp
Log:
Fixed AEC instability, non-C89 stuff. Also small Symbian/TI
fixes.
Modified: tags/speex-1-2beta1.1/libspeex/fftwrap.c
===================================================================
--- tags/speex-1-2beta1.1/libspeex/fftwrap.c 2006-10-28 01:22:12 UTC (rev 11967)
+++ tags/speex-1-2beta1.1/libspeex/fftwrap.c 2006-10-28 12:32:37 UTC (rev 11968)
@@ -103,8 +103,8 @@
if (in==out)
{
int i;
+ float scale = 1./((struct drft_lookup *)table)->n;
speex_warning("FFT should not be done in-place");
- float scale = 1./((struct drft_lookup *)table)->n;
for (i=0;i<((struct drft_lookup *)table)->n;i++)
out[i] = scale*in[i];
} else {
Modified: tags/speex-1-2beta1.1/libspeex/filters.c
===================================================================
--- tags/speex-1-2beta1.1/libspeex/filters.c 2006-10-28 01:22:12 UTC (rev 11967)
+++ tags/speex-1-2beta1.1/libspeex/filters.c 2006-10-28 12:32:37 UTC (rev 11968)
@@ -676,21 +676,21 @@
#ifdef FIXED_POINT
#if 0
-spx_word16_t shift_filt[3][7] = {{-33, 1043, -4551, 19959, 19959, -4551, 1043},
+const spx_word16_t shift_filt[3][7] = {{-33, 1043, -4551, 19959, 19959, -4551, 1043},
{-98, 1133, -4425, 29179, 8895, -2328, 444},
{444, -2328, 8895, 29179, -4425, 1133, -98}};
#else
-spx_word16_t shift_filt[3][7] = {{-390, 1540, -4993, 20123, 20123, -4993, 1540},
+const spx_word16_t shift_filt[3][7] = {{-390, 1540, -4993, 20123, 20123, -4993, 1540},
{-1064, 2817, -6694, 31589, 6837, -990, -209},
{-209, -990, 6837, 31589, -6694, 2817, -1064}};
#endif
#else
#if 0
-float shift_filt[3][7] = {{-9.9369e-04, 3.1831e-02, -1.3889e-01, 6.0910e-01, 6.0910e-01, -1.3889e-01, 3.1831e-02},
+const float shift_filt[3][7] = {{-9.9369e-04, 3.1831e-02, -1.3889e-01, 6.0910e-01, 6.0910e-01, -1.3889e-01, 3.1831e-02},
{-0.0029937, 0.0345613, -0.1350474, 0.8904793, 0.2714479, -0.0710304, 0.0135403},
{0.0135403, -0.0710304, 0.2714479, 0.8904793, -0.1350474, 0.0345613, -0.0029937}};
#else
-float shift_filt[3][7] = {{-0.011915, 0.046995, -0.152373, 0.614108, 0.614108, -0.152373, 0.046995},
+const float shift_filt[3][7] = {{-0.011915, 0.046995, -0.152373, 0.614108, 0.614108, -0.152373, 0.046995},
{-0.0324855, 0.0859768, -0.2042986, 0.9640297, 0.2086420, -0.0302054, -0.0063646},
{-0.0063646, -0.0302054, 0.2086420, 0.9640297, -0.2042986, 0.0859768, -0.0324855}};
#endif
Modified: tags/speex-1-2beta1.1/libspeex/lbr_48k_tables.c
===================================================================
--- tags/speex-1-2beta1.1/libspeex/lbr_48k_tables.c 2006-10-28 01:22:12 UTC (rev 11967)
+++ tags/speex-1-2beta1.1/libspeex/lbr_48k_tables.c 2006-10-28 12:32:37 UTC (rev 11968)
@@ -34,7 +34,7 @@
#endif
-int dummy_epic_48k_variable=0;
+const int dummy_epic_48k_variable=0;
#ifdef EPIC_48K
const signed char gain_cdbk_ulbr[192] = {
Modified: tags/speex-1-2beta1.1/libspeex/mdf.c
===================================================================
--- tags/speex-1-2beta1.1/libspeex/mdf.c 2006-10-28 01:22:12 UTC (rev 11967)
+++ tags/speex-1-2beta1.1/libspeex/mdf.c 2006-10-28 12:32:37 UTC (rev 11968)
@@ -740,7 +740,7 @@
#endif
/* We consider that the filter has had minimal adaptation if the following is true*/
- if (!st->adapted && st->sum_adapt > QCONST32(1,15))
+ if (!st->adapted && st->sum_adapt > QCONST32(M,15))
{
st->adapted = 1;
}
@@ -764,20 +764,22 @@
/*st->power_1[i] = adapt_rate*r/(e*(1+st->power[i]));*/
st->power_1[i] = FLOAT_SHL(FLOAT_DIV32_FLOAT(r,FLOAT_MUL32U(e,st->power[i]+10)),WEIGHT_SHIFT+16);
}
- } else if (Sxx > SHR32(MULT16_16(N, 1000),6)) {
+ } else {
/* Temporary adaption rate if filter is not yet adapted enough */
spx_word16_t adapt_rate=0;
- tmp32 = MULT16_32_Q15(QCONST16(.25f, 15), Sxx);
+ if (Sxx > SHR32(MULT16_16(N, 1000),6))
+ {
+ tmp32 = MULT16_32_Q15(QCONST16(.25f, 15), Sxx);
#ifdef FIXED_POINT
- if (tmp32 > SHR32(See,2))
- tmp32 = SHR32(See,2);
+ if (tmp32 > SHR32(See,2))
+ tmp32 = SHR32(See,2);
#else
- if (tmp32 > .25*See)
- tmp32 = .25*See;
+ if (tmp32 > .25*See)
+ tmp32 = .25*See;
#endif
- adapt_rate = FLOAT_EXTRACT16(FLOAT_SHL(FLOAT_DIV32(tmp32, See),15));
-
+ adapt_rate = FLOAT_EXTRACT16(FLOAT_SHL(FLOAT_DIV32(tmp32, See),15));
+ }
for (i=0;i<=st->frame_size;i++)
st->power_1[i] = FLOAT_SHL(FLOAT_DIV32(EXTEND32(adapt_rate),ADD32(st->power[i],10)),WEIGHT_SHIFT+1);
Modified: tags/speex-1-2beta1.1/libspeex/pseudofloat.h
===================================================================
--- tags/speex-1-2beta1.1/libspeex/pseudofloat.h 2006-10-28 01:22:12 UTC (rev 11967)
+++ tags/speex-1-2beta1.1/libspeex/pseudofloat.h 2006-10-28 12:32:37 UTC (rev 11968)
@@ -347,7 +347,7 @@
{
spx_float_t r;
spx_int32_t m;
- m = a.m << 14;
+ m = SHL32(EXTEND32(a.m), 14);
r.e = a.e - 14;
if (r.e & 1)
{
Modified: tags/speex-1-2beta1.1/symbian/speex.mmp
===================================================================
--- tags/speex-1-2beta1.1/symbian/speex.mmp 2006-10-28 01:22:12 UTC (rev 11967)
+++ tags/speex-1-2beta1.1/symbian/speex.mmp 2006-10-28 12:32:37 UTC (rev 11968)
@@ -36,10 +36,10 @@
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 filters.c gain_table.c
+SOURCE exc_10_16_table.c exc_10_32_table.c exc_20_32_table.c fftwrap.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 speex.c speex_callbacks.c speex_header.c stereo.c vbr.c vq.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
More information about the commits
mailing list