ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Thu Mar 27 02:57:20 2025 +0100| [3792cf52afc12e6de82ac57fbdcf0960d5bc3d78] | 
committer: Andreas Rheinhardt

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.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3792cf52afc12e6de82ac57fbdcf0960d5bc3d78
---

 libavcodec/mips/xvididct_init_mips.c | 16 +++++-----------
 libavcodec/x86/xvididct_init.c       |  8 +-------
 libavcodec/xvididct.c                |  4 ++--
 libavcodec/xvididct.h                |  6 ++----
 4 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/libavcodec/mips/xvididct_init_mips.c 
b/libavcodec/mips/xvididct_init_mips.c
index 658a5792e0..524cf8dcdf 100644
--- a/libavcodec/mips/xvididct_init_mips.c
+++ b/libavcodec/mips/xvididct_init_mips.c
@@ -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;
     }
 }
diff --git a/libavcodec/x86/xvididct_init.c b/libavcodec/x86/xvididct_init.c
index fda34cc638..c6c87b0c90 100644
--- a/libavcodec/x86/xvididct_init.c
+++ b/libavcodec/x86/xvididct_init.c
@@ -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;
diff --git a/libavcodec/xvididct.c b/libavcodec/xvididct.c
index 01072d80ab..2eddc5978c 100644
--- a/libavcodec/xvididct.c
+++ b/libavcodec/xvididct.c
@@ -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);
diff --git a/libavcodec/xvididct.h b/libavcodec/xvididct.h
index e0bc1a2b91..1395cfd8e1 100644
--- a/libavcodec/xvididct.h
+++ b/libavcodec/xvididct.h
@@ -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 */

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to