# HG changeset patch # User michael # Date 1086552953 0 # Node ID b77fe059dd090ed83d44664c588723fed424fefe # Parent 99556d33f102d4f9a0fdcb1cb1a28afe2dbc4269 fix normalization diff -r 99556d33f102 -r b77fe059dd09 imgresample.c --- a/imgresample.c Sun Jun 06 19:44:05 2004 +0000 +++ b/imgresample.c Sun Jun 06 20:15:53 2004 +0000 @@ -545,7 +545,7 @@ static void build_filter(int16_t *filter, float factor) { int ph, i, v; - float x, y, tab[NB_TAPS], norm, mult; + float x, y, tab[NB_TAPS], norm, mult, target; /* if upsampling, only need to interpolate, no filter */ if (factor > 1.0) @@ -571,10 +571,13 @@ } /* normalize so that an uniform color remains the same */ - mult = (float)(1 << FILTER_BITS) / norm; + target= 1 << FILTER_BITS; for(i=0;i