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

Git pushed a commit to branch master
in repository ffmpeg.

commit 13388c0cacc1752ceee9ac08bf82bc95ba2c1780
Author:     Niklas Haas <[email protected]>
AuthorDate: Sat Mar 28 16:33:38 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Sun Mar 29 09:39:09 2026 +0000

    swscale/ops: test for SWS_COMP_GARBAGE instead of next->comps.unused
    
    When printing/describing operations.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops.c           | 18 +++++++++---------
 libswscale/ops.h           |  2 +-
 libswscale/tests/sws_ops.c |  3 +--
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/libswscale/ops.c b/libswscale/ops.c
index 56fd1f81ec..93d6350864 100644
--- a/libswscale/ops.c
+++ b/libswscale/ops.c
@@ -788,13 +788,13 @@ static void print_q(AVBPrint *bp, const AVRational q, 
bool ignore_den0)
 }
 
 static void print_q4(AVBPrint *bp, const AVRational q4[4], bool ignore_den0,
-                     const bool unused[4])
+                     const SwsCompFlags flags[4])
 {
     av_bprintf(bp, "{");
     for (int i = 0; i < 4; i++) {
         if (i)
             av_bprintf(bp, " ");
-        if (unused && unused[i]) {
+        if (flags[i] & SWS_COMP_GARBAGE) {
             av_bprintf(bp, "_");
         } else {
             print_q(bp, q4[i], ignore_den0);
@@ -803,7 +803,7 @@ static void print_q4(AVBPrint *bp, const AVRational q4[4], 
bool ignore_den0,
     av_bprintf(bp, "}");
 }
 
-void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op, const bool unused[4])
+void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op)
 {
     const char *name  = ff_sws_op_type_name(op->op);
 
@@ -838,7 +838,7 @@ void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op, const 
bool unused[4])
         break;
     case SWS_OP_CLEAR:
         av_bprintf(bp, "%-20s: ", name);
-        print_q4(bp, op->c.q4, true, unused);
+        print_q4(bp, op->c.q4, true, op->comps.flags);
         break;
     case SWS_OP_SWIZZLE:
         av_bprintf(bp, "%-20s: %d%d%d%d", name,
@@ -858,11 +858,11 @@ void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op, const 
bool unused[4])
         break;
     case SWS_OP_MIN:
         av_bprintf(bp, "%-20s: x <= ", name);
-        print_q4(bp, op->c.q4, true, unused);
+        print_q4(bp, op->c.q4, true, op->comps.flags);
         break;
     case SWS_OP_MAX:
         av_bprintf(bp, "%-20s: ", name);
-        print_q4(bp, op->c.q4, true, unused);
+        print_q4(bp, op->c.q4, true, op->comps.flags);
         av_bprintf(bp, " <= x");
         break;
     case SWS_OP_LINEAR:
@@ -933,7 +933,7 @@ void ff_sws_op_list_print(void *log, int lev, int lev_extra,
                    next->comps.unused[2] ? 'X' : 
describe_comp_flags(op->comps.flags[2]),
                    next->comps.unused[3] ? 'X' : 
describe_comp_flags(op->comps.flags[3]));
 
-        ff_sws_op_desc(&bp, op, next->comps.unused);
+        ff_sws_op_desc(&bp, op);
 
         if (op->op == SWS_OP_READ || op->op == SWS_OP_WRITE) {
             const int planes = op->rw.packed ? 1 : op->rw.elems;
@@ -951,9 +951,9 @@ void ff_sws_op_list_print(void *log, int lev, int lev_extra,
         {
             av_bprint_clear(&bp);
             av_bprintf(&bp, "    min: ");
-            print_q4(&bp, op->comps.min, false, next->comps.unused);
+            print_q4(&bp, op->comps.min, false, op->comps.flags);
             av_bprintf(&bp, ", max: ");
-            print_q4(&bp, op->comps.max, false, next->comps.unused);
+            print_q4(&bp, op->comps.max, false, op->comps.flags);
             av_assert0(av_bprint_is_complete(&bp));
             av_log(log, lev_extra, "%s\n", bp.str);
         }
diff --git a/libswscale/ops.h b/libswscale/ops.h
index a6bbceced4..abeaf97d27 100644
--- a/libswscale/ops.h
+++ b/libswscale/ops.h
@@ -233,7 +233,7 @@ typedef struct SwsOp {
 /**
  * Describe an operation in human-readable form.
  */
-void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op, const bool unused[4]);
+void ff_sws_op_desc(AVBPrint *bp, const SwsOp *op);
 
 /**
  * Frees any allocations associated with an SwsOp and sets it to {0}.
diff --git a/libswscale/tests/sws_ops.c b/libswscale/tests/sws_ops.c
index 91b3d8c4b7..02049156e7 100644
--- a/libswscale/tests/sws_ops.c
+++ b/libswscale/tests/sws_ops.c
@@ -50,7 +50,6 @@ static int cmp_str(const void *a, const void *b)
     return strcmp(a, b);
 }
 
-static const bool unused[4] = { false, false, false, false };
 static int register_op(SwsContext *ctx, void *opaque, SwsOp *op)
 {
     struct AVTreeNode **root = opaque;
@@ -80,7 +79,7 @@ static int register_op(SwsContext *ctx, void *opaque, SwsOp 
*op)
     }
 
     av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
-    ff_sws_op_desc(&bp, op, unused);
+    ff_sws_op_desc(&bp, op);
     int ret = av_bprint_finalize(&bp, &desc);
     if (ret < 0)
         return ret;

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

Reply via email to