x86: h264_chromamc: port to cpuflags

pull/8/head
Diego Biurrun 12 years ago
parent b491da18d1
commit 28c8e288fa
  1. 85
      libavcodec/x86/h264_chromamc.asm

@ -89,7 +89,7 @@ SECTION .text
jne .next4rows jne .next4rows
%endmacro %endmacro
%macro chroma_mc8_mmx_func 3 %macro chroma_mc8_mmx_func 2-3
%ifidn %2, rv40 %ifidn %2, rv40
%ifdef PIC %ifdef PIC
%define rnd_1d_rv40 r8 %define rnd_1d_rv40 r8
@ -103,9 +103,9 @@ SECTION .text
%else %else
%define extra_regs 0 %define extra_regs 0
%endif ; rv40 %endif ; rv40
; put/avg_h264_chroma_mc8_mmx_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/, ; put/avg_h264_chroma_mc8_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/,
; int stride, int h, int mx, int my) ; int stride, int h, int mx, int my)
cglobal %1_%2_chroma_mc8_%3, 6, 7 + extra_regs, 0 cglobal %1_%2_chroma_mc8%3, 6, 7 + extra_regs, 0
%if ARCH_X86_64 %if ARCH_X86_64
movsxd r2, r2d movsxd r2, r2d
%endif %endif
@ -282,14 +282,14 @@ cglobal %1_%2_chroma_mc8_%3, 6, 7 + extra_regs, 0
RET RET
%endmacro %endmacro
%macro chroma_mc4_mmx_func 3 %macro chroma_mc4_mmx_func 2
%define extra_regs 0 %define extra_regs 0
%ifidn %2, rv40 %ifidn %2, rv40
%ifdef PIC %ifdef PIC
%define extra_regs 1 %define extra_regs 1
%endif ; PIC %endif ; PIC
%endif ; rv40 %endif ; rv40
cglobal %1_%2_chroma_mc4_%3, 6, 6 + extra_regs, 0 cglobal %1_%2_chroma_mc4, 6, 6 + extra_regs, 0
%if ARCH_X86_64 %if ARCH_X86_64
movsxd r2, r2d movsxd r2, r2d
%endif %endif
@ -373,8 +373,8 @@ cglobal %1_%2_chroma_mc4_%3, 6, 6 + extra_regs, 0
REP_RET REP_RET
%endmacro %endmacro
%macro chroma_mc2_mmx_func 3 %macro chroma_mc2_mmx_func 2
cglobal %1_%2_chroma_mc2_%3, 6, 7, 0 cglobal %1_%2_chroma_mc2, 6, 7, 0
%if ARCH_X86_64 %if ARCH_X86_64
movsxd r2, r2d movsxd r2, r2d
%endif %endif
@ -434,35 +434,38 @@ cglobal %1_%2_chroma_mc2_%3, 6, 7, 0
PAVG %1, %2 PAVG %1, %2
%endmacro %endmacro
INIT_MMX INIT_MMX mmx
%define CHROMAMC_AVG NOTHING %define CHROMAMC_AVG NOTHING
%define CHROMAMC_AVG4 NOTHING %define CHROMAMC_AVG4 NOTHING
chroma_mc8_mmx_func put, h264, rnd_mmx chroma_mc8_mmx_func put, h264, _rnd
chroma_mc8_mmx_func put, vc1, nornd_mmx chroma_mc8_mmx_func put, vc1, _nornd
chroma_mc8_mmx_func put, rv40, mmx chroma_mc8_mmx_func put, rv40
chroma_mc4_mmx_func put, h264, mmx chroma_mc4_mmx_func put, h264
chroma_mc4_mmx_func put, rv40, mmx chroma_mc4_mmx_func put, rv40
chroma_mc2_mmx_func put, h264, mmxext
INIT_MMX mmxext
chroma_mc2_mmx_func put, h264
%define CHROMAMC_AVG DIRECT_AVG %define CHROMAMC_AVG DIRECT_AVG
%define CHROMAMC_AVG4 COPY_AVG %define CHROMAMC_AVG4 COPY_AVG
%define PAVG pavgb %define PAVG pavgb
chroma_mc8_mmx_func avg, h264, rnd_mmxext chroma_mc8_mmx_func avg, h264, _rnd
chroma_mc8_mmx_func avg, vc1, nornd_mmxext chroma_mc8_mmx_func avg, vc1, _nornd
chroma_mc8_mmx_func avg, rv40, mmxext chroma_mc8_mmx_func avg, rv40
chroma_mc4_mmx_func avg, h264, mmxext chroma_mc4_mmx_func avg, h264
chroma_mc4_mmx_func avg, rv40, mmxext chroma_mc4_mmx_func avg, rv40
chroma_mc2_mmx_func avg, h264, mmxext chroma_mc2_mmx_func avg, h264
%define PAVG pavgusb %define PAVG pavgusb
chroma_mc8_mmx_func avg, h264, rnd_3dnow INIT_MMX 3dnow
chroma_mc8_mmx_func avg, vc1, nornd_3dnow chroma_mc8_mmx_func avg, h264, _rnd
chroma_mc8_mmx_func avg, rv40, 3dnow chroma_mc8_mmx_func avg, vc1, _nornd
chroma_mc4_mmx_func avg, h264, 3dnow chroma_mc8_mmx_func avg, rv40
chroma_mc4_mmx_func avg, rv40, 3dnow chroma_mc4_mmx_func avg, h264
chroma_mc4_mmx_func avg, rv40
%macro chroma_mc8_ssse3_func 3
cglobal %1_%2_chroma_mc8_%3, 6, 7, 8 %macro chroma_mc8_ssse3_func 2-3
cglobal %1_%2_chroma_mc8%3, 6, 7, 8
%if ARCH_X86_64 %if ARCH_X86_64
movsxd r2, r2d movsxd r2, r2d
%endif %endif
@ -609,8 +612,8 @@ cglobal %1_%2_chroma_mc8_%3, 6, 7, 8
REP_RET REP_RET
%endmacro %endmacro
%macro chroma_mc4_ssse3_func 3 %macro chroma_mc4_ssse3_func 2
cglobal %1_%2_chroma_mc4_%3, 6, 7, 0 cglobal %1_%2_chroma_mc4, 6, 7, 0
%if ARCH_X86_64 %if ARCH_X86_64
movsxd r2, r2d movsxd r2, r2d
%endif %endif
@ -663,16 +666,16 @@ cglobal %1_%2_chroma_mc4_%3, 6, 7, 0
%endmacro %endmacro
%define CHROMAMC_AVG NOTHING %define CHROMAMC_AVG NOTHING
INIT_XMM INIT_XMM ssse3
chroma_mc8_ssse3_func put, h264, rnd_ssse3 chroma_mc8_ssse3_func put, h264, _rnd
chroma_mc8_ssse3_func put, vc1, nornd_ssse3 chroma_mc8_ssse3_func put, vc1, _nornd
INIT_MMX INIT_MMX ssse3
chroma_mc4_ssse3_func put, h264, ssse3 chroma_mc4_ssse3_func put, h264
%define CHROMAMC_AVG DIRECT_AVG %define CHROMAMC_AVG DIRECT_AVG
%define PAVG pavgb %define PAVG pavgb
INIT_XMM INIT_XMM ssse3
chroma_mc8_ssse3_func avg, h264, rnd_ssse3 chroma_mc8_ssse3_func avg, h264, _rnd
chroma_mc8_ssse3_func avg, vc1, nornd_ssse3 chroma_mc8_ssse3_func avg, vc1, _nornd
INIT_MMX INIT_MMX ssse3
chroma_mc4_ssse3_func avg, h264, ssse3 chroma_mc4_ssse3_func avg, h264

Loading…
Cancel
Save