[FFmpeg-devel] [PATCH 11/11] avcodec/lossless_videodsp: add AVX-512 version of add_bytes

James Darnley jdarnley at obe.tv
Thu Nov 9 13:58:37 EET 2017


---
 libavcodec/x86/lossless_videodsp.asm    | 5 +++++
 libavcodec/x86/lossless_videodsp_init.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/libavcodec/x86/lossless_videodsp.asm b/libavcodec/x86/lossless_videodsp.asm
index ba4d4f0153..5649348f86 100644
--- a/libavcodec/x86/lossless_videodsp.asm
+++ b/libavcodec/x86/lossless_videodsp.asm
@@ -229,6 +229,11 @@ INIT_YMM avx2
 ADD_BYTES
 %endif
 
+%if HAVE_AVX512_EXTERNAL
+INIT_ZMM avx512
+ADD_BYTES
+%endif
+
 %macro ADD_HFYU_LEFT_LOOP_INT16 2 ; %1 = dst alignment (a/u), %2 = src alignment (a/u)
     add     wd, wd
     add     srcq, wq
diff --git a/libavcodec/x86/lossless_videodsp_init.c b/libavcodec/x86/lossless_videodsp_init.c
index 4f20c1ce92..80d6972f36 100644
--- a/libavcodec/x86/lossless_videodsp_init.c
+++ b/libavcodec/x86/lossless_videodsp_init.c
@@ -26,6 +26,7 @@
 void ff_add_bytes_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t w);
 void ff_add_bytes_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t w);
 void ff_add_bytes_avx2(uint8_t *dst, uint8_t *src, ptrdiff_t w);
+void ff_add_bytes_avx512(uint8_t *dst, uint8_t *src, ptrdiff_t w);
 
 void ff_add_median_pred_mmxext(uint8_t *dst, const uint8_t *top,
                                const uint8_t *diff, ptrdiff_t w,
@@ -119,4 +120,8 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->add_bytes       = ff_add_bytes_avx2;
     }
+
+    if (EXTERNAL_AVX512(cpu_flags)) {
+        c->add_bytes       = ff_add_bytes_avx512;
+    }
 }
-- 
2.15.0



More information about the ffmpeg-devel mailing list