avfilter/avf_showspectrum: use log10 instead of log()/...
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>
Thu, 29 Oct 2015 04:14:39 +0000 (00:14 -0400)
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>
Thu, 29 Oct 2015 22:55:10 +0000 (18:55 -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/avf_showspectrum.c

index 936db60..7d5c438 100644 (file)
@@ -386,7 +386,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
                 a = cbrt(a);
                 break;
             case LOG:
-                a = 1 - log(FFMAX(FFMIN(1, a), 1e-6)) / log(1e-6); // zero = -120dBFS
+                a = 1 + log10(FFMAX(FFMIN(1, a), 1e-6)) / 6; // zero = -120dBFS
                 break;
             default:
                 av_assert0(0);