summaryrefslogtreecommitdiff
path: root/libavfilter/vf_convolve.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-15 21:33:25 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-15 21:33:25 +0200
commit1b20853fb3e2c4879cdecf2414a2d68760df1149 (patch)
tree131de80408a5a252609a067b2ab1d086b30ef2b5 /libavfilter/vf_convolve.c
parent32b56af6fb9f97749ad091c9373d399e4678457d (diff)
avfilter/internal: Factor out executing a filter's execute_func
The current way of doing it involves writing the ctx parameter twice. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/vf_convolve.c')
-rw-r--r--libavfilter/vf_convolve.c21
1 files changed, 14 insertions, 7 deletions
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));
}