[FFmpeg-devel] [PATCH 07/10] avfilter/vf_codecview: use hypot()

Ganesh Ajjanagadde gajjanagadde at gmail.com
Sun Nov 22 18:05:47 CET 2015


Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 libavfilter/vf_codecview.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_codecview.c b/libavfilter/vf_codecview.c
index df45f55..94b5e56 100644
--- a/libavfilter/vf_codecview.c
+++ b/libavfilter/vf_codecview.c
@@ -175,7 +175,7 @@ static void draw_arrow(uint8_t *buf, int sx, int sy, int ex,
     if (dx * dx + dy * dy > 3 * 3) {
         int rx =  dx + dy;
         int ry = -dx + dy;
-        int length = sqrt((rx * rx + ry * ry) << 8);
+        int length = hypot(rx, ry) * 16;
 
         // FIXME subpixel accuracy
         rx = ROUNDED_DIV(rx * 3 << 4, length);
-- 
2.6.2



More information about the ffmpeg-devel mailing list