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

Git pushed a commit to branch master
in repository ffmpeg.

commit 3f9219d60527ffeb30f4c35557e67f8c1e0b4f54
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Apr 30 16:59:15 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Jun 9 18:27:20 2026 +0200

    swscale/uops: add SwsUOpFlags to ff_sws_ops_translate()
    
    These will be used to e.g. enable extra uops during translation.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/tests/sws_ops.c | 2 +-
 libswscale/uops.c          | 9 +++++----
 libswscale/uops.h          | 9 ++++++++-
 libswscale/uops_backend.c  | 2 +-
 4 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/libswscale/tests/sws_ops.c b/libswscale/tests/sws_ops.c
index 22b90926ca..6b5ad486b9 100644
--- a/libswscale/tests/sws_ops.c
+++ b/libswscale/tests/sws_ops.c
@@ -43,7 +43,7 @@ static int print_ops(SwsContext *ctx, SwsOpList *ops, 
SwsCompiledOp *out)
     if (!uops)
         return AVERROR(ENOMEM);
 
-    int ret = ff_sws_ops_translate(ops, uops);
+    int ret = ff_sws_ops_translate(ops, 0, uops);
     if (ret == AVERROR(ENOTSUP)) {
         av_log(NULL, AV_LOG_INFO, " Retrying with split passes:\n");
         goto fail;
diff --git a/libswscale/uops.c b/libswscale/uops.c
index 12b92c2bde..98890b6263 100644
--- a/libswscale/uops.c
+++ b/libswscale/uops.c
@@ -540,7 +540,7 @@ static bool is_expand_bit(SwsPixelType type, AVRational 
factor)
     return false;
 }
 
-static int translate_op(SwsUOpList *uops, const SwsOp *op)
+static int translate_op(SwsUOpList *uops, SwsUOpFlags flags, const SwsOp *op)
 {
     switch (op->op) {
     case SWS_OP_FILTER_H:
@@ -640,10 +640,11 @@ static int translate_op(SwsUOpList *uops, const SwsOp *op)
     return ff_sws_uop_list_append(uops, &uop);
 }
 
-int ff_sws_ops_translate(const SwsOpList *ops, SwsUOpList *uops)
+int ff_sws_ops_translate(const SwsOpList *ops, SwsUOpFlags flags,
+                         SwsUOpList *uops)
 {
     for (int i = 0; i < ops->num_ops; i++) {
-        int ret = translate_op(uops, &ops->ops[i]);
+        int ret = translate_op(uops, flags, &ops->ops[i]);
         if (ret < 0)
             return ret;
     }
@@ -677,7 +678,7 @@ static int register_uops(SwsContext *ctx, SwsOpList *ops, 
SwsCompiledOp *out)
     if (!uops)
         return AVERROR(ENOMEM);
 
-    int ret = ff_sws_ops_translate(ops, uops);
+    int ret = ff_sws_ops_translate(ops, 0, uops);
     if (ret < 0)
         goto fail;
 
diff --git a/libswscale/uops.h b/libswscale/uops.h
index 3e59119bbf..21bb8cb2e2 100644
--- a/libswscale/uops.h
+++ b/libswscale/uops.h
@@ -77,6 +77,12 @@ enum {
      ((W) ? SWS_COMP(3) : 0))
 };
 
+typedef uint32_t SwsUOpFlags;
+typedef enum SwsUOpFlagBits {
+    SWS_UOP_FLAG_NONE = 0,
+    SWS_UOP_FLAG_FMA  = (1 << 0), /* platform supports FMA ops */
+} SwsUOpFlagBits;
+
 typedef enum SwsUOpType {
     SWS_UOP_INVALID = 0,
 
@@ -219,7 +225,8 @@ int ff_sws_uop_list_append(SwsUOpList *uops, SwsUOp *uop);
  *
  * Return 0 or a negative error code.
  */
-int ff_sws_ops_translate(const SwsOpList *ops, SwsUOpList *uops);
+int ff_sws_ops_translate(const SwsOpList *ops, SwsUOpFlags flags,
+                         SwsUOpList *uops);
 
 /**
  * Generate a set of boilerplate C preprocessor macros for describing and
diff --git a/libswscale/uops_backend.c b/libswscale/uops_backend.c
index bcfc511e57..87b50453d1 100644
--- a/libswscale/uops_backend.c
+++ b/libswscale/uops_backend.c
@@ -149,7 +149,7 @@ static int compile(SwsContext *ctx, SwsOpList *ops, 
SwsCompiledOp *out)
         goto fail;
     }
 
-    ret = ff_sws_ops_translate(ops, uops);
+    ret = ff_sws_ops_translate(ops, 0, uops);
     if (ret < 0)
         goto fail;
 

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

Reply via email to