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

Git pushed a commit to branch master
in repository ffmpeg.

commit d8b82c109762fae01e0513e3b1f1638c646d7d84
Author:     Niklas Haas <[email protected]>
AuthorDate: Mon Mar 9 16:08:30 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Sat Mar 28 18:50:14 2026 +0100

    tests/checkasm/sw_ops: add tests for SWS_OP_FILTER_H/V
    
    These tests check that the (fused) read+filter ops work.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 tests/checkasm/sw_ops.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/tests/checkasm/sw_ops.c b/tests/checkasm/sw_ops.c
index 8a7c30b028..570fbfc825 100644
--- a/tests/checkasm/sw_ops.c
+++ b/tests/checkasm/sw_ops.c
@@ -208,6 +208,24 @@ static void check_ops(const char *report, const unsigned 
ranges[NB_PLANES],
         exec.out_bump[i] = exec.out_stride[i] - write_size;
     }
 
+    int32_t in_bump_y[LINES];
+    if (read_op->rw.filter == SWS_OP_FILTER_V) {
+        const int *offsets = read_op->rw.kernel->offsets;
+        for (int y = 0; y < LINES - 1; y++)
+            in_bump_y[y] = offsets[y + 1] - offsets[y] - 1;
+        in_bump_y[LINES - 1] = 0;
+        exec.in_bump_y = in_bump_y;
+    }
+
+    int32_t in_offset_x[PIXELS];
+    if (read_op->rw.filter == SWS_OP_FILTER_H) {
+        const int *offsets = read_op->rw.kernel->offsets;
+        const int rw_bits = rw_pixel_bits(read_op);
+        for (int x = 0; x < PIXELS; x++)
+            in_offset_x[x] = offsets[x] * rw_bits >> 3;
+        exec.in_offset_x = in_offset_x;
+    }
+
     /**
      * Don't use check_func() because the actual function pointer may be a
      * wrapper shared by multiple implementations. Instead, take a hash of both
@@ -772,6 +790,79 @@ static void check_scale(void)
     }
 }
 
+static void check_filter(void)
+{
+    SwsFilterParams params = {
+        .scaler_params = { SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT },
+    };
+
+    SwsFilterWeights *filter;
+
+    for (SwsPixelType t = U8; t < SWS_PIXEL_TYPE_NB; t++) {
+        const char *type = ff_sws_pixel_type_name(t);
+        for (SwsScaler scaler = SWS_SCALE_AUTO + 1; scaler < SWS_SCALE_NB; 
scaler++) {
+            params.scaler = scaler;
+            params.dst_size = LINES;
+            for (int h = 1; h <= LINES; h += h) {
+                params.src_size = h;
+                int ret = ff_sws_filter_generate(NULL, &params, &filter);
+                if (ret < 0) {
+                    fail();
+                    return;
+                }
+
+                const char *name = filter->name;
+                for (int n = 1; n <= 4; n++) {
+                    check_ops(FMT("%s_filter%d_v_%dx%d_%s", name, n, PIXELS, 
h, type), NULL, (SwsOp[]) {
+                        {
+                            .op = SWS_OP_READ,
+                            .type = t,
+                            .rw.elems = n,
+                            .rw.filter = SWS_OP_FILTER_V,
+                            .rw.kernel = filter,
+                        }, {
+                            .op = SWS_OP_WRITE,
+                            .type = SWS_PIXEL_F32,
+                            .rw.elems = n,
+                        }, {0}
+                    });
+                }
+
+                av_refstruct_unref(&filter);
+            }
+
+            params.dst_size = PIXELS;
+            for (int w = 1; w <= PIXELS; w += w) {
+                params.src_size = w;
+                int ret = ff_sws_filter_generate(NULL, &params, &filter);
+                if (ret < 0) {
+                    fail();
+                    return;
+                }
+
+                const char *name = filter->name;
+                for (int n = 1; n <= 4; n++) {
+                    check_ops(FMT("%s_filter%d_h_%dx%d_%s", name, n, w, LINES, 
type), NULL, (SwsOp[]) {
+                        {
+                            .op = SWS_OP_READ,
+                            .type = t,
+                            .rw.elems = n,
+                            .rw.filter = SWS_OP_FILTER_H,
+                            .rw.kernel = filter,
+                        }, {
+                            .op = SWS_OP_WRITE,
+                            .type = SWS_PIXEL_F32,
+                            .rw.elems = n,
+                        }, {0}
+                    });
+                }
+
+                av_refstruct_unref(&filter);
+            }
+        }
+    }
+}
+
 void checkasm_check_sw_ops(void)
 {
     check_read_write();
@@ -796,4 +887,6 @@ void checkasm_check_sw_ops(void)
     report("linear");
     check_scale();
     report("scale");
+    check_filter();
+    report("filter");
 }

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

Reply via email to