Commit 7324af65 authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde

avformat/mov: use hypot()

This simplifies the code.
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 764900d6
......@@ -3421,9 +3421,8 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (width && height && sc->display_matrix) {
double disp_transform[2];
#define SQR(a) ((a)*(double)(a))
for (i = 0; i < 2; i++)
disp_transform[i] = sqrt(SQR(display_matrix[i][0]) + SQR(display_matrix[i][1]));
disp_transform[i] = hypot(display_matrix[i][0], display_matrix[i][1]);
if (disp_transform[0] > 0 && disp_transform[1] > 0 &&
disp_transform[0] < (1<<24) && disp_transform[1] < (1<<24) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment