[FFmpeg-devel] [PATCH 09/10] avfilter/vsrc_mandelbrot: use hypot()

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


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

diff --git a/libavfilter/vsrc_mandelbrot.c b/libavfilter/vsrc_mandelbrot.c
index 950c5c8..a0c101e 100644
--- a/libavfilter/vsrc_mandelbrot.c
+++ b/libavfilter/vsrc_mandelbrot.c
@@ -291,7 +291,7 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
 
             use_zyklus= (x==0 || s->inner!=BLACK ||color[x-1 + y*linesize] == 0xFF000000);
             if(use_zyklus)
-                epsilon= scale*1*sqrt(SQR(x-s->w/2) + SQR(y-s->h/2))/s->w;
+                epsilon= scale*hypot(x-s->w/2, y-s->h/2)/s->w;
 
 #define Z_Z2_C(outr,outi,inr,ini)\
             outr= inr*inr - ini*ini + cr;\
-- 
2.6.2



More information about the ffmpeg-devel mailing list