avcodec/{x86,mips}/xvididct_init: Remove redundant checks

ff_xvid_idct_init() already checks in case of high_bit_depth,
lowres or an incompatible idct_algo.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-03-27 02:57:20 +01:00
parent 1f2b8d7238
commit 3792cf52af
4 changed files with 10 additions and 24 deletions

View File

@ -22,20 +22,14 @@
#include "libavutil/mips/cpu.h"
#include "xvididct_mips.h"
av_cold void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
av_cold void ff_xvid_idct_init_mips(IDCTDSPContext *c)
{
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
if (!high_bit_depth) {
if (avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_XVID) {
c->idct_put = ff_xvid_idct_put_mmi;
c->idct_add = ff_xvid_idct_add_mmi;
c->idct = ff_xvid_idct_mmi;
c->perm_type = FF_IDCT_PERM_NONE;
}
}
c->idct_put = ff_xvid_idct_put_mmi;
c->idct_add = ff_xvid_idct_add_mmi;
c->idct = ff_xvid_idct_mmi;
c->perm_type = FF_IDCT_PERM_NONE;
}
}

View File

@ -25,17 +25,11 @@
#include "xvididct.h"
av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c)
{
#if HAVE_X86ASM
int cpu_flags = av_get_cpu_flags();
if (high_bit_depth ||
!(avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_XVID))
return;
if (EXTERNAL_SSE2(cpu_flags)) {
c->idct_put = ff_xvid_idct_put_sse2;
c->idct_add = ff_xvid_idct_add_sse2;

View File

@ -347,9 +347,9 @@ av_cold void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx)
}
#if ARCH_X86
ff_xvid_idct_init_x86(c, avctx, high_bit_depth);
ff_xvid_idct_init_x86(c);
#elif ARCH_MIPS
ff_xvid_idct_init_mips(c, avctx, high_bit_depth);
ff_xvid_idct_init_mips(c);
#endif
ff_init_scantable_permutation(c->idct_permutation, c->perm_type);

View File

@ -28,9 +28,7 @@ void ff_xvid_idct(int16_t *const in);
void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx);
void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_xvid_idct_init_x86(IDCTDSPContext *c);
void ff_xvid_idct_init_mips(IDCTDSPContext *c);
#endif /* AVCODEC_XVIDIDCT_H */