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

Git pushed a commit to branch master
in repository ffmpeg.

commit 1940662ac6abc12a5c322541dcf5c948cdb5c4e0
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Feb 19 15:00:36 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Thu Feb 19 19:44:46 2026 +0000

    swscale/ops: take plane order into account during noop() check
    
    This helper function now also takes into account the plane order, and only
    returns true if the SwsOpList is a true no-op (i.e. the input image may be
    exactly ref'd to the output, with no change in plane order, etc.)
    
    As pointed out in the code, this is unlikely to actually matter, but still
    technically correct.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libswscale/ops.c b/libswscale/ops.c
index 808160ebd9..4d9d73437b 100644
--- a/libswscale/ops.c
+++ b/libswscale/ops.c
@@ -560,6 +560,18 @@ bool ff_sws_op_list_is_noop(const SwsOpList *ops)
         read->rw.frac != write->rw.frac)
         return false;
 
+    /**
+     * Note that this check is unlikely to ever be hit in practice, since it
+     * would imply the existence of planar formats with different plane orders
+     * between them, e.g. rgbap <-> gbrap, which doesn't currently exist.
+     * However, the check is cheap and lets me sleep at night.
+     */
+    const int num_planes = read->rw.packed ? 1 : read->rw.elems;
+    for (int i = 0; i < num_planes; i++) {
+        if (ops->order_src.in[i] != ops->order_dst.in[i])
+            return false;
+    }
+
     return true;
 }
 

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

Reply via email to