From patchwork Wed Feb 23 08:57:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Jianhua" X-Patchwork-Id: 34468 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:d078:0:0:0:0 with SMTP id x24csp633115nkx; Wed, 23 Feb 2022 00:58:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIPFa4t2DfvZKk1UKJX7Unb2n9pOEfkt4zg7MK8Z/HG5mfMVaedkLBWgCHg70W9GdjQlyQ X-Received: by 2002:aa7:c986:0:b0:413:30cc:cfd8 with SMTP id c6-20020aa7c986000000b0041330cccfd8mr2458065edt.122.1645606710904; Wed, 23 Feb 2022 00:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645606710; cv=none; d=google.com; s=arc-20160816; b=cf9Nzbfx/+vByrkYiwFEHznjvyF0evR4bFXUTZ829svaKLjgLQcXg8i5IG8Vqkggo8 HYc+Qva/YUdx9sB18uHDPzBAszrXXXSJ9daKH1IH6wEqkwBFkNv9FNGYOiOHf7HXcxlY fmXfmlwooOewloosN2GcdKRG7KdVNX9BvxHo64PLJPOypzaIW/scYCRTGdQ/IR/Mmt03 2m0KhGnqQzpSNT8zNGfhDmBXDO4Yeo8WpOqiypJGd9jIQ2BHgFjX8ItsnJ2ZErLN4v9o cJ77CvtelnoaCbMJsLh6I48CSKamI+6ht7FBWTO6CD5pXIjlM8/OaRurs5ZW9pxyt+Dk C0aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=FYveWN4FbrYKGplI13DSK8CSw1ryBiqzmqmtC5XAh+c=; b=LPtGB53ZdR4NbwRrUCUiAoDxB/gNhcPUx7mS3P2m4zgR09CcBsu+x4j2y995iu2fDQ mia/iGjPBDMkDP76ZRoJGrUcSJCMWkFZqQtkF+o+a+rsEq6g1sJ+HEbbdsnIRUPt/w70 NXCPDphomg+w8J9r2VfbHppVb8Pp8+GZ+9ja2AWXosePE6BqaTNvDmaj844mUN7FBhZ4 SA++wWCNcjr4XM8JhrDa6VUXhZBn7moDp/UnvF/QxHMpy1xhzjT0RxTj5K2E8zun1I7D vN3xW+CQ+cEpaTuX+xcZW+kwJfcAMoP1evCS06GB6bi72su3Vcocvm6pz0EUde5haZWO t/tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=BCujw7xQ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t15si436796edc.81.2022.02.23.00.58.30; Wed, 23 Feb 2022 00:58:30 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=BCujw7xQ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9125268B27D; Wed, 23 Feb 2022 10:58:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 71B6068B28E for ; Wed, 23 Feb 2022 10:57:53 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645606678; x=1677142678; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=I0zjEoblg0E5m5+R3XOvJraak26/fFX+i58L1N6GTTo=; b=BCujw7xQcbOCh86cV+OISHcW5fUJ0Hq4b8ud5DIS8N1CNI5f6SjzybdO wKdX74hjo71AXIWlenjAqFKaTnz95nNCueZo3spnm9lKWI9EHFGAv3tg6 V/ag30/nRE53TMaSbdKYX+HHjX2VEhpH8IDIbBrC89byZbRrswTaY38cA 07FwS5dHzWylTKdUg+fViB0KWM4YCy0ERzNst7iHt0h6BlZmtAaFymHNT p0Kg3kEgxN8vMsvoi1gtXkVLBKFyrbFlT+iUHV22jXRNwQb6AZHxn/baw /VseWebs10jymtCe2uROB3tSqUNomax/Gd+2FBx+Zkc3nbT4r+jQBuuqM w==; X-IronPort-AV: E=McAfee;i="6200,9189,10266"; a="235427232" X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="235427232" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 00:57:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="628005797" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by FMSMGA003.fm.intel.com with ESMTP; 23 Feb 2022 00:57:47 -0800 From: jianhua.wu-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Wed, 23 Feb 2022 16:57:33 +0800 Message-Id: <20220223085735.70854-4-jianhua.wu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220223085735.70854-1-jianhua.wu@intel.com> References: <20220223085735.70854-1-jianhua.wu@intel.com> Subject: [FFmpeg-devel] [PATCH 4/6] avcodec/x86/hevc_mc: add qpel_h4_8_avx512icl X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Wu Jianhua MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: WSj/WaVaP1HC From: Wu Jianhua ff_hevc_put_hevc_qpel_h4_8_sse4 993694 ff_hevc_put_hevc_qpel_h4_8_avx512icl 686647 Signed-off-by: Wu Jianhua --- libavcodec/x86/hevc_mc.asm | 12 ++++++++++-- libavcodec/x86/hevcdsp.h | 1 + libavcodec/x86/hevcdsp_init.c | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libavcodec/x86/hevc_mc.asm b/libavcodec/x86/hevc_mc.asm index 8c128f5202..25880b8858 100644 --- a/libavcodec/x86/hevc_mc.asm +++ b/libavcodec/x86/hevc_mc.asm @@ -87,6 +87,7 @@ QPEL_TABLE 12, 4, w, sse4 QPEL_TABLE 8,16, b, avx2 QPEL_TABLE 10, 8, w, avx2 +QPEL_TABLE 4, 1, b, avx512icl_h QPEL_TABLE 8, 1, b, avx512icl_h QPEL_TABLE 8, 1, d, avx512icl_v QPEL_TABLE 16, 1, b, avx512icl_h @@ -1734,7 +1735,7 @@ HEVC_PUT_HEVC_QPEL_HV 16, 10 ; required: m0-m5 ; %1: dst register index -; %2: name for src +; %2: src %macro QPEL_H_LOAD_COMPUTE 2 pxor m%1, m%1 %if mmsize == 64 @@ -1754,9 +1755,13 @@ cglobal hevc_put_hevc_qpel_h%1_%2, 5, 6, 8, dst, src, srcstride, height, mx, tmp QPEL_LOAD_SHUF 2, 3 .loop: QPEL_H_LOAD_COMPUTE 6, srcq - 3 -%if %1 == 8 +%if %1 < 16 vpmovdw xm6, m6 +%if %1 == 4 + movq [dstq], xm6 +%else movu [dstq], xm6 +%endif %else vpmovdw ym6, m6 movu [dstq], ym6 @@ -1829,6 +1834,9 @@ cglobal hevc_put_hevc_qpel_hv%1_%2, 6, 7, 8, dst, src, srcstride, height, mx, my %if ARCH_X86_64 %if HAVE_AVX512ICL_EXTERNAL +INIT_XMM avx512icl +HEVC_PUT_HEVC_QPEL_AVX512ICL 4, 8 + INIT_YMM avx512icl HEVC_PUT_HEVC_QPEL_AVX512ICL 8, 8 HEVC_PUT_HEVC_QPEL_HV_AVX512ICL 8, 8 diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevcdsp.h index 6e3fc01ad0..51ffdc9628 100644 --- a/libavcodec/x86/hevcdsp.h +++ b/libavcodec/x86/hevcdsp.h @@ -233,6 +233,7 @@ WEIGHTING_PROTOTYPES(8, sse4); WEIGHTING_PROTOTYPES(10, sse4); WEIGHTING_PROTOTYPES(12, sse4); +void ff_hevc_put_hevc_qpel_h4_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_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 4023faa654..be1484d06e 100644 --- a/libavcodec/x86/hevcdsp_init.c +++ b/libavcodec/x86/hevcdsp_init.c @@ -879,6 +879,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) c->add_residual[3] = ff_hevc_add_residual_32_8_avx2; } if (EXTERNAL_AVX512ICL(cpu_flags)) { + c->put_hevc_qpel[1][0][1] = ff_hevc_put_hevc_qpel_h4_8_avx512icl; 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;