From 3680642e1bd8f8d28164494d05cd4be7e300771d Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 31 Mar 2026 13:27:22 +0200 Subject: [PATCH] swscale/ops: simplify min/max range print check This does come with a slight change in behavior, as we now don't print the range information in the case that the range is only known for *unused* components. However, in practice, that's already guaranteed by update_comps() stripping the range info explicitly in this case. Signed-off-by: Niklas Haas --- libswscale/ops.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libswscale/ops.c b/libswscale/ops.c index 32807ed79d..1084c16d4a 100644 --- a/libswscale/ops.c +++ b/libswscale/ops.c @@ -995,11 +995,10 @@ void ff_sws_op_list_print(void *log, int lev, int lev_extra, av_assert0(av_bprint_is_complete(&bp)); av_log(log, lev, "%s\n", bp.str); - if (op->comps.min[0].den || op->comps.min[1].den || - op->comps.min[2].den || op->comps.min[3].den || - op->comps.max[0].den || op->comps.max[1].den || - op->comps.max[2].den || op->comps.max[3].den) - { + /* Only print value ranges if any are relevant */ + SwsCompMask range_mask = ff_sws_comp_mask_q4(op->comps.min) | + ff_sws_comp_mask_q4(op->comps.max); + if (range_mask & mask) { av_bprint_clear(&bp); av_bprintf(&bp, " min: "); print_q4(&bp, op->comps.min, mask);