tests/swscale: fix input pattern generation for very small sizes

This currently completely fails for images smaller than 12x12; and even in that
case, the limited resolution makes these tests a bit useless.

At the risk of triggering a lot of spurious SSIM regressions for very
small sizes (due to insufficiently modelling the effects of low resolution on
the expected noise), this patch allows us to at least *run* such tests.

Incidentally, 8x8 is the smallest size that passes the SSIM check.
This commit is contained in:
Niklas Haas
2026-04-14 16:29:17 +02:00
committed by Niklas Haas
parent 0da2bbab68
commit 953d278a01

View File

@@ -793,8 +793,8 @@ static int init_ref(AVFrame *ref, const struct options *opts)
if (!ctx || !rgb)
goto error;
rgb->width = opts->w / 12;
rgb->height = opts->h / 12;
rgb->width = opts->w > 32 ? opts->w / 12 : opts->w;
rgb->height = opts->h > 32 ? opts->h / 12 : opts->h;
rgb->format = AV_PIX_FMT_RGBA;
ret = av_frame_get_buffer(rgb, 32);
if (ret < 0)