[vlc-devel] [PATCH 24/25] deinterlace: add render_mean AVX2 asm

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Tue Apr 14 12:40:35 CEST 2020


8-bit:
   SSE2: 34230 cycles
   AVX2: 30823 cycles
16-bit:
   SSE2: 68427 cycles
   AVX2: 61949 cycles
---
 modules/video_filter/deinterlace/algo_basic.c       | 8 ++++++++
 modules/video_filter/deinterlace/algo_basic_x86.asm | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/modules/video_filter/deinterlace/algo_basic.c b/modules/video_filter/deinterlace/algo_basic.c
index 3e075bbeda..17434a66a7 100644
--- a/modules/video_filter/deinterlace/algo_basic.c
+++ b/modules/video_filter/deinterlace/algo_basic.c
@@ -360,6 +360,10 @@ RENDER_MEAN(Merge16BitGeneric, 16, c)
 RENDER_MEAN_SIMD(8, sse2)
 RENDER_MEAN_SIMD(16, sse2)
 #endif
+#ifdef __x86_64__
+RENDER_MEAN_SIMD(8, avx2)
+RENDER_MEAN_SIMD(16, avx2)
+#endif
 #if defined(CAN_COMPILE_ARM)
 RENDER_MEAN_ARM(8, arm_neon)
 RENDER_MEAN_ARM(16, arm_neon)
@@ -377,6 +381,10 @@ RENDER_MEAN_ARM(16, arm64_neon)
 
 single_pic_renderer_t MeanRenderer(unsigned pixel_size)
 {
+#ifdef __x86_64__
+    if (vlc_CPU_AVX2())
+        return pixel_size & 1 ? RenderMean8Bit_avx2 : RenderMean16Bit_avx2;
+#endif
 #if defined(__i386__) || defined(__x86_64__)
     if (vlc_CPU_SSE2())
         return pixel_size & 1 ? RenderMean8Bit_sse2 : RenderMean16Bit_sse2;
diff --git a/modules/video_filter/deinterlace/algo_basic_x86.asm b/modules/video_filter/deinterlace/algo_basic_x86.asm
index 199d19e7a2..3bb773eac3 100644
--- a/modules/video_filter/deinterlace/algo_basic_x86.asm
+++ b/modules/video_filter/deinterlace/algo_basic_x86.asm
@@ -144,6 +144,8 @@ DEINT_BLEND 16
 INIT_YMM avx2
 
 DEINT_LINEAR 8
+DEINT_MEAN 8
 
 DEINT_LINEAR 16
+DEINT_MEAN 16
 %endif
-- 
2.24.1



More information about the vlc-devel mailing list