ff_xvid_idct_init() already checks in case of high_bit_depth, lowres or an incompatible idct_algo.
Unified · Split
| @@ -22,20 +22,14 @@ · 21 unmodified lines | |||
| 22 | #include "libavutil/mips/cpu.h" | 22 | #include "libavutil/mips/cpu.h" |
| 23 | #include "xvididct_mips.h" | 23 | #include "xvididct_mips.h" |
| 24 | 24 | ||
| 25 | av_cold void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx, | 25 | av_cold void ff_xvid_idct_init_mips(IDCTDSPContext *c) |
| 26 | unsigned high_bit_depth) | ||
| 27 | { | 26 | { |
| 28 | int cpu_flags = av_get_cpu_flags(); | 27 | int cpu_flags = av_get_cpu_flags(); |
| 29 | 28 | ||
| 30 | if (have_mmi(cpu_flags)) { | 29 | if (have_mmi(cpu_flags)) { |
| 31 | if (!high_bit_depth) { | 30 | c->idct_put = ff_xvid_idct_put_mmi; |
| 32 | if (avctx->idct_algo == FF_IDCT_AUTO || | 31 | c->idct_add = ff_xvid_idct_add_mmi; |
| 33 | avctx->idct_algo == FF_IDCT_XVID) { | 32 | c->idct = ff_xvid_idct_mmi; |
| 34 | c->idct_put = ff_xvid_idct_put_mmi; | 33 | c->perm_type = FF_IDCT_PERM_NONE; |
| 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 | } | ||
| 40 | } | 34 | } |
| 41 | } | 35 | } |
| @@ -25,17 +25,11 @@ · 24 unmodified lines | |||
| 25 | 25 | ||
| 26 | #include "xvididct.h" | 26 | #include "xvididct.h" |
| 27 | 27 | ||
| 28 | av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, | 28 | av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c) |
| 29 | unsigned high_bit_depth) | ||
| 30 | { | 29 | { |
| 31 | #if HAVE_X86ASM | 30 | #if HAVE_X86ASM |
| 32 | int cpu_flags = av_get_cpu_flags(); | 31 | int cpu_flags = av_get_cpu_flags(); |
| 33 | 32 | ||
| 34 | if (high_bit_depth || | ||
| 35 | !(avctx->idct_algo == FF_IDCT_AUTO || | ||
| 36 | avctx->idct_algo == FF_IDCT_XVID)) | ||
| 37 | return; | ||
| 38 | |||
| 39 | if (EXTERNAL_SSE2(cpu_flags)) { | 33 | if (EXTERNAL_SSE2(cpu_flags)) { |
| 40 | c->idct_put = ff_xvid_idct_put_sse2; | 34 | c->idct_put = ff_xvid_idct_put_sse2; |
| 41 | c->idct_add = ff_xvid_idct_add_sse2; | 35 | c->idct_add = ff_xvid_idct_add_sse2; |
| @@ -347,9 +347,9 @@ av_cold void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx) · 346 unmodified lines | |||
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | #if ARCH_X86 | 349 | #if ARCH_X86 |
| 350 | ff_xvid_idct_init_x86(c, avctx, high_bit_depth); | 350 | ff_xvid_idct_init_x86(c); |
| 351 | #elif ARCH_MIPS | 351 | #elif ARCH_MIPS |
| 352 | ff_xvid_idct_init_mips(c, avctx, high_bit_depth); | 352 | ff_xvid_idct_init_mips(c); |
| 353 | #endif | 353 | #endif |
| 354 | 354 | ||
| 355 | ff_init_scantable_permutation(c->idct_permutation, c->perm_type); | 355 | ff_init_scantable_permutation(c->idct_permutation, c->perm_type); |
| @@ -28,9 +28,7 @@ void ff_xvid_idct(int16_t *const in); · 27 unmodified lines | |||
| 28 | 28 | ||
| 29 | void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx); | 29 | void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx); |
| 30 | 30 | ||
| 31 | void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, | 31 | void ff_xvid_idct_init_x86(IDCTDSPContext *c); |
| 32 | unsigned high_bit_depth); | 32 | void ff_xvid_idct_init_mips(IDCTDSPContext *c); |
| 33 | void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx, | ||
| 34 | unsigned high_bit_depth); | ||
| 35 | 33 | ||
| 36 | #endif /* AVCODEC_XVIDIDCT_H */ | 34 | #endif /* AVCODEC_XVIDIDCT_H */ |