Commit da1344e0 authored by Michael Niedermayer's avatar Michael Niedermayer

vsrc_mandelbrot: simplify second bailout search by not recalculating values.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e749b378
......@@ -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;
}
if(zr*zr + zi*zi > mb->bailout){
i-= FFMIN(7, i);
for(; i<mb->maxiter; 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 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;
}
Z_Z2_C_ZYKLUS(t, zi, zr, zi, 0)
i++;
Z_Z2_C_ZYKLUS(zr, zi, t, zi, 1)
}
break;
}
}
if(!c){
if(mb->inner==PERIOD){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment