diff options
author | Diego Biurrun <diego@biurrun.de> | 2016-09-01 21:41:01 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2016-09-29 14:48:04 +0200 |
commit | e4a94d8b36c48d95a7d412c40d7b558422ff659c (patch) | |
tree | 754724de182b2d0379f14d2a347d1e4f78d52648 /libavcodec/x86 | |
parent | 2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428 (diff) | |
download | ffmpeg-e4a94d8b36c48d95a7d412c40d7b558422ff659c.tar.gz |
h264chroma: Change type of stride parameters to ptrdiff_t
This avoids SIMD-optimized functions having to sign-extend their
stride argument manually to be able to do pointer arithmetic.
Diffstat (limited to 'libavcodec/x86')
-rw-r--r-- | libavcodec/x86/h264_chromamc.asm | 18 | ||||
-rw-r--r-- | libavcodec/x86/h264_chromamc_10bit.asm | 15 | ||||
-rw-r--r-- | libavcodec/x86/h264chroma_init.c | 26 | ||||
-rw-r--r-- | libavcodec/x86/rv40dsp_init.c | 12 | ||||
-rw-r--r-- | libavcodec/x86/vc1dsp_init.c | 10 |
5 files changed, 31 insertions, 50 deletions
diff --git a/libavcodec/x86/h264_chromamc.asm b/libavcodec/x86/h264_chromamc.asm index 1447940857..a9cac59f0f 100644 --- a/libavcodec/x86/h264_chromamc.asm +++ b/libavcodec/x86/h264_chromamc.asm @@ -105,11 +105,8 @@ SECTION .text %endif ; rv40 ; void ff_put/avg_h264_chroma_mc8_*(uint8_t *dst /* align 8 */, ; uint8_t *src /* align 1 */, -; int stride, int h, int mx, int my) +; ptrdiff_t stride, int h, int mx, int my) cglobal %1_%2_chroma_mc8%3, 6, 7 + extra_regs, 0 -%if ARCH_X86_64 - movsxd r2, r2d -%endif mov r6d, r5d or r6d, r4d jne .at_least_one_non_zero @@ -291,9 +288,6 @@ cglobal %1_%2_chroma_mc8%3, 6, 7 + extra_regs, 0 %endif ; PIC %endif ; rv40 cglobal %1_%2_chroma_mc4, 6, 6 + extra_regs, 0 -%if ARCH_X86_64 - movsxd r2, r2d -%endif pxor m7, m7 movd m2, r4d ; x movd m3, r5d ; y @@ -376,10 +370,6 @@ cglobal %1_%2_chroma_mc4, 6, 6 + extra_regs, 0 %macro chroma_mc2_mmx_func 2 cglobal %1_%2_chroma_mc2, 6, 7, 0 -%if ARCH_X86_64 - movsxd r2, r2d -%endif - mov r6d, r4d shl r4d, 16 sub r4d, r6d @@ -465,9 +455,6 @@ chroma_mc4_mmx_func avg, rv40 %macro chroma_mc8_ssse3_func 2-3 cglobal %1_%2_chroma_mc8%3, 6, 7, 8 -%if ARCH_X86_64 - movsxd r2, r2d -%endif mov r6d, r5d or r6d, r4d jne .at_least_one_non_zero @@ -613,9 +600,6 @@ cglobal %1_%2_chroma_mc8%3, 6, 7, 8 %macro chroma_mc4_ssse3_func 2 cglobal %1_%2_chroma_mc4, 6, 7, 0 -%if ARCH_X86_64 - movsxd r2, r2d -%endif mov r6, r4 shl r4d, 8 sub r4d, r6d diff --git a/libavcodec/x86/h264_chromamc_10bit.asm b/libavcodec/x86/h264_chromamc_10bit.asm index 7b003515cc..ff53b91c42 100644 --- a/libavcodec/x86/h264_chromamc_10bit.asm +++ b/libavcodec/x86/h264_chromamc_10bit.asm @@ -57,12 +57,11 @@ SECTION .text %endmacro ;----------------------------------------------------------------------------- -; void ff_put/avg_h264_chroma_mc8(pixel *dst, pixel *src, int stride, int h, -; int mx, int my) +; void ff_put/avg_h264_chroma_mc8(pixel *dst, pixel *src, ptrdiff_t stride, +; int h, int mx, int my) ;----------------------------------------------------------------------------- %macro CHROMA_MC8 1 cglobal %1_h264_chroma_mc8_10, 6,7,8 - movsxdifnidn r2, r2d mov r6d, r5d or r6d, r4d jne .at_least_one_non_zero @@ -149,8 +148,8 @@ cglobal %1_h264_chroma_mc8_10, 6,7,8 %endmacro ;----------------------------------------------------------------------------- -; void ff_put/avg_h264_chroma_mc4(pixel *dst, pixel *src, int stride, int h, -; int mx, int my) +; void ff_put/avg_h264_chroma_mc4(pixel *dst, pixel *src, ptrdiff_t stride, +; int h, int mx, int my) ;----------------------------------------------------------------------------- ;TODO: xmm mc4 %macro MC4_OP 2 @@ -174,7 +173,6 @@ cglobal %1_h264_chroma_mc8_10, 6,7,8 %macro CHROMA_MC4 1 cglobal %1_h264_chroma_mc4_10, 6,6,7 - movsxdifnidn r2, r2d movd m2, r4m ; x movd m3, r5m ; y mova m4, [pw_8] @@ -200,12 +198,11 @@ cglobal %1_h264_chroma_mc4_10, 6,6,7 %endmacro ;----------------------------------------------------------------------------- -; void ff_put/avg_h264_chroma_mc2(pixel *dst, pixel *src, int stride, int h, -; int mx, int my) +; void ff_put/avg_h264_chroma_mc2(pixel *dst, pixel *src, ptrdiff_t stride, +; int h, int mx, int my) ;----------------------------------------------------------------------------- %macro CHROMA_MC2 1 cglobal %1_h264_chroma_mc2_10, 6,7 - movsxdifnidn r2, r2d mov r6d, r4d shl r4d, 16 sub r4d, r6d diff --git a/libavcodec/x86/h264chroma_init.c b/libavcodec/x86/h264chroma_init.c index 8ec8a79aba..0d5ff3d159 100644 --- a/libavcodec/x86/h264chroma_init.c +++ b/libavcodec/x86/h264chroma_init.c @@ -25,38 +25,38 @@ #include "libavcodec/h264chroma.h" void ff_put_h264_chroma_mc8_rnd_mmx (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_h264_chroma_mc8_rnd_mmxext(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_h264_chroma_mc8_rnd_3dnow(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_put_h264_chroma_mc4_mmx (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_h264_chroma_mc4_mmxext (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_h264_chroma_mc4_3dnow (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_put_h264_chroma_mc2_mmxext (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_h264_chroma_mc2_mmxext (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_put_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_put_h264_chroma_mc4_ssse3 (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_h264_chroma_mc4_ssse3 (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); #define CHROMA_MC(OP, NUM, DEPTH, OPT) \ void ff_ ## OP ## _h264_chroma_mc ## NUM ## _ ## DEPTH ## _ ## OPT \ (uint8_t *dst, uint8_t *src, \ - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); CHROMA_MC(put, 2, 10, mmxext) CHROMA_MC(avg, 2, 10, mmxext) diff --git a/libavcodec/x86/rv40dsp_init.c b/libavcodec/x86/rv40dsp_init.c index e006c76584..7bf3ecd1f3 100644 --- a/libavcodec/x86/rv40dsp_init.c +++ b/libavcodec/x86/rv40dsp_init.c @@ -34,18 +34,18 @@ #if HAVE_YASM void ff_put_rv40_chroma_mc8_mmx (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_rv40_chroma_mc8_mmxext(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_rv40_chroma_mc8_3dnow(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_put_rv40_chroma_mc4_mmx (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_rv40_chroma_mc4_mmxext(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_rv40_chroma_mc4_3dnow(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); #define DECLARE_WEIGHT(opt) \ void ff_rv40_weight_func_rnd_16_##opt(uint8_t *dst, uint8_t *src1, uint8_t *src2, \ diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c index aff4b264e3..8982ff908a 100644 --- a/libavcodec/x86/vc1dsp_init.c +++ b/libavcodec/x86/vc1dsp_init.c @@ -71,15 +71,15 @@ static void avg_vc1_mspel_mc00_mmxext(uint8_t *dst, const uint8_t *src, #endif /* HAVE_YASM */ void ff_put_vc1_chroma_mc8_nornd_mmx (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_vc1_chroma_mc8_nornd_mmxext(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_vc1_chroma_mc8_nornd_3dnow(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_put_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); void ff_avg_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); + ptrdiff_t stride, int h, int x, int y); av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp) |