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

Git pushed a commit to branch master
in repository ffmpeg.

commit 310df19fcd16d5e416030781eda2dcdb2761933c
Author:     Niklas Haas <[email protected]>
AuthorDate: Wed May 20 16:44:09 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Sat Jun 20 14:08:49 2026 +0000

    tests/checkasm/sw_ops: add check for SWS_UOP_READ_PALETTE
    
    We just need to ensure the palette contains valid data, which will happen
    automatically as long as the plane 1 is large enough.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 tests/checkasm/sw_ops.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tests/checkasm/sw_ops.c b/tests/checkasm/sw_ops.c
index 49fb0fd6f5..40093009ac 100644
--- a/tests/checkasm/sw_ops.c
+++ b/tests/checkasm/sw_ops.c
@@ -56,6 +56,9 @@ static const char *tprintf(char buf[], size_t size, const 
char *fmt, ...)
 
 static int rw_pixel_bits(const SwsOp *op)
 {
+    if (op->rw.mode == SWS_RW_PALETTE)
+        return 8; /* index size */
+
     int elems = 0;
     switch (op->rw.mode) {
     case SWS_RW_PLANAR: elems = 1; break;
@@ -177,6 +180,11 @@ static void check_compiled(const char *name,
         exec.out_bump[i] = exec.out_stride[i] - write_size;
     }
 
+    if (read_op->rw.mode == SWS_RW_PALETTE) {
+        static_assert(sizeof(src0[1]) >= sizeof(uint32_t[256]), "palette plane 
too small");
+        exec.in_bump[1] = exec.in_stride[1] = 0;
+    }
+
     int32_t in_bump_y[LINES];
     if (read_op->rw.filter.op == SWS_OP_FILTER_V) {
         const int *offsets = read_op->rw.filter.kernel->offsets;
@@ -403,8 +411,9 @@ static void check_read(const char *name, const SwsUOp *uop)
     switch (uop->uop) {
     case SWS_UOP_READ_PACKED:
     case SWS_UOP_READ_BIT:
-    case SWS_UOP_READ_NIBBLE: mode = SWS_RW_PACKED; break;
-    case SWS_UOP_READ_PLANAR: mode = SWS_RW_PLANAR; break;
+    case SWS_UOP_READ_NIBBLE:  mode = SWS_RW_PACKED; break;
+    case SWS_UOP_READ_PLANAR:  mode = SWS_RW_PLANAR; break;
+    case SWS_UOP_READ_PALETTE: mode = SWS_RW_PALETTE; break;
     default: return;
     }
 
@@ -764,6 +773,7 @@ void checkasm_check_sw_ops(void)
     CHECK_FOR(READ_PACKED,      check_read);
     CHECK_FOR(READ_NIBBLE,      check_read);
     CHECK_FOR(READ_BIT,         check_read);
+    CHECK_FOR(READ_PALETTE,     check_read);
     CHECK_FOR(WRITE_PLANAR,     check_write);
     CHECK_FOR(WRITE_PACKED,     check_write);
     CHECK_FOR(WRITE_NIBBLE,     check_write);

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

Reply via email to