aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-03-21 22:02:52 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-03-21 22:02:52 +0000
commit66a148a19ae6c6284afeaf7a14dea6ba49069a9a (patch)
treed9f814143141bc973d11da50d5c0b51098bba630
parent8076609a40ebf19541b52fe47a882c5ddd0fcb7c (diff)
downloadffmpeg-66a148a19ae6c6284afeaf7a14dea6ba49069a9a.tar.gz
remove dithering of filter coefficients, improves precision by 1-2 bits and
improves subjective sound quality on artificial sample (udial.wav resampling to 32khz) Originally committed as revision 8467 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/resample2.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c
index 9cc2edbe8f..82eddf6562 100644
--- a/libavcodec/resample2.c
+++ b/libavcodec/resample2.c
@@ -93,7 +93,6 @@ void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_coun
for(ph=0;ph<phase_count;ph++) {
double norm = 0;
- double e= 0;
for(i=0;i<tap_count;i++) {
x = M_PI * ((double)(i - center) - (double)ph / phase_count) * factor;
if (x == 0) y = 1.0;
@@ -121,9 +120,8 @@ void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_coun
/* normalize so that an uniform color remains the same */
for(i=0;i<tap_count;i++) {
- v = av_clip(lrintf(tab[i] * scale / norm + e), FELEM_MIN, FELEM_MAX);
+ v = av_clip(lrintf(tab[i] * scale / norm), FELEM_MIN, FELEM_MAX);
filter[ph * tap_count + i] = v;
- e += tab[i] * scale / norm - v;
}
}
}