avutil/display: use hypot().

pull/72/head
Clément Bœsch 11 years ago
parent 584327f22f
commit fa972dcf1a
  1. 6
      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;

Loading…
Cancel
Save