avfilter/vf_ssim: use log10 instead of log()/log(10)
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>
Thu, 29 Oct 2015 04:17:19 +0000 (00:17 -0400)
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>
Thu, 29 Oct 2015 23:02:05 +0000 (19:02 -0400)
This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
libavfilter/vf_ssim.c

index ce1e3db..7c43e98 100644 (file)
@@ -176,7 +176,7 @@ static float ssim_plane(SSIMDSPContext *dsp,
 
 static double ssim_db(double ssim, double weight)
 {
-    return 10 * (log(weight) / log(10) - log(weight - ssim) / log(10));
+    return 10 * log10(weight / (weight - ssim));
 }
 
 static AVFrame *do_ssim(AVFilterContext *ctx, AVFrame *main,