mandelbrot: only check periodicity once for each period instead of twice.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Nov 2011 15:37:55 +0000 (16:37 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Nov 2011 16:01:56 +0000 (17:01 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vsrc_mandelbrot.c

index 7bcf3b7..6f9644d 100644 (file)
@@ -194,7 +194,7 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
                 zi= 2*zr*zi + ci;
                 zr=       t + cr;
                 if(use_zyklus){
-                    if(i && mb->zyklus[i>>1][0]==zr && mb->zyklus[i>>1][1]==zi)
+                    if((i&1) && mb->zyklus[i>>1][0]==zr && mb->zyklus[i>>1][1]==zi)
                         break;
                     mb->zyklus[i][0]= zr;
                     mb->zyklus[i][1]= zi;