This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 65197f67ffdcfd255dc4f8c40652c48b2f79f5ea
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Jun 18 13:43:59 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Jun 23 11:48:13 2026 +0000

    swscale/ops_dispatch: add option to link subpass outputs together
    
    Not needed currently but will be used for parallel splits.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops_dispatch.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/libswscale/ops_dispatch.c b/libswscale/ops_dispatch.c
index a0a23185a8..e1f9504cde 100644
--- a/libswscale/ops_dispatch.c
+++ b/libswscale/ops_dispatch.c
@@ -525,7 +525,7 @@ typedef struct CompileArgs {
 } CompileArgs;
 
 static int compile_single(const CompileArgs *args, const SwsOpList *ops,
-                          SwsPass *input, SwsPass **output)
+                          SwsPass *link, SwsPass *input, SwsPass **output)
 {
     SwsGraph *graph = args->graph;
     SwsContext *ctx = graph->ctx;
@@ -542,14 +542,17 @@ static int compile_single(const CompileArgs *args, const 
SwsOpList *ops,
     const SwsCompiledOp *comp = &p->comp;
     const SwsFormat *src = &ops->src;
     const SwsFormat *dst = &ops->dst;
+    av_assert0(!link || link->format == dst->format);
     if (p->comp.opaque) {
         SwsCompiledOp c = *comp;
         av_free(p);
         ret = ff_sws_graph_add_pass(graph, dst->format, dst->width, 
dst->height,
                                     input, 0, c.slice_align, c.func_opaque,
                                     NULL, c.priv, c.free, output);
-        if (ret >= 0)
+        if (ret >= 0) {
             (*output)->backend = comp->backend->flags;
+            ff_sws_pass_link_output(*output, link);
+        }
         return ret;
     }
 
@@ -659,6 +662,7 @@ static int compile_single(const CompileArgs *args, const 
SwsOpList *ops,
         return ret;
 
     (*output)->backend = comp->backend->flags;
+    ff_sws_pass_link_output(*output, link);
     align_pass(*output, comp->block_size, comp->over_write, p->pixel_bits_out);
     if (read)
         align_pass(input, comp->block_size, comp->over_read,  
p->pixel_bits_in);
@@ -671,7 +675,7 @@ fail:
 
 /* Takes over ownership of *pops, even on failure */
 static int compile_subpass(const CompileArgs *args, SwsOpList **pops,
-                           SwsPass *input, SwsPass **output)
+                           SwsPass *link, SwsPass *input, SwsPass **output)
 {
     SwsContext *ctx = args->graph->ctx;
     SwsOpList *ops  = *pops;
@@ -679,7 +683,7 @@ static int compile_subpass(const CompileArgs *args, 
SwsOpList **pops,
     SwsPass *tmp = NULL;
     *pops = NULL;
 
-    int ret = compile_single(args, ops, input, output);
+    int ret = compile_single(args, ops, link, input, output);
     if (ret != AVERROR(ENOTSUP))
         goto fail; /* either success or a hard error */
 
@@ -696,8 +700,8 @@ static int compile_subpass(const CompileArgs *args, 
SwsOpList **pops,
                 break;
             }
             /* Serial split: feed first pass into second */
-            RET(compile_subpass(args, &ops,  input, &tmp));
-            RET(compile_subpass(args, &rest, tmp, output));
+            RET(compile_subpass(args, &ops,  NULL, input, &tmp));
+            RET(compile_subpass(args, &rest, link, tmp, output));
             return 0;
         }
     }
@@ -751,7 +755,7 @@ int ff_sws_compile_pass(SwsGraph *graph, const SwsOpBackend 
*backend,
         .flags   = flags,
     };
 
-    ret = compile_subpass(&args, &ops, input, output);
+    ret = compile_subpass(&args, &ops, NULL, input, output);
     if (ret < 0)
         goto out;
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to