From 88e923a48cfbea1f5ee1fda31c17366f1b18a6bc Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Tue, 20 May 2025 22:31:47 +0200 Subject: [PATCH 11/19] avcodec/xvididct: Remove always-true checks ff_xvid_idct_init() is now only called from ff_idctdsp_init() and only if idct_algo is FF_IDCT_XVID. This also implies that it is unnecessary to initalize the permutation on our own. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/xvididct.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/libavcodec/xvididct.c b/libavcodec/xvididct.c index 2eddc5978c..f50d8b7695 100644 --- a/libavcodec/xvididct.c +++ b/libavcodec/xvididct.c @@ -334,23 +334,17 @@ av_cold void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx) { const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8; - if (high_bit_depth || avctx->lowres || - !(avctx->idct_algo == FF_IDCT_AUTO || - avctx->idct_algo == FF_IDCT_XVID)) + if (high_bit_depth || avctx->lowres) return; - if (avctx->idct_algo == FF_IDCT_XVID) { - c->idct_put = xvid_idct_put; - c->idct_add = xvid_idct_add; - c->idct = ff_xvid_idct; - c->perm_type = FF_IDCT_PERM_NONE; - } + c->idct_put = xvid_idct_put; + c->idct_add = xvid_idct_add; + c->idct = ff_xvid_idct; + c->perm_type = FF_IDCT_PERM_NONE; #if ARCH_X86 ff_xvid_idct_init_x86(c); #elif ARCH_MIPS ff_xvid_idct_init_mips(c); #endif - - ff_init_scantable_permutation(c->idct_permutation, c->perm_type); } -- 2.45.2