[FFmpeg-cvslog] avfilter/internal: Factor out executing a filter's execute_func

Andreas Rheinhardt git at videolan.org
Sun Aug 15 23:33:18 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Aug 15 21:33:25 2021 +0200| [1b20853fb3e2c4879cdecf2414a2d68760df1149] | committer: Andreas Rheinhardt

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 at nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavfilter/af_acrossover.c        |  4 ++--
 libavfilter/af_adeclick.c          |  2 +-
 libavfilter/af_adenorm.c           |  4 ++--
 libavfilter/af_aemphasis.c         |  4 ++--
 libavfilter/af_afftdn.c            |  4 ++--
 libavfilter/af_afir.c              |  4 ++--
 libavfilter/af_afreqshift.c        |  4 ++--
 libavfilter/af_afwtdn.c            |  2 +-
 libavfilter/af_aiir.c              |  2 +-
 libavfilter/af_anequalizer.c       |  4 ++--
 libavfilter/af_anlmdn.c            |  2 +-
 libavfilter/af_anlms.c             |  4 ++--
 libavfilter/af_arnndn.c            |  4 ++--
 libavfilter/af_asoftclip.c         |  8 ++++----
 libavfilter/af_astats.c            |  3 ++-
 libavfilter/af_asubboost.c         |  4 ++--
 libavfilter/af_asupercut.c         |  4 ++--
 libavfilter/af_biquads.c           |  3 ++-
 libavfilter/af_crystalizer.c       |  4 ++--
 libavfilter/af_headphone.c         |  4 ++--
 libavfilter/af_sofalizer.c         |  4 ++--
 libavfilter/af_surround.c          |  4 ++--
 libavfilter/avf_showspatial.c      |  2 +-
 libavfilter/avf_showspectrum.c     | 12 ++++++------
 libavfilter/internal.h             |  6 ++++++
 libavfilter/vf_amplify.c           |  3 ++-
 libavfilter/vf_atadenoise.c        |  2 +-
 libavfilter/vf_avgblur.c           |  6 ++++--
 libavfilter/vf_blackdetect.c       |  4 ++--
 libavfilter/vf_blend.c             |  3 ++-
 libavfilter/vf_bm3d.c              |  2 +-
 libavfilter/vf_bwdif.c             |  3 ++-
 libavfilter/vf_cas.c               |  4 ++--
 libavfilter/vf_chromakey.c         |  3 ++-
 libavfilter/vf_chromanr.c          |  8 ++++----
 libavfilter/vf_chromashift.c       |  8 ++++----
 libavfilter/vf_colorbalance.c      |  3 ++-
 libavfilter/vf_colorchannelmixer.c |  3 ++-
 libavfilter/vf_colorconstancy.c    |  9 +++++----
 libavfilter/vf_colorcontrast.c     |  4 ++--
 libavfilter/vf_colorcorrect.c      |  4 ++--
 libavfilter/vf_colorize.c          |  4 ++--
 libavfilter/vf_colorkey.c          |  3 ++-
 libavfilter/vf_colorlevels.c       |  4 ++--
 libavfilter/vf_colormatrix.c       | 16 ++++++++--------
 libavfilter/vf_colorspace.c        |  4 ++--
 libavfilter/vf_colortemperature.c  |  4 ++--
 libavfilter/vf_convolution.c       |  3 ++-
 libavfilter/vf_convolve.c          | 21 ++++++++++++++-------
 libavfilter/vf_curves.c            |  3 ++-
 libavfilter/vf_datascope.c         |  3 ++-
 libavfilter/vf_dctdnoiz.c          |  2 +-
 libavfilter/vf_deband.c            |  6 +++---
 libavfilter/vf_dedot.c             | 18 +++++++++---------
 libavfilter/vf_despill.c           |  3 ++-
 libavfilter/vf_epx.c               |  3 ++-
 libavfilter/vf_estdif.c            |  4 ++--
 libavfilter/vf_exposure.c          |  4 ++--
 libavfilter/vf_fade.c              | 16 ++++++++--------
 libavfilter/vf_framerate.c         |  3 ++-
 libavfilter/vf_gblur.c             |  9 ++++++---
 libavfilter/vf_geq.c               |  3 ++-
 libavfilter/vf_guided.c            | 12 ++++++------
 libavfilter/vf_hflip.c             |  3 ++-
 libavfilter/vf_hqdn3d.c            |  2 +-
 libavfilter/vf_hqx.c               |  3 ++-
 libavfilter/vf_identity.c          |  3 ++-
 libavfilter/vf_lagfun.c            |  3 ++-
 libavfilter/vf_lenscorrection.c    |  3 ++-
 libavfilter/vf_lensfun.c           | 16 ++++++----------
 libavfilter/vf_limiter.c           |  4 ++--
 libavfilter/vf_lumakey.c           |  3 ++-
 libavfilter/vf_lut.c               | 16 ++++++++--------
 libavfilter/vf_lut2.c              |  6 ++++--
 libavfilter/vf_lut3d.c             |  6 ++++--
 libavfilter/vf_maskedclamp.c       |  4 ++--
 libavfilter/vf_maskedmerge.c       |  4 ++--
 libavfilter/vf_maskedminmax.c      |  4 ++--
 libavfilter/vf_maskedthreshold.c   |  4 ++--
 libavfilter/vf_maskfun.c           |  4 ++--
 libavfilter/vf_median.c            |  2 +-
 libavfilter/vf_mix.c               |  6 ++++--
 libavfilter/vf_monochrome.c        |  8 ++++----
 libavfilter/vf_neighbor.c          |  3 ++-
 libavfilter/vf_nlmeans.c           |  4 ++--
 libavfilter/vf_nnedi.c             |  3 ++-
 libavfilter/vf_noise.c             |  3 ++-
 libavfilter/vf_overlay.c           |  4 ++--
 libavfilter/vf_perspective.c       |  3 ++-
 libavfilter/vf_photosensitivity.c  |  6 ++++--
 libavfilter/vf_premultiply.c       |  4 ++--
 libavfilter/vf_pseudocolor.c       |  3 ++-
 libavfilter/vf_psnr.c              |  3 ++-
 libavfilter/vf_readeia608.c        |  4 ++--
 libavfilter/vf_remap.c             |  3 ++-
 libavfilter/vf_removegrain.c       |  4 ++--
 libavfilter/vf_rotate.c            |  4 ++--
 libavfilter/vf_scroll.c            |  4 ++--
 libavfilter/vf_selectivecolor.c    |  4 ++--
 libavfilter/vf_shear.c             |  3 ++-
 libavfilter/vf_shufflepixels.c     |  3 ++-
 libavfilter/vf_signalstats.c       | 16 ++++++++--------
 libavfilter/vf_ssim.c              |  3 ++-
 libavfilter/vf_stack.c             |  3 ++-
 libavfilter/vf_stereo3d.c          |  4 ++--
 libavfilter/vf_super2xsai.c        |  3 ++-
 libavfilter/vf_threshold.c         |  4 ++--
 libavfilter/vf_tonemap.c           |  3 ++-
 libavfilter/vf_transpose.c         |  3 ++-
 libavfilter/vf_unsharp.c           |  3 ++-
 libavfilter/vf_v360.c              |  4 ++--
 libavfilter/vf_vibrance.c          |  4 ++--
 libavfilter/vf_vif.c               | 14 +++++++-------
 libavfilter/vf_w3fdif.c            |  3 ++-
 libavfilter/vf_waveform.c          |  3 ++-
 libavfilter/vf_weave.c             |  4 ++--
 libavfilter/vf_xbr.c               |  3 ++-
 libavfilter/vf_xfade.c             |  3 ++-
 libavfilter/vf_xmedian.c           |  6 ++++--
 libavfilter/vf_yadif.c             |  3 ++-
 libavfilter/vf_yaepblur.c          |  9 ++++++---
 libavfilter/vsrc_gradients.c       |  4 ++--
 libavfilter/vsrc_sierpinski.c      |  3 ++-
 123 files changed, 332 insertions(+), 261 deletions(-)

diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c
index 4d3eae2d62..e8dcc48e6a 100644
--- a/libavfilter/af_acrossover.c
+++ b/libavfilter/af_acrossover.c
@@ -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]);
diff --git a/libavfilter/af_adeclick.c b/libavfilter/af_adeclick.c
index e1ecbc4c9b..c216aaca15 100644
--- a/libavfilter/af_adeclick.c
+++ b/libavfilter/af_adeclick.c
@@ -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;
 
diff --git a/libavfilter/af_adenorm.c b/libavfilter/af_adenorm.c
index b5679b0f20..f6e120c97c 100644
--- a/libavfilter/af_adenorm.c
+++ b/libavfilter/af_adenorm.c
@@ -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;
 
diff --git a/libavfilter/af_aemphasis.c b/libavfilter/af_aemphasis.c
index 621e0fe7cf..4646ac0170 100644
--- a/libavfilter/af_aemphasis.c
+++ b/libavfilter/af_aemphasis.c
@@ -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);
diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index 6ac2a30e70..6f343e8bd0 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -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) {
diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c
index bb07d31726..8cbdf81df4 100644
--- a/libavfilter/af_afir.c
+++ b/libavfilter/af_afir.c
@@ -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)
diff --git a/libavfilter/af_afreqshift.c b/libavfilter/af_afreqshift.c
index caacdbccae..e864a73574 100644
--- a/libavfilter/af_afreqshift.c
+++ b/libavfilter/af_afreqshift.c
@@ -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;
 
diff --git a/libavfilter/af_afwtdn.c b/libavfilter/af_afwtdn.c
index 8d67d6458e..d39d75d405 100644
--- a/libavfilter/af_afwtdn.c
+++ b/libavfilter/af_afwtdn.c
@@ -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;
 
diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c
index a396ec7885..55d5ac7f14 100644
--- a/libavfilter/af_aiir.c
+++ b/libavfilter/af_aiir.c
@@ -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)
diff --git a/libavfilter/af_anequalizer.c b/libavfilter/af_anequalizer.c
index faa0e2a230..9aab577079 100644
--- a/libavfilter/af_anequalizer.c
+++ b/libavfilter/af_anequalizer.c
@@ -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;
diff --git a/libavfilter/af_anlmdn.c b/libavfilter/af_anlmdn.c
index 58cbf8fab1..408e35fb63 100644
--- a/libavfilter/af_anlmdn.c
+++ b/libavfilter/af_anlmdn.c
@@ -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);
 
diff --git a/libavfilter/af_anlms.c b/libavfilter/af_anlms.c
index cc25ff6586..83666ac2e7 100644
--- a/libavfilter/af_anlms.c
+++ b/libavfilter/af_anlms.c
@@ -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;
 
diff --git a/libavfilter/af_arnndn.c b/libavfilter/af_arnndn.c
index 9bb1df437d..cec22bbacc 100644
--- a/libavfilter/af_arnndn.c
+++ b/libavfilter/af_arnndn.c
@@ -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);
diff --git a/libavfilter/af_asoftclip.c b/libavfilter/af_asoftclip.c
index a82c523bd4..377666678a 100644
--- a/libavfilter/af_asoftclip.c
+++ b/libavfilter/af_asoftclip.c
@@ -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)
diff --git a/libavfilter/af_astats.c b/libavfilter/af_astats.c
index 0e6650cacb..d910ca8f23 100644
--- a/libavfilter/af_astats.c
+++ b/libavfilter/af_astats.c
@@ -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);
diff --git a/libavfilter/af_asubboost.c b/libavfilter/af_asubboost.c
index 02d88c4c85..aeaac2645f 100644
--- a/libavfilter/af_asubboost.c
+++ b/libavfilter/af_asubboost.c
@@ -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);
diff --git a/libavfilter/af_asupercut.c b/libavfilter/af_asupercut.c
index 439cab6d6d..b6cf4c13c7 100644
--- a/libavfilter/af_asupercut.c
+++ b/libavfilter/af_asupercut.c
@@ -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);
diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 253383fc6f..2495069672 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -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)
diff --git a/libavfilter/af_crystalizer.c b/libavfilter/af_crystalizer.c
index 27d3579b7c..1e7432ffd0 100644
--- a/libavfilter/af_crystalizer.c
+++ b/libavfilter/af_crystalizer.c
@@ -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);
diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c
index 182f51c347..f3543fafb6 100644
--- a/libavfilter/af_headphone.c
+++ b/libavfilter/af_headphone.c
@@ -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();
 
diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 0412bc5dda..9708aab634 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.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();
 
diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c
index fbb2f26891..06e181c7ad 100644
--- a/libavfilter/af_surround.c
+++ b/libavfilter/af_surround.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)
diff --git a/libavfilter/avf_showspatial.c b/libavfilter/avf_showspatial.c
index 82d202a817..3e1d4bd70e 100644
--- a/libavfilter/avf_showspatial.c
+++ b/libavfilter/avf_showspatial.c
@@ -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);
 
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 26d8c79a72..6ae4c89d77 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -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;
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 6c908690b4..c2be4a18fc 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -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
diff --git a/libavfilter/vf_amplify.c b/libavfilter/vf_amplify.c
index 2640b61be8..c24ce6edc0 100644
--- a/libavfilter/vf_amplify.c
+++ b/libavfilter/vf_amplify.c
@@ -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)
diff --git a/libavfilter/vf_atadenoise.c b/libavfilter/vf_atadenoise.c
index ad99c7a797..e39670d982 100644
--- a/libavfilter/vf_atadenoise.c
+++ b/libavfilter/vf_atadenoise.c
@@ -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)));
diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c
index f6d36abb50..368452e68f 100644
--- a/libavfilter/vf_avgblur.c
+++ b/libavfilter/vf_avgblur.c
@@ -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)
diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c
index e7fa5ce3ab..99366c669e 100644
--- a/libavfilter/vf_blackdetect.c
+++ b/libavfilter/vf_blackdetect.c
@@ -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];
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 5eed52a5d8..7a64e70862 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -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)
diff --git a/libavfilter/vf_bm3d.c b/libavfilter/vf_bm3d.c
index 96bf8b671a..49a52ecc18 100644
--- a/libavfilter/vf_bm3d.c
+++ b/libavfilter/vf_bm3d.c
@@ -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);
     }
diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
index d63976b70b..6b737bba32 100644
--- a/libavfilter/vf_bwdif.c
+++ b/libavfilter/vf_bwdif.c
@@ -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;
diff --git a/libavfilter/vf_cas.c b/libavfilter/vf_cas.c
index 4378ccd5eb..5424c37bf6 100644
--- a/libavfilter/vf_cas.c
+++ b/libavfilter/vf_cas.c
@@ -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;
 
diff --git a/libavfilter/vf_chromakey.c b/libavfilter/vf_chromakey.c
index 61a1ab53f9..a3d4caf411 100644
--- a/libavfilter/vf_chromakey.c
+++ b/libavfilter/vf_chromakey.c
@@ -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);
diff --git a/libavfilter/vf_chromanr.c b/libavfilter/vf_chromanr.c
index 006d6410b7..99d5ed552a 100644
--- a/libavfilter/vf_chromanr.c
+++ b/libavfilter/vf_chromanr.c
@@ -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);
diff --git a/libavfilter/vf_chromashift.c b/libavfilter/vf_chromashift.c
index 8079196862..b6607a05e4 100644
--- a/libavfilter/vf_chromashift.c
+++ b/libavfilter/vf_chromashift.c
@@ -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);
diff --git a/libavfilter/vf_colorbalance.c b/libavfilter/vf_colorbalance.c
index 1da1a643eb..815cb6e5df 100644
--- a/libavfilter/vf_colorbalance.c
+++ b/libavfilter/vf_colorbalance.c
@@ -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);
diff --git a/libavfilter/vf_colorchannelmixer.c b/libavfilter/vf_colorchannelmixer.c
index e259fa3028..fa0609329a 100644
--- a/libavfilter/vf_colorchannelmixer.c
+++ b/libavfilter/vf_colorchannelmixer.c
@@ -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);
diff --git a/libavfilter/vf_colorconstancy.c b/libavfilter/vf_colorconstancy.c
index 0cef043bcd..eae19c1104 100644
--- a/libavfilter/vf_colorconstancy.c
+++ b/libavfilter/vf_colorconstancy.c
@@ -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)
diff --git a/libavfilter/vf_colorcontrast.c b/libavfilter/vf_colorcontrast.c
index 8aae031745..8975033760 100644
--- a/libavfilter/vf_colorcontrast.c
+++ b/libavfilter/vf_colorcontrast.c
@@ -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);
diff --git a/libavfilter/vf_colorcorrect.c b/libavfilter/vf_colorcorrect.c
index 8c670c0f94..0105886124 100644
--- a/libavfilter/vf_colorcorrect.c
+++ b/libavfilter/vf_colorcorrect.c
@@ -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);
 }
diff --git a/libavfilter/vf_colorize.c b/libavfilter/vf_colorize.c
index 1dc99681ce..84876b78da 100644
--- a/libavfilter/vf_colorize.c
+++ b/libavfilter/vf_colorize.c
@@ -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);
 }
diff --git a/libavfilter/vf_colorkey.c b/libavfilter/vf_colorkey.c
index 93e69b712c..eb3173ff43 100644
--- a/libavfilter/vf_colorkey.c
+++ b/libavfilter/vf_colorkey.c
@@ -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);
diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index b17bb9f11f..039b79a1a2 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -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);
diff --git a/libavfilter/vf_colormatrix.c b/libavfilter/vf_colormatrix.c
index 0686ca068b..8a58c209bb 100644
--- a/libavfilter/vf_colormatrix.c
+++ b/libavfilter/vf_colormatrix.c
@@ -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);
diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 65e072d137..740e258df0 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -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);
 
diff --git a/libavfilter/vf_colortemperature.c b/libavfilter/vf_colortemperature.c
index ad288e3b84..a5ba4a7b6c 100644
--- a/libavfilter/vf_colortemperature.c
+++ b/libavfilter/vf_colortemperature.c
@@ -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);
 }
diff --git a/libavfilter/vf_convolution.c b/libavfilter/vf_convolution.c
index db92f5aa0b..e14dc9990a 100644
--- a/libavfilter/vf_convolution.c
+++ b/libavfilter/vf_convolution.c
@@ -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);
diff --git a/libavfilter/vf_convolve.c b/libavfilter/vf_convolve.c
index fd0f3ca404..269f7cf09f 100644
--- a/libavfilter/vf_convolve.c
+++ b/libavfilter/vf_convolve.c
@@ -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));
     }
diff --git a/libavfilter/vf_curves.c b/libavfilter/vf_curves.c
index 457fd77184..de6f37c73a 100644
--- a/libavfilter/vf_curves.c
+++ b/libavfilter/vf_curves.c
@@ -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);
diff --git a/libavfilter/vf_datascope.c b/libavfilter/vf_datascope.c
index 63c93fd98d..70857ea491 100644
--- a/libavfilter/vf_datascope.c
+++ b/libavfilter/vf_datascope.c
@@ -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);
diff --git a/libavfilter/vf_dctdnoiz.c b/libavfilter/vf_dctdnoiz.c
index 8c0691c07f..d1bb7bf96b 100644
--- a/libavfilter/vf_dctdnoiz.c
+++ b/libavfilter/vf_dctdnoiz.c
@@ -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,
diff --git a/libavfilter/vf_deband.c b/libavfilter/vf_deband.c
index 767f1c7687..d84e41b963 100644
--- a/libavfilter/vf_deband.c
+++ b/libavfilter/vf_deband.c
@@ -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);
diff --git a/libavfilter/vf_dedot.c b/libavfilter/vf_dedot.c
index 8660eb08b4..8f58c59fe9 100644
--- a/libavfilter/vf_dedot.c
+++ b/libavfilter/vf_dedot.c
@@ -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);
diff --git a/libavfilter/vf_despill.c b/libavfilter/vf_despill.c
index 315104638b..fb9c3bb988 100644
--- a/libavfilter/vf_despill.c
+++ b/libavfilter/vf_despill.c
@@ -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);
diff --git a/libavfilter/vf_epx.c b/libavfilter/vf_epx.c
index f33be65095..28001fd35d 100644
--- a/libavfilter/vf_epx.c
+++ b/libavfilter/vf_epx.c
@@ -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);
diff --git a/libavfilter/vf_estdif.c b/libavfilter/vf_estdif.c
index 92b1c77806..a04b4b37db 100644
--- a/libavfilter/vf_estdif.c
+++ b/libavfilter/vf_estdif.c
@@ -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;
diff --git a/libavfilter/vf_exposure.c b/libavfilter/vf_exposure.c
index 135a9a0e03..f8bcf28e6a 100644
--- a/libavfilter/vf_exposure.c
+++ b/libavfilter/vf_exposure.c
@@ -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);
 }
diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
index 05ab762ec8..d801bf8c95 100644
--- a/libavfilter/vf_fade.c
+++ b/libavfilter/vf_fade.c
@@ -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)));
             }
         }
     }
diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index e8f6b5b8c5..440cfecc71 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -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;
diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index 1def5b049b..91b9ea8889 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -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)
diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c
index 4162476f41..75f374df3d 100644
--- a/libavfilter/vf_geq.c
+++ b/libavfilter/vf_geq.c
@@ -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);
diff --git a/libavfilter/vf_guided.c b/libavfilter/vf_guided.c
index 3bdde30b58..5d8796c7bf 100644
--- a/libavfilter/vf_guided.c
+++ b/libavfilter/vf_guided.c
@@ -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++) {                                                   \
diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c
index 2a0defda6c..390c3a1553 100644
--- a/libavfilter/vf_hflip.c
+++ b/libavfilter/vf_hflip.c
@@ -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);
diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c
index 99c43593cd..885ae02f74 100644
--- a/libavfilter/vf_hqdn3d.c
+++ b/libavfilter/vf_hqdn3d.c
@@ -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);
diff --git a/libavfilter/vf_hqx.c b/libavfilter/vf_hqx.c
index b6c3893b66..4e7c7c6c05 100644
--- a/libavfilter/vf_hqx.c
+++ b/libavfilter/vf_hqx.c
@@ -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);
diff --git a/libavfilter/vf_identity.c b/libavfilter/vf_identity.c
index f5dcdfc906..5481222114 100644
--- a/libavfilter/vf_identity.c
+++ b/libavfilter/vf_identity.c
@@ -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++)
diff --git a/libavfilter/vf_lagfun.c b/libavfilter/vf_lagfun.c
index 0f4f38e0ed..3ca9639594 100644
--- a/libavfilter/vf_lagfun.c
+++ b/libavfilter/vf_lagfun.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);
diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c
index 9d89f79101..c9585ceb22 100644
--- a/libavfilter/vf_lenscorrection.c
+++ b/libavfilter/vf_lenscorrection.c
@@ -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);
diff --git a/libavfilter/vf_lensfun.c b/libavfilter/vf_lensfun.c
index ffe81b9bc2..ea5ef5e3cf 100644
--- a/libavfilter/vf_lensfun.c
+++ b/libavfilter/vf_lensfun.c
@@ -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);
diff --git a/libavfilter/vf_limiter.c b/libavfilter/vf_limiter.c
index 3bf1b371cf..9d4f573bec 100644
--- a/libavfilter/vf_limiter.c
+++ b/libavfilter/vf_limiter.c
@@ -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);
 
diff --git a/libavfilter/vf_lumakey.c b/libavfilter/vf_lumakey.c
index 8b2a102369..763c5098ba 100644
--- a/libavfilter/vf_lumakey.c
+++ b/libavfilter/vf_lumakey.c
@@ -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);
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index 78f0955446..082e0bdb7a 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -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)
diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c
index 85669a2e2d..ba03467331 100644
--- a/libavfilter/vf_lut2.c
+++ b/libavfilter/vf_lut2.c
@@ -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;
diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index b81ef46b48..1246a5cab6 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -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);
diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c
index 2cd1ec88c7..0c558d1030 100644
--- a/libavfilter/vf_maskedclamp.c
+++ b/libavfilter/vf_maskedclamp.c
@@ -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);
 
diff --git a/libavfilter/vf_maskedmerge.c b/libavfilter/vf_maskedmerge.c
index 6a15a907c5..37d33f9313 100644
--- a/libavfilter/vf_maskedmerge.c
+++ b/libavfilter/vf_maskedmerge.c
@@ -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);
 
diff --git a/libavfilter/vf_maskedminmax.c b/libavfilter/vf_maskedminmax.c
index 6ad5ddb1de..08ff6e852b 100644
--- a/libavfilter/vf_maskedminmax.c
+++ b/libavfilter/vf_maskedminmax.c
@@ -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);
 
diff --git a/libavfilter/vf_maskedthreshold.c b/libavfilter/vf_maskedthreshold.c
index e80d383f9d..1392e09176 100644
--- a/libavfilter/vf_maskedthreshold.c
+++ b/libavfilter/vf_maskedthreshold.c
@@ -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);
 
diff --git a/libavfilter/vf_maskfun.c b/libavfilter/vf_maskfun.c
index 70198c66bc..0a6d17f7af 100644
--- a/libavfilter/vf_maskfun.c
+++ b/libavfilter/vf_maskfun.c
@@ -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);
 }
diff --git a/libavfilter/vf_median.c b/libavfilter/vf_median.c
index e02629a5ca..9d92f1543b 100644
--- a/libavfilter/vf_median.c
+++ b/libavfilter/vf_median.c
@@ -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);
diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c
index 0ca60d5522..5bd056759e 100644
--- a/libavfilter/vf_mix.c
+++ b/libavfilter/vf_mix.c
@@ -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);
 }
diff --git a/libavfilter/vf_monochrome.c b/libavfilter/vf_monochrome.c
index 870811d4d4..0471c7d237 100644
--- a/libavfilter/vf_monochrome.c
+++ b/libavfilter/vf_monochrome.c
@@ -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);
 }
diff --git a/libavfilter/vf_neighbor.c b/libavfilter/vf_neighbor.c
index ea6449830c..2d1c3da898 100644
--- a/libavfilter/vf_neighbor.c
+++ b/libavfilter/vf_neighbor.c
@@ -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);
diff --git a/libavfilter/vf_nlmeans.c b/libavfilter/vf_nlmeans.c
index 95cdad780e..08183fa04f 100644
--- a/libavfilter/vf_nlmeans.c
+++ b/libavfilter/vf_nlmeans.c
@@ -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)));
             }
         }
     }
diff --git a/libavfilter/vf_nnedi.c b/libavfilter/vf_nnedi.c
index cffb23d37c..a5d5f3b0f4 100644
--- a/libavfilter/vf_nnedi.c
+++ b/libavfilter/vf_nnedi.c
@@ -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;
diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c
index 73e88063e9..9738a12650 100644
--- a/libavfilter/vf_noise.c
+++ b/libavfilter/vf_noise.c
@@ -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)
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
index 8fec1f554c..eb29e8e8c1 100644
--- a/libavfilter/vf_overlay.c
+++ b/libavfilter/vf_overlay.c
@@ -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);
 }
diff --git a/libavfilter/vf_perspective.c b/libavfilter/vf_perspective.c
index eb8e5e2414..acfafe2bb0 100644
--- a/libavfilter/vf_perspective.c
+++ b/libavfilter/vf_perspective.c
@@ -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);
diff --git a/libavfilter/vf_photosensitivity.c b/libavfilter/vf_photosensitivity.c
index c28d06b08a..1237330fff 100644
--- a/libavfilter/vf_photosensitivity.c
+++ b/libavfilter/vf_photosensitivity.c
@@ -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)
diff --git a/libavfilter/vf_premultiply.c b/libavfilter/vf_premultiply.c
index 1dde273eae..bc8e080e4c 100644
--- a/libavfilter/vf_premultiply.c
+++ b/libavfilter/vf_premultiply.c
@@ -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;
diff --git a/libavfilter/vf_pseudocolor.c b/libavfilter/vf_pseudocolor.c
index 35b9a10519..d860bc7223 100644
--- a/libavfilter/vf_pseudocolor.c
+++ b/libavfilter/vf_pseudocolor.c
@@ -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);
diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index 715230142b..5f93fa5fc7 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -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++)
diff --git a/libavfilter/vf_readeia608.c b/libavfilter/vf_readeia608.c
index fe4a8c4648..49e1c27ce6 100644
--- a/libavfilter/vf_readeia608.c
+++ b/libavfilter/vf_readeia608.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++) {
diff --git a/libavfilter/vf_remap.c b/libavfilter/vf_remap.c
index 5ab6199d71..9c6e3c390f 100644
--- a/libavfilter/vf_remap.c
+++ b/libavfilter/vf_remap.c
@@ -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);
 
diff --git a/libavfilter/vf_removegrain.c b/libavfilter/vf_removegrain.c
index 2fde9a954c..b3bb51175d 100644
--- a/libavfilter/vf_removegrain.c
+++ b/libavfilter/vf_removegrain.c
@@ -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];
diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c
index 654a7171a9..d7f2cd77c4 100644
--- a/libavfilter/vf_rotate.c
+++ b/libavfilter/vf_rotate.c
@@ -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);
diff --git a/libavfilter/vf_scroll.c b/libavfilter/vf_scroll.c
index 77d8db51bc..278d38bd1b 100644
--- a/libavfilter/vf_scroll.c
+++ b/libavfilter/vf_scroll.c
@@ -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;
diff --git a/libavfilter/vf_selectivecolor.c b/libavfilter/vf_selectivecolor.c
index af6e8b2518..167fc88c86 100644
--- a/libavfilter/vf_selectivecolor.c
+++ b/libavfilter/vf_selectivecolor.c
@@ -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);
diff --git a/libavfilter/vf_shear.c b/libavfilter/vf_shear.c
index 849592ccde..ed7540c90a 100644
--- a/libavfilter/vf_shear.c
+++ b/libavfilter/vf_shear.c
@@ -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);
diff --git a/libavfilter/vf_shufflepixels.c b/libavfilter/vf_shufflepixels.c
index 051be44bf3..aeb41f7896 100644
--- a/libavfilter/vf_shufflepixels.c
+++ b/libavfilter/vf_shufflepixels.c
@@ -387,7 +387,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
     td.out = out;
     td.in = in;
-    ctx->internal->execute(ctx, s->shuffle_pixels, &td, NULL, FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, s->shuffle_pixels, &td, NULL,
+                      FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
 
     av_frame_free(&in);
     return ff_filter_frame(ctx->outputs[0], out);
diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c
index 49a2996b5c..fc8e81375f 100644
--- a/libavfilter/vf_signalstats.c
+++ b/libavfilter/vf_signalstats.c
@@ -596,8 +596,8 @@ static int filter_frame8(AVFilterLink *link, AVFrame *in)
         av_frame_make_writable(out);
     }
 
-    ctx->internal->execute(ctx, compute_sat_hue_metrics8, &td_huesat,
-                           NULL, FFMIN(s->chromah, ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, compute_sat_hue_metrics8, &td_huesat,
+                      NULL, FFMIN(s->chromah, ff_filter_get_nb_threads(ctx)));
 
     // Calculate luma histogram and difference with previous frame or field.
     memset(s->histy, 0, s->maxsize * sizeof(*s->histy));
@@ -645,8 +645,8 @@ static int filter_frame8(AVFilterLink *link, AVFrame *in)
                 .out = out != in && s->outfilter == fil ? out : NULL,
             };
             memset(s->jobs_rets, 0, s->nb_jobs * sizeof(*s->jobs_rets));
-            ctx->internal->execute(ctx, filters_def[fil].process8,
-                                   &td, s->jobs_rets, s->nb_jobs);
+            ff_filter_execute(ctx, filters_def[fil].process8,
+                              &td, s->jobs_rets, s->nb_jobs);
             for (i = 0; i < s->nb_jobs; i++)
                 filtot[fil] += s->jobs_rets[i];
         }
@@ -818,8 +818,8 @@ static int filter_frame16(AVFilterLink *link, AVFrame *in)
         av_frame_make_writable(out);
     }
 
-    ctx->internal->execute(ctx, compute_sat_hue_metrics16, &td_huesat,
-                           NULL, FFMIN(s->chromah, ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, compute_sat_hue_metrics16, &td_huesat,
+                      NULL, FFMIN(s->chromah, ff_filter_get_nb_threads(ctx)));
 
     // Calculate luma histogram and difference with previous frame or field.
     memset(s->histy, 0, s->maxsize * sizeof(*s->histy));
@@ -867,8 +867,8 @@ static int filter_frame16(AVFilterLink *link, AVFrame *in)
                 .out = out != in && s->outfilter == fil ? out : NULL,
             };
             memset(s->jobs_rets, 0, s->nb_jobs * sizeof(*s->jobs_rets));
-            ctx->internal->execute(ctx, filters_def[fil].process16,
-                                   &td, s->jobs_rets, s->nb_jobs);
+            ff_filter_execute(ctx, filters_def[fil].process16,
+                              &td, s->jobs_rets, s->nb_jobs);
             for (i = 0; i < s->nb_jobs; i++)
                 filtot[fil] += s->jobs_rets[i];
         }
diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c
index 618b24c010..851a684673 100644
--- a/libavfilter/vf_ssim.c
+++ b/libavfilter/vf_ssim.c
@@ -359,7 +359,8 @@ static int do_ssim(FFFrameSync *fs)
         td.planeheight[n] = s->planeheight[n];
     }
 
-    ctx->internal->execute(ctx, s->ssim_plane, &td, NULL, FFMIN((s->planeheight[1] + 3) >> 2, s->nb_threads));
+    ff_filter_execute(ctx, s->ssim_plane, &td, NULL,
+                      FFMIN((s->planeheight[1] + 3) >> 2, s->nb_threads));
 
     for (i = 0; i < s->nb_components; i++) {
         for (int j = 0; j < s->nb_threads; j++)
diff --git a/libavfilter/vf_stack.c b/libavfilter/vf_stack.c
index 3368e25c9c..38e5aa098b 100644
--- a/libavfilter/vf_stack.c
+++ b/libavfilter/vf_stack.c
@@ -179,7 +179,8 @@ static int process_frame(FFFrameSync *fs)
         ff_fill_rectangle(&s->draw, &s->color, out->data, out->linesize,
                           0, 0, outlink->w, outlink->h);
 
-    ctx->internal->execute(ctx, process_slice, out, NULL, FFMIN(s->nb_inputs, ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, process_slice, out, NULL,
+                      FFMIN(s->nb_inputs, ff_filter_get_nb_threads(ctx)));
 
     return ff_filter_frame(outlink, out);
 }
diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c
index 099dd5724b..56b53c8206 100644
--- a/libavfilter/vf_stereo3d.c
+++ b/libavfilter/vf_stereo3d.c
@@ -937,8 +937,8 @@ copy:
             ThreadData td;
 
             td.ileft = ileft; td.iright = iright; td.out = out;
-            ctx->internal->execute(ctx, filter_slice, &td, NULL,
-                                   FFMIN(s->out.height, ff_filter_get_nb_threads(ctx)));
+            ff_filter_execute(ctx, filter_slice, &td, NULL,
+                              FFMIN(s->out.height, ff_filter_get_nb_threads(ctx)));
         }
         break;
     }
diff --git a/libavfilter/vf_super2xsai.c b/libavfilter/vf_super2xsai.c
index d6371644e6..8df9dcc72b 100644
--- a/libavfilter/vf_super2xsai.c
+++ b/libavfilter/vf_super2xsai.c
@@ -331,7 +331,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     out->height = outlink->h;
 
     td.in = in, td.out = out;
-    ctx->internal->execute(ctx, super2xsai, &td, NULL, FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, super2xsai, &td, NULL,
+                      FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
 
     av_frame_free(&in);
     return ff_filter_frame(outlink, out);
diff --git a/libavfilter/vf_threshold.c b/libavfilter/vf_threshold.c
index 17ceb0dfa8..c37d676882 100644
--- a/libavfilter/vf_threshold.c
+++ b/libavfilter/vf_threshold.c
@@ -146,8 +146,8 @@ static int process_frame(FFFrameSync *fs)
         td.threshold = threshold;
         td.min = min;
         td.max = max;
-        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);
diff --git a/libavfilter/vf_tonemap.c b/libavfilter/vf_tonemap.c
index da6b4e235d..eb99ce77f3 100644
--- a/libavfilter/vf_tonemap.c
+++ b/libavfilter/vf_tonemap.c
@@ -275,7 +275,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
     td.in = in;
     td.desc = desc;
     td.peak = peak;
-    ctx->internal->execute(ctx, tonemap_slice, &td, NULL, FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, tonemap_slice, &td, NULL,
+                      FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
 
     /* copy/generate alpha if needed */
     if (desc->flags & AV_PIX_FMT_FLAG_ALPHA && odesc->flags & AV_PIX_FMT_FLAG_ALPHA) {
diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c
index 6affbed0a6..5c551ce823 100644
--- a/libavfilter/vf_transpose.c
+++ b/libavfilter/vf_transpose.c
@@ -352,7 +352,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     }
 
     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);
 }
diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c
index e9f75a673f..fad880c73d 100644
--- a/libavfilter/vf_unsharp.c
+++ b/libavfilter/vf_unsharp.c
@@ -164,7 +164,8 @@ static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
         td.height = plane_h[i];
         td.dst_stride = out->linesize[i];
         td.src_stride = in->linesize[i];
-        ctx->internal->execute(ctx, s->unsharp_slice, &td, NULL, FFMIN(plane_h[i], s->nb_threads));
+        ff_filter_execute(ctx, s->unsharp_slice, &td, NULL,
+                          FFMIN(plane_h[i], s->nb_threads));
     }
     return 0;
 }
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index d4bd5756da..4bba7140ba 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -4887,7 +4887,7 @@ static int config_output(AVFilterLink *outlink)
 
     set_mirror_modifier(s->h_flip, s->v_flip, s->d_flip, s->output_mirror_modifier);
 
-    ctx->internal->execute(ctx, v360_slice, NULL, NULL, s->nb_threads);
+    ff_filter_execute(ctx, v360_slice, NULL, NULL, s->nb_threads);
 
     return 0;
 }
@@ -4910,7 +4910,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     td.in = in;
     td.out = out;
 
-    ctx->internal->execute(ctx, s->remap_slice, &td, NULL, s->nb_threads);
+    ff_filter_execute(ctx, s->remap_slice, &td, NULL, s->nb_threads);
 
     av_frame_free(&in);
     return ff_filter_frame(outlink, out);
diff --git a/libavfilter/vf_vibrance.c b/libavfilter/vf_vibrance.c
index abbc25436f..b8f9fa0198 100644
--- a/libavfilter/vf_vibrance.c
+++ b/libavfilter/vf_vibrance.c
@@ -285,8 +285,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
     VibranceContext *s = avctx->priv;
     int res;
 
-    if (res = avctx->internal->execute(avctx, s->do_slice, frame, NULL,
-                                       FFMIN(frame->height, ff_filter_get_nb_threads(avctx))))
+    if (res = ff_filter_execute(avctx, s->do_slice, frame, NULL,
+                                FFMIN(frame->height, ff_filter_get_nb_threads(avctx))))
         return res;
 
     return ff_filter_frame(avctx->outputs[0], frame);
diff --git a/libavfilter/vf_vif.c b/libavfilter/vf_vif.c
index 4d2381abcb..e1b51aae3f 100644
--- a/libavfilter/vf_vif.c
+++ b/libavfilter/vf_vif.c
@@ -331,12 +331,12 @@ static int compute_vif2(AVFilterContext *ctx,
             td.src_stride = curr_ref_stride;
             td.dst_stride = w;
             td.temp = temp;
-            ctx->internal->execute(ctx, vif_filter1d, &td, NULL, nb_threads);
+            ff_filter_execute(ctx, vif_filter1d, &td, NULL, nb_threads);
 
             td.src = curr_main_scale;
             td.dst = mu2;
             td.src_stride = curr_main_stride;
-            ctx->internal->execute(ctx, vif_filter1d, &td, NULL, nb_threads);
+            ff_filter_execute(ctx, vif_filter1d, &td, NULL, nb_threads);
 
             vif_dec2(mu1, ref_scale, buf_valid_w, buf_valid_h, w, w);
             vif_dec2(mu2, main_scale, buf_valid_w, buf_valid_h, w, w);
@@ -361,12 +361,12 @@ static int compute_vif2(AVFilterContext *ctx,
         td.src_stride = curr_ref_stride;
         td.dst_stride = w;
         td.temp = temp;
-        ctx->internal->execute(ctx, vif_filter1d, &td, NULL, nb_threads);
+        ff_filter_execute(ctx, vif_filter1d, &td, NULL, nb_threads);
 
         td.src = curr_main_scale;
         td.dst = mu2;
         td.src_stride = curr_main_stride;
-        ctx->internal->execute(ctx, vif_filter1d, &td, NULL, nb_threads);
+        ff_filter_execute(ctx, vif_filter1d, &td, NULL, nb_threads);
 
         vif_xx_yy_xy(mu1, mu2, mu1_sq, mu2_sq, mu1_mu2, w, h);
 
@@ -375,16 +375,16 @@ static int compute_vif2(AVFilterContext *ctx,
         td.src = ref_sq;
         td.dst = ref_sq_filt;
         td.src_stride = w;
-        ctx->internal->execute(ctx, vif_filter1d, &td, NULL, nb_threads);
+        ff_filter_execute(ctx, vif_filter1d, &td, NULL, nb_threads);
 
         td.src = main_sq;
         td.dst = main_sq_filt;
         td.src_stride = w;
-        ctx->internal->execute(ctx, vif_filter1d, &td, NULL, nb_threads);
+        ff_filter_execute(ctx, vif_filter1d, &td, NULL, nb_threads);
 
         td.src = ref_main;
         td.dst = ref_main_filt;
-        ctx->internal->execute(ctx, vif_filter1d, &td, NULL, nb_threads);
+        ff_filter_execute(ctx, vif_filter1d, &td, NULL, nb_threads);
 
         vif_statistic(mu1_sq, mu2_sq, mu1_mu2, ref_sq_filt, main_sq_filt,
                       ref_main_filt, &num, &den, w, h);
diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index e8e55d5be3..25f46558e5 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -504,7 +504,8 @@ static int filter(AVFilterContext *ctx, int is_second)
 
     adj = s->field ? s->next : s->prev;
     td.out = out; td.cur = s->cur; td.adj = adj;
-    ctx->internal->execute(ctx, deinterlace_slice, &td, NULL, FFMIN(s->planeheight[1], s->nb_threads));
+    ff_filter_execute(ctx, deinterlace_slice, &td, NULL,
+                      FFMIN(s->planeheight[1], s->nb_threads));
 
     if (s->mode)
         s->field = !s->field;
diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c
index 977ebad9ce..8aad6e9cca 100644
--- a/libavfilter/vf_waveform.c
+++ b/libavfilter/vf_waveform.c
@@ -3416,7 +3416,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
             td.component = k;
             td.offset_y = offset_y;
             td.offset_x = offset_x;
-            ctx->internal->execute(ctx, s->waveform_slice, &td, NULL, ff_filter_get_nb_threads(ctx));
+            ff_filter_execute(ctx, s->waveform_slice, &td, NULL,
+                              ff_filter_get_nb_threads(ctx));
             switch (s->filter) {
             case LOWPASS:
                 if (s->bits <= 8)
diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c
index 98b8d0bd06..7fba26088c 100644
--- a/libavfilter/vf_weave.c
+++ b/libavfilter/vf_weave.c
@@ -150,8 +150,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, weave_slice, &td, NULL, FFMIN(s->planeheight[1],
-                                                              ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, weave_slice, &td, NULL,
+                      FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
 
     out->pts = s->double_weave ? s->prev->pts : in->pts / 2;
     out->interlaced_frame = 1;
diff --git a/libavfilter/vf_xbr.c b/libavfilter/vf_xbr.c
index 28642fa323..d73b2fd4e5 100644
--- a/libavfilter/vf_xbr.c
+++ b/libavfilter/vf_xbr.c
@@ -367,7 +367,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     td.in = in;
     td.out = out;
     td.rgbtoyuv = s->rgbtoyuv;
-    ctx->internal->execute(ctx, s->func, &td, NULL, FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, s->func, &td, NULL,
+                      FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
 
     out->width  = outlink->w;
     out->height = outlink->h;
diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c
index c3e5f3df85..268352a53e 100644
--- a/libavfilter/vf_xfade.c
+++ b/libavfilter/vf_xfade.c
@@ -1830,7 +1830,8 @@ static int xfade_frame(AVFilterContext *ctx, AVFrame *a, AVFrame *b)
     av_frame_copy_props(out, a);
 
     td.xf[0] = a, td.xf[1] = b, td.out = out, td.progress = progress;
-    ctx->internal->execute(ctx, xfade_slice, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, xfade_slice, &td, NULL,
+                      FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
 
     out->pts = s->pts;
 
diff --git a/libavfilter/vf_xmedian.c b/libavfilter/vf_xmedian.c
index c8ff37f797..fa131a7259 100644
--- a/libavfilter/vf_xmedian.c
+++ b/libavfilter/vf_xmedian.c
@@ -253,7 +253,8 @@ static int process_frame(FFFrameSync *fs)
     if (!ctx->is_disabled) {
         td.in = in;
         td.out = out;
-        ctx->internal->execute(ctx, s->median_frames, &td, NULL, FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
+        ff_filter_execute(ctx, s->median_frames, &td, NULL,
+                          FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
     }
 
     return ff_filter_frame(outlink, out);
@@ -440,7 +441,8 @@ static int tmedian_filter_frame(AVFilterLink *inlink, AVFrame *in)
 
     td.out = out;
     td.in = s->frames;
-    ctx->internal->execute(ctx, s->median_frames, &td, NULL, FFMIN(s->height[0], ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, s->median_frames, &td, NULL,
+                      FFMIN(s->height[0], ff_filter_get_nb_threads(ctx)));
 
     return ff_filter_frame(outlink, out);
 }
diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 41069a711c..773ff7bede 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -249,7 +249,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)));
     }
 
     emms_c();
diff --git a/libavfilter/vf_yaepblur.c b/libavfilter/vf_yaepblur.c
index c68edc815a..7a289c2f5a 100644
--- a/libavfilter/vf_yaepblur.c
+++ b/libavfilter/vf_yaepblur.c
@@ -253,12 +253,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         td.height       = s->planeheight[plane];
         td.src          = in->data[plane];
         td.src_linesize = in->linesize[plane];
-        ctx->internal->execute(ctx, s->pre_calculate_row, &td, NULL, FFMIN(td.height, nb_threads));
-        ctx->internal->execute(ctx, pre_calculate_col, &td, NULL, FFMIN(td.width,  nb_threads));
+        ff_filter_execute(ctx, s->pre_calculate_row, &td, NULL,
+                          FFMIN(td.height, nb_threads));
+        ff_filter_execute(ctx, pre_calculate_col, &td, NULL,
+                          FFMIN(td.width,  nb_threads));
 
         td.dst          = out->data[plane];
         td.dst_linesize = out->linesize[plane];
-        ctx->internal->execute(ctx, s->filter_slice, &td, NULL, FFMIN(td.height, nb_threads));
+        ff_filter_execute(ctx, s->filter_slice, &td, NULL,
+                          FFMIN(td.height, nb_threads));
     }
 
     if (out != in)
diff --git a/libavfilter/vsrc_gradients.c b/libavfilter/vsrc_gradients.c
index c1962b1ed8..199abab3fa 100644
--- a/libavfilter/vsrc_gradients.c
+++ b/libavfilter/vsrc_gradients.c
@@ -277,8 +277,8 @@ static int activate(AVFilterContext *ctx)
         frame->sample_aspect_ratio = (AVRational) {1, 1};
         frame->pts = s->pts++;
 
-        ctx->internal->execute(ctx, s->draw_slice, frame, NULL,
-                               FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
+        ff_filter_execute(ctx, s->draw_slice, frame, NULL,
+                          FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
 
         return ff_filter_frame(outlink, frame);
     }
diff --git a/libavfilter/vsrc_sierpinski.c b/libavfilter/vsrc_sierpinski.c
index eec9e8c25d..1e331b01fb 100644
--- a/libavfilter/vsrc_sierpinski.c
+++ b/libavfilter/vsrc_sierpinski.c
@@ -191,7 +191,8 @@ static void draw_sierpinski(AVFilterContext *ctx, AVFrame *frame)
             s->pos_y--;
     }
 
-    ctx->internal->execute(ctx, s->draw_slice, frame, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
+    ff_filter_execute(ctx, s->draw_slice, frame, NULL,
+                      FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
 }
 
 static int sierpinski_request_frame(AVFilterLink *link)



More information about the ffmpeg-cvslog mailing list