[FFmpeg-cvslog] vsrc_mandelbrot: simplify second bailout search by not recalculating values .

Michael Niedermayer git at videolan.org
Sat Nov 19 15:26:35 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 19 15:00:26 2011 +0100| [da1344e0cd3c796791e984d6e66721e5a457e466] | committer: Michael Niedermayer

vsrc_mandelbrot: simplify second bailout search by not recalculating values.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da1344e0cd3c796791e984d6e66721e5a457e466
---

 libavfilter/vsrc_mandelbrot.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/libavfilter/vsrc_mandelbrot.c b/libavfilter/vsrc_mandelbrot.c
index d7f51db..68f65bc 100644
--- a/libavfilter/vsrc_mandelbrot.c
+++ b/libavfilter/vsrc_mandelbrot.c
@@ -264,25 +264,22 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
                 Z_Z2_C_ZYKLUS(t, zi, zr, zi, 0)
                 i++;
                 Z_Z2_C_ZYKLUS(zr, zi, t, zi, 1)
-                if(zr*zr + zi*zi > mb->bailout)
-                    break;
-            }
-            i-= FFMIN(7, i);
-            zr= mb->zyklus[i][0];
-            zi= mb->zyklus[i][1];
-            for(; i<mb->maxiter; i++){
-                double t;
                 if(zr*zr + zi*zi > mb->bailout){
-                    switch(mb->outer){
-                    case            ITERATION_COUNT: zr = i - (SQR(zr-cr)+SQR(zi-ci) > SQR(mb->bailout)); break;
-                    case NORMALIZED_ITERATION_COUNT: zr= i + log2(log(mb->bailout) / log(zr*zr + zi*zi)); break;
+                    i-= FFMIN(7, i);
+                    for(; i<mb->maxiter; i++){
+                        zr= mb->zyklus[i][0];
+                        zi= mb->zyklus[i][1];
+                        if(zr*zr + zi*zi > mb->bailout){
+                            switch(mb->outer){
+                            case            ITERATION_COUNT: zr = i; break;
+                            case NORMALIZED_ITERATION_COUNT: zr= i + log2(log(mb->bailout) / log(zr*zr + zi*zi)); break;
+                            }
+                            c= lrintf((sin(zr)+1)*127) + lrintf((sin(zr/1.234)+1)*127)*256*256 + lrintf((sin(zr/100)+1)*127)*256;
+                            break;
+                        }
                     }
-                    c= lrintf((sin(zr)+1)*127) + lrintf((sin(zr/1.234)+1)*127)*256*256 + lrintf((sin(zr/100)+1)*127)*256;
                     break;
                 }
-                Z_Z2_C_ZYKLUS(t, zi, zr, zi, 0)
-                i++;
-                Z_Z2_C_ZYKLUS(zr, zi, t, zi, 1)
             }
             if(!c){
                 if(mb->inner==PERIOD){



More information about the ffmpeg-cvslog mailing list