avfilter/vf_idet: use av_rescale()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 3 Nov 2014 16:22:16 +0000 (17:22 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 3 Nov 2014 16:22:16 +0000 (17:22 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vf_idet.c

index 05f361a..a059565 100644 (file)
@@ -173,8 +173,8 @@ static void filter(AVFilterContext *ctx)
 
 
     for(i=0; i<4; i++){
-        idet->prestat [i] = (idet->decay_coefficient * idet->prestat [i]) / PRECISION;
-        idet->poststat[i] = (idet->decay_coefficient * idet->poststat[i]) / PRECISION;
+        idet->prestat [i] = av_rescale(idet->prestat [i], idet->decay_coefficient, PRECISION);
+        idet->poststat[i] = av_rescale(idet->poststat[i], idet->decay_coefficient, PRECISION);
     }
 
     idet->total_prestat [           type] ++;