[FFmpeg-devel] [PATCH 6/6] x86: huffyuvdsp: fewer functions for x86_64
Christophe Gisquet
christophe.gisquet at gmail.com
Thu May 29 11:10:41 CEST 2014
When there are 2 functions that are <= SSE2, only one is needed for x86_64.
---
libavcodec/x86/huffyuvdsp.asm | 4 ++++
libavcodec/x86/huffyuvdsp_init.c | 8 +++++---
libavcodec/x86/huffyuvdsp_mmx.c | 2 +-
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/libavcodec/x86/huffyuvdsp.asm b/libavcodec/x86/huffyuvdsp.asm
index 38309b7..be63f37 100644
--- a/libavcodec/x86/huffyuvdsp.asm
+++ b/libavcodec/x86/huffyuvdsp.asm
@@ -109,8 +109,10 @@ cglobal add_hfyu_median_pred, 6,6,8, dst, top, diff, w, left, left_top
RET
%endmacro
+%if ARCH_X86_32
INIT_MMX mmxext
HFYU_MEDIAN
+%endif
INIT_XMM sse2
HFYU_MEDIAN
@@ -250,7 +252,9 @@ cglobal add_hfyu_left_pred_bgr32, 4,4,0, dst, src, w, left
REP_RET
%endmacro
+%if ARCH_X86_32
INIT_MMX mmx
LEFT_BGR32
+%endif
INIT_MMX mmxext
LEFT_BGR32
diff --git a/libavcodec/x86/huffyuvdsp_init.c b/libavcodec/x86/huffyuvdsp_init.c
index 2abd8d5..745390e 100644
--- a/libavcodec/x86/huffyuvdsp_init.c
+++ b/libavcodec/x86/huffyuvdsp_init.c
@@ -49,19 +49,21 @@ av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c)
{
int cpu_flags = av_get_cpu_flags();
-#if HAVE_7REGS && HAVE_INLINE_ASM
+#if HAVE_7REGS && HAVE_INLINE_ASM && ARCH_X86_32
if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_CMOV)
c->add_hfyu_median_pred = ff_add_hfyu_median_pred_cmov;
#endif
if (EXTERNAL_MMX(cpu_flags)) {
c->add_bytes = ff_add_bytes_mmx;
- c->add_hfyu_left_pred_bgr32 = ff_add_hfyu_left_pred_bgr32_mmx;
+ if (ARCH_X86_32) {
+ c->add_hfyu_left_pred_bgr32 = ff_add_hfyu_left_pred_bgr32_mmx;
+ }
}
if (EXTERNAL_MMXEXT(cpu_flags)) {
/* slower than cmov version on AMD */
- if (!(cpu_flags & AV_CPU_FLAG_3DNOW))
+ if (!(cpu_flags & AV_CPU_FLAG_3DNOW) && ARCH_X86_32)
c->add_hfyu_median_pred = ff_add_hfyu_median_pred_mmxext;
c->add_hfyu_left_pred_bgr32 = ff_add_hfyu_left_pred_bgr32_mmxext;
}
diff --git a/libavcodec/x86/huffyuvdsp_mmx.c b/libavcodec/x86/huffyuvdsp_mmx.c
index ee6ec91..bd7b840 100644
--- a/libavcodec/x86/huffyuvdsp_mmx.c
+++ b/libavcodec/x86/huffyuvdsp_mmx.c
@@ -22,7 +22,7 @@
#include "libavutil/x86/asm.h"
#include "huffyuvdsp.h"
-#if HAVE_INLINE_ASM && HAVE_7REGS
+#if HAVE_INLINE_ASM && HAVE_7REGS && ARCH_X86_32
void ff_add_hfyu_median_pred_cmov(uint8_t *dst, const uint8_t *top,
const uint8_t *diff, int w,
int *left, int *left_top)
--
1.8.0.msysgit.0
More information about the ffmpeg-devel
mailing list