From f681c443ea634e0bbadf502db714f3718cb27280 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Thu, 13 Mar 2025 22:23:50 +0100 Subject: [PATCH 12/17] avcodec/hqx: Combine checks Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/hqx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c index c28c274b24..54a9870e11 100644 --- a/libavcodec/hqx.c +++ b/libavcodec/hqx.c @@ -282,7 +282,7 @@ static int hqx_decode_444(HQXContext *ctx, int slice_no, int x, int y) quants = hqx_quants[get_bits(gb, 4)]; for (i = 0; i < 12; i++) { - if (i == 0 || i == 4 || i == 8) + if (!(i & 3)) last_dc = 0; ret = decode_block(gb, ctx->dc_vlc, quants, ctx->dcb, slice->block[i], &last_dc); @@ -324,7 +324,7 @@ static int hqx_decode_444a(HQXContext *ctx, int slice_no, int x, int y) cbp |= cbp << 4; // alpha CBP cbp |= cbp << 8; // chroma CBP for (i = 0; i < 16; i++) { - if (i == 0 || i == 4 || i == 8 || i == 12) + if (!(i & 3)) last_dc = 0; if (cbp & (1 << i)) { ret = decode_block(gb, ctx->dc_vlc, quants, -- 2.45.2