Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: jianhua.wu-at-intel.com@ffmpeg.org
To: ffmpeg-devel@ffmpeg.org
Cc: Wu Jianhua <jianhua.wu@intel.com>
Subject: [FFmpeg-devel] [PATCH 3/6] avcodec/x86/hevc_mc: add qpel_h16_8_avx512icl
Date: Wed, 23 Feb 2022 16:57:32 +0800
Message-ID: <20220223085735.70854-3-jianhua.wu@intel.com> (raw)
In-Reply-To: <20220223085735.70854-1-jianhua.wu@intel.com>

From: Wu Jianhua <jianhua.wu@intel.com>

ff_hevc_put_hevc_qpel_h16_8_sse4       3290870
ff_hevc_put_hevc_qpel_h16_8_avx512icl  1730033

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
---
 libavcodec/x86/hevc_mc.asm    | 39 ++++++++++++++++++++++++++++++-----
 libavcodec/x86/hevcdsp.h      |  1 +
 libavcodec/x86/hevcdsp_init.c |  1 +
 3 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/libavcodec/x86/hevc_mc.asm b/libavcodec/x86/hevc_mc.asm
index 026b6b48ee..8c128f5202 100644
--- a/libavcodec/x86/hevc_mc.asm
+++ b/libavcodec/x86/hevc_mc.asm
@@ -89,6 +89,7 @@ QPEL_TABLE 10, 8, w, avx2
 
 QPEL_TABLE  8, 1, b, avx512icl_h
 QPEL_TABLE  8, 1, d, avx512icl_v
+QPEL_TABLE 16, 1, b, avx512icl_h
 
 pb_qpel_shuffle_index: db  0,  1,  2,  3
                        db  1,  2,  3,  4
@@ -98,6 +99,14 @@ pb_qpel_shuffle_index: db  0,  1,  2,  3
                        db  5,  6,  7,  8
                        db  6,  7,  8,  9
                        db  7,  8,  9, 10
+                       db  8,  9, 10, 11
+                       db  9, 10, 11, 12
+                       db 10, 11, 12, 13
+                       db 11, 12, 13, 14
+                       db 12, 13, 14, 15
+                       db 13, 14, 15, 16
+                       db 14, 15, 16, 17
+                       db 15, 16, 17, 18
                        db  4,  5,  6,  7
                        db  5,  6,  7,  8
                        db  6,  7,  8,  9
@@ -106,6 +115,14 @@ pb_qpel_shuffle_index: db  0,  1,  2,  3
                        db  9, 10, 11, 12
                        db 10, 11, 12, 13
                        db 11, 12, 13, 14
+                       db 12, 13, 14, 15
+                       db 13, 14, 15, 16
+                       db 14, 15, 16, 17
+                       db 15, 16, 17, 18
+                       db 16, 17, 18, 19
+                       db 17, 18, 19, 20
+                       db 18, 19, 20, 21
+                       db 19, 20, 21, 22
 
 SECTION .text
 
@@ -1712,7 +1729,7 @@ HEVC_PUT_HEVC_QPEL_HV 16, 10
 
 %macro QPEL_LOAD_SHUF 2
     movu m%1, [pb_qpel_shuffle_index +  0]
-    movu m%2, [pb_qpel_shuffle_index + 32]
+    movu m%2, [pb_qpel_shuffle_index + 64]
 %endmacro
 
 ; required: m0-m5
@@ -1720,7 +1737,11 @@ HEVC_PUT_HEVC_QPEL_HV 16, 10
 ; %2: name for src
 %macro QPEL_H_LOAD_COMPUTE 2
     pxor            m%1, m%1
-    movu            xm4, [%2q - 3]
+%if mmsize == 64
+    movu            ym4, [%2]
+%else
+    movu            xm4, [%2]
+%endif
     vpermb           m5, m2, m4
     vpermb           m4, m3, m4
     vpdpbusd        m%1, m5, m0
@@ -1732,9 +1753,14 @@ cglobal hevc_put_hevc_qpel_h%1_%2, 5, 6, 8, dst, src, srcstride, height, mx, tmp
     QPEL_FILTER_H   %1, mx, 0, 1, tmp
     QPEL_LOAD_SHUF   2, 3
 .loop:
-    QPEL_H_LOAD_COMPUTE   6, src
+    QPEL_H_LOAD_COMPUTE   6, srcq - 3
+%if %1 == 8
     vpmovdw             xm6, m6
     movu             [dstq], xm6
+%else
+    vpmovdw             ym6, m6
+    movu             [dstq], ym6
+%endif
     LOOP_END            dst, src, srcstride
     RET
 %endmacro
@@ -1764,12 +1790,12 @@ cglobal hevc_put_hevc_qpel_hv%1_%2, 6, 7, 8, dst, src, srcstride, height, mx, my
     %assign %%j %%j+1
 %endrep
 %rep %%extra
-    QPEL_H_LOAD_COMPUTE %%i, src
+    QPEL_H_LOAD_COMPUTE %%i, srcq - 3
     add srcq, srcstrideq
 %assign %%i %%i+1
 %endrep
 .loop:
-    QPEL_H_LOAD_COMPUTE %%i, src
+    QPEL_H_LOAD_COMPUTE %%i, srcq - 3
     vpmulld           m22, m14, m6
     vpmulld           m23, m15, m7
     vpmulld           m24, m16, m8
@@ -1807,5 +1833,8 @@ INIT_YMM avx512icl
 HEVC_PUT_HEVC_QPEL_AVX512ICL 8, 8
 HEVC_PUT_HEVC_QPEL_HV_AVX512ICL 8, 8
 
+INIT_ZMM avx512icl
+HEVC_PUT_HEVC_QPEL_AVX512ICL 16, 8
+
 %endif
 %endif
diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevcdsp.h
index 5a495d2563..6e3fc01ad0 100644
--- a/libavcodec/x86/hevcdsp.h
+++ b/libavcodec/x86/hevcdsp.h
@@ -234,6 +234,7 @@ WEIGHTING_PROTOTYPES(10, sse4);
 WEIGHTING_PROTOTYPES(12, sse4);
 
 void ff_hevc_put_hevc_qpel_h8_8_avx512icl(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);
+void ff_hevc_put_hevc_qpel_h16_8_avx512icl(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);
 void ff_hevc_put_hevc_qpel_hv8_8_avx512icl(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index 0341835944..4023faa654 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -880,6 +880,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         }
         if (EXTERNAL_AVX512ICL(cpu_flags)) {
             c->put_hevc_qpel[3][0][1] = ff_hevc_put_hevc_qpel_h8_8_avx512icl;
+            c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_8_avx512icl;
             c->put_hevc_qpel[3][1][1] = ff_hevc_put_hevc_qpel_hv8_8_avx512icl;
         }
     } else if (bit_depth == 10) {
-- 
2.17.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2022-02-23  8:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23  8:57 [FFmpeg-devel] [PATCH 1/6] avutil/cpu: add AVX512 Icelake flag jianhua.wu-at-intel.com
2022-02-23  8:57 ` [FFmpeg-devel] [PATCH 2/6] avcodec/x86/hevc_mc: add qpel_h8_8_avx512icl and qpel_hv8_8_avx512icl jianhua.wu-at-intel.com
2022-03-10 15:22   ` Henrik Gramner
2022-03-11  7:55     ` Wu, Jianhua
2022-02-23  8:57 ` jianhua.wu-at-intel.com [this message]
2022-02-23  8:57 ` [FFmpeg-devel] [PATCH 4/6] avcodec/x86/hevc_mc: add qpel_h4_8_avx512icl jianhua.wu-at-intel.com
2022-02-23  8:57 ` [FFmpeg-devel] [PATCH 5/6] avcodec/x86/hevc_mc: add qpel_h32_8_avx512icl jianhua.wu-at-intel.com
2022-02-23  8:57 ` [FFmpeg-devel] [PATCH 6/6] avcodec/x86/hevc_mc: add qpel_h64_8_avx512icl jianhua.wu-at-intel.com
2022-03-02  5:33 ` [FFmpeg-devel] [PATCH 1/6] avutil/cpu: add AVX512 Icelake flag Wu, Jianhua
2022-03-09  7:38   ` Wu, Jianhua
2022-03-10 14:34 ` Henrik Gramner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220223085735.70854-3-jianhua.wu@intel.com \
    --to=jianhua.wu-at-intel.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=jianhua.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git