changeset 4694:f5fa13dfd3c8 libavcodec

remove dithering of filter coefficients, improves precision by 1-2 bits and improves subjective sound quality on artificial sample (udial.wav resampling to 32khz)
author michael
date Wed, 21 Mar 2007 22:02:52 +0000
parents 86a2dfcc5eef
children 8155dd60b50b
files resample2.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/resample2.c	Wed Mar 21 05:56:29 2007 +0000
+++ b/resample2.c	Wed Mar 21 22:02:52 2007 +0000
@@ -93,7 +93,6 @@
 
     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 @@
 
         /* 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;
         }
     }
 }