Commit d07ff3cd authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

h264_chromamc_10bit: port x86 simd to cpuflags.

parent 4a26fdd8
......@@ -2117,10 +2117,10 @@ void ff_ ## OP ## _h264_chroma_mc ## NUM ## _ ## DEPTH ## _ ## OPT \
(uint8_t *dst, uint8_t *src, \
int stride, int h, int x, int y);
CHROMA_MC(put, 2, 10, mmxext)
CHROMA_MC(avg, 2, 10, mmxext)
CHROMA_MC(put, 4, 10, mmxext)
CHROMA_MC(avg, 4, 10, mmxext)
CHROMA_MC(put, 2, 10, mmx2)
CHROMA_MC(avg, 2, 10, mmx2)
CHROMA_MC(put, 4, 10, mmx2)
CHROMA_MC(avg, 4, 10, mmx2)
CHROMA_MC(put, 8, 10, sse2)
CHROMA_MC(avg, 8, 10, sse2)
CHROMA_MC(put, 8, 10, avx)
......@@ -2740,10 +2740,10 @@ static void dsputil_init_mmx2(DSPContext *c, AVCodecContext *avctx,
c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_mmx2;
}
if (bit_depth == 10 && CONFIG_H264CHROMA) {
c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_10_mmxext;
c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_10_mmxext;
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_10_mmxext;
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_10_mmxext;
c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_10_mmx2;
c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_10_mmx2;
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_10_mmx2;
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_10_mmx2;
}
c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_mmx2;
......
......@@ -60,10 +60,10 @@ SECTION .text
;-----------------------------------------------------------------------------
; void put/avg_h264_chroma_mc8(pixel *dst, pixel *src, int stride, int h, int mx, int my)
;-----------------------------------------------------------------------------
%macro CHROMA_MC8 2
%macro CHROMA_MC8 1
; put/avg_h264_chroma_mc8_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/,
; int stride, int h, int mx, int my)
cglobal %1_h264_chroma_mc8_10_%2, 6,7,8
cglobal %1_h264_chroma_mc8_10, 6,7,8
movsxdifnidn r2, r2d
mov r6d, r5d
or r6d, r4d
......@@ -173,8 +173,8 @@ cglobal %1_h264_chroma_mc8_10_%2, 6,7,8
add r0, r2
%endmacro
%macro CHROMA_MC4 2
cglobal %1_h264_chroma_mc4_10_%2, 6,6,7
%macro CHROMA_MC4 1
cglobal %1_h264_chroma_mc4_10, 6,6,7
movsxdifnidn r2, r2d
movd m2, r4m ; x
movd m3, r5m ; y
......@@ -203,8 +203,8 @@ cglobal %1_h264_chroma_mc4_10_%2, 6,6,7
;-----------------------------------------------------------------------------
; void put/avg_h264_chroma_mc2(pixel *dst, pixel *src, int stride, int h, int mx, int my)
;-----------------------------------------------------------------------------
%macro CHROMA_MC2 2
cglobal %1_h264_chroma_mc2_10_%2, 6,7
%macro CHROMA_MC2 1
cglobal %1_h264_chroma_mc2_10, 6,7
movsxdifnidn r2, r2d
mov r6d, r4d
shl r4d, 16
......@@ -250,24 +250,24 @@ cglobal %1_h264_chroma_mc2_10_%2, 6,7
%endmacro
%define CHROMAMC_AVG NOTHING
INIT_XMM
CHROMA_MC8 put, sse2
INIT_XMM sse2
CHROMA_MC8 put
%if HAVE_AVX
INIT_AVX
CHROMA_MC8 put, avx
INIT_XMM avx
CHROMA_MC8 put
%endif
INIT_MMX
CHROMA_MC4 put, mmxext
CHROMA_MC2 put, mmxext
INIT_MMX mmx2
CHROMA_MC4 put
CHROMA_MC2 put
%define CHROMAMC_AVG AVG
%define PAVG pavgw
INIT_XMM
CHROMA_MC8 avg, sse2
INIT_XMM sse2
CHROMA_MC8 avg
%if HAVE_AVX
INIT_AVX
CHROMA_MC8 avg, avx
INIT_XMM avx
CHROMA_MC8 avg
%endif
INIT_MMX
CHROMA_MC4 avg, mmxext
CHROMA_MC2 avg, mmxext
INIT_MMX mmx2
CHROMA_MC4 avg
CHROMA_MC2 avg
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