[FFmpeg-devel] [PATCH 1/3] avutil/display: use hypot().

Clément Bœsch u at pkh.me
Tue May 20 19:59:05 CEST 2014


---
 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;
-- 
1.9.2



More information about the ffmpeg-devel mailing list