From patchwork Fri Feb 23 14:45:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: flow gg X-Patchwork-Id: 46495 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:26a3:b0:19e:cdac:8cce with SMTP id h35csp999896pze; Fri, 23 Feb 2024 06:46:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU+lkudP5QTbDk6NospFHFJs6wIyBYFfPIPaLUVcC9VRR8Dg+DuQHkQQ66g1NcMjiB1+bd00whmmKMm3hN9jvYr3mG1LM4Md7LQsw== X-Google-Smtp-Source: AGHT+IE8r/5thpls0vbvYVZFt3rOgQpfTdfMf2Is1Wn2K+tv6Hqxs85ArEmTQh549xJTzKq5c+TT X-Received: by 2002:a17:907:770e:b0:a3f:6fd8:c7a2 with SMTP id kw14-20020a170907770e00b00a3f6fd8c7a2mr1202074ejc.4.1708699569453; Fri, 23 Feb 2024 06:46:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708699569; cv=none; d=google.com; s=arc-20160816; b=LUXEUnCfm3FuWULop67Yy8CizN0pupvJRJNSVuVR1dn7ZwDHXfqXreyU+miHxcHCSe HZJuCM5WAa4w7E6/GI7Zg8xvNeNC1GAr/P/sWVHjjfpOnHsupeL7riRJv0aJxcElFNk0 edlZglPQ+MjePcUrzFa4Os7EA6y3xGBGeRFx2XpGNZro8VJVWK0TgUmb/IbDB4PYJPdv Z+rDaDPH/COOJvQSJqYynyRrU8/AP767nU08QucZQIMYJMlGfGoWX9OkY5eG6d4Cqzfr l6RSndtDsGQmNBH0qnBtS2ApgQ8l1wqRiDka1IwDFuGUAPjAmfR/CTByIQ2wqiKEdTUC laIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=tuYQiMwGYQsGn5K+qdgk75IylTajxWEgIzOOkS4rfRg=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=sZzqJWjSKHynLcLd/KuxxDlMIpN8iTK9tUEECTwxIoDmYCMwlQ1KtRa1wYH2P0lwm6 vSdxT4KAgmWo9M5Zul1ZKmOra6ZhEk/FQ6tzjGaIeKCHqr1pB9s5VPSbKLdVpp6ErprT mMoMKhUKN5dw473sjmlj9sEaeQhSdidBhZ8n58SXrvy7M2xZkhXqGD3P3/v/h2JzWFyB xVgo1W4dOG+h6FuGO6yDNxJ0geMKlFHdB7MWOUy+EdSxui52vSNm+WKi3v/r8OzA7dPR 9SYEHuyepY4PtsOjlNGiWmyDbp79JYHiXr3tBdQ3+LmKLhucqRa7RslPjq5wwhF5vQ8S zaVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b="R8KbD/ZQ"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l9-20020a170906414900b00a3e53aeb48bsi5352505ejk.523.2024.02.23.06.46.09; Fri, 23 Feb 2024 06:46:09 -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=@gmail.com header.s=20230601 header.b="R8KbD/ZQ"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F21B968C846; Fri, 23 Feb 2024 16:46:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 45B8468C80D for ; Fri, 23 Feb 2024 16:45:59 +0200 (EET) Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-68f63f8d807so3333506d6.0 for ; Fri, 23 Feb 2024 06:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708699557; x=1709304357; darn=ffmpeg.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=o/3dC5cpOCtAAHHXIepfQ4EDX1QXZhGBG5cSRMf4V8I=; b=R8KbD/ZQG7bPTnVUawsez6FhADC3e26EJzPX0WTCQjF0/VNxOo2DLzMs5g4Owpg2C5 C88lRjGednwjt0quOwOg+ghDG/KGGpvUlgiT+kbnvOp3nVpzz/esywIlIQWDHmnptbLq bhiP4MehHyxkryYq8wAcEadbXCleu7X0yc3SmjTHyCYSUKEPo53eBPAORx5L4RJi4hxt WnXCgu0ed61A2Ef/nxw5qaHFAAnLsndxHeBA1zQq/3xYQ9H8L5MLt5d6aazParhxtxtp sYDcWlUuJ5y6xz7/OlWChbIjFUY330XGL6GeR1JtJ1pMu6j59d9G7GHueUUR/CGwOqye Llfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708699557; x=1709304357; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=o/3dC5cpOCtAAHHXIepfQ4EDX1QXZhGBG5cSRMf4V8I=; b=C9nCHe+w3fPd+b1103P71vO9t3r6FpUdoOE3KRB1bBPoJz/X+PcLcft83eNJPyle1f jzPjY9rLbpk+YahV7v9CDI7Ba9gogopSQkLqkTc2xp/cv/8Z/vNzn12kgZVPpvC8l2pO g0AS4AhsZP13IpSRIiiIqwsIp44SR6ajC/6mggvrB7rG8MsZNBX8CpTRxl6dQlphBaLX Gbdx7QgvOHjtTSFtLWB+78zk5o6unww2BYeEm5x+1xXL/S3EaWEfb56wdZqt+Yyx38hn WHNs6nzMlMXGL9/gbxVQUEluzV600ErhUdV4ggMprmA0LkqkaccpqfYPNjt1iGTuh0Kr UVTQ== X-Gm-Message-State: AOJu0Yy3EybCpKrtSPUvxlNdAZ9GC0k3HaniKazKT2beHaQ+2e0SvE3G JflpKZl+KTYdO5OwsqhekAC6ZfJmaKT3ShpcVkkCdi2ucANxQJBc5ojdG2tjHaXDUWabnbhBfZo 8ksi1BslXuGCSmIgv4oKb1uPsLQPKym/ci44= X-Received: by 2002:a05:6214:529a:b0:68f:2a5e:4fa3 with SMTP id kj26-20020a056214529a00b0068f2a5e4fa3mr2556980qvb.10.1708699557655; Fri, 23 Feb 2024 06:45:57 -0800 (PST) MIME-Version: 1.0 From: flow gg Date: Fri, 23 Feb 2024 22:45:46 +0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH 1/3] lavc/vp8dsp: R-V V put_bilin_h 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ag/ctSr9NAM/ From b773a2b640ba38a106539da7f3414d6892364c4f Mon Sep 17 00:00:00 2001 From: sunyuechi Date: Fri, 23 Feb 2024 13:27:42 +0800 Subject: [PATCH 1/3] lavc/vp8dsp: R-V V put_bilin_h C908: vp8_put_bilin4_h_c: 373.5 vp8_put_bilin4_h_rvv_i32: 158.7 vp8_put_bilin8_h_c: 1437.7 vp8_put_bilin8_h_rvv_i32: 318.7 vp8_put_bilin16_h_c: 2845.7 vp8_put_bilin16_h_rvv_i32: 374.7 --- libavcodec/riscv/vp8dsp_init.c | 11 +++++++ libavcodec/riscv/vp8dsp_rvv.S | 54 ++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/libavcodec/riscv/vp8dsp_init.c b/libavcodec/riscv/vp8dsp_init.c index c364de3dc9..32cb4893a4 100644 --- a/libavcodec/riscv/vp8dsp_init.c +++ b/libavcodec/riscv/vp8dsp_init.c @@ -34,6 +34,10 @@ VP8_EPEL(16, rvv); VP8_EPEL(8, rvv); VP8_EPEL(4, rvv); +VP8_BILIN(16, rvv); +VP8_BILIN(8, rvv); +VP8_BILIN(4, rvv); + av_cold void ff_vp78dsp_init_riscv(VP8DSPContext *c) { #if HAVE_RVV @@ -47,6 +51,13 @@ av_cold void ff_vp78dsp_init_riscv(VP8DSPContext *c) c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_rvv; c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_rvv; c->put_vp8_bilinear_pixels_tab[2][0][0] = ff_put_vp8_pixels4_rvv; + + c->put_vp8_bilinear_pixels_tab[0][0][1] = ff_put_vp8_bilin16_h_rvv; + c->put_vp8_bilinear_pixels_tab[0][0][2] = ff_put_vp8_bilin16_h_rvv; + c->put_vp8_bilinear_pixels_tab[1][0][1] = ff_put_vp8_bilin8_h_rvv; + c->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilin8_h_rvv; + c->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilin4_h_rvv; + c->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilin4_h_rvv; } #endif } diff --git a/libavcodec/riscv/vp8dsp_rvv.S b/libavcodec/riscv/vp8dsp_rvv.S index 063ab7110c..c8d265e516 100644 --- a/libavcodec/riscv/vp8dsp_rvv.S +++ b/libavcodec/riscv/vp8dsp_rvv.S @@ -98,3 +98,57 @@ func ff_put_vp8_pixels4_rvv, zve32x vsetivli zero, 4, e8, mf4, ta, ma put_vp8_pixels endfunc + +.macro bilin_h_load dst len +.ifc \len,4 + vsetivli zero, 5, e8, mf2, ta, ma +.elseif \len == 8 + vsetivli zero, 9, e8, m1, ta, ma +.else + vsetivli zero, 17, e8, m2, ta, ma +.endif + + vle8.v \dst, (a2) + vslide1down.vx v2, \dst, t5 + +.ifc \len,4 + vsetivli zero, 4, e8, mf4, ta, ma +.elseif \len == 8 + vsetivli zero, 8, e8, mf2, ta, ma +.else + vsetivli zero, 16, e8, m1, ta, ma +.endif + + vwmulu.vx v28, \dst, t1 + vwmaccu.vx v28, a5, v2 + vwaddu.wx v24, v28, t4 + vnsra.wi \dst, v24, 3 +.endm + +.macro put_vp8_bilin_h len + li t1, 8 + li t4, 4 + li t5, 1 + sub t1, t1, a5 +1: + addi a4, a4, -1 + bilin_h_load v0, \len + vse8.v v0, (a0) + add a2, a2, a3 + add a0, a0, a1 + bnez a4, 1b + + ret +.endm + +func ff_put_vp8_bilin16_h_rvv, zve32x + put_vp8_bilin_h 16 +endfunc + +func ff_put_vp8_bilin8_h_rvv, zve32x + put_vp8_bilin_h 8 +endfunc + +func ff_put_vp8_bilin4_h_rvv, zve32x + put_vp8_bilin_h 4 +endfunc -- 2.43.2 From patchwork Fri Feb 23 14:46:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: flow gg X-Patchwork-Id: 46497 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:26a3:b0:19e:cdac:8cce with SMTP id h35csp1000050pze; Fri, 23 Feb 2024 06:46:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUgvywrFlvFiz9ffwoNC/sNr6glAdEV9pfD/VjuzR7Py69+U+d3Nx4/x1+LAJ//G+/ND99CNEpq6OPLaDddY8Mcq0w4AorE4y+jGQ== X-Google-Smtp-Source: AGHT+IEZ5r3+azma/TjOG+mBAtp5pt+K6vI/eiyclPc5eC22mRBkytzPb9dmV+Gb/hLbJlxktfqp X-Received: by 2002:a17:907:788b:b0:a3f:7ad0:2b00 with SMTP id ku11-20020a170907788b00b00a3f7ad02b00mr24901ejc.2.1708699583987; Fri, 23 Feb 2024 06:46:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708699583; cv=none; d=google.com; s=arc-20160816; b=qfEbhAytl9L9tezbm9wGPRO+jcPB/jXiswiex62ZZd5mE5/J5/SDTRrQTAgMPKLlj0 xMpRxPcs60NIHcP5+VppIInqeH/+Fvg0LgkllPcylHns+Ihn+lPb2YHWWnzcrD+rfq89 N1R01UVaXa/5Y+IJovMBloCQoIsUmihxjp5WA/NUZcNEwbhwIE6xaZFPBt31nEwHfHMh 1uFAFjsUoBQqvQXHRtEQHkECPzq6wxw0NZ3jO6w0QCcWxxit84q/wYGSwMab5/PWr2tj fayIOIYSKhMHXfHFw+0JDHz76Git/nHT/vNmOVdOJL/W8BnLAJA8Dc6MuYruNKDONWar tp2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=IHj8COc97QaAdxDGFUHWeQ7HhKg2ht7GzUS5aufZHgA=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=e78ikvPYReomdmSM4z94rxC9+dDMfapep58b8VLdsnktG+NVZ3AAbUBnXA0NqA0pp9 V5TSaW/9ZCHEFoSUe0bSM/Y2soIPGHjG/XdvXOjLjzUrRbjy/s3kNrD3PrMzDqGRA+b5 amP3/BUtwqZWCZRen1vwhtQIK81C597JQrcwd3R86HTsabPsxDcyniAtd3MCAowMH5pf 77UCvQidxcKMdaACSASDnLY//ajlD89Ejk9LUCJxe0jNx+udWcc7DFjYFvwhmzAg8gkR qOnYxdodgbHeHCdUhC6GKMTKNcR8BHsCfgEGoC3+UojU+g8+1dA0Vwq+me7tyKGbDRnt go4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=g8GzdvR0; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m13-20020a1709062acd00b00a3e4094408dsi5661698eje.356.2024.02.23.06.46.23; Fri, 23 Feb 2024 06:46:23 -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=@gmail.com header.s=20230601 header.b=g8GzdvR0; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 089C368C8AE; Fri, 23 Feb 2024 16:46:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4454168BDB6 for ; Fri, 23 Feb 2024 16:46:14 +0200 (EET) Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-6869233d472so4691076d6.2 for ; Fri, 23 Feb 2024 06:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708699573; x=1709304373; darn=ffmpeg.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=IN2WHnSHuw6+SF6uyjusBTO9+CrQmI82oFmEKNRE+go=; b=g8GzdvR09w4dzKnIcOfv989IBnK3gMMUZK00Bm235XDR7W62egpo+KZ0ecR6KbGvsW dLOXpauuxv9TYtQ+dod8yFFBqxsH9GTnOTQm2dP9FxUboK/uE0QSfN5A6DJ57WCVv8bw SDrEtIWgXw2WH0yqinqnE0MrfyM4uBmfIePZDFrvXd2dPaYPgrQ7T3luTMMsuRiCctB5 1to4irmeqiUUCf92C/Zoh1n5xmmr1rKRfHLNsSArgZxaVhUZchNQYtyq7TP6UGz+zvbt xpO8GugnPgMi4/NQVWBSUoQDyyJl66SATyuzi/R+CIHrgzWX6ZZntQkaZYcfjQDcli7C ZkRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708699573; x=1709304373; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IN2WHnSHuw6+SF6uyjusBTO9+CrQmI82oFmEKNRE+go=; b=uCBRHbmuiGyshs0qSDMy0sz1xognULUig6DoXhwTkvrHQwOSzj7gOm56DwcezrST5n JskGMBZwzPORBdOJuHsJ3/pG1K8q3J+2GEa86p7/wOK6DEKfuxvqk5C64HsjZ7M/f7DH NYuepqaNFK5W791xmV0shdu+OIqEpKUK0J5N20PDwPJZwDG/ICet6O42aAKKamEhq59i Q4/uUxH3nEShNdYUvaYsbl8XLr9C3shNJgnbVuwzg43/8jqH9/NIIi0WXxVQuTCwP7/Q OKkEK2+GeWiFiLjrTpY6hPfrxcv1En7nuMG9BtnJz9U30lvXf7ovmFrAhbDnVGK2tAZ2 2cLg== X-Gm-Message-State: AOJu0YyANL+A5cFz0PTYc98U3l3NY+Ckep3qT63Zeqg5zH8/blWVLjWI Lo4kV0c1GXQunu0sBm0YFK4Eo0w6S36MF0TLEc7veOK+HQmEZF++WPucYFaej8BjvnmUZuDPWcu Eks2W/4m2HPXdRPQkAbX6ZaWSt+GNyE8d/0s= X-Received: by 2002:a05:6214:268d:b0:68f:5ab1:a135 with SMTP id gm13-20020a056214268d00b0068f5ab1a135mr2538710qvb.47.1708699572895; Fri, 23 Feb 2024 06:46:12 -0800 (PST) MIME-Version: 1.0 From: flow gg Date: Fri, 23 Feb 2024 22:46:01 +0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH 2/3] lavc/vp8dsp: R-V V put_bilin_v 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Vw97zA20YJzw From 488d0cd6645b2c6936c3298e010615facb6d0bd0 Mon Sep 17 00:00:00 2001 From: sunyuechi Date: Fri, 23 Feb 2024 22:35:01 +0800 Subject: [PATCH 2/3] lavc/vp8dsp: R-V V put_bilin_v C908: vp8_put_bilin4_v_c: 383.5 vp8_put_bilin4_v_rvv_i32: 139.7 vp8_put_bilin8_v_c: 1455.7 vp8_put_bilin8_v_rvv_i32: 299.7 vp8_put_bilin16_v_c: 2863.7 vp8_put_bilin16_v_rvv_i32: 347.7 --- libavcodec/riscv/vp8dsp_init.c | 7 +++++++ libavcodec/riscv/vp8dsp_rvv.S | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/libavcodec/riscv/vp8dsp_init.c b/libavcodec/riscv/vp8dsp_init.c index 32cb4893a4..10e1498d01 100644 --- a/libavcodec/riscv/vp8dsp_init.c +++ b/libavcodec/riscv/vp8dsp_init.c @@ -58,6 +58,13 @@ av_cold void ff_vp78dsp_init_riscv(VP8DSPContext *c) c->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilin8_h_rvv; c->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilin4_h_rvv; c->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilin4_h_rvv; + + c->put_vp8_bilinear_pixels_tab[0][1][0] = ff_put_vp8_bilin16_v_rvv; + c->put_vp8_bilinear_pixels_tab[0][2][0] = ff_put_vp8_bilin16_v_rvv; + c->put_vp8_bilinear_pixels_tab[1][1][0] = ff_put_vp8_bilin8_v_rvv; + c->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilin8_v_rvv; + c->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilin4_v_rvv; + c->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_rvv; } #endif } diff --git a/libavcodec/riscv/vp8dsp_rvv.S b/libavcodec/riscv/vp8dsp_rvv.S index c8d265e516..a58c197ba1 100644 --- a/libavcodec/riscv/vp8dsp_rvv.S +++ b/libavcodec/riscv/vp8dsp_rvv.S @@ -152,3 +152,39 @@ endfunc func ff_put_vp8_bilin4_h_rvv, zve32x put_vp8_bilin_h 4 endfunc + +.macro put_vp8_bilin_v + li t1, 8 + li t4, 4 + sub t1, t1, a6 +1: + add t2, a2, a3 + addi a4, a4, -1 + vle8.v v0, (a2) + vle8.v v2, (t2) + vwmulu.vx v28, v0, t1 + vwmaccu.vx v28, a6, v2 + vwaddu.wx v24, v28, t4 + vnsra.wi v0, v24, 3 + vse8.v v0, (a0) + add a2, a2, a3 + add a0, a0, a1 + bnez a4, 1b + + ret +.endm + +func ff_put_vp8_bilin16_v_rvv, zve32x + vsetivli zero, 16, e8, m1, ta, ma + put_vp8_bilin_v +endfunc + +func ff_put_vp8_bilin8_v_rvv, zve32x + vsetivli zero, 8, e8, mf2, ta, ma + put_vp8_bilin_v +endfunc + +func ff_put_vp8_bilin4_v_rvv, zve32x + vsetivli zero, 4, e8, mf4, ta, ma + put_vp8_bilin_v +endfunc -- 2.43.2 From patchwork Fri Feb 23 14:46:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: flow gg X-Patchwork-Id: 46498 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:26a3:b0:19e:cdac:8cce with SMTP id h35csp1000186pze; Fri, 23 Feb 2024 06:46:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWJPqbMcCrcIsk66zm8iZuEwqllgGRlNdML5ubYWT9H3v9BLf0IkpOgVT3gMM9TVdZjXCvew3Mz3Iv+76wOtpNvj9MDakYVnkR5CQ== X-Google-Smtp-Source: AGHT+IGSb/QvqSyWFq1OTMEy5iBd/CAr2imRPykuDIUfh5s3UZyMt7wJRBIIMPw/5xm7H+IfzviT X-Received: by 2002:a17:906:260d:b0:a3c:a4ba:7917 with SMTP id h13-20020a170906260d00b00a3ca4ba7917mr15784ejc.0.1708699596940; Fri, 23 Feb 2024 06:46:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708699596; cv=none; d=google.com; s=arc-20160816; b=W793CflSTpj0lDxDJm7/JvjRlYFRl6oPPJQtmlKlBJjUKQSyERVQtSBMjsAFHOlo6X jsMcKy7zxGI3zlhyAyQ6Djd6EmxG9D9+hXvN9nhvJLh3MVU6yUWTPAkN6O6wZX0+ATKR dRtTXssl6O8P5s58CXIsfslHHrf8OrRCdni2i+GtAtp6LnVlZ2sMpUNaFmgUFwBYImgA 4M3njxIyN35dwr7TWMym34Gbp2Mjw7aL73DPbQG1OzquLdoWBxzYOEok5o/PXmjcbWaS 9Jp6w4Sl3L4pSu2lEYDK2WhVexlY7/9KjS7C6Y3Gr/cfY7Pa60YzRo1QsTQiRVpz/tlL oHog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=nfqdBJrqgaDWZMolYMrUXtbuv1F6dkXe6U59S40whXU=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=Wk+M3oNBo9wCoYJ88pVfqVj4F0HnRqcqb3Tdd8JKDNEYgbIi+emYochFfczZyqJiox V2AWLvbXbffhsliT0a3xdkFyx1jnB600wg55zj5l+ghYnNWOMY/htt8IVDQNp7pGn9tX e94EkosZRD934oDXBAu1ykxd+C4oen9ndi2N4H0zhzrS8C2/1YyoK9x/J23XpH7+GkDB O6a6N4B65d1AYUcEGJtzN+6UJouyji5x0dhImUT8x7iwgyrsCU9+rZ6VOGYu0bxWmoYJ pQltr0yZlQfVPqAKduudIysIyykb2BmT3sndSzs27LZme7IOocmhoC4TlLYhcunqjMXY F9dQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b="kU/TqcPZ"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id nb18-20020a1709071c9200b00a3ef1214742si3820524ejc.85.2024.02.23.06.46.36; Fri, 23 Feb 2024 06:46:36 -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=@gmail.com header.s=20230601 header.b="kU/TqcPZ"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 288706808F5; Fri, 23 Feb 2024 16:46:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7310F6808F5 for ; Fri, 23 Feb 2024 16:46:27 +0200 (EET) Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-68fdc714187so1647756d6.2 for ; Fri, 23 Feb 2024 06:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708699586; x=1709304386; darn=ffmpeg.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=6co+zFYR1yLmmnEqDCxuogSACF4p/a3livoNAq9Akk8=; b=kU/TqcPZAfZkTS5XQo659cUro5fX2PVvkRqAw8AmT8oNNhnTk3rwLpeWr+wujG/p0a sLS7oTzkvyVGcLTEWfttmL/VCr0UgDVn0cIvbSefx3eVsOP0SRTM8PhSFGbYKXHXMJHO G+guZ+axFv9zfKQTTqpa3Tx1TpjM/SGfWim1WwBVI609tEL691kUBWCyzdRvcbEUhjI7 dRh6Qgh73fT5ZN4h3CfL67r5vWtzNoO485SCCzhSBYiBBXLP3HXNa+uMT0HqVQz3S5eh L6r1Wd0FsFi/4OuXWL/Enmb+gsaW61s978kcjBw/lKgIMzdP1Cp+LtCb7hQS9IkQrmK3 7IrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708699586; x=1709304386; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6co+zFYR1yLmmnEqDCxuogSACF4p/a3livoNAq9Akk8=; b=lYJN0mnOHpVmxUTO4uSfKJocQGF/j5nzWjWw10Br0+nWJ7xTPTeJ/xsv1aspFh7yTA kHG3m9DZQFq2Ksy0VVDd5fiEDsHIVLZ1zWZjemGCy/3YtNDX0Mdpeezso17NKp1ZsRWB 5z1CRSvnk1ifg0nDY79JqGp9qKYckyfADRSm3B+UsyzVK4n8NHv1eGp9o28YViXhT7ht n4ZM5p2+kmZ9hEmhiIw2oYDUVjIlz8q8aaqwq6Ht48mhGBHTPTs6qDFGxTa/tb1EsPmH PUenxZS/Hz89id2IF+FtBSXThjiZncjHMG+6ZlgxSLfijSJDB6V8S3xY3Nm+P3b9wkGN G8Ww== X-Gm-Message-State: AOJu0YxoYVig3FMVGv0DdiHNeY7u/owuatpiB5piT7FHfppYAPS6nB9g aM8I2uhStZomnECc8PguwxfEimCb+RlA3pmkmU9ZqVHwKG5L8fj/bNknZAuCuHH4XQ/OlxCbwp4 t8MBHQ5rqX3uMIVulnYXE4kTUHyolQjB8edQ= X-Received: by 2002:a0c:e202:0:b0:68f:5cf1:ffdc with SMTP id q2-20020a0ce202000000b0068f5cf1ffdcmr2103963qvl.51.1708699586180; Fri, 23 Feb 2024 06:46:26 -0800 (PST) MIME-Version: 1.0 From: flow gg Date: Fri, 23 Feb 2024 22:46:15 +0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH 3/3] lavc/vp8dsp: R-V V put_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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: jRbnnakqytBq From e1a01b1e0a365935868d7825d53c7cc64e2c1787 Mon Sep 17 00:00:00 2001 From: sunyuechi Date: Fri, 23 Feb 2024 22:35:23 +0800 Subject: [PATCH 3/3] lavc/vp8dsp: R-V V put_bilin_hv C908: vp8_put_bilin4_hv_c: 567.7 vp8_put_bilin4_hv_rvv_i32: 255.7 vp8_put_bilin8_hv_c: 2169.5 vp8_put_bilin8_hv_rvv_i32: 528.7 vp8_put_bilin16_hv_c: 4777.5 vp8_put_bilin16_hv_rvv_i32: 587.7 --- libavcodec/riscv/vp8dsp_init.c | 13 +++++++++++++ libavcodec/riscv/vp8dsp_rvv.S | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/libavcodec/riscv/vp8dsp_init.c b/libavcodec/riscv/vp8dsp_init.c index 10e1498d01..02dbda979e 100644 --- a/libavcodec/riscv/vp8dsp_init.c +++ b/libavcodec/riscv/vp8dsp_init.c @@ -65,6 +65,19 @@ av_cold void ff_vp78dsp_init_riscv(VP8DSPContext *c) c->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilin8_v_rvv; c->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilin4_v_rvv; c->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_rvv; + + c->put_vp8_bilinear_pixels_tab[0][1][1] = ff_put_vp8_bilin16_hv_rvv; + c->put_vp8_bilinear_pixels_tab[0][1][2] = ff_put_vp8_bilin16_hv_rvv; + c->put_vp8_bilinear_pixels_tab[0][2][1] = ff_put_vp8_bilin16_hv_rvv; + c->put_vp8_bilinear_pixels_tab[0][2][2] = ff_put_vp8_bilin16_hv_rvv; + c->put_vp8_bilinear_pixels_tab[1][1][1] = ff_put_vp8_bilin8_hv_rvv; + c->put_vp8_bilinear_pixels_tab[1][1][2] = ff_put_vp8_bilin8_hv_rvv; + c->put_vp8_bilinear_pixels_tab[1][2][1] = ff_put_vp8_bilin8_hv_rvv; + c->put_vp8_bilinear_pixels_tab[1][2][2] = ff_put_vp8_bilin8_hv_rvv; + c->put_vp8_bilinear_pixels_tab[2][1][1] = ff_put_vp8_bilin4_hv_rvv; + c->put_vp8_bilinear_pixels_tab[2][1][2] = ff_put_vp8_bilin4_hv_rvv; + c->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_rvv; + c->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_rvv; } #endif } diff --git a/libavcodec/riscv/vp8dsp_rvv.S b/libavcodec/riscv/vp8dsp_rvv.S index a58c197ba1..9d4ffed255 100644 --- a/libavcodec/riscv/vp8dsp_rvv.S +++ b/libavcodec/riscv/vp8dsp_rvv.S @@ -188,3 +188,38 @@ func ff_put_vp8_bilin4_v_rvv, zve32x vsetivli zero, 4, e8, mf4, ta, ma put_vp8_bilin_v endfunc + +.macro put_vp8_bilin_hv len + li t3, 8 + sub t1, t3, a5 + sub t2, t3, a6 + li t4, 4 + li t5, 1 + bilin_h_load v4, \len + add a2, a2, a3 +1: + addi a4, a4, -1 + vwmulu.vx v20, v4, t2 + bilin_h_load v4, \len + vwmaccu.vx v20, a6, v4 + vwaddu.wx v24, v20, t4 + vnsra.wi v0, v24, 3 + vse8.v v0, (a0) + add a2, a2, a3 + add a0, a0, a1 + bnez a4, 1b + + ret +.endm + +func ff_put_vp8_bilin16_hv_rvv, zve32x + put_vp8_bilin_hv 16 +endfunc + +func ff_put_vp8_bilin8_hv_rvv, zve32x + put_vp8_bilin_hv 8 +endfunc + +func ff_put_vp8_bilin4_hv_rvv, zve32x + put_vp8_bilin_hv 4 +endfunc -- 2.43.2