Skip to content

Commit 1e2f996

Browse files
committed
Fixed a resampler regression cause by signed/unsigned errors. Also started
documenting regressions. git-svn-id: http://svn.xiph.org/trunk/speex@13535 0101bb08-14d6-0310-b084-bc0e0c8e3800
1 parent 97f17be commit 1e2f996

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

libspeex/resample.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,10 @@ static void update_filter(SpeexResamplerState *st)
577577
}
578578
for (i=0;i<st->den_rate;i++)
579579
{
580-
spx_uint32_t j;
580+
spx_int32_t j;
581581
for (j=0;j<st->filt_len;j++)
582582
{
583-
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);
583+
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);
584584
}
585585
}
586586
#ifdef FIXED_POINT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/libspeex/resample.c b/libspeex/resample.c
2+
index 4403f78..48ffcef 100644
3+
--- a/libspeex/resample.c
4+
+++ b/libspeex/resample.c
5+
@@ -561,10 +561,10 @@ static void update_filter(SpeexResamplerState *st)
6+
}
7+
for (i=0;i<st->den_rate;i++)
8+
{
9+
- spx_uint32_t j;
10+
+ spx_int32_t j;
11+
for (j=0;j<st->filt_len;j++)
12+
{
13+
- 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);
14+
+ 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);
15+
}
16+
}
17+
#ifdef FIXED_POINT

regressions

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1: 723f644e09333a0230383eae4af1f3aa3e46e1c3 (r12736): broke resampler badly
2+
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.
3+
Fixed: 2007-08-11
4+

0 commit comments

Comments
 (0)