mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavfi/mandelbrot: fix speedloss with default config after morphing introduction.
Morphing was introduced in 0d6e5a171
and forced cos/sin computations
with some mult all the time. This commit makes sure these are computed
only when morphing is enabled.
This commit is contained in:
parent
1f2ce32825
commit
51bcd5cd65
@ -271,21 +271,27 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
|
|||||||
for(x=0; x<mb->w; x++){
|
for(x=0; x<mb->w; x++){
|
||||||
float av_uninit(epsilon);
|
float av_uninit(epsilon);
|
||||||
const double cr=mb->start_x+scale*(x-mb->w/2);
|
const double cr=mb->start_x+scale*(x-mb->w/2);
|
||||||
double zr=cr + cos(pts * mb->morphxf) * mb->morphamp;
|
double zr=cr;
|
||||||
double zi=ci + sin(pts * mb->morphyf) * mb->morphamp;
|
double zi=ci;
|
||||||
uint32_t c=0;
|
uint32_t c=0;
|
||||||
double dv= mb->dither / (double)(1LL<<32);
|
double dv= mb->dither / (double)(1LL<<32);
|
||||||
mb->dither= mb->dither*1664525+1013904223;
|
mb->dither= mb->dither*1664525+1013904223;
|
||||||
|
|
||||||
if(color[x + y*linesize] & 0xFF000000)
|
if(color[x + y*linesize] & 0xFF000000)
|
||||||
continue;
|
continue;
|
||||||
if(!mb->morphamp && interpol(mb, color, x, y, linesize)){
|
if(!mb->morphamp){
|
||||||
|
if(interpol(mb, color, x, y, linesize)){
|
||||||
|
//TODO: reindent
|
||||||
if(next_cidx < mb->cache_allocated){
|
if(next_cidx < mb->cache_allocated){
|
||||||
mb->next_cache[next_cidx ].p[0]= cr;
|
mb->next_cache[next_cidx ].p[0]= cr;
|
||||||
mb->next_cache[next_cidx ].p[1]= ci;
|
mb->next_cache[next_cidx ].p[1]= ci;
|
||||||
mb->next_cache[next_cidx++].val = color[x + y*linesize];
|
mb->next_cache[next_cidx++].val = color[x + y*linesize];
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
zr += cos(pts * mb->morphxf) * mb->morphamp;
|
||||||
|
zi += sin(pts * mb->morphyf) * mb->morphamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
use_zyklus= (x==0 || mb->inner!=BLACK ||color[x-1 + y*linesize] == 0xFF000000);
|
use_zyklus= (x==0 || mb->inner!=BLACK ||color[x-1 + y*linesize] == 0xFF000000);
|
||||||
|
Loading…
Reference in New Issue
Block a user