[xiph-commits] r13535 - in trunk/speex: . libspeex regression-fixes

jm at svn.xiph.org jm at svn.xiph.org
Sat Aug 11 06:18:57 PDT 2007


Author: jm
Date: 2007-08-11 06:18:56 -0700 (Sat, 11 Aug 2007)
New Revision: 13535

Added:
   trunk/speex/regression-fixes/
   trunk/speex/regression-fixes/1-resampler_unsigned_fix.patch
   trunk/speex/regressions
Modified:
   trunk/speex/libspeex/resample.c
Log:
Fixed a resampler regression cause by signed/unsigned errors. Also started
documenting regressions.


Modified: trunk/speex/libspeex/resample.c
===================================================================
--- trunk/speex/libspeex/resample.c	2007-08-11 00:24:51 UTC (rev 13534)
+++ trunk/speex/libspeex/resample.c	2007-08-11 13:18:56 UTC (rev 13535)
@@ -577,10 +577,10 @@
       }
       for (i=0;i<st->den_rate;i++)
       {
-         spx_uint32_t j;
+         spx_int32_t j;
          for (j=0;j<st->filt_len;j++)
          {
-            st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func);
+            st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-(spx_int32_t)st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func);
          }
       }
 #ifdef FIXED_POINT

Added: trunk/speex/regression-fixes/1-resampler_unsigned_fix.patch
===================================================================
--- trunk/speex/regression-fixes/1-resampler_unsigned_fix.patch	                        (rev 0)
+++ trunk/speex/regression-fixes/1-resampler_unsigned_fix.patch	2007-08-11 13:18:56 UTC (rev 13535)
@@ -0,0 +1,17 @@
+diff --git a/libspeex/resample.c b/libspeex/resample.c
+index 4403f78..48ffcef 100644
+--- a/libspeex/resample.c
++++ b/libspeex/resample.c
+@@ -561,10 +561,10 @@ static void update_filter(SpeexResamplerState *st)
+       }
+       for (i=0;i<st->den_rate;i++)
+       {
+-         spx_uint32_t j;
++         spx_int32_t j;
+          for (j=0;j<st->filt_len;j++)
+          {
+-            st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func);
++            st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-(spx_int32_t)st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func);
+          }
+       }
+ #ifdef FIXED_POINT

Added: trunk/speex/regressions
===================================================================
--- trunk/speex/regressions	                        (rev 0)
+++ trunk/speex/regressions	2007-08-11 13:18:56 UTC (rev 13535)
@@ -0,0 +1,4 @@
+1: 723f644e09333a0230383eae4af1f3aa3e46e1c3 (r12736): broke resampler badly
+Changed the sign of a bunch of parameters in the API. Tons of signed/unsigned changes in the code as a consequence of that. Hopefully this will be the last change to the API.
+Fixed: 2007-08-11
+



More information about the commits mailing list