Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: flow gg <hlefthleft@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH 5/7] lavc/vp9dsp: R-V V mc tap v
Date: Fri, 22 Mar 2024 14:05:17 +0800
Message-ID: <CAEa-L+sfif7QTeHpJ1YL-N+++7Ojn9H4LUtYW0iEBgdKih2LOg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0005-lavc-vp9dsp-R-V-V-mc-tap-v.patch --]
[-- Type: text/x-patch, Size: 4147 bytes --]

From 94aacf6d1d49cc009669f89c91db71038a13285d Mon Sep 17 00:00:00 2001
From: sunyuechi <sunyuechi@iscas.ac.cn>
Date: Thu, 21 Mar 2024 23:08:01 +0800
Subject: [PATCH 5/7] lavc/vp9dsp: R-V V mc tap v

C908:
vp9_avg_8tap_smooth_4v_8bpp_c: 13.7
vp9_avg_8tap_smooth_4v_8bpp_rvv_i64: 5.0
vp9_avg_8tap_smooth_8v_8bpp_c: 49.7
vp9_avg_8tap_smooth_8v_8bpp_rvv_i64: 9.2
vp9_avg_8tap_smooth_16v_8bpp_c: 191.5
vp9_avg_8tap_smooth_16v_8bpp_rvv_i64: 21.2
vp9_avg_8tap_smooth_32v_8bpp_c: 770.5
vp9_avg_8tap_smooth_32v_8bpp_rvv_i64: 66.0
vp9_avg_8tap_smooth_64v_8bpp_c: 3068.0
vp9_avg_8tap_smooth_64v_8bpp_rvv_i64: 262.5
vp9_put_8tap_smooth_4v_8bpp_c: 12.0
vp9_put_8tap_smooth_4v_8bpp_rvv_i64: 4.5
vp9_put_8tap_smooth_8v_8bpp_c: 43.7
vp9_put_8tap_smooth_8v_8bpp_rvv_i64: 8.5
vp9_put_8tap_smooth_16v_8bpp_c: 168.7
vp9_put_8tap_smooth_16v_8bpp_rvv_i64: 20.0
vp9_put_8tap_smooth_32v_8bpp_c: 681.5
vp9_put_8tap_smooth_32v_8bpp_rvv_i64: 63.7
vp9_put_8tap_smooth_64v_8bpp_c: 2692.7
vp9_put_8tap_smooth_64v_8bpp_rvv_i64: 253.5
---
 libavcodec/riscv/vp9_mc_rvv.S  | 32 +++++++++++++++++++++++++++++++-
 libavcodec/riscv/vp9dsp_init.c |  3 ++-
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/libavcodec/riscv/vp9_mc_rvv.S b/libavcodec/riscv/vp9_mc_rvv.S
index 9458a2e82b..2d4b56516f 100644
--- a/libavcodec/riscv/vp9_mc_rvv.S
+++ b/libavcodec/riscv/vp9_mc_rvv.S
@@ -221,7 +221,11 @@ subpel_filters_smooth:
 .macro epel_filter name type regtype
         lla             \regtype\()2, subpel_filters_\name
         li              \regtype\()1, 8
+.ifc \type,v
+        mul             \regtype\()0, a6, \regtype\()1
+.elseif \type == h
         mul             \regtype\()0, a5, \regtype\()1
+.endif
         add             \regtype\()0, \regtype\()0, \regtype\()2
         .irp n 1,2,3,4,5,6
         lb              \regtype\n, \n(\regtype\()0)
@@ -238,6 +242,19 @@ subpel_filters_smooth:
         li              a5, 64
 .ifc \from_mem, 1
         vle8.v          v22, (a2)
+.ifc \type,v
+        sub             a2, a2, a3
+        vle8.v          v20, (a2)
+        add             a2, a2, a3
+        add             a2, a2, a3
+        vle8.v          v24, (a2)
+        add             a2, a2, a3
+        vle8.v          v26, (a2)
+        add             a2, a2, a3
+        vle8.v          v28, (a2)
+        add             a2, a2, a3
+        vle8.v          v30, (a2)
+.elseif \type == h
         addi            a2, a2, -1
         vle8.v          v20, (a2)
         addi            a2, a2, 2
@@ -248,6 +265,7 @@ subpel_filters_smooth:
         vle8.v          v28, (a2)
         addi            a2, a2, 1
         vle8.v          v30, (a2)
+.endif
 
 .ifc \name,smooth
         vwmulu.vx       v16, v24, \regtype\()4
@@ -266,11 +284,23 @@ subpel_filters_smooth:
         vwmaccsu.vx     v16, s7, v30
 .endif
 
+.ifc \type,v
+        .rept 6
+        sub             a2, a2, a3
+        .endr
+        vle8.v          v28, (a2)
+        sub             a2, a2, a3
+        vle8.v          v26, (a2)
+        .rept 3
+        add             a2, a2, a3
+        .endr
+.elseif \type == h
         addi            a2, a2, -6
         vle8.v          v28, (a2)
         addi            a2, a2, -1
         vle8.v          v26, (a2)
         addi            a2, a2, 3
+.endif
 
 .ifc \name,smooth
         vwmaccsu.vx     v16, \regtype\()1, v28
@@ -410,7 +440,7 @@ endfunc
 
 .irp name regular sharp smooth
         .irp do put avg
-                .irp type h
+                .irp type h v
                         gen_epel \len \do \name \type
                 .endr
         .endr
diff --git a/libavcodec/riscv/vp9dsp_init.c b/libavcodec/riscv/vp9dsp_init.c
index 413b203e5f..da09918796 100644
--- a/libavcodec/riscv/vp9dsp_init.c
+++ b/libavcodec/riscv/vp9dsp_init.c
@@ -125,7 +125,8 @@ static av_cold void vp9dsp_mc_init_rvv(VP9DSPContext *dsp, int bpp)
     init_subpel1(4, idx, idxh, idxv,  4, dir, type)
 
 #define init_subpel3(idx, type)         \
-    init_subpel2(idx, 1, 0, h, type)
+    init_subpel2(idx, 1, 0, h, type);   \
+    init_subpel2(idx, 0, 1, v, type)
 
     init_subpel3(0, put);
     init_subpel3(1, avg);
-- 
2.44.0


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

                 reply	other threads:[~2024-03-22  6:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAEa-L+sfif7QTeHpJ1YL-N+++7Ojn9H4LUtYW0iEBgdKih2LOg@mail.gmail.com \
    --to=hlefthleft@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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