[xiph-commits] r14185 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Mon Nov 19 04:54:39 PST 2007


Author: jm
Date: 2007-11-19 04:54:38 -0800 (Mon, 19 Nov 2007)
New Revision: 14185

Modified:
   trunk/speex/libspeex/mdf.c
   trunk/speex/libspeex/preprocess.c
Log:
fixed-point: Got rid of the three last float bits in the
preprocessor and echo canceller.


Modified: trunk/speex/libspeex/mdf.c
===================================================================
--- trunk/speex/libspeex/mdf.c	2007-11-19 03:22:11 UTC (rev 14184)
+++ trunk/speex/libspeex/mdf.c	2007-11-19 12:54:38 UTC (rev 14185)
@@ -1042,7 +1042,7 @@
 #endif
 
    /* We consider that the filter has had minimal adaptation if the following is true*/
-   if (!st->adapted && st->sum_adapt > QCONST32(M,15) && MULT16_32_Q15(st->leak_estimate,Syy) > MULT16_32_Q15(QCONST16(.03f,15),Syy))
+   if (!st->adapted && st->sum_adapt > SHL32(EXTEND32(M),15) && MULT16_32_Q15(st->leak_estimate,Syy) > MULT16_32_Q15(QCONST16(.03f,15),Syy))
    {
       st->adapted = 1;
    }

Modified: trunk/speex/libspeex/preprocess.c
===================================================================
--- trunk/speex/libspeex/preprocess.c	2007-11-19 03:22:11 UTC (rev 14184)
+++ trunk/speex/libspeex/preprocess.c	2007-11-19 12:54:38 UTC (rev 14185)
@@ -277,7 +277,7 @@
          x=QCONST16(2.f,13)-x+QCONST16(2.f,13); /* 4 - x */
       }
       x = MULT16_16_Q14(QCONST16(1.271903f,14), x);
-      tmp = SQR16_Q15(QCONST16(.5f,15)-MULT16_16_P15(QCONST16(.5f,15),spx_cos_norm(QCONST32(x,2))));
+      tmp = SQR16_Q15(QCONST16(.5f,15)-MULT16_16_P15(QCONST16(.5f,15),spx_cos_norm(SHL32(EXTEND32(x),2))));
       if (inv)
          tmp=SUB16(Q15_ONE,tmp);
       w[i]=spx_sqrt(SHL32(EXTEND32(tmp),15));
@@ -1067,14 +1067,14 @@
       break;
 
    case SPEEX_PREPROCESS_SET_AGC_LEVEL:
-      st->agc_level = (*(float*)ptr);
+      st->agc_level = (*(spx_int32_t*)ptr);
       if (st->agc_level<1)
          st->agc_level=1;
       if (st->agc_level>32768)
          st->agc_level=32768;
       break;
    case SPEEX_PREPROCESS_GET_AGC_LEVEL:
-      (*(float*)ptr) = st->agc_level;
+      (*(spx_int32_t*)ptr) = st->agc_level;
       break;
    case SPEEX_PREPROCESS_SET_AGC_INCREMENT:
       st->max_increase_step = exp(0.11513f * (*(spx_int32_t*)ptr)*st->frame_size / st->sampling_rate);
@@ -1113,17 +1113,21 @@
       break;
 
    case SPEEX_PREPROCESS_SET_DEREVERB_LEVEL:
-      st->reverb_level = (*(float*)ptr);
+      /* FIXME: Re-enable when de-reverberation is actually enabled again */
+      /*st->reverb_level = (*(float*)ptr);*/
       break;
    case SPEEX_PREPROCESS_GET_DEREVERB_LEVEL:
-      (*(float*)ptr) = st->reverb_level;
+      /* FIXME: Re-enable when de-reverberation is actually enabled again */
+      /*(*(float*)ptr) = st->reverb_level;*/
       break;
    
    case SPEEX_PREPROCESS_SET_DEREVERB_DECAY:
-      st->reverb_decay = (*(float*)ptr);
+      /* FIXME: Re-enable when de-reverberation is actually enabled again */
+      /*st->reverb_decay = (*(float*)ptr);*/
       break;
    case SPEEX_PREPROCESS_GET_DEREVERB_DECAY:
-      (*(float*)ptr) = st->reverb_decay;
+      /* FIXME: Re-enable when de-reverberation is actually enabled again */
+      /*(*(float*)ptr) = st->reverb_decay;*/
       break;
 
    case SPEEX_PREPROCESS_SET_PROB_START:



More information about the commits mailing list