summaryrefslogtreecommitdiff
path: root/libavcodec/x86/idctdsp_init.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2014-07-21 13:13:21 -0700
committerDiego Biurrun <diego@biurrun.de>2014-08-01 01:25:18 -0700
commita786c8259dafeca9744252230b5d78f67810770c (patch)
treeaade39c2a8bc84ea95306d7a8117d4e05c908139 /libavcodec/x86/idctdsp_init.c
parent03c9f357a4c2307a7913cea2cbf0ba817e80beb6 (diff)
idct: Split off Xvid IDCT
The Xvid IDCT is only required to decode some Xvid-encoded MPEG-4 files, so there is no point in having it as an unconditional part of idctdsp.
Diffstat (limited to 'libavcodec/x86/idctdsp_init.c')
-rw-r--r--libavcodec/x86/idctdsp_init.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index f0511f5115..a0d681afb5 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -22,7 +22,6 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/idctdsp.h"
-#include "idct_xvid.h"
#include "idctdsp.h"
#include "simple_idct.h"
@@ -38,8 +37,6 @@ static const uint8_t simple_mmx_permutation[64] = {
0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
};
-static const uint8_t idct_sse2_row_perm[8] = { 0, 4, 1, 5, 2, 6, 3, 7 };
-
av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation,
enum idct_permutation_type perm_type)
{
@@ -50,10 +47,6 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation,
for (i = 0; i < 64; i++)
idct_permutation[i] = simple_mmx_permutation[i];
return 1;
- case FF_IDCT_PERM_SSE2:
- for (i = 0; i < 64; i++)
- idct_permutation[i] = (i & 0x38) | idct_sse2_row_perm[i & 7];
- return 1;
}
return 0;
@@ -69,38 +62,13 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmx;
c->add_pixels_clamped = ff_add_pixels_clamped_mmx;
- if (!high_bit_depth) {
- switch (avctx->idct_algo) {
- case FF_IDCT_AUTO:
- case FF_IDCT_SIMPLEMMX:
+ if (!high_bit_depth &&
+ (avctx->idct_algo == FF_IDCT_AUTO ||
+ avctx->idct_algo == FF_IDCT_SIMPLEMMX)) {
c->idct_put = ff_simple_idct_put_mmx;
c->idct_add = ff_simple_idct_add_mmx;
c->idct = ff_simple_idct_mmx;
c->perm_type = FF_IDCT_PERM_SIMPLE;
- break;
- case FF_IDCT_XVIDMMX:
- c->idct_put = ff_idct_xvid_mmx_put;
- c->idct_add = ff_idct_xvid_mmx_add;
- c->idct = ff_idct_xvid_mmx;
- break;
- }
- }
- }
-
- if (INLINE_MMXEXT(cpu_flags)) {
- if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
- c->idct_put = ff_idct_xvid_mmxext_put;
- c->idct_add = ff_idct_xvid_mmxext_add;
- c->idct = ff_idct_xvid_mmxext;
- }
- }
-
- if (INLINE_SSE2(cpu_flags)) {
- if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
- c->idct_put = ff_idct_xvid_sse2_put;
- c->idct_add = ff_idct_xvid_sse2_add;
- c->idct = ff_idct_xvid_sse2;
- c->perm_type = FF_IDCT_PERM_SSE2;
}
}
}