Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: uk7b@foxmail.com
To: ffmpeg-devel@ffmpeg.org
Cc: sunyuechi <sunyuechi@iscas.ac.cn>
Subject: [FFmpeg-devel] [PATCH 4/4] lavc/vp8dsp: R-V V loop_filter
Date: Sat, 22 Jun 2024 23:58:06 +0800
Message-ID: <tencent_0A9DA1F8E289393E2C98B01C9E7DD5230B07@qq.com> (raw)
In-Reply-To: <20240622155806.3191984-1-uk7b@foxmail.com>

From: sunyuechi <sunyuechi@iscas.ac.cn>

                                                     C908   X60
vp8_loop_filter8uv_v_c                             :   13.7   11.7
vp8_loop_filter8uv_v_rvv_i32                       :    7.7    6.2
vp8_loop_filter16y_h_c                             :   12.2   11.2
vp8_loop_filter16y_h_rvv_i32                       :    9.5    7.2
vp8_loop_filter16y_v_c                             :   13.2   12.0
vp8_loop_filter16y_v_rvv_i32                       :    5.5    3.7
---
 libavcodec/riscv/vp8dsp_init.c |  5 ++-
 libavcodec/riscv/vp8dsp_rvv.S  | 57 ++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/libavcodec/riscv/vp8dsp_init.c b/libavcodec/riscv/vp8dsp_init.c
index 94f78cd84b..72191f558b 100644
--- a/libavcodec/riscv/vp8dsp_init.c
+++ b/libavcodec/riscv/vp8dsp_init.c
@@ -157,7 +157,10 @@ av_cold void ff_vp8dsp_init_riscv(VP8DSPContext *c)
     c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_rvv##vlen; \
     c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_rvv##vlen; \
     c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_rvv##vlen; \
-    c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_rvv##vlen;
+    c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_rvv##vlen; \
+    c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_rvv##vlen; \
+    c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_rvv##vlen; \
+    c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_rvv##vlen;
 
     int flags = av_get_cpu_flags();
 
diff --git a/libavcodec/riscv/vp8dsp_rvv.S b/libavcodec/riscv/vp8dsp_rvv.S
index ed789ec4fd..98ff389b9a 100644
--- a/libavcodec/riscv/vp8dsp_rvv.S
+++ b/libavcodec/riscv/vp8dsp_rvv.S
@@ -410,6 +410,33 @@ endfunc
         vsra.vi         v24, v24, 1              // (f1 + 1) >> 1;
         vadd.vv         v8, v18, v24
         vsub.vv         v10, v20, v24
+        .else
+        li              t5, 27
+        li              t3, 9
+        li              a7, 18
+        vwmul.vx        v2, v11, t5
+        vwmul.vx        v6, v11, t3
+        vwmul.vx        v4, v11, a7
+        vsetvlstatic16  \len, \vlen
+        li              a7, 63
+        vzext.vf2       v14, v15                 // p2
+        vzext.vf2       v24, v10                 // q2
+        vadd.vx         v2, v2, a7
+        vadd.vx         v4, v4, a7
+        vadd.vx         v6, v6, a7
+        vsra.vi         v2, v2, 7                // a0
+        vsra.vi         v12, v4, 7               // a1
+        vsra.vi         v6, v6, 7                // a2
+        vadd.vv         v14, v14, v6             // p2 + a2
+        vsub.vv         v22, v24, v6             // q2 - a2
+        vsub.vv         v10, v20, v12            // q1 - a1
+        vadd.vv         v4, v8, v2               // p0 + a0
+        vsub.vv         v6, v16, v2              // q0 - a0
+        vadd.vv         v8, v12, v18             // a1 + p1
+        vmax.vx         v4, v4, zero
+        vmax.vx         v6, v6, zero
+        vmax.vx         v14, v14, zero
+        vmax.vx         v16, v22, zero
         .endif
 
         vmax.vx         v8, v8, zero
@@ -430,6 +457,17 @@ endfunc
         vsse8.v         v6, (a6), \stride, v0.t
         vsse8.v         v7, (t4), \stride, v0.t
         .endif
+        .if !\inner
+        vnclipu.wi      v14, v14, 0
+        vnclipu.wi      v16, v16, 0
+        .ifc \type,v
+        vse8.v          v14, (t0), v0.t
+        vse8.v          v16, (t6), v0.t
+        .else
+        vsse8.v         v14, (t0), \stride, v0.t
+        vsse8.v         v16, (t6), \stride, v0.t
+        .endif
+        .endif
 .endif
 .endm
 
@@ -464,6 +502,25 @@ func ff_vp8_v_loop_filter8uv_inner_rvv\vlen, zve32x
         filter 8, \vlen, v, 1, 1, a1, a2, a3, a4, a5
         ret
 endfunc
+
+func ff_vp8_v_loop_filter16_rvv\vlen, zve32x
+        vsetvlstatic8   16, \vlen
+        filter 16, \vlen, v, 1, 0, a0, a1, a2, a3, a4
+        ret
+endfunc
+
+func ff_vp8_h_loop_filter16_rvv\vlen, zve32x
+        vsetvlstatic8   16, \vlen
+        filter 16, \vlen, h, 1, 0, a0, a1, a2, a3, a4
+        ret
+endfunc
+
+func ff_vp8_v_loop_filter8uv_rvv\vlen, zve32x
+        vsetvlstatic8   8, \vlen
+        filter 8, \vlen, v, 1, 0, a0, a2, a3, a4, a5
+        filter 8, \vlen, v, 1, 0, a1, a2, a3, a4, a5
+        ret
+endfunc
 .endr
 
 .macro bilin_load_h dst mn
-- 
2.45.2

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

      parent reply	other threads:[~2024-06-22 15:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240622155806.3191984-1-uk7b@foxmail.com>
2024-06-22 15:58 ` [FFmpeg-devel] [PATCH 2/4] lavc/vp8dsp: R-V V loop_filter_simple uk7b
2024-06-24 20:19   ` Rémi Denis-Courmont
2024-06-22 15:58 ` [FFmpeg-devel] [PATCH 3/4] lavc/vp8dsp: R-V V loop_filter_inner uk7b
2024-06-22 15:58 ` uk7b [this message]

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=tencent_0A9DA1F8E289393E2C98B01C9E7DD5230B07@qq.com \
    --to=uk7b@foxmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=sunyuechi@iscas.ac.cn \
    /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