ffmpeg: use log10 instead of log()/log(10)
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>
Thu, 29 Oct 2015 04:01:43 +0000 (00:01 -0400)
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>
Thu, 29 Oct 2015 23:05:29 +0000 (19:05 -0400)
This is more concise and conveys the intent better.
Furthermore, it is likely more precise as well due to lack of floating
point division.

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

index afe1cb7..f8b071a 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1244,7 +1244,7 @@ static void do_video_out(AVFormatContext *s,
 
 static double psnr(double d)
 {
-    return -10.0 * log(d) / log(10.0);
+    return -10.0 * log10(d);
 }
 
 static void do_video_stats(OutputStream *ost, int frame_size)