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

Git pushed a commit to branch master
in repository ffmpeg.

commit 670324675fed1ea22f98e5ad07d5fcf4375e0187
Author:     Niklas Haas <[email protected]>
AuthorDate: Fri Jun 12 12:12:52 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Jul 14 12:24:01 2026 +0000

    swscale/uops: add extra convenience metadata for the backends
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/uops.c | 14 +++++++++++++-
 libswscale/uops.h |  5 +++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/libswscale/uops.c b/libswscale/uops.c
index f8af9c41c2..2c9916d4ed 100644
--- a/libswscale/uops.c
+++ b/libswscale/uops.c
@@ -330,6 +330,13 @@ static int translate_rw_op(SwsContext *ctx, SwsUOpList 
*ops, SwsUOpFlags flags,
         uop.uop = is_read ? SWS_UOP_READ_PLANAR : SWS_UOP_WRITE_PLANAR;
     }
 
+    const int planes = ff_sws_rw_op_planes(op);
+    if (op->op == SWS_OP_READ) {
+        ops->planes_in  |= SWS_COMP_ELEMS(planes);
+    } else {
+        ops->planes_out |= SWS_COMP_ELEMS(planes);
+    }
+
     return ff_sws_uop_list_append(ops, &uop);
 }
 
@@ -687,7 +694,12 @@ int ff_sws_ops_translate(SwsContext *ctx, const SwsOpList 
*ops,
 {
     SwsComps input = ops->comps_src;
     for (int i = 0; i < ops->num_ops; i++) {
-        int ret = translate_op(ctx, uops, flags, &ops->ops[i], &input);
+        const SwsOp *op = &ops->ops[i];
+        const int pixel_size = ff_sws_pixel_type_size(op->type);
+        if (pixel_size > uops->pixel_size_max)
+            uops->pixel_size_max = pixel_size;
+
+        int ret = translate_op(ctx, uops, flags, op, &input);
         if (ret < 0)
             return ret;
         input = ops->ops[i].comps;
diff --git a/libswscale/uops.h b/libswscale/uops.h
index 1ad14efc58..bea017268a 100644
--- a/libswscale/uops.h
+++ b/libswscale/uops.h
@@ -255,6 +255,11 @@ void ff_sws_uop_name(const SwsUOp *op, char 
buf[SWS_UOP_NAME_MAX]);
 typedef struct SwsUOpList {
     SwsUOp *ops;
     int num_ops;
+
+    /* Additional metadata for implementations */
+    SwsCompMask planes_in;  /* mask of planes read from */
+    SwsCompMask planes_out; /* mask of planes written to */
+    int pixel_size_max;     /* size of largest pixel type seen in any uop */
 } SwsUOpList;
 
 SwsUOpList *ff_sws_uop_list_alloc(void);

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

Reply via email to