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

Git pushed a commit to branch master
in repository ffmpeg.

commit 1d16161a8bb897a2a6f20bfcad0486e966b3f086
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Feb 12 10:44:19 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Mar 9 11:25:57 2026 +0100

    swscale/ops: use SwsCompFlags typedef instead of plain int
    
    This improves the debugging experience. These are all internal structs so
    there is no need to worry about ABI stability as a result of adding flags.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops.c | 14 +++++++-------
 libswscale/ops.h |  8 ++++----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libswscale/ops.c b/libswscale/ops.c
index 9961f4f791..f8447f284c 100644
--- a/libswscale/ops.c
+++ b/libswscale/ops.c
@@ -213,11 +213,11 @@ void ff_sws_apply_op_q(const SwsOp *op, AVRational x[4])
 }
 
 /* merge_comp_flags() forms a monoid with flags_identity as the null element */
-static const unsigned flags_identity = SWS_COMP_ZERO | SWS_COMP_EXACT;
-static unsigned merge_comp_flags(unsigned a, unsigned b)
+static const SwsCompFlags flags_identity = SWS_COMP_ZERO | SWS_COMP_EXACT;
+static SwsCompFlags merge_comp_flags(SwsCompFlags a, SwsCompFlags b)
 {
-    const unsigned flags_or  = SWS_COMP_GARBAGE;
-    const unsigned flags_and = SWS_COMP_ZERO | SWS_COMP_EXACT;
+    const SwsCompFlags flags_or  = SWS_COMP_GARBAGE;
+    const SwsCompFlags flags_and = SWS_COMP_ZERO | SWS_COMP_EXACT;
     return ((a & b) & flags_and) | ((a | b) & flags_or);
 }
 
@@ -320,7 +320,7 @@ void ff_sws_op_list_update_comps(SwsOpList *ops)
             }
             break;
         case SWS_OP_PACK: {
-            unsigned flags = flags_identity;
+            SwsCompFlags flags = flags_identity;
             for (int i = 0; i < 4; i++) {
                 if (op->pack.pattern[i])
                     flags = merge_comp_flags(flags, prev.flags[i]);
@@ -356,7 +356,7 @@ void ff_sws_op_list_update_comps(SwsOpList *ops)
             break;
         case SWS_OP_LINEAR:
             for (int i = 0; i < 4; i++) {
-                unsigned flags = flags_identity;
+                SwsCompFlags flags = flags_identity;
                 AVRational min = Q(0), max = Q(0);
                 for (int j = 0; j < 4; j++) {
                     const AVRational k = op->lin.m[i][j];
@@ -681,7 +681,7 @@ static const char *describe_lin_mask(uint32_t mask)
     return "ERR";
 }
 
-static char describe_comp_flags(unsigned flags)
+static char describe_comp_flags(SwsCompFlags flags)
 {
     if (flags & SWS_COMP_GARBAGE)
         return 'X';
diff --git a/libswscale/ops.h b/libswscale/ops.h
index 64a4a6dd61..8868d88bed 100644
--- a/libswscale/ops.h
+++ b/libswscale/ops.h
@@ -69,12 +69,12 @@ typedef enum SwsOpType {
     SWS_OP_TYPE_NB,
 } SwsOpType;
 
-enum SwsCompFlags {
+typedef enum SwsCompFlags {
     SWS_COMP_GARBAGE = 1 << 0, /* contents are undefined / garbage data */
     SWS_COMP_EXACT   = 1 << 1, /* value is an exact integer */
     SWS_COMP_ZERO    = 1 << 2, /* known to be a constant zero */
     SWS_COMP_SWAPPED = 1 << 3, /* byte order is swapped */
-};
+} SwsCompFlags;
 
 typedef union SwsConst {
     /* Generic constant value */
@@ -87,8 +87,8 @@ static_assert(sizeof(SwsConst) == sizeof(AVRational) * 4,
               "First field of SwsConst should span the entire union");
 
 typedef struct SwsComps {
-    unsigned flags[4]; /* knowledge about (output) component contents */
-    bool unused[4];    /* which input components are definitely unused */
+    SwsCompFlags flags[4]; /* knowledge about (output) component contents */
+    bool unused[4]; /* which input components are definitely unused */
 
     /* Keeps track of the known possible value range, or {0, 0} for undefined
      * or (unknown range) floating point inputs */

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

Reply via email to