mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avfilter/internal: Factor out executing a filter's execute_func
The current way of doing it involves writing the ctx parameter twice. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
32b56af6fb
commit
1b20853fb3
@ -517,8 +517,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
goto fail;
|
||||
|
||||
s->input_frame = in;
|
||||
ctx->internal->execute(ctx, s->filter_channels, NULL, NULL, FFMIN(inlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter_channels, NULL, NULL,
|
||||
FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
for (i = 0; i < ctx->nb_outputs; i++) {
|
||||
ret = ff_filter_frame(ctx->outputs[i], frames[i]);
|
||||
|
@ -576,7 +576,7 @@ static int filter_frame(AVFilterLink *inlink)
|
||||
goto fail;
|
||||
|
||||
td.out = out;
|
||||
ret = ctx->internal->execute(ctx, filter_channel, &td, NULL, inlink->channels);
|
||||
ret = ff_filter_execute(ctx, filter_channel, &td, NULL, inlink->channels);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
|
@ -250,8 +250,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
s->level = exp(s->level_db / 20. * M_LN10);
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, filter_channels, &td, NULL, FFMIN(inlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channels, &td, NULL,
|
||||
FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
s->in_samples += in->nb_samples;
|
||||
|
||||
|
@ -143,8 +143,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
}
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, filter_channels, &td, NULL, FFMIN(inlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channels, &td, NULL,
|
||||
FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (in != out)
|
||||
av_frame_free(&in);
|
||||
|
@ -1224,8 +1224,8 @@ static int output_frame(AVFilterLink *inlink)
|
||||
|
||||
s->block_count++;
|
||||
td.in = in;
|
||||
ctx->internal->execute(ctx, filter_channel, &td, NULL,
|
||||
FFMIN(outlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channel, &td, NULL,
|
||||
FFMIN(outlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
out = ff_get_audio_buffer(outlink, s->sample_advance);
|
||||
if (!out) {
|
||||
|
@ -225,8 +225,8 @@ static int fir_frame(AudioFIRContext *s, AVFrame *in, AVFilterLink *outlink)
|
||||
if (s->pts == AV_NOPTS_VALUE)
|
||||
s->pts = in->pts;
|
||||
s->in = in;
|
||||
ctx->internal->execute(ctx, fir_channels, out, NULL, FFMIN(outlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, fir_channels, out, NULL,
|
||||
FFMIN(outlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
out->pts = s->pts;
|
||||
if (s->pts != AV_NOPTS_VALUE)
|
||||
|
@ -329,8 +329,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
}
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, filter_channels, &td, NULL, FFMIN(inlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channels, &td, NULL,
|
||||
FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
s->in_samples += in->nb_samples;
|
||||
|
||||
|
@ -1060,7 +1060,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, s->filter_channel, &td, NULL, inlink->channels);
|
||||
ff_filter_execute(ctx, s->filter_channel, &td, NULL, inlink->channels);
|
||||
if (s->need_profile)
|
||||
s->got_profile = 1;
|
||||
|
||||
|
@ -1401,7 +1401,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, s->iir_channel, &td, NULL, outlink->channels);
|
||||
ff_filter_execute(ctx, s->iir_channel, &td, NULL, outlink->channels);
|
||||
|
||||
for (ch = 0; ch < outlink->channels; ch++) {
|
||||
if (s->iir[ch].clippings > 0)
|
||||
|
@ -730,8 +730,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
|
||||
AVFilterLink *outlink = ctx->outputs[0];
|
||||
|
||||
if (!ctx->is_disabled)
|
||||
ctx->internal->execute(ctx, filter_channels, buf, NULL, FFMIN(inlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channels, buf, NULL,
|
||||
FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (s->draw_curves) {
|
||||
AVFrame *clone;
|
||||
|
@ -309,7 +309,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
if (ret < 0)
|
||||
break;
|
||||
|
||||
ctx->internal->execute(ctx, filter_channel, out, NULL, inlink->channels);
|
||||
ff_filter_execute(ctx, filter_channel, out, NULL, inlink->channels);
|
||||
|
||||
av_audio_fifo_drain(s->fifo, s->H);
|
||||
|
||||
|
@ -203,8 +203,8 @@ static int activate(AVFilterContext *ctx)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
ctx->internal->execute(ctx, process_channels, out, NULL, FFMIN(ctx->outputs[0]->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, process_channels, out, NULL,
|
||||
FFMIN(ctx->outputs[0]->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
out->pts = s->frame[0]->pts;
|
||||
|
||||
|
@ -1441,8 +1441,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
out->pts = in->pts;
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, rnnoise_channels, &td, NULL, FFMIN(outlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, rnnoise_channels, &td, NULL,
|
||||
FFMIN(outlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -400,8 +400,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
td.out = s->frame;
|
||||
td.nb_samples = av_sample_fmt_is_planar(in->format) ? ret : ret * in->channels;
|
||||
td.channels = channels;
|
||||
ctx->internal->execute(ctx, filter_channels, &td, NULL, FFMIN(channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channels, &td, NULL,
|
||||
FFMIN(channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
ret = swr_convert(s->down_ctx, (uint8_t**)out->extended_data, out->nb_samples,
|
||||
(const uint8_t **)s->frame->extended_data, ret);
|
||||
@ -419,8 +419,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
td.out = out;
|
||||
td.nb_samples = nb_samples;
|
||||
td.channels = channels;
|
||||
ctx->internal->execute(ctx, filter_channels, &td, NULL, FFMIN(channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channels, &td, NULL,
|
||||
FFMIN(channels, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
if (out != in)
|
||||
|
@ -632,7 +632,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
|
||||
s->nb_frames++;
|
||||
}
|
||||
|
||||
ctx->internal->execute(ctx, filter_channel, buf, NULL, FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channel, buf, NULL,
|
||||
FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (s->metadata)
|
||||
set_metadata(s, metadata);
|
||||
|
@ -169,8 +169,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
}
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, filter_channels, &td, NULL, FFMIN(inlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channels, &td, NULL,
|
||||
FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (out != in)
|
||||
av_frame_free(&in);
|
||||
|
@ -299,8 +299,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
}
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, s->filter_channels, &td, NULL, FFMIN(inlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter_channels, &td, NULL,
|
||||
FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (out != in)
|
||||
av_frame_free(&in);
|
||||
|
@ -797,7 +797,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
|
||||
|
||||
td.in = buf;
|
||||
td.out = out_buf;
|
||||
ctx->internal->execute(ctx, filter_channel, &td, NULL, FFMIN(outlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_channel, &td, NULL,
|
||||
FFMIN(outlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
for (ch = 0; ch < outlink->channels; ch++) {
|
||||
if (s->cache[ch].clippings > 0)
|
||||
|
@ -398,8 +398,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
td.channels = in->channels;
|
||||
td.mult = ctx->is_disabled ? 0.f : s->mult;
|
||||
td.clip = s->clip;
|
||||
ctx->internal->execute(ctx, s->filter, &td, NULL, FFMIN(inlink->channels,
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter, &td, NULL,
|
||||
FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (out != in)
|
||||
av_frame_free(&in);
|
||||
|
@ -341,9 +341,9 @@ static int headphone_frame(HeadphoneContext *s, AVFrame *in, AVFilterLink *outli
|
||||
td.temp_afft = s->temp_afft;
|
||||
|
||||
if (s->type == TIME_DOMAIN) {
|
||||
ctx->internal->execute(ctx, headphone_convolute, &td, NULL, 2);
|
||||
ff_filter_execute(ctx, headphone_convolute, &td, NULL, 2);
|
||||
} else {
|
||||
ctx->internal->execute(ctx, headphone_fast_convolute, &td, NULL, 2);
|
||||
ff_filter_execute(ctx, headphone_fast_convolute, &td, NULL, 2);
|
||||
}
|
||||
emms_c();
|
||||
|
||||
|
@ -604,9 +604,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
td.temp_afft = s->temp_afft;
|
||||
|
||||
if (s->type == TIME_DOMAIN) {
|
||||
ctx->internal->execute(ctx, sofalizer_convolute, &td, NULL, 2);
|
||||
ff_filter_execute(ctx, sofalizer_convolute, &td, NULL, 2);
|
||||
} else if (s->type == FREQUENCY_DOMAIN) {
|
||||
ctx->internal->execute(ctx, sofalizer_fast_convolute, &td, NULL, 2);
|
||||
ff_filter_execute(ctx, sofalizer_fast_convolute, &td, NULL, 2);
|
||||
}
|
||||
emms_c();
|
||||
|
||||
|
@ -1586,7 +1586,7 @@ static int filter_frame(AVFilterLink *inlink)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ctx->internal->execute(ctx, fft_channel, NULL, NULL, inlink->channels);
|
||||
ff_filter_execute(ctx, fft_channel, NULL, NULL, inlink->channels);
|
||||
|
||||
s->filter(ctx);
|
||||
|
||||
@ -1594,7 +1594,7 @@ static int filter_frame(AVFilterLink *inlink)
|
||||
if (!out)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
ctx->internal->execute(ctx, ifft_channel, out, NULL, outlink->channels);
|
||||
ff_filter_execute(ctx, ifft_channel, out, NULL, outlink->channels);
|
||||
|
||||
out->pts = s->pts;
|
||||
if (s->pts != AV_NOPTS_VALUE)
|
||||
|
@ -318,7 +318,7 @@ static int spatial_activate(AVFilterContext *ctx)
|
||||
|
||||
av_assert0(fin->nb_samples == s->win_size);
|
||||
|
||||
ctx->internal->execute(ctx, run_channel_fft, fin, NULL, 2);
|
||||
ff_filter_execute(ctx, run_channel_fft, fin, NULL, 2);
|
||||
|
||||
ret = draw_spatial(inlink, fin);
|
||||
|
||||
|
@ -1412,7 +1412,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
|
||||
/* initialize buffer for combining to black */
|
||||
clear_combine_buffer(s, z);
|
||||
|
||||
ctx->internal->execute(ctx, s->plot_channel, NULL, NULL, s->nb_display_channels);
|
||||
ff_filter_execute(ctx, s->plot_channel, NULL, NULL, s->nb_display_channels);
|
||||
|
||||
for (y = 0; y < z * 3; y++) {
|
||||
for (x = 0; x < s->nb_display_channels; x++) {
|
||||
@ -1586,16 +1586,16 @@ static int activate(AVFilterContext *ctx)
|
||||
|
||||
av_assert0(fin->nb_samples == s->win_size);
|
||||
|
||||
ctx->internal->execute(ctx, run_channel_fft, fin, NULL, s->nb_display_channels);
|
||||
ff_filter_execute(ctx, run_channel_fft, fin, NULL, s->nb_display_channels);
|
||||
|
||||
if (s->data == D_MAGNITUDE)
|
||||
ctx->internal->execute(ctx, calc_channel_magnitudes, NULL, NULL, s->nb_display_channels);
|
||||
ff_filter_execute(ctx, calc_channel_magnitudes, NULL, NULL, s->nb_display_channels);
|
||||
|
||||
if (s->data == D_PHASE)
|
||||
ctx->internal->execute(ctx, calc_channel_phases, NULL, NULL, s->nb_display_channels);
|
||||
ff_filter_execute(ctx, calc_channel_phases, NULL, NULL, s->nb_display_channels);
|
||||
|
||||
if (s->data == D_UPHASE)
|
||||
ctx->internal->execute(ctx, calc_channel_uphases, NULL, NULL, s->nb_display_channels);
|
||||
ff_filter_execute(ctx, calc_channel_uphases, NULL, NULL, s->nb_display_channels);
|
||||
|
||||
ret = plot_spectrum_column(inlink, fin);
|
||||
|
||||
@ -1792,7 +1792,7 @@ static int showspectrumpic_request_frame(AVFilterLink *outlink)
|
||||
}
|
||||
}
|
||||
|
||||
ctx->internal->execute(ctx, run_channel_fft, fin, NULL, s->nb_display_channels);
|
||||
ff_filter_execute(ctx, run_channel_fft, fin, NULL, s->nb_display_channels);
|
||||
acalc_magnitudes(s);
|
||||
|
||||
consumed += spf;
|
||||
|
@ -132,6 +132,12 @@ struct AVFilterInternal {
|
||||
avfilter_execute_func *execute;
|
||||
};
|
||||
|
||||
static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func,
|
||||
void *arg, int *ret, int nb_jobs)
|
||||
{
|
||||
return ctx->internal->execute(ctx, func, arg, ret, nb_jobs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell if an integer is contained in the provided -1-terminated list of integers.
|
||||
* This is useful for determining (for instance) if an AVPixelFormat is in an
|
||||
|
@ -264,7 +264,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.out = out;
|
||||
td.in = s->frames;
|
||||
ctx->internal->execute(ctx, amplify_frame, &td, NULL, FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, amplify_frame, &td, NULL,
|
||||
FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
|
||||
} else {
|
||||
out = av_frame_clone(s->frames[s->radius]);
|
||||
if (!out)
|
||||
|
@ -488,7 +488,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
|
||||
}
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, s->filter_slice, &td, NULL,
|
||||
ff_filter_execute(ctx, s->filter_slice, &td, NULL,
|
||||
FFMIN3(s->planeheight[1],
|
||||
s->planeheight[2],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
|
@ -216,10 +216,12 @@ static void averageiir2d(AVFilterContext *ctx, AVFrame *in, AVFrame *out, int pl
|
||||
td.height = height;
|
||||
td.ptr = in->data[plane];
|
||||
td.linesize = in->linesize[plane];
|
||||
ctx->internal->execute(ctx, s->filter_horizontally, &td, NULL, FFMIN(height, nb_threads));
|
||||
ff_filter_execute(ctx, s->filter_horizontally, &td,
|
||||
NULL, FFMIN(height, nb_threads));
|
||||
td.ptr = out->data[plane];
|
||||
td.linesize = out->linesize[plane];
|
||||
ctx->internal->execute(ctx, s->filter_vertically, &td, NULL, FFMIN(width, nb_threads));
|
||||
ff_filter_execute(ctx, s->filter_vertically, &td,
|
||||
NULL, FFMIN(width, nb_threads));
|
||||
}
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
|
@ -188,8 +188,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
|
||||
BlackDetectContext *s = ctx->priv;
|
||||
double picture_black_ratio = 0;
|
||||
|
||||
ctx->internal->execute(ctx, black_counter, picref, NULL,
|
||||
FFMIN(inlink->h, s->nb_threads));
|
||||
ff_filter_execute(ctx, black_counter, picref, NULL,
|
||||
FFMIN(inlink->h, s->nb_threads));
|
||||
|
||||
for (int i = 0; i < s->nb_threads; i++)
|
||||
s->nb_black_pixels += s->counter[i];
|
||||
|
@ -624,7 +624,8 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
|
||||
.w = outw, .h = outh, .param = param, .plane = plane,
|
||||
.inlink = inlink };
|
||||
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outh, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(outh, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
if (!s->tblend)
|
||||
|
@ -763,7 +763,7 @@ static int filter_frame(AVFilterContext *ctx, AVFrame **out, AVFrame *in, AVFram
|
||||
td.ref = ref->data[p];
|
||||
td.ref_linesize = ref->linesize[p];
|
||||
td.plane = p;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, nb_jobs);
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL, nb_jobs);
|
||||
|
||||
s->do_output(s, (*out)->data[p], (*out)->linesize[p], p, nb_jobs);
|
||||
}
|
||||
|
@ -279,7 +279,8 @@ static void filter(AVFilterContext *ctx, AVFrame *dstpic,
|
||||
td.h = h;
|
||||
td.plane = i;
|
||||
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(h, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
if (yadif->current_field == YADIF_FIELD_END) {
|
||||
yadif->current_field = YADIF_FIELD_NORMAL;
|
||||
|
@ -193,8 +193,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
av_frame_copy_props(out, in);
|
||||
|
||||
s->in = in;
|
||||
ctx->internal->execute(ctx, s->do_slice, out, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->do_slice, out, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
av_frame_free(&in);
|
||||
s->in = NULL;
|
||||
|
||||
|
@ -260,7 +260,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
|
||||
ChromakeyContext *ctx = avctx->priv;
|
||||
int res;
|
||||
|
||||
if (res = avctx->internal->execute(avctx, ctx->do_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(avctx))))
|
||||
if (res = ff_filter_execute(avctx, ctx->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(avctx))))
|
||||
return res;
|
||||
|
||||
return ff_filter_frame(avctx->outputs[0], frame);
|
||||
|
@ -208,10 +208,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
av_frame_copy_props(out, in);
|
||||
s->out = out;
|
||||
ctx->internal->execute(ctx, s->filter_slice, in, NULL,
|
||||
FFMIN3(s->planeheight[1],
|
||||
s->planeheight[2],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter_slice, in, NULL,
|
||||
FFMIN3(s->planeheight[1],
|
||||
s->planeheight[2],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -359,10 +359,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
in->data[0], in->linesize[0],
|
||||
s->linesize[0], s->height[0]);
|
||||
}
|
||||
ctx->internal->execute(ctx, s->filter_slice, out, NULL,
|
||||
FFMIN3(s->height[1],
|
||||
s->height[2],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter_slice, out, NULL,
|
||||
FFMIN3(s->height[1],
|
||||
s->height[2],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
s->in = NULL;
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -411,7 +411,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, s->color_balance, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->color_balance, &td, NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (in != out)
|
||||
av_frame_free(&in);
|
||||
|
@ -753,7 +753,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, s->filter_slice[pl], &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter_slice[pl], &td, NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (in != out)
|
||||
av_frame_free(&in);
|
||||
|
@ -366,7 +366,8 @@ get_deriv(AVFilterContext *ctx, ThreadData *td, int ord, int dir,
|
||||
td->meta_data[INDEX_DIR] = dir;
|
||||
td->meta_data[INDEX_SRC] = src;
|
||||
td->meta_data[INDEX_DST] = dst;
|
||||
ctx->internal->execute(ctx, slice_get_derivative, td, NULL, FFMIN(dim, nb_threads));
|
||||
ff_filter_execute(ctx, slice_get_derivative, td,
|
||||
NULL, FFMIN(dim, nb_threads));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -500,10 +501,10 @@ static int filter_grey_edge(AVFilterContext *ctx, AVFrame *in)
|
||||
}
|
||||
get_derivative(ctx, &td);
|
||||
if (difford > 0) {
|
||||
ctx->internal->execute(ctx, slice_normalize, &td, NULL, nb_jobs);
|
||||
ff_filter_execute(ctx, slice_normalize, &td, NULL, nb_jobs);
|
||||
}
|
||||
|
||||
ctx->internal->execute(ctx, filter_slice_grey_edge, &td, NULL, nb_jobs);
|
||||
ff_filter_execute(ctx, filter_slice_grey_edge, &td, NULL, nb_jobs);
|
||||
if (!minknorm) {
|
||||
for (plane = 0; plane < NUM_PLANES; ++plane) {
|
||||
white[plane] = 0; // All values are absolute
|
||||
@ -631,7 +632,7 @@ static void chromatic_adaptation(AVFilterContext *ctx, AVFrame *in, AVFrame *out
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, diagonal_transformation, &td, NULL, nb_jobs);
|
||||
ff_filter_execute(ctx, diagonal_transformation, &td, NULL, nb_jobs);
|
||||
}
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
|
@ -303,8 +303,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
|
||||
ColorContrastContext *s = ctx->priv;
|
||||
int res;
|
||||
|
||||
if (res = ctx->internal->execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx))))
|
||||
if (res = ff_filter_execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx))))
|
||||
return res;
|
||||
|
||||
return ff_filter_frame(ctx->outputs[0], frame);
|
||||
|
@ -140,8 +140,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
AVFilterContext *ctx = inlink->dst;
|
||||
ColorCorrectContext *s = ctx->priv;
|
||||
|
||||
ctx->internal->execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
return ff_filter_frame(ctx->outputs[0], frame);
|
||||
}
|
||||
|
@ -203,8 +203,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
hsl2rgb(s->hue, s->saturation, s->lightness, &c[0], &c[1], &c[2]);
|
||||
rgb2yuv(c[0], c[1], c[2], &s->c[0], &s->c[1], &s->c[2], s->depth);
|
||||
|
||||
ctx->internal->execute(ctx, do_slice, frame, NULL,
|
||||
FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, do_slice, frame, NULL,
|
||||
FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
return ff_filter_frame(ctx->outputs[0], frame);
|
||||
}
|
||||
|
@ -138,7 +138,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
|
||||
if (res = av_frame_make_writable(frame))
|
||||
return res;
|
||||
|
||||
if (res = avctx->internal->execute(avctx, ctx->do_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(avctx))))
|
||||
if (res = ff_filter_execute(avctx, ctx->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(avctx))))
|
||||
return res;
|
||||
|
||||
return ff_filter_frame(avctx->outputs[0], frame);
|
||||
|
@ -286,8 +286,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->internal->execute(ctx, s->colorlevels_slice, &td, NULL,
|
||||
FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->colorlevels_slice, &td, NULL,
|
||||
FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (in != out)
|
||||
av_frame_free(&in);
|
||||
|
@ -470,17 +470,17 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
|
||||
td.c7 = color->yuv_convert[color->mode][2][2];
|
||||
|
||||
if (in->format == AV_PIX_FMT_YUV444P)
|
||||
ctx->internal->execute(ctx, process_slice_yuv444p, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, process_slice_yuv444p, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
else if (in->format == AV_PIX_FMT_YUV422P)
|
||||
ctx->internal->execute(ctx, process_slice_yuv422p, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, process_slice_yuv422p, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
else if (in->format == AV_PIX_FMT_YUV420P)
|
||||
ctx->internal->execute(ctx, process_slice_yuv420p, &td, NULL,
|
||||
FFMIN(in->height / 2, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, process_slice_yuv420p, &td, NULL,
|
||||
FFMIN(in->height / 2, ff_filter_get_nb_threads(ctx)));
|
||||
else
|
||||
ctx->internal->execute(ctx, process_slice_uyvy422, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, process_slice_uyvy422, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -873,8 +873,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
ctx->internal->execute(ctx, convert, &td, NULL,
|
||||
FFMIN((in->height + 1) >> 1, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, convert, &td, NULL,
|
||||
FFMIN((in->height + 1) >> 1, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
av_frame_free(&in);
|
||||
|
||||
|
@ -270,8 +270,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
|
||||
kelvin2rgb(s->temperature, s->color);
|
||||
|
||||
ctx->internal->execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
return ff_filter_frame(ctx->outputs[0], frame);
|
||||
}
|
||||
|
@ -736,7 +736,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN3(s->planeheight[1], s->planewidth[1], s->nb_threads));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN3(s->planeheight[1], s->planewidth[1], s->nb_threads));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -472,8 +472,10 @@ static int do_convolve(FFFrameSync *fs)
|
||||
td.hdata = s->fft_hdata[plane];
|
||||
td.vdata = s->fft_vdata[plane];
|
||||
|
||||
ctx->internal->execute(ctx, fft_horizontal, &td, NULL, FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ctx->internal->execute(ctx, fft_vertical, &td, NULL, FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, fft_horizontal, &td, NULL,
|
||||
FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, fft_vertical, &td, NULL,
|
||||
FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if ((!s->impulse && !s->got_impulse[plane]) || s->impulse) {
|
||||
if (s->depth == 8) {
|
||||
@ -498,8 +500,10 @@ static int do_convolve(FFFrameSync *fs)
|
||||
td.hdata = s->fft_hdata_impulse[plane];
|
||||
td.vdata = s->fft_vdata_impulse[plane];
|
||||
|
||||
ctx->internal->execute(ctx, fft_horizontal, &td, NULL, FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ctx->internal->execute(ctx, fft_vertical, &td, NULL, FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, fft_horizontal, &td, NULL,
|
||||
FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, fft_vertical, &td, NULL,
|
||||
FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
s->got_impulse[plane] = 1;
|
||||
}
|
||||
@ -507,13 +511,16 @@ static int do_convolve(FFFrameSync *fs)
|
||||
td.hdata = input;
|
||||
td.vdata = filter;
|
||||
|
||||
ctx->internal->execute(ctx, s->filter, &td, NULL, FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter, &td, NULL,
|
||||
FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
td.hdata = s->fft_hdata[plane];
|
||||
td.vdata = s->fft_vdata[plane];
|
||||
|
||||
ctx->internal->execute(ctx, ifft_vertical, &td, NULL, FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ctx->internal->execute(ctx, ifft_horizontal, &td, NULL, FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, ifft_vertical, &td, NULL,
|
||||
FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, ifft_horizontal, &td, NULL,
|
||||
FFMIN3(MAX_THREADS, n, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
get_output(s, s->fft_hdata[plane], mainpic, w, h, n, plane, 1.f / (n * n));
|
||||
}
|
||||
|
@ -739,7 +739,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, curves->filter_slice, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, curves->filter_slice, &td, NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (out != in)
|
||||
av_frame_free(&in);
|
||||
|
@ -370,7 +370,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
}
|
||||
|
||||
td.in = in; td.out = out, td.yoff = xmaxlen, td.xoff = ymaxlen, td.PP = PP;
|
||||
ctx->internal->execute(ctx, s->filter, &td, NULL, FFMIN(ff_filter_get_nb_threads(ctx), FFMAX(outlink->w / 20, 1)));
|
||||
ff_filter_execute(ctx, s->filter, &td, NULL,
|
||||
FFMIN(ff_filter_get_nb_threads(ctx), FFMAX(outlink->w / 20, 1)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -745,7 +745,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
.src = s->cbuf[0][plane],
|
||||
.dst = s->cbuf[1][plane],
|
||||
};
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, s->nb_threads);
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL, s->nb_threads);
|
||||
}
|
||||
s->color_correlation(out->data, out->linesize[0],
|
||||
s->cbuf[1], s->p_linesize,
|
||||
|
@ -422,9 +422,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
av_frame_copy_props(out, in);
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, s->deband, &td, NULL, FFMIN3(s->planeheight[1],
|
||||
s->planeheight[2],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->deband, &td, NULL,
|
||||
FFMIN3(s->planeheight[1], s->planeheight[2],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -296,19 +296,19 @@ static int activate(AVFilterContext *ctx)
|
||||
ret = av_frame_make_writable(out);
|
||||
if (ret >= 0) {
|
||||
if (s->m & 1)
|
||||
ctx->internal->execute(ctx, s->dedotcrawl, out, NULL,
|
||||
FFMIN(s->planeheight[0],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->dedotcrawl, out, NULL,
|
||||
FFMIN(ff_filter_get_nb_threads(ctx),
|
||||
s->planeheight[0]));
|
||||
if (s->m & 2) {
|
||||
ThreadData td;
|
||||
td.out = out; td.plane = 1;
|
||||
ctx->internal->execute(ctx, s->derainbow, &td, NULL,
|
||||
FFMIN(s->planeheight[1],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->derainbow, &td, NULL,
|
||||
FFMIN(ff_filter_get_nb_threads(ctx),
|
||||
s->planeheight[1]));
|
||||
td.plane = 2;
|
||||
ctx->internal->execute(ctx, s->derainbow, &td, NULL,
|
||||
FFMIN(s->planeheight[2],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->derainbow, &td, NULL,
|
||||
FFMIN(ff_filter_get_nb_threads(ctx),
|
||||
s->planeheight[2]));
|
||||
}
|
||||
} else
|
||||
av_frame_free(&out);
|
||||
|
@ -97,7 +97,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
|
||||
if (ret = av_frame_make_writable(frame))
|
||||
return ret;
|
||||
|
||||
if (ret = ctx->internal->execute(ctx, do_despill_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(ctx))))
|
||||
if (ret = ff_filter_execute(ctx, do_despill_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx))))
|
||||
return ret;
|
||||
|
||||
return ff_filter_frame(ctx->outputs[0], frame);
|
||||
|
@ -247,7 +247,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
av_frame_copy_props(out, in);
|
||||
|
||||
td.in = in, td.out = out;
|
||||
ctx->internal->execute(ctx, s->epx_slice, &td, NULL, FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->epx_slice, &td, NULL,
|
||||
FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -441,8 +441,8 @@ static int filter(AVFilterContext *ctx, int is_second, AVFrame *in)
|
||||
out->pts = s->pts;
|
||||
|
||||
td.out = out; td.in = in;
|
||||
ctx->internal->execute(ctx, deinterlace_slice, &td, NULL,
|
||||
FFMIN(s->planeheight[1] / 2, s->nb_threads));
|
||||
ff_filter_execute(ctx, deinterlace_slice, &td, NULL,
|
||||
FFMIN(s->planeheight[1] / 2, s->nb_threads));
|
||||
|
||||
if (s->mode)
|
||||
s->field = !s->field;
|
||||
|
@ -69,8 +69,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
ExposureContext *s = ctx->priv;
|
||||
|
||||
s->scale = 1.f / (exp2f(-s->exposure) - s->black);
|
||||
ctx->internal->execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
return ff_filter_frame(ctx->outputs[0], frame);
|
||||
}
|
||||
|
@ -493,20 +493,20 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
|
||||
if (s->factor < UINT16_MAX) {
|
||||
if (s->alpha) {
|
||||
ctx->internal->execute(ctx, s->filter_slice_alpha, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter_slice_alpha, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
} else if (s->is_rgb && !s->black_fade) {
|
||||
ctx->internal->execute(ctx, filter_slice_rgb, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice_rgb, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
} else {
|
||||
/* luma, or rgb plane in case of black */
|
||||
ctx->internal->execute(ctx, s->filter_slice_luma, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter_slice_luma, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (frame->data[1] && frame->data[2] && !s->is_rgb) {
|
||||
/* chroma planes */
|
||||
ctx->internal->execute(ctx, s->filter_slice_chroma, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter_slice_chroma, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,8 @@ static int blend_frames(AVFilterContext *ctx, int interpolate)
|
||||
av_frame_copy_props(s->work, s->f0);
|
||||
|
||||
ff_dlog(ctx, "blend_frames() INTERPOLATE to create work frame\n");
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(FFMAX(1, outlink->h >> 2), ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(FFMAX(1, outlink->h >> 2), ff_filter_get_nb_threads(ctx)));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -196,9 +196,12 @@ static void gaussianiir2d(AVFilterContext *ctx, int plane)
|
||||
|
||||
td.width = width;
|
||||
td.height = height;
|
||||
ctx->internal->execute(ctx, filter_horizontally, &td, NULL, FFMIN(height, nb_threads));
|
||||
ctx->internal->execute(ctx, filter_vertically, &td, NULL, FFMIN(width, nb_threads));
|
||||
ctx->internal->execute(ctx, filter_postscale, &td, NULL, FFMIN(width * height, nb_threads));
|
||||
ff_filter_execute(ctx, filter_horizontally, &td,
|
||||
NULL, FFMIN(height, nb_threads));
|
||||
ff_filter_execute(ctx, filter_vertically, &td,
|
||||
NULL, FFMIN(width, nb_threads));
|
||||
ff_filter_execute(ctx, filter_postscale, &td,
|
||||
NULL, FFMIN(width * height, nb_threads));
|
||||
}
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
|
@ -449,7 +449,8 @@ static int geq_filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
if (geq->needs_sum[plane])
|
||||
calculate_sums(geq, plane, width, height);
|
||||
|
||||
ctx->internal->execute(ctx, slice_geq_filter, &td, NULL, FFMIN(height, nb_threads));
|
||||
ff_filter_execute(ctx, slice_geq_filter, &td,
|
||||
NULL, FFMIN(height, nb_threads));
|
||||
}
|
||||
|
||||
av_frame_free(&geq->picref);
|
||||
|
@ -250,16 +250,16 @@ static int guided_##name(AVFilterContext *ctx, GuidedContext *s,
|
||||
t.dstStride = w; \
|
||||
t.src = I; \
|
||||
t.dst = meanI; \
|
||||
ctx->internal->execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
ff_filter_execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
t.src = II; \
|
||||
t.dst = meanII; \
|
||||
ctx->internal->execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
ff_filter_execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
t.src = P; \
|
||||
t.dst = meanP; \
|
||||
ctx->internal->execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
ff_filter_execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
t.src = IP; \
|
||||
t.dst = meanIP; \
|
||||
ctx->internal->execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
ff_filter_execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
\
|
||||
for (int i = 0;i < h;i++) { \
|
||||
for (int j = 0;j < w;j++) { \
|
||||
@ -273,10 +273,10 @@ static int guided_##name(AVFilterContext *ctx, GuidedContext *s,
|
||||
\
|
||||
t.src = A; \
|
||||
t.dst = meanA; \
|
||||
ctx->internal->execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
ff_filter_execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
t.src = B; \
|
||||
t.dst = meanB; \
|
||||
ctx->internal->execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
ff_filter_execute(ctx, s->box_slice, &t, NULL, FFMIN(h, nb_threads)); \
|
||||
\
|
||||
for (int i = 0;i < height;i++) { \
|
||||
for (int j = 0;j < width;j++) { \
|
||||
|
@ -221,7 +221,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
memcpy(out->data[1], in->data[1], AVPALETTE_SIZE);
|
||||
|
||||
td.in = in, td.out = out;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -337,7 +337,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
td.out = out;
|
||||
td.direct = direct;
|
||||
/* one thread per plane */
|
||||
ctx->internal->execute(ctx, do_denoise, &td, NULL, 3);
|
||||
ff_filter_execute(ctx, do_denoise, &td, NULL, 3);
|
||||
|
||||
if (ctx->is_disabled) {
|
||||
av_frame_free(&out);
|
||||
|
@ -499,7 +499,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
td.rgbtoyuv = hqx->rgbtoyuv;
|
||||
ctx->internal->execute(ctx, hqx->func, &td, NULL, FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, hqx->func, &td, NULL,
|
||||
FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -196,7 +196,8 @@ static int do_identity(FFFrameSync *fs)
|
||||
td.planeheight[c] = s->planeheight[c];
|
||||
}
|
||||
|
||||
ctx->internal->execute(ctx, s->filter_slice, &td, NULL, FFMIN(s->planeheight[1], s->nb_threads));
|
||||
ff_filter_execute(ctx, s->filter_slice, &td, NULL,
|
||||
FFMIN(s->planeheight[1], s->nb_threads));
|
||||
|
||||
for (int j = 0; j < s->nb_threads; j++) {
|
||||
for (int c = 0; c < s->nb_components; c++)
|
||||
|
@ -173,7 +173,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.out = out;
|
||||
td.in = in;
|
||||
ctx->internal->execute(ctx, s->lagfun, &td, NULL, FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->lagfun, &td, NULL,
|
||||
FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -315,7 +315,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
av_frame_copy_props(out, in);
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(rect->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(rect->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -461,11 +461,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
.modifier = lensfun->modifier
|
||||
};
|
||||
|
||||
ctx->internal->execute(ctx,
|
||||
vignetting_filter_slice,
|
||||
&vignetting_thread_data,
|
||||
NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, vignetting_filter_slice,
|
||||
&vignetting_thread_data, NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) {
|
||||
@ -489,11 +487,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
.interpolation_type = lensfun->interpolation_type
|
||||
};
|
||||
|
||||
ctx->internal->execute(ctx,
|
||||
distortion_correction_filter_slice,
|
||||
&distortion_correction_thread_data,
|
||||
NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, distortion_correction_filter_slice,
|
||||
&distortion_correction_thread_data, NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -219,8 +219,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.out = out;
|
||||
td.in = in;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(s->height[2], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(s->height[2], ff_filter_get_nb_threads(ctx)));
|
||||
if (out != in)
|
||||
av_frame_free(&in);
|
||||
|
||||
|
@ -138,7 +138,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
|
||||
if (ret = av_frame_make_writable(frame))
|
||||
return ret;
|
||||
|
||||
if (ret = ctx->internal->execute(ctx, s->do_lumakey_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(ctx))))
|
||||
if (ret = ff_filter_execute(ctx, s->do_lumakey_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx))))
|
||||
return ret;
|
||||
|
||||
return ff_filter_frame(ctx->outputs[0], frame);
|
||||
|
@ -538,23 +538,23 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
if (s->is_rgb && s->is_16bit && !s->is_planar) {
|
||||
/* packed, 16-bit */
|
||||
PACKED_THREAD_DATA
|
||||
ctx->internal->execute(ctx, lut_packed_16bits, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, lut_packed_16bits, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
} else if (s->is_rgb && !s->is_planar) {
|
||||
/* packed 8 bits */
|
||||
PACKED_THREAD_DATA
|
||||
ctx->internal->execute(ctx, lut_packed_8bits, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, lut_packed_8bits, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
} else if (s->is_16bit) {
|
||||
/* planar >8 bit depth */
|
||||
PLANAR_THREAD_DATA
|
||||
ctx->internal->execute(ctx, lut_planar_16bits, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, lut_planar_16bits, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
} else {
|
||||
/* planar 8bit depth */
|
||||
PLANAR_THREAD_DATA
|
||||
ctx->internal->execute(ctx, lut_planar_8bits, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, lut_planar_8bits, &td, NULL,
|
||||
FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
if (!direct)
|
||||
|
@ -316,7 +316,8 @@ static int process_frame(FFFrameSync *fs)
|
||||
td.out = out;
|
||||
td.srcx = srcx;
|
||||
td.srcy = srcy;
|
||||
ctx->internal->execute(ctx, s->lut2, &td, NULL, FFMIN(s->heightx[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->lut2, &td, NULL,
|
||||
FFMIN(s->heightx[1], ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
|
||||
@ -613,7 +614,8 @@ static int tlut2_filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
td.out = out;
|
||||
td.srcx = frame;
|
||||
td.srcy = s->prev_frame;
|
||||
ctx->internal->execute(ctx, s->lut2, &td, NULL, FFMIN(s->heightx[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->lut2, &td, NULL,
|
||||
FFMIN(s->heightx[1], ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
av_frame_free(&s->prev_frame);
|
||||
s->prev_frame = frame;
|
||||
|
@ -1231,7 +1231,8 @@ static AVFrame *apply_lut(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, lut3d->interp, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, lut3d->interp, &td, NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (out != in)
|
||||
av_frame_free(&in);
|
||||
@ -2229,7 +2230,8 @@ static AVFrame *apply_1d_lut(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, lut1d->interp, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, lut1d->interp, &td, NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (out != in)
|
||||
av_frame_free(&in);
|
||||
|
@ -159,8 +159,8 @@ static int process_frame(FFFrameSync *fs)
|
||||
td.m = bright;
|
||||
td.d = out;
|
||||
|
||||
ctx->internal->execute(ctx, maskedclamp_slice, &td, NULL, FFMIN(s->height[0],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, maskedclamp_slice, &td, NULL,
|
||||
FFMIN(s->height[0], ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
|
||||
|
||||
|
@ -134,8 +134,8 @@ static int process_frame(FFFrameSync *fs)
|
||||
td.base = base;
|
||||
td.overlay = overlay;
|
||||
td.mask = mask;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(s->height[2], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(s->height[2], ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
|
||||
|
||||
|
@ -221,8 +221,8 @@ static int process_frame(FFFrameSync *fs)
|
||||
td.f2 = f2;
|
||||
td.dst = out;
|
||||
|
||||
ctx->internal->execute(ctx, maskedminmax_slice, &td, NULL, FFMIN(s->planeheight[0],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, maskedminmax_slice, &td, NULL,
|
||||
FFMIN(s->planeheight[0], ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
|
||||
|
||||
|
@ -191,8 +191,8 @@ static int process_frame(FFFrameSync *fs)
|
||||
td.ref = ref;
|
||||
td.dst = out;
|
||||
|
||||
ctx->internal->execute(ctx, threshold_slice, &td, NULL, FFMIN(s->planeheight[2],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, threshold_slice, &td, NULL,
|
||||
FFMIN(s->planeheight[2], ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
|
||||
|
||||
|
@ -105,8 +105,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
return ff_filter_frame(outlink, out);
|
||||
}
|
||||
|
||||
ctx->internal->execute(ctx, s->maskfun, frame, NULL,
|
||||
FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->maskfun, frame, NULL,
|
||||
FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
return ff_filter_frame(outlink, frame);
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
av_frame_copy_props(out, in);
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, s->nb_threads);
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL, s->nb_threads);
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -226,7 +226,8 @@ static int process_frame(FFFrameSync *fs)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, mix_frames, &td, NULL, FFMIN(s->height[0], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, mix_frames, &td, NULL,
|
||||
FFMIN(s->height[0], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
return ff_filter_frame(outlink, out);
|
||||
}
|
||||
@ -412,7 +413,8 @@ static int tmix_filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.out = out;
|
||||
td.in = s->frames;
|
||||
ctx->internal->execute(ctx, mix_frames, &td, NULL, FFMIN(s->height[0], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, mix_frames, &td, NULL,
|
||||
FFMIN(s->height[0], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
return ff_filter_frame(outlink, out);
|
||||
}
|
||||
|
@ -214,10 +214,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
AVFilterContext *ctx = inlink->dst;
|
||||
MonochromeContext *s = ctx->priv;
|
||||
|
||||
ctx->internal->execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
ctx->internal->execute(ctx, s->clear_uv, frame, NULL,
|
||||
FFMIN(frame->height >> s->subh, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->do_slice, frame, NULL,
|
||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->clear_uv, frame, NULL,
|
||||
FFMIN(frame->height >> s->subh, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
return ff_filter_frame(ctx->outputs[0], frame);
|
||||
}
|
||||
|
@ -328,7 +328,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -455,8 +455,8 @@ static int nlmeans_plane(AVFilterContext *ctx, int w, int h, int p, int r,
|
||||
compute_ssd_integral_image(&s->dsp, s->ii, s->ii_lz_32,
|
||||
src, src_linesize,
|
||||
offx, offy, e, w, h);
|
||||
ctx->internal->execute(ctx, nlmeans_slice, &td, NULL,
|
||||
FFMIN(td.endy - td.starty, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, nlmeans_slice, &td, NULL,
|
||||
FFMIN(td.endy - td.starty, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -671,7 +671,8 @@ static int get_frame(AVFilterContext *ctx, int is_second)
|
||||
dst->interlaced_frame = 0;
|
||||
dst->pts = s->pts;
|
||||
|
||||
ctx->internal->execute(ctx, filter_slice, dst, NULL, FFMIN(s->planeheight[1] / 2, s->nb_threads));
|
||||
ff_filter_execute(ctx, filter_slice, dst, NULL,
|
||||
FFMIN(s->planeheight[1] / 2, s->nb_threads));
|
||||
|
||||
if (s->field == -2 || s->field > 1)
|
||||
s->field_n = !s->field_n;
|
||||
|
@ -272,7 +272,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
|
||||
}
|
||||
|
||||
td.in = inpicref; td.out = out;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(n->height[0], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(n->height[0], ff_filter_get_nb_threads(ctx)));
|
||||
emms_c();
|
||||
|
||||
if (inpicref != out)
|
||||
|
@ -1029,8 +1029,8 @@ static int do_blend(FFFrameSync *fs)
|
||||
|
||||
td.dst = mainpic;
|
||||
td.src = second;
|
||||
ctx->internal->execute(ctx, s->blend_slice, &td, NULL, FFMIN(FFMAX(1, FFMIN3(s->y + second->height, FFMIN(second->height, mainpic->height), mainpic->height - s->y)),
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->blend_slice, &td, NULL, FFMIN(FFMAX(1, FFMIN3(s->y + second->height, FFMIN(second->height, mainpic->height), mainpic->height - s->y)),
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
return ff_filter_frame(ctx->outputs[0], mainpic);
|
||||
}
|
||||
|
@ -476,7 +476,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
.h = s->height[plane],
|
||||
.hsub = hsub,
|
||||
.vsub = vsub };
|
||||
ctx->internal->execute(ctx, s->perspective, &td, NULL, FFMIN(td.h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->perspective, &td, NULL,
|
||||
FFMIN(td.h, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
av_frame_free(&frame);
|
||||
|
@ -143,7 +143,8 @@ static void convert_frame(AVFilterContext *ctx, AVFrame *in, PhotosensitivityFra
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
td.skip = skip;
|
||||
ctx->internal->execute(ctx, convert_frame_partial, &td, NULL, FFMIN(NUM_CELLS, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, convert_frame_partial, &td, NULL,
|
||||
FFMIN(NUM_CELLS, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
typedef struct ThreadData_blend_frame
|
||||
@ -182,7 +183,8 @@ static void blend_frame(AVFilterContext *ctx, AVFrame *target, AVFrame *source,
|
||||
td.target = target;
|
||||
td.source = source;
|
||||
td.s_mul = (uint16_t)(factor * 0x100);
|
||||
ctx->internal->execute(ctx, blend_frame_partial, &td, NULL, FFMIN(ctx->outputs[0]->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, blend_frame_partial, &td, NULL,
|
||||
FFMIN(ctx->outputs[0]->h, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
static int get_badness(PhotosensitivityFrame *a, PhotosensitivityFrame *b)
|
||||
|
@ -635,8 +635,8 @@ static int filter_frame(AVFilterContext *ctx,
|
||||
td.d = *out;
|
||||
td.a = alpha;
|
||||
td.m = base;
|
||||
ctx->internal->execute(ctx, premultiply_slice, &td, NULL, FFMIN(s->height[0],
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, premultiply_slice, &td, NULL,
|
||||
FFMIN(s->height[0], ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -869,7 +869,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
av_frame_copy_props(out, in);
|
||||
|
||||
td.out = out, td.in = in;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
@ -189,7 +189,8 @@ static int do_psnr(FFFrameSync *fs)
|
||||
td.planeheight[c] = s->planeheight[c];
|
||||
}
|
||||
|
||||
ctx->internal->execute(ctx, compute_images_mse, &td, NULL, FFMIN(s->planeheight[1], s->nb_threads));
|
||||
ff_filter_execute(ctx, compute_images_mse, &td, NULL,
|
||||
FFMIN(s->planeheight[1], s->nb_threads));
|
||||
|
||||
for (int j = 0; j < s->nb_threads; j++) {
|
||||
for (int c = 0; c < s->nb_components; c++)
|
||||
|
@ -471,8 +471,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
ReadEIA608Context *s = ctx->priv;
|
||||
int nb_found;
|
||||
|
||||
ctx->internal->execute(ctx, extract_lines, in, NULL, FFMIN(FFMAX(s->end - s->start + 1, 1),
|
||||
ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, extract_lines, in, NULL,
|
||||
FFMIN(FFMAX(s->end - s->start + 1, 1), ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
nb_found = 0;
|
||||
for (int i = 0; i < s->end - s->start + 1; i++) {
|
||||
|
@ -302,7 +302,8 @@ static int process_frame(FFFrameSync *fs)
|
||||
td.nb_planes = s->nb_planes;
|
||||
td.nb_components = s->nb_components;
|
||||
td.step = s->step;
|
||||
ctx->internal->execute(ctx, s->remap_slice, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->remap_slice, &td, NULL,
|
||||
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
|
||||
|
||||
|
@ -615,8 +615,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
memcpy(dst, src, s->planewidth[i]);
|
||||
|
||||
td.in = in; td.out = out; td.plane = i;
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(s->planeheight[i], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(s->planeheight[i], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
src = in->data[i] + (s->planeheight[i] - 1) * in->linesize[i];
|
||||
dst = out->data[i] + (s->planeheight[i] - 1) * out->linesize[i];
|
||||
|
@ -548,8 +548,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
.yprime = -(outh-1) * c / 2,
|
||||
.plane = plane, .c = c, .s = s };
|
||||
|
||||
|
||||
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outh, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, filter_slice, &td, NULL,
|
||||
FFMIN(outh, ff_filter_get_nb_threads(ctx)));
|
||||
}
|
||||
|
||||
av_frame_free(&in);
|
||||
|
@ -128,8 +128,8 @@ static void scroll(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
|
||||
s->pos_h[0] = s->pos_h[3] = h_pos * s->bytes;
|
||||
|
||||
td.in = in; td.out = out;
|
||||
ctx->internal->execute(ctx, scroll_slice, &td, NULL,
|
||||
FFMIN(out->height, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, scroll_slice, &td, NULL,
|
||||
FFMIN(out->height, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
s->h_pos += s->h_speed * in->width;
|
||||
s->v_pos += s->v_speed * in->height;
|
||||
|
@ -441,8 +441,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
td.in = in;
|
||||
td.out = out;
|
||||
ctx->internal->execute(ctx, funcs[s->is_16bit][direct][s->correction_method],
|
||||
&td, NULL, FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, funcs[s->is_16bit][direct][s->correction_method],
|
||||
&td, NULL, FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
if (!direct)
|
||||
av_frame_free(&in);
|
||||
|
@ -243,7 +243,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
0, 0, outlink->w, outlink->h);
|
||||
|
||||
td.in = in, td.out = out;
|
||||
ctx->internal->execute(ctx, s->filter_slice[s->interp], &td, NULL, FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
ff_filter_execute(ctx, s->filter_slice[s->interp], &td, NULL,
|
||||
FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
|
||||
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user