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

Git pushed a commit to branch master
in repository ffmpeg.

commit c9977acbc6b49cb6b1eef5601e1e1608c23b14e6
Author:     Ramiro Polla <[email protected]>
AuthorDate: Thu Feb 19 23:20:08 2026 +0100
Commit:     Ramiro Polla <[email protected]>
CommitDate: Tue Feb 24 20:25:59 2026 +0100

    swscale/ops: clear range values SWS_OP_{MIN,MAX}
    
    This gives partial range values on conversions with floats, after the
    values have been clamped.
    
     gbrpf32be -> rgb8:
       [f32 XXXX -> zzzX] SWS_OP_READ         : 3 elem(s) planar >> 0
       [f32 ...X -> ...X] SWS_OP_SWAP_BYTES
       [f32 ...X -> ...X] SWS_OP_SWIZZLE      : 2013
       [f32 ...X -> ...X] SWS_OP_LINEAR       : diag3 [[7 0 0 0 0] [0 7 0 0 0] 
[0 0 3 0 0] [0 0 0 1 0]]
       [f32 ...X -> ...X] SWS_OP_DITHER       : 16x16 matrix + {0 3 2 5}
       [f32 ...X -> ...X] SWS_OP_MAX          : {0 0 0 0} <= x
    +    min: {0, 0, 0, _}, max: {nan, nan, nan, _}
       [f32 ...X -> ...X] SWS_OP_MIN          : x <= {7 7 3 _}
    +    min: {0, 0, 0, _}, max: {7, 7, 3, _}
       [f32 ...X -> +++X] SWS_OP_CONVERT      : f32 -> u8
    +    min: {0, 0, 0, _}, max: {7, 7, 3, _}
       [ u8 ...X -> +XXX] SWS_OP_PACK         : {3 3 2 0}
    -    min: {0, _, _, _}, max: {0, _, _, _}
    +    min: {0, _, _, _}, max: {255, _, _, _}
       [ u8 .XXX -> +XXX] SWS_OP_WRITE        : 1 elem(s) packed >> 0
    -    min: {0, _, _, _}, max: {0, _, _, _}
    +    min: {0, _, _, _}, max: {255, _, _, _}
         (X = unused, z = byteswapped, + = exact, 0 = zero)
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Ramiro Polla <[email protected]>
---
 libswscale/ops.c            | 26 +++++++++++++++++++++++---
 tests/ref/fate/sws-ops-list |  2 +-
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/libswscale/ops.c b/libswscale/ops.c
index f6fccd0688..2889e95d12 100644
--- a/libswscale/ops.c
+++ b/libswscale/ops.c
@@ -221,6 +221,22 @@ static unsigned merge_comp_flags(unsigned a, unsigned b)
     return ((a & b) & flags_and) | ((a | b) & flags_or);
 }
 
+/* Linearly propagate flags per component */
+static void propagate_flags(SwsOp *op, const SwsComps *prev)
+{
+    for (int i = 0; i < 4; i++)
+        op->comps.flags[i] = prev->flags[i];
+}
+
+/* Clear undefined values in dst with src */
+static void clear_undefined_values(AVRational dst[4], const AVRational src[4])
+{
+    for (int i = 0; i < 4; i++) {
+        if (dst[i].den == 0)
+            dst[i] = src[i];
+    }
+}
+
 /* Infer + propagate known information about components */
 void ff_sws_op_list_update_comps(SwsOpList *ops)
 {
@@ -276,11 +292,15 @@ void ff_sws_op_list_update_comps(SwsOpList *ops)
             /* fall through */
         case SWS_OP_LSHIFT:
         case SWS_OP_RSHIFT:
+            propagate_flags(op, &prev);
+            break;
         case SWS_OP_MIN:
+            propagate_flags(op, &prev);
+            clear_undefined_values(op->comps.max, op->c.q4);
+            break;
         case SWS_OP_MAX:
-            /* Linearly propagate flags per component */
-            for (int i = 0; i < 4; i++)
-                op->comps.flags[i] = prev.flags[i];
+            propagate_flags(op, &prev);
+            clear_undefined_values(op->comps.min, op->c.q4);
             break;
         case SWS_OP_DITHER:
             /* Strip zero flag because of the nonzero dithering offset */
diff --git a/tests/ref/fate/sws-ops-list b/tests/ref/fate/sws-ops-list
index 5233a822e9..9f85a106ed 100644
--- a/tests/ref/fate/sws-ops-list
+++ b/tests/ref/fate/sws-ops-list
@@ -1 +1 @@
-7feeffb2210933bab6f7dcd6641014cf
+86c2335d1adad97dda299cbc6234ac57

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

Reply via email to