[FFmpeg-devel] [PATCH 06/10] avfilter/vf_chromakey: use hypot()

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


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

diff --git a/libavfilter/vf_chromakey.c b/libavfilter/vf_chromakey.c
index 3309748..06988d6 100644
--- a/libavfilter/vf_chromakey.c
+++ b/libavfilter/vf_chromakey.c
@@ -49,7 +49,7 @@ static uint8_t do_chromakey_pixel(ChromakeyContext *ctx, uint8_t u[9], uint8_t v
         du = (int)u[i] - ctx->chromakey_uv[0];
         dv = (int)v[i] - ctx->chromakey_uv[1];
 
-        diff += sqrt((du * du + dv * dv) / (255.0 * 255.0));
+        diff += hypot(du, dv) / 255.0;
     }
 
     diff /= 9.0;
-- 
2.6.2



More information about the ffmpeg-devel mailing list