From patchwork Thu Aug 1 12:08:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: uk7b@foxmail.com X-Patchwork-Id: 50854 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:12d6:0:b0:489:2eb3:e4c4 with SMTP id 205csp1097350vqs; Thu, 1 Aug 2024 05:09:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWpj/nrlgJwzNCQ97aq63ghvwL+pPyRPXecBMx9ObPQA4+bLzPM/e6gniZW/0xrhx4WiVxVF3jdPsCTG30xS1Cl76vtBSRC2vXL2Q== X-Google-Smtp-Source: AGHT+IGQIADYcjUanPnzuTJPUFf52+xej8WCmz9qgWyQoVaoCQ+AsYBzVsTB0h60GnwXJVemXm1f X-Received: by 2002:a17:907:3f9f:b0:a7a:a763:8428 with SMTP id a640c23a62f3a-a7daf522a87mr159338966b.25.1722514165003; Thu, 01 Aug 2024 05:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722514164; cv=none; d=google.com; s=arc-20160816; b=vuLIbKCi6yPdz8mUsrh3H6hNePrf52c3p54jHIpNC8Sx21rKI/xmObQ6ymIbcuNTKe TmXNWzl9ymJQ+uAiqB+1Uf22gt82rfSR/438PYyt1nY7N75WfBHBlfUmqZc7lXDubMZ0 XowubW8zyxXd7b+zjnDZfBeT13+gijctWaO7W2Y6s1UL7HyH+mxvOLlJVsA58HCRUpAT EXCg8PwvgZFztwW2vtFSU+jy/mxvXLW8/Fno+6TVm+IpgYeYkky0gDOijoX5oW8pp5XT 7zFjeo/+sJEMH3oWuzMoFAXA8p7xIm4Q2Y5jrLNFSEgjBCh4aqkS6/nt+J/8r2XuWifv 0ipg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to:date :to:from:message-id:dkim-signature:delivered-to; bh=dy5uXvUw4+qqad99CITdvMgWki7ICj7UeN2E1y0hEBc=; fh=D0bFwGkf4X22/D/bfeDVrXKIx7S6kcXsNzy10j8ORbQ=; b=BhmckRfE9dDYDdtfmqbPGhismrDdi8Ye7yJBkRrY5Waf8sA49yNB/IvmftsTAQRjBZ bOkCLByVq9F57JPDDgsiQj25+3rJ8Inqg22/iQrbgHG35KSepbuZywnyCDrPrxl5vbrx +T3iB7CqJwcraW1aYI1/PmCTBaL1jN21Ipted9gk9TIdPHbanXTLN2Op98Gk8l5hvLFQ wANnSp7YtWqgl2FhlLZEi+5kJYRpkGCXRcvXdjFSH7d5SGNc1bnM5HOAafY+aXbc+531 K1E22RvqHh5D5EbkU7tWbj3mDqGto87ySOVQhAwTTP485+4n8ivZVxTXxuystRcbzROr z/iA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=B910zA4g; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a7acac91722si1024243566b.816.2024.08.01.05.09.24; Thu, 01 Aug 2024 05:09:24 -0700 (PDT) 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=@foxmail.com header.s=s201512 header.b=B910zA4g; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A6A5568D849; Thu, 1 Aug 2024 15:09:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-221-192.mail.qq.com (out203-205-221-192.mail.qq.com [203.205.221.192]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 27A7068D077 for ; Thu, 1 Aug 2024 15:09:11 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1722514144; bh=sce6mtTRGAa5rCYyNGCxLM4rodZoLnrpVoh46q5Izsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=B910zA4gG9PWFg6nd7J+p2E2FVC7zIz640dFzxoHw/vzw2ecMAEbOweT55/9RMtnk c9NOw9VBpLk4dOFyCEokPmmNSkoUBbJ6DBzBRKTpM241KEiydaTnXtOaeydm4Ap7h0 EWjJk7deU3XWXVFqvMRBTK6ovkM9D/97ztEK5TFQ= Received: from localhost.localdomain ([42.86.132.47]) by newxmesmtplogicsvrsza15-1.qq.com (NewEsmtp) with SMTP id 2419AC43; Thu, 01 Aug 2024 20:09:01 +0800 X-QQ-mid: xmsmtpt1722514143trsi3kse1 Message-ID: X-QQ-XMAILINFO: MJh9J/jkhbSZa3gzj/ZA1e5CF93qnWnVsRLD2N4f9DwttSlVSbaBykneGLxkhq /qv6tm+FPY+ia6ej0qKGMnhTj6LGBIufyXG4OmM1Zg55yQSNL2lcaepKQ2EthV1RcWOq2lay8qLL n4dTQcH9JgB6l8TLpaksOQKfHgvHnnT72KTMpxgzv/kJxfjN8nUMcaao0dWuhC5KXafGNibknpFy jeSSVWvwzA2SC8R1EjjbvJ7olc++zhggUJvrPGiaWtuVh8JsBMm/e2GhYD3OBmktPTWNX3KJm58W VXgpLlyx7PGD+gQ4XWU5XI6aQXwqgcJAdvaFUXTRxLjc/PI1I/Dau03gbu+KmTC18lFLCfBJR69M d6geTzkovP9hw76tLi+UbYDdpR/u1jSdDxE2DWLymqxrAgF1biltIXUGXHYxBBl7H4TJLC2Mh97o Gag43r7zlrz1Fgv8k9e3K2zQyh7dly7vTFkH+e9eSb+4b5B/VoX2RmDKxmN+OHfSANo1dhiTx2ut J0ZNLV94ej0d5sNncMMe1D+9FxpA0+eEE+x3xY45vFYnCu68ixzRvdnooKgc7c4NI7W5CBNrGVXp NWaVSDotrzfs1w3Xq+zOnEO6iahjRmO/jhlH+WIC6ZvqNfzIUm4iLSwSFig7jUJd6Ogu2vD/EEdM dydKY10GncrUMEK2KmDKTKXKz2zXaTVrPiKK9Wl5AGp9qFcIgoZLqVFwYL74RM3nCEXMgjqlL6aL RJLNL9jgMuwMSygDa1zlFqjnpG4eeTCSjrAPsp4kfhzZbqTpoHysnFH3bfLFQJQg/hP0EL9cpPWx w2cWQMxNxK5MUKOPbOnGM8ZJzKFYteOYXXIqfJ2DqqV0+GUFpS5L3/wj0mFPHHIv7SQ+ZUiK9RR3 tbyGZ7UjrhYv9sgfsi2vjf5EByiKATS6BzzGDyAg8HTwRFDi9fF1QeQyloUUoykw== X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= From: uk7b@foxmail.com To: ffmpeg-devel@ffmpeg.org Date: Thu, 1 Aug 2024 20:08:49 +0800 X-OQ-MSGID: <20240801120851.3097443-2-uk7b@foxmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240801120851.3097443-1-uk7b@foxmail.com> References: <20240801120851.3097443-1-uk7b@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/4] lavc/vp9dsp: R-V V mc bilin hv 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: sunyuechi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: wAiECT2Aa0q+ From: sunyuechi C908 X60 vp9_avg_bilin_4hv_8bpp_c : 10.7 9.5 vp9_avg_bilin_4hv_8bpp_rvv_i32 : 4.0 3.5 vp9_avg_bilin_8hv_8bpp_c : 38.5 34.2 vp9_avg_bilin_8hv_8bpp_rvv_i32 : 7.2 6.5 vp9_avg_bilin_16hv_8bpp_c : 147.2 130.5 vp9_avg_bilin_16hv_8bpp_rvv_i32 : 14.5 12.7 vp9_avg_bilin_32hv_8bpp_c : 574.2 509.7 vp9_avg_bilin_32hv_8bpp_rvv_i32 : 42.5 38.0 vp9_avg_bilin_64hv_8bpp_c : 2321.2 2017.7 vp9_avg_bilin_64hv_8bpp_rvv_i32 : 163.5 131.0 vp9_put_bilin_4hv_8bpp_c : 10.0 8.7 vp9_put_bilin_4hv_8bpp_rvv_i32 : 3.5 3.0 vp9_put_bilin_8hv_8bpp_c : 35.2 31.2 vp9_put_bilin_8hv_8bpp_rvv_i32 : 6.5 5.7 vp9_put_bilin_16hv_8bpp_c : 134.0 119.0 vp9_put_bilin_16hv_8bpp_rvv_i32 : 12.7 11.5 vp9_put_bilin_32hv_8bpp_c : 538.5 464.2 vp9_put_bilin_32hv_8bpp_rvv_i32 : 39.7 35.2 vp9_put_bilin_64hv_8bpp_c : 2111.7 1833.2 vp9_put_bilin_64hv_8bpp_rvv_i32 : 138.5 122.5 --- libavcodec/riscv/vp9_mc_rvv.S | 38 +++++++++++++++++++++++++++++++++- libavcodec/riscv/vp9dsp_init.c | 10 +++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/libavcodec/riscv/vp9_mc_rvv.S b/libavcodec/riscv/vp9_mc_rvv.S index 2fe8e5b6d3..4faf932100 100644 --- a/libavcodec/riscv/vp9_mc_rvv.S +++ b/libavcodec/riscv/vp9_mc_rvv.S @@ -148,6 +148,40 @@ func ff_\op\()_vp9_bilin_64\type\()_rvv, zve32x endfunc .endm +.macro bilin_hv op +func ff_\op\()_vp9_bilin_64hv_rvv, zve32x + vsetvlstatic8 64, t0, 64 +.Lbilin_hv\op: +.ifc \op,avg + csrwi vxrm, 0 +.endif + neg t1, a5 + neg t2, a6 + li t4, 8 + bilin_load_h v24, put, a5 + add a2, a2, a3 +1: + addi a4, a4, -1 + bilin_load_h v4, put, a5 + vwmulu.vx v16, v4, a6 + vwmaccsu.vx v16, t2, v24 + vwadd.wx v16, v16, t4 + vnsra.wi v16, v16, 4 + vadd.vv v0, v16, v24 +.ifc \op,avg + vle8.v v16, (a0) + vaaddu.vv v0, v0, v16 +.endif + vse8.v v0, (a0) + vmv.v.v v24, v4 + add a2, a2, a3 + add a0, a0, a1 + bnez a4, 1b + + ret +endfunc +.endm + .irp len, 64, 32, 16, 8, 4 copy_avg \len .endr @@ -156,6 +190,8 @@ bilin_h_v put, h, a5 bilin_h_v avg, h, a5 bilin_h_v put, v, a6 bilin_h_v avg, v, a6 +bilin_hv put +bilin_hv avg .macro func_bilin_h_v len, op, type func ff_\op\()_vp9_bilin_\len\()\type\()_rvv, zve32x @@ -166,7 +202,7 @@ endfunc .irp len, 32, 16, 8, 4 .irp op, put, avg - .irp type, h, v + .irp type, h, v, hv func_bilin_h_v \len, \op, \type .endr .endr diff --git a/libavcodec/riscv/vp9dsp_init.c b/libavcodec/riscv/vp9dsp_init.c index 83dbe1b5d9..d53852f673 100644 --- a/libavcodec/riscv/vp9dsp_init.c +++ b/libavcodec/riscv/vp9dsp_init.c @@ -83,6 +83,16 @@ static av_cold void vp9dsp_mc_init_riscv(VP9DSPContext *dsp, int bpp) dsp->mc[4][FILTER_BILINEAR ][0][1][0] = ff_put_vp9_bilin_4h_rvv; dsp->mc[4][FILTER_BILINEAR ][1][0][1] = ff_avg_vp9_bilin_4v_rvv; dsp->mc[4][FILTER_BILINEAR ][1][1][0] = ff_avg_vp9_bilin_4h_rvv; + dsp->mc[0][FILTER_BILINEAR ][0][1][1] = ff_put_vp9_bilin_64hv_rvv; + dsp->mc[0][FILTER_BILINEAR ][1][1][1] = ff_avg_vp9_bilin_64hv_rvv; + dsp->mc[1][FILTER_BILINEAR ][0][1][1] = ff_put_vp9_bilin_32hv_rvv; + dsp->mc[1][FILTER_BILINEAR ][1][1][1] = ff_avg_vp9_bilin_32hv_rvv; + dsp->mc[2][FILTER_BILINEAR ][0][1][1] = ff_put_vp9_bilin_16hv_rvv; + dsp->mc[2][FILTER_BILINEAR ][1][1][1] = ff_avg_vp9_bilin_16hv_rvv; + dsp->mc[3][FILTER_BILINEAR ][0][1][1] = ff_put_vp9_bilin_8hv_rvv; + dsp->mc[3][FILTER_BILINEAR ][1][1][1] = ff_avg_vp9_bilin_8hv_rvv; + dsp->mc[4][FILTER_BILINEAR ][0][1][1] = ff_put_vp9_bilin_4hv_rvv; + dsp->mc[4][FILTER_BILINEAR ][1][1][1] = ff_avg_vp9_bilin_4hv_rvv; #undef init_fpel }