Commit c3bf5271 authored by Christophe Gisquet's avatar Christophe Gisquet Committed by Michael Niedermayer

x86: xvid_idct: port MMX iDCT to yasm

Also reduce the table duplication with SSE2 code, remove duplicated
macro parameters.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7b05b509
......@@ -73,7 +73,6 @@ MMX-OBJS-$(CONFIG_FDCTDSP) += x86/fdct.o
MMX-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct.o
# decoders/encoders
MMX-OBJS-$(CONFIG_MPEG4_DECODER) += x86/xvididct_mmx.o
MMX-OBJS-$(CONFIG_SNOW_DECODER) += x86/snowdsp.o
MMX-OBJS-$(CONFIG_SNOW_ENCODER) += x86/snowdsp.o
MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
......
......@@ -60,11 +60,9 @@ static const struct algo idct_tab_arch[] = {
#if HAVE_MMX_INLINE
{ "SIMPLE-MMX", ff_simple_idct_mmx, FF_IDCT_PERM_SIMPLE, AV_CPU_FLAG_MMX },
#endif
#if CONFIG_MPEG4_DECODER
#if HAVE_MMX_INLINE
#if CONFIG_MPEG4_DECODER && HAVE_YASM
#if ARCH_X86_32
{ "XVID-MMX", ff_xvid_idct_mmx, FF_IDCT_PERM_NONE, AV_CPU_FLAG_MMX, 1 },
#endif
#if HAVE_MMXEXT_INLINE
{ "XVID-MMXEXT", ff_xvid_idct_mmxext, FF_IDCT_PERM_NONE, AV_CPU_FLAG_MMXEXT, 1 },
#endif
#if HAVE_SSE2_EXTERNAL
......@@ -73,7 +71,7 @@ static const struct algo idct_tab_arch[] = {
{ "PR-SSE2", ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_SSE2, 1 },
#endif
#endif
#endif /* CONFIG_MPEG4_DECODER */
#endif /* CONFIG_MPEG4_DECODER && HAVE_YASM */
{ 0 }
};
......
This diff is collapsed.
......@@ -38,6 +38,32 @@ static void xvid_idct_sse2_add(uint8_t *dest, int line_size, short *block)
ff_add_pixels_clamped(block, dest, line_size);
}
#if ARCH_X86_32
static void xvid_idct_mmx_put(uint8_t *dest, int line_size, short *block)
{
ff_xvid_idct_mmx(block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void xvid_idct_mmx_add(uint8_t *dest, int line_size, short *block)
{
ff_xvid_idct_mmx(block);
ff_add_pixels_clamped(block, dest, line_size);
}
static void xvid_idct_mmxext_put(uint8_t *dest, int line_size, short *block)
{
ff_xvid_idct_mmxext(block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void xvid_idct_mmxext_add(uint8_t *dest, int line_size, short *block)
{
ff_xvid_idct_mmxext(block);
ff_add_pixels_clamped(block, dest, line_size);
}
#endif
av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
......@@ -48,19 +74,21 @@ av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
avctx->idct_algo == FF_IDCT_XVID))
return;
if (INLINE_MMX(cpu_flags)) {
c->idct_put = ff_xvid_idct_mmx_put;
c->idct_add = ff_xvid_idct_mmx_add;
#if ARCH_X86_32
if (EXTERNAL_MMX(cpu_flags)) {
c->idct_put = xvid_idct_mmx_put;
c->idct_add = xvid_idct_mmx_add;
c->idct = ff_xvid_idct_mmx;
c->perm_type = FF_IDCT_PERM_NONE;
}
if (INLINE_MMXEXT(cpu_flags)) {
c->idct_put = ff_xvid_idct_mmxext_put;
c->idct_add = ff_xvid_idct_mmxext_add;
if (EXTERNAL_MMXEXT(cpu_flags)) {
c->idct_put = xvid_idct_mmxext_put;
c->idct_add = xvid_idct_mmxext_add;
c->idct = ff_xvid_idct_mmxext;
c->perm_type = FF_IDCT_PERM_NONE;
}
#endif
if (EXTERNAL_SSE2(cpu_flags)) {
c->idct_put = xvid_idct_sse2_put;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment