From patchwork Sat Aug 3 09:50:38 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: 50878 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:1f5a:b0:489:2eb3:e4c4 with SMTP id jm26csp373419vqb; Sat, 3 Aug 2024 02:51:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX0aScFWMHzCPd+RtGn05saqsTKehVvRbSyuN7gQ9hs9nZtb4/IxCxrSaMqAoaqbn7T959sQ1sRXwx6E1ZIXz/VzvXRwp6KlhqKtw== X-Google-Smtp-Source: AGHT+IGpswlvPt5x+nGy+U8JhMI8SGjqcN8mmdv7c8s135hRuuiBpGfiz2xqu+oAinc0WFv1ViZI X-Received: by 2002:a17:906:d554:b0:a72:6849:cb0f with SMTP id a640c23a62f3a-a7dc5100463mr379762566b.62.1722678690847; Sat, 03 Aug 2024 02:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722678690; cv=none; d=google.com; s=arc-20160816; b=hK9I5193NhsJeCAq1DUew+mn/c0c6vDpcJvnx4ZKnCnsKYoOd6Lqudumfn7tnl17tQ BEgJ9IXmwVpDvrg5W6yrS4vm0C1laEWWigU8dKPTpF2lqwjjG6MLNSZrPVGTJ3WHK7kC zWqwVsjUmbItpHKqLrxwxzcxNop3uQIxRpMYlxK/FdiQZcw933ISoeIcNYf8CwJei7j6 PfF+MRvGn/99dSz1Wt4OncCWwOP9s2OkgRpJ7xcGG+AafXviptlnwczWSH8JZllOGV7c Tx/1fk6ogk+N+D/jLgvw+JjZd19JhfDzC8VPdE7GsXGva0Du2+GIsa9WOHNy0rW7Woks BqOg== 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=1elZmFnJhIUiqx/gjTn1eNaFSUDNvGtqRjyhAtJkfOw=; fh=D0bFwGkf4X22/D/bfeDVrXKIx7S6kcXsNzy10j8ORbQ=; b=JXU8vFRS6K2Qrcztd3E3gWQrDc/cUYGujuL7LV6LqivoRhJMzRsqTM/J+yVoUXVYlE oTBs2BmWDVtLVX8yPOEm6Q9IGYDCvnPeLVBkp11BXlwRJyRFoLEknzZ1IrRggbX46HZu 7B+abaknQH76n4JdzAW+0s/PlHRP+4QLynfwg3IcIzkEkKsk8zo5ihXCvyXOf3ec6u83 bbVjcgcoM0rG9iOWcXBT+HSBBk2RCisOywBgHCVsdoFhdDMze8GG0XKTUYsMYPRndiJP Tg8QdD1pXd+bsmN/m0LOVeaHEfB2W6zI6eb1PuunpYPcI1dPt24m561OdpEhiheLasKL A88g==; 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=WvW6+uu5; 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-a7dd081e609si176596666b.732.2024.08.03.02.51.30; Sat, 03 Aug 2024 02:51:30 -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=WvW6+uu5; 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 40C1B68D8CC; Sat, 3 Aug 2024 12:51:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-221-155.mail.qq.com (out203-205-221-155.mail.qq.com [203.205.221.155]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2934E68D87E for ; Sat, 3 Aug 2024 12:50:53 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1722678644; bh=nYjzmufK/jTFsltEq+yFiSvfIUb+sREVq55zw7tKsao=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WvW6+uu5NZb8evYhhewag0L6qO9KYopnjXD1IH6+pTNStkzZRgH1phappEofM67pg BHeXIb9xqLg0cvSo+WVQfWUelQiz96Q4T03iaxyhbE1vrjEd5ht3eiR0dSPmFoCZId xhYlxJElhJUTSLDiYqaEHlAHcQ7gKk7vj5TBs/u4= Received: from localhost.localdomain ([42.86.132.47]) by newxmesmtplogicsvrszb16-1.qq.com (NewEsmtp) with SMTP id CAA3C22C; Sat, 03 Aug 2024 17:50:42 +0800 X-QQ-mid: xmsmtpt1722678643t585kphn6 Message-ID: X-QQ-XMAILINFO: OQgs7+tfliAnBJCjbCZFRa823DoWj2IR3kzr7aAAPZUSkHiffr9JW5YEMqAvtX RqOGbCaPv2L0Ey2QeaI2cTIDm4DW2BXP5F4xxv7NV3NgtlkY19frNp459zLiYq6xWaep92GBmU7Z y9nClpdEQUoKq8IbFmrsw0AlbcnVJiWjGJ/q2BStZWZbzD6DHXnvh7CglFN0WoIbbFzj/7/R2/7+ OhvTrf68d6HMwjHBZ45leMoIu5bbYKp1Q0zqYfU14Q9IbUdm17cGAJ2ivQtHsooEF4AU8faUFaM5 bmeBYX33tauwxfM3TSLTPZE5dF5+f+ML5wBzUXDAOJ53plad5WK/uFmyZWcyX3G3TXANhf28WG8J SL+wANMiVVLUrCLuUvF7kHmmhLplyd5MXCNr3Oj6HDEuzojEOZ6IylJc4s8mL+3Vf0B+R5GHKM6p Atj/glbD2SCVHEiruFtjZttkQ+hL10TAilcHP9hvWEpBpakeiTyl2Z0JJpT570moVl2BfJ+98N9G FSlLlK2RdbTueVAGi3yB10mIw2BqcbkKo1R0P37v2Uir8rLPqxHNSnZaavjifVyJaOxej1os8lno VmtKcd5e49ysXdxPYourSm9C08JpIqqgIOR+A/rWCALKaYmSWAcCd4oreJZ5yViI3j5oLa/oFpxq vfWZTKwSq79kADqdnfKzIBp4tjP/ZOa4Ndg3koK7Bb63drLnPRb/5qZP70UHCnfUiS11znl6KCZL PyPUWNItPq8vLQKsEzWMNDF0dx+kPUj40K27klkpaThsXhqN9E7sgOee+q9PGzky0JnWRxPWwJ0/ 5jegjncK0jArNlVkK+cNoRb6mT1YYIUkG5JsIcdIGpHBRJf/eWnS4xEWLKCmB0grtL/hXuZJpxSQ yHgsgPtRgOl1sXNGwHW9U7iLqaE58gYJkAsMKIeOaiWa2TCiXAkZAy4z6H7flUWK2rA6FEpqBw X-QQ-XMRINFO: MSVp+SPm3vtS1Vd6Y4Mggwc= From: uk7b@foxmail.com To: ffmpeg-devel@ffmpeg.org Date: Sat, 3 Aug 2024 17:50:38 +0800 X-OQ-MSGID: <20240803095040.3648582-2-uk7b@foxmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240803095040.3648582-1-uk7b@foxmail.com> References: <20240803095040.3648582-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: B+lfWsf7Kd9F 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 | 39 +++++++++++++++++++++++++++++++++- libavcodec/riscv/vp9dsp_init.c | 10 +++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/libavcodec/riscv/vp9_mc_rvv.S b/libavcodec/riscv/vp9_mc_rvv.S index 817cc58b5e..caab2093be 100644 --- a/libavcodec/riscv/vp9_mc_rvv.S +++ b/libavcodec/riscv/vp9_mc_rvv.S @@ -149,6 +149,41 @@ func ff_\op\()_vp9_bilin_64\type\()_rvv, zve32x endfunc .endm +.macro bilin_hv op +func ff_\op\()_vp9_bilin_64hv_rvv, zve32x + lpad 0 + 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 @@ -157,6 +192,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 @@ -168,7 +205,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 }