This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 420b1bf3686c21a104b53aab27db364ed10d500f Author: Niklas Haas <[email protected]> AuthorDate: Fri Apr 24 01:59:09 2026 +0200 Commit: Niklas Haas <[email protected]> CommitDate: Fri May 15 18:53:05 2026 +0200 swscale/ops_dispatch: allow forcing specific ops backend This will be used eventually when I rewrite checkasm/sw_ops to re-use the code in ops_dispatch.c instead of hand-rolling the execution layer. Signed-off-by: Niklas Haas <[email protected]> --- libswscale/graph.c | 2 +- libswscale/ops_dispatch.c | 15 ++++++++------- libswscale/ops_dispatch.h | 7 +++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/libswscale/graph.c b/libswscale/graph.c index 757c1097ef..a5209b5058 100644 --- a/libswscale/graph.c +++ b/libswscale/graph.c @@ -593,7 +593,7 @@ static int add_convert_pass(SwsGraph *graph, const SwsFormat *src, av_log(ctx, AV_LOG_DEBUG, "Unoptimized operation list:\n"); ff_sws_op_list_print(ctx, AV_LOG_DEBUG, AV_LOG_TRACE, ops); - ret = ff_sws_compile_pass(graph, &ops, SWS_OP_FLAG_OPTIMIZE, input, output); + ret = ff_sws_compile_pass(graph, NULL, &ops, SWS_OP_FLAG_OPTIMIZE, input, output); if (ret < 0) goto fail; diff --git a/libswscale/ops_dispatch.c b/libswscale/ops_dispatch.c index fa60888272..1bf1069d28 100644 --- a/libswscale/ops_dispatch.c +++ b/libswscale/ops_dispatch.c @@ -470,15 +470,15 @@ static void align_pass(SwsPass *pass, int block_size, int over_rw, int pixel_bit buf->width_pad = FFMAX(buf->width_pad, pad); } -static int compile(SwsGraph *graph, const SwsOpList *ops, SwsPass *input, - SwsPass **output) +static int compile(SwsGraph *graph, const SwsOpBackend *backend, + const SwsOpList *ops, SwsPass *input, SwsPass **output) { SwsContext *ctx = graph->ctx; SwsOpPass *p = av_mallocz(sizeof(*p)); if (!p) return AVERROR(ENOMEM); - int ret = ff_sws_ops_compile(ctx, NULL, ops, &p->comp); + int ret = ff_sws_ops_compile(ctx, backend, ops, &p->comp); if (ret < 0) goto fail; @@ -580,8 +580,9 @@ fail: return ret; } -int ff_sws_compile_pass(SwsGraph *graph, SwsOpList **pops, int flags, - SwsPass *input, SwsPass **output) +int ff_sws_compile_pass(SwsGraph *graph, const SwsOpBackend *backend, + SwsOpList **pops, int flags, SwsPass *input, + SwsPass **output) { const int passes_orig = graph->num_passes; SwsContext *ctx = graph->ctx; @@ -611,7 +612,7 @@ int ff_sws_compile_pass(SwsGraph *graph, SwsOpList **pops, int flags, ff_sws_op_list_print(ctx, AV_LOG_DEBUG, AV_LOG_TRACE, ops); } - ret = compile(graph, ops, input, output); + ret = compile(graph, backend, ops, input, output); if (ret != AVERROR(ENOTSUP)) goto out; @@ -629,7 +630,7 @@ int ff_sws_compile_pass(SwsGraph *graph, SwsOpList **pops, int flags, goto out; } - ret = compile(graph, ops, prev, &prev); + ret = compile(graph, backend, ops, prev, &prev); if (ret < 0) { ff_sws_op_list_free(&rest); goto out; diff --git a/libswscale/ops_dispatch.h b/libswscale/ops_dispatch.h index d5c5c4ecb7..c9f7daecfa 100644 --- a/libswscale/ops_dispatch.h +++ b/libswscale/ops_dispatch.h @@ -162,11 +162,14 @@ int ff_sws_ops_compile(SwsContext *ctx, const SwsOpBackend *backend, * Resolves an operation list to a graph pass. The first and last operations * must be a read/write respectively. `flags` is a list of SwsOpCompileFlags. * + * @param backend Force the use of a specific backend (Optional) + * * Takes over ownership of `ops` and sets it to NULL, even on failure. * * Note: `ops` may be modified by this function. */ -int ff_sws_compile_pass(SwsGraph *graph, SwsOpList **ops, int flags, - SwsPass *input, SwsPass **output); +int ff_sws_compile_pass(SwsGraph *graph, const SwsOpBackend *backend, + SwsOpList **ops, int flags, SwsPass *input, + SwsPass **output); #endif /* SWSCALE_OPS_DISPATCH_H */ _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
