History

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.

Andreas Rheinhardt committed 1 year ago

Commit 3792cf51 parent 1f2b8d74 files · +10 −24Browse files

Showing the changes to libavcodec (4 of 4 files). Show all

Unified · Split

4 files
  1. libavcodec/mips/xvididct_init_mips.c +5 −11
  2. libavcodec/x86/xvididct_init.c +1 −7
  3. libavcodec/xvididct.c +2 −2
  4. libavcodec/xvididct.h +2 −4
libavcodec/mips/xvididct_init_mips.c+5−11
@@ -22,20 +22,14 @@ · 21 unmodified lines
2222 #include "libavutil/mips/cpu.h"
2323 #include "xvididct_mips.h"
2424
25−av_cold void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
26− unsigned high_bit_depth)
25+av_cold void ff_xvid_idct_init_mips(IDCTDSPContext *c)
2726 {
2827 int cpu_flags = av_get_cpu_flags();
2928
3029 if (have_mmi(cpu_flags)) {
31− if (!high_bit_depth) {
32− if (avctx->idct_algo == FF_IDCT_AUTO ||
33− avctx->idct_algo == FF_IDCT_XVID) {
34− c->idct_put = ff_xvid_idct_put_mmi;
35− c->idct_add = ff_xvid_idct_add_mmi;
36− c->idct = ff_xvid_idct_mmi;
37− c->perm_type = FF_IDCT_PERM_NONE;
38− }
39− }
30+ c->idct_put = ff_xvid_idct_put_mmi;
31+ c->idct_add = ff_xvid_idct_add_mmi;
32+ c->idct = ff_xvid_idct_mmi;
33+ c->perm_type = FF_IDCT_PERM_NONE;
4034 }
4135 }
libavcodec/x86/xvididct_init.c+1−7
@@ -25,17 +25,11 @@ · 24 unmodified lines
2525
2626 #include "xvididct.h"
2727
28−av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
29− unsigned high_bit_depth)
28+av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c)
3029 {
3130 #if HAVE_X86ASM
3231 int cpu_flags = av_get_cpu_flags();
3332
34− if (high_bit_depth ||
35− !(avctx->idct_algo == FF_IDCT_AUTO ||
36− avctx->idct_algo == FF_IDCT_XVID))
37− return;
38−
3933 if (EXTERNAL_SSE2(cpu_flags)) {
4034 c->idct_put = ff_xvid_idct_put_sse2;
4135 c->idct_add = ff_xvid_idct_add_sse2;
libavcodec/xvididct.c+2−2
@@ -347,9 +347,9 @@ av_cold void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx) · 346 unmodified lines
347347 }
348348
349349 #if ARCH_X86
350− ff_xvid_idct_init_x86(c, avctx, high_bit_depth);
350+ ff_xvid_idct_init_x86(c);
351351 #elif ARCH_MIPS
352− ff_xvid_idct_init_mips(c, avctx, high_bit_depth);
352+ ff_xvid_idct_init_mips(c);
353353 #endif
354354
355355 ff_init_scantable_permutation(c->idct_permutation, c->perm_type);
libavcodec/xvididct.h+2−4
@@ -28,9 +28,7 @@ void ff_xvid_idct(int16_t *const in); · 27 unmodified lines
2828
2929 void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx);
3030
31−void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
32− unsigned high_bit_depth);
33−void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
34− unsigned high_bit_depth);
31+void ff_xvid_idct_init_x86(IDCTDSPContext *c);
32+void ff_xvid_idct_init_mips(IDCTDSPContext *c);
3533
3634 #endif /* AVCODEC_XVIDIDCT_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t