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

jm at svn.xiph.org jm at svn.xiph.org
Mon Nov 5 14:17:08 PST 2007


Author: jm
Date: 2007-11-05 14:17:07 -0800 (Mon, 05 Nov 2007)
New Revision: 14103

Modified:
   trunk/speex/libspeex/preprocess.c
Log:
Preprocessor patch by Mikael Magnusson to fix SPEEX_PREPROCESS_SET_PROB_START.


Modified: trunk/speex/libspeex/preprocess.c
===================================================================
--- trunk/speex/libspeex/preprocess.c	2007-11-05 17:57:40 UTC (rev 14102)
+++ trunk/speex/libspeex/preprocess.c	2007-11-05 22:17:07 UTC (rev 14103)
@@ -1127,16 +1127,16 @@
       break;
 
    case SPEEX_PREPROCESS_SET_PROB_START:
-      *(spx_int32_t*)ptr = MIN32(Q15_ONE,MAX32(0, *(spx_int32_t*)ptr));
-      st->speech_prob_start = DIV32_16(MULT16_16(32767,*(spx_int32_t*)ptr), 100);
+      *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr));
+      st->speech_prob_start = DIV32_16(MULT16_16(Q15ONE,*(spx_int32_t*)ptr), 100);
       break;
    case SPEEX_PREPROCESS_GET_PROB_START:
       (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob_start, 100);
       break;
 
    case SPEEX_PREPROCESS_SET_PROB_CONTINUE:
-      *(spx_int32_t*)ptr = MIN32(Q15_ONE,MAX32(0, *(spx_int32_t*)ptr));
-      st->speech_prob_continue = DIV32_16(MULT16_16(32767,*(spx_int32_t*)ptr), 100);
+      *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr));
+      st->speech_prob_continue = DIV32_16(MULT16_16(Q15ONE,*(spx_int32_t*)ptr), 100);
       break;
    case SPEEX_PREPROCESS_GET_PROB_CONTINUE:
       (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob_continue, 100);



More information about the commits mailing list