[FFmpeg-cvslog] avfilter/vf_ssim: use log10 instead of log()/log(10)

Ganesh Ajjanagadde git at videolan.org
Fri Oct 30 00:03:19 CET 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Thu Oct 29 00:17:19 2015 -0400| [b8e19808071c87c271896685d3c5038a6c469f5b] | committer: Ganesh Ajjanagadde

avfilter/vf_ssim: use log10 instead of log()/log(10)

This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8e19808071c87c271896685d3c5038a6c469f5b
---

 libavfilter/vf_ssim.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c
index ce1e3db..7c43e98 100644
--- a/libavfilter/vf_ssim.c
+++ b/libavfilter/vf_ssim.c
@@ -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,



More information about the ffmpeg-cvslog mailing list