From 80b86f08075757f455cddc656e4e435b4643f52d Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 12 Apr 2026 15:45:26 +0200 Subject: [PATCH] tests/checkasm/sw_ops: fix check_scale() This was not actually testing integer path. Additionally, for integer scales, there is a special fast path for expansion from bits to full range, which we should separate from the random value test. --- tests/checkasm/sw_ops.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/checkasm/sw_ops.c b/tests/checkasm/sw_ops.c index d2961406f4..9bd36c1cc8 100644 --- a/tests/checkasm/sw_ops.c +++ b/tests/checkasm/sw_ops.c @@ -799,13 +799,21 @@ static void check_linear(void) static void check_scale(void) { - for (SwsPixelType t = F32; t < SWS_PIXEL_TYPE_NB; t++) { + for (SwsPixelType t = U8; t < SWS_PIXEL_TYPE_NB; t++) { const char *type = ff_sws_pixel_type_name(t); const int bits = ff_sws_pixel_type_size(t) * 8; if (ff_sws_pixel_type_is_int(t)) { - /* Ensure the result won't exceed the value range */ const unsigned max = (1 << bits) - 1; - const unsigned scale = rnd() & max; + + /* Test fixed fast path for expansion from bits to full range */ + CHECK_COMMON_RANGE(FMT("scale_full_%s", type), 1, t, t, { + .op = SWS_OP_SCALE, + .type = t, + .scale = {{ max, 1 }}, + }); + + /* Ensure the result won't exceed the value range */ + const unsigned scale = rnd() & (max >> 1); const unsigned range = max / (scale ? scale : 1); CHECK_COMMON_RANGE(FMT("scale_%s", type), range, t, t, { .op = SWS_OP_SCALE,