[Ffmpeg-cvslog] r8467 - trunk/libavcodec/resample2.c
michael
subversion
Wed Mar 21 23:02:52 CET 2007
Author: michael
Date: Wed Mar 21 23:02:52 2007
New Revision: 8467
Modified:
trunk/libavcodec/resample2.c
Log:
remove dithering of filter coefficients, improves precission by 1-2 bits and improves subjective sound quality on aritificial sample (udial.wav resampling to 32khz)
Modified: trunk/libavcodec/resample2.c
==============================================================================
--- trunk/libavcodec/resample2.c (original)
+++ trunk/libavcodec/resample2.c Wed Mar 21 23:02:52 2007
@@ -93,7 +93,6 @@ void av_build_filter(FELEM *filter, doub
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, doub
/* 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;
}
}
}
More information about the ffmpeg-cvslog
mailing list