Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 4/4] lavc/rv34dsp: R-V V rv34_idct_dc_add
@ 2024-01-31 12:01 flow gg
  2024-01-31 17:58 ` flow gg
  0 siblings, 1 reply; 4+ messages in thread
From: flow gg @ 2024-01-31 12:01 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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



[-- Attachment #2: 0004-lavc-rv34dsp-R-V-V-rv34_idct_dc_add.patch --]
[-- Type: text/x-patch, Size: 2033 bytes --]

From aec115a7179f23642c2b1c1a1cae3253a40c38fc Mon Sep 17 00:00:00 2001
From: sunyuechi <sunyuechi@iscas.ac.cn>
Date: Wed, 31 Jan 2024 19:04:11 +0800
Subject: [PATCH 4/4] lavc/rv34dsp: R-V V rv34_idct_dc_add

C908:
rv34_idct_dc_add_c: 134.7
rv34_idct_dc_add_rvv_i32: 45.5
---
 libavcodec/riscv/rv34dsp_init.c |  2 ++
 libavcodec/riscv/rv34dsp_rvv.S  | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/libavcodec/riscv/rv34dsp_init.c b/libavcodec/riscv/rv34dsp_init.c
index 852c8ad9a8..7dcadc7e43 100644
--- a/libavcodec/riscv/rv34dsp_init.c
+++ b/libavcodec/riscv/rv34dsp_init.c
@@ -26,6 +26,7 @@
 #include "libavcodec/rv34dsp.h"
 
 void ff_rv34_inv_transform_dc_rvv(int16_t *block);
+void ff_rv34_idct_dc_add_rvv(uint8_t *dst, ptrdiff_t stride, int dc);
 
 av_cold void ff_rv34dsp_init_riscv(RV34DSPContext *c)
 {
@@ -34,6 +35,7 @@ av_cold void ff_rv34dsp_init_riscv(RV34DSPContext *c)
 
     if (flags & AV_CPU_FLAG_RVV_I32 && ff_get_rv_vlenb() >= 16) {
         c->rv34_inv_transform_dc = ff_rv34_inv_transform_dc_rvv;
+        c->rv34_idct_dc_add = ff_rv34_idct_dc_add_rvv;
     }
 #endif
 }
diff --git a/libavcodec/riscv/rv34dsp_rvv.S b/libavcodec/riscv/rv34dsp_rvv.S
index acf5b0c3e8..c73b9c4555 100644
--- a/libavcodec/riscv/rv34dsp_rvv.S
+++ b/libavcodec/riscv/rv34dsp_rvv.S
@@ -36,3 +36,23 @@ func ff_rv34_inv_transform_dc_rvv, zve32x
 
         ret
 endfunc
+
+func ff_rv34_idct_dc_add_rvv, zve32x
+        vsetivli      zero, 4, e8, mf4, ta, ma
+        vlse32.v      v0, (a0), a1
+        li            t1, 169
+        mulw          t1, t1, a2
+        li            a2, 255
+        addiw         t1, t1, 512
+        sraiw         t1, t1, 10
+        vsetivli      zero, 4*4, e16, m2, ta, ma
+        vzext.vf2     v2, v0
+        vadd.vx       v2, v2, t1
+        vmax.vx       v2, v2, zero
+        vsetvli       zero, zero, e8, m1, ta, ma
+        vnclipu.wi    v0, v2, 0
+        vsetivli      zero, 4, e8, mf4, ta, ma
+        vsse32.v      v0, (a0), a1
+
+        ret
+endfunc
-- 
2.43.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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-13  2:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 12:01 [FFmpeg-devel] [PATCH 4/4] lavc/rv34dsp: R-V V rv34_idct_dc_add flow gg
2024-01-31 17:58 ` flow gg
2024-02-12 19:46   ` Rémi Denis-Courmont
2024-02-13  2:18     ` flow gg

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