[FFmpeg-cvslog] avformat/mov: use hypot()
Ganesh Ajjanagadde
git at videolan.org
Sun Nov 22 22:15:14 CET 2015
ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Sun Nov 22 11:15:39 2015 -0500| [7324af651f60aadc8a1a04d99314d211df30ccb3] | committer: Ganesh Ajjanagadde
avformat/mov: use hypot()
This simplifies the code.
Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7324af651f60aadc8a1a04d99314d211df30ccb3
---
libavformat/mov.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2910701..cee037b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -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) &&
More information about the ffmpeg-cvslog
mailing list