[FFmpeg-cvslog] lavfi/avf_showspectrum: replace pow(x, 0.25) by sqrt(sqrt(x))

Ganesh Ajjanagadde git at videolan.org
Fri Jan 8 02:23:49 CET 2016


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Mon Jan  4 18:37:16 2016 -0800| [2fbdc4faf1bc0740cf18b0267c017e2afafaa99e] | committer: Ganesh Ajjanagadde

lavfi/avf_showspectrum: replace pow(x, 0.25) by sqrt(sqrt(x))

This is faster; precision assured as result is a float.

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=2fbdc4faf1bc0740cf18b0267c017e2afafaa99e
---

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

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 3611c96..88bee3c 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -590,7 +590,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
                 a = cbrt(a);
                 break;
             case FOURTHRT:
-                a = pow(a, 0.25);
+                a = sqrt(sqrt(a));
                 break;
             case FIFTHRT:
                 a = pow(a, 0.20);



More information about the ffmpeg-cvslog mailing list