avutil/display: use hypot().
authorClément Bœsch <u@pkh.me>
Tue, 20 May 2014 17:51:03 +0000 (19:51 +0200)
committerClément Bœsch <u@pkh.me>
Fri, 23 May 2014 21:30:21 +0000 (23:30 +0200)
libavutil/display.c

index cc11536..da47cee 100644 (file)
@@ -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;