[FFmpeg-cvslog] avutil/display: use hypot().

Clément Bœsch git at videolan.org
Fri May 23 23:30:29 CEST 2014


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Tue May 20 19:51:03 2014 +0200| [fa972dcf1a36805de4aaa031331061a0a334996d] | committer: Clément Bœsch

avutil/display: use hypot().

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

 libavutil/display.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavutil/display.c b/libavutil/display.c
index cc11536..da47cee 100644
--- a/libavutil/display.c
+++ b/libavutil/display.c
@@ -35,10 +35,8 @@ double av_display_rotation_get(const int32_t matrix[9])
 {
     double rotation, scale[2];
 
-    scale[0] = sqrt(CONV_FP(matrix[0]) * CONV_FP(matrix[0]) +
-                    CONV_FP(matrix[3]) * CONV_FP(matrix[3]));
-    scale[1] = sqrt(CONV_FP(matrix[1]) * CONV_FP(matrix[1]) +
-                    CONV_FP(matrix[4]) * CONV_FP(matrix[4]));
+    scale[0] = hypot(CONV_FP(matrix[0]), CONV_FP(matrix[3]));
+    scale[1] = hypot(CONV_FP(matrix[1]), CONV_FP(matrix[4]));
 
     if (scale[0] == 0.0 || scale[1] == 0.0)
         return NAN;



More information about the ffmpeg-cvslog mailing list