[FFmpeg-cvslog] avcodec/huffyuvdspenc : add diff_int16 AVX2 func

Martin Vignali git at videolan.org
Tue Nov 21 10:43:40 EET 2017


ffmpeg | branch: master | Martin Vignali <martin.vignali at gmail.com> | Tue Nov 21 09:17:44 2017 +0100| [ba98f8463fd1345fab173fa405ac98aefd92ed06] | committer: Martin Vignali

avcodec/huffyuvdspenc : add diff_int16 AVX2 func

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba98f8463fd1345fab173fa405ac98aefd92ed06
---

 libavcodec/x86/huffyuvencdsp.asm    | 4 ++++
 libavcodec/x86/huffyuvencdsp_init.c | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/libavcodec/x86/huffyuvencdsp.asm b/libavcodec/x86/huffyuvencdsp.asm
index 3f5a7df7ff..d994fd0fd6 100644
--- a/libavcodec/x86/huffyuvencdsp.asm
+++ b/libavcodec/x86/huffyuvencdsp.asm
@@ -59,6 +59,10 @@ DIFF_INT16
 INIT_XMM sse2
 DIFF_INT16
 
+%if HAVE_AVX2_EXTERNAL
+INIT_YMM avx2
+DIFF_INT16
+%endif
 
 INIT_MMX mmxext
 cglobal sub_hfyu_median_pred_int16, 7,7,0, dst, src1, src2, mask, w, left, left_top
diff --git a/libavcodec/x86/huffyuvencdsp_init.c b/libavcodec/x86/huffyuvencdsp_init.c
index f66bc8c4f0..6c6e068cf8 100644
--- a/libavcodec/x86/huffyuvencdsp_init.c
+++ b/libavcodec/x86/huffyuvencdsp_init.c
@@ -32,6 +32,8 @@ void ff_diff_int16_mmx (uint16_t *dst, const uint16_t *src1, const uint16_t *src
                         unsigned mask, int w);
 void ff_diff_int16_sse2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
                         unsigned mask, int w);
+void ff_diff_int16_avx2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
+                        unsigned mask, int w);
 void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
                                           unsigned mask, int w, int *left, int *left_top);
 
@@ -51,4 +53,8 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, AVCodecContext *
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->diff_int16 = ff_diff_int16_sse2;
     }
+
+    if (EXTERNAL_AVX2_FAST(cpu_flags)) {
+        c->diff_int16 = ff_diff_int16_avx2;
+    }
 }



More information about the ffmpeg-cvslog mailing list