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

Git pushed a commit to branch master
in repository ffmpeg.

commit 01a25f74cc446a683318bab13dfd98a467082ef7
Author:     Niklas Haas <[email protected]>
AuthorDate: Sun Jul 26 00:04:59 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Aug 3 09:32:30 2026 +0000

    checkasm/sw_ops: add SWS_UOP_LUT_3D test
    
    checkasm:
     - CPU: AMD Ryzen 9 9950X3D 16-Core Processor (00B40F40)
     - Timing source: x86 (rdtsc)
     - Bench duration: 100000 µs per function (448667793 cycles)
     - Random seed: 3773883393
    Benchmark results:
      name                         cycles (vs ref)
      f32_lut_3d_xyz_dynamic_c:  125193.9
      f32_lut_3d_xyz_static_c:    25792.1
      f32_lut_3d_xyzw_dynamic_c: 123807.1
      f32_lut_3d_xyzw_static_c:   25739.0
    
    This is roughly ~50% faster than the existing code in lut3d.c, from a quick
    test.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 tests/checkasm/sw_ops.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tests/checkasm/sw_ops.c b/tests/checkasm/sw_ops.c
index df81caf469..21b064e897 100644
--- a/tests/checkasm/sw_ops.c
+++ b/tests/checkasm/sw_ops.c
@@ -634,6 +634,32 @@ static void check_dither(const char *name, SwsUOp *uop)
     av_refstruct_unref(&matrix);
 }
 
+static void check_lut_3d(const char *name, SwsUOp *uop)
+{
+    SwsLut3D *lut3d = ff_sws_lut3d_alloc();
+    if (!lut3d) {
+        fail();
+        return;
+    }
+
+    checkasm_init(&lut3d->input, sizeof(lut3d->input));
+
+    if (uop->par.lut3d.dynamic) {
+        checkasm_init(&lut3d->tone_map, sizeof(lut3d->tone_map));
+        checkasm_init(&lut3d->output,   sizeof(lut3d->output));
+        lut3d->dynamic = true;
+
+        /* Prevent out-of-bounds read from IPT values with abs(PT) > 0.5 */
+        for (int i = 0; i < FF_ARRAY_ELEMS(lut3d->tone_map); i++)
+            lut3d->tone_map[i].y = FFMIN(lut3d->tone_map[i].y, 1 << 15);
+    }
+
+    uop->data.lut3d = lut3d;
+    check_range(name, uop, MK_RANGES(INPUT_LUT_SIZE - 1));
+
+    av_refstruct_unref(&lut3d);
+}
+
 #define CHECK_FUNCTION(CHECK, NAME, ...) \
     CHECK(#NAME, &(SwsUOp) { __VA_ARGS__ });
 
@@ -678,4 +704,5 @@ void checkasm_check_sw_ops(void)
     CHECK_FOR(CLEAR,            check_vec4);
     CHECK_FOR(LINEAR,           check_linear);
     CHECK_FOR(DITHER,           check_dither);
+    CHECK_FOR(LUT_3D,           check_lut_3d);
 }

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

Reply via email to