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 3/3] lavc/h264dsp: R-V V h264_add_pixels8_clear
@ 2023-12-25  4:01 flow gg
  2024-01-11 16:56 ` flow gg
  0 siblings, 1 reply; 2+ messages in thread
From: flow gg @ 2023-12-25  4:01 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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

C908
h264_add_pixels8_clear_c: 262.0
h264_add_pixels8_clear_rvv_i64: 59.0

[-- Attachment #2: 0003-lavc-h264dsp-R-V-V-h264_add_pixels8_clear.patch --]
[-- Type: text/x-patch, Size: 2260 bytes --]

From 11218f9067566fa3ace8821b4b890457d6ea17f9 Mon Sep 17 00:00:00 2001
From: sunyuechi <sunyuechi@iscas.ac.cn>
Date: Mon, 25 Dec 2023 00:07:09 +0800
Subject: [PATCH 3/3] lavc/h264dsp: R-V V h264_add_pixels8_clear

C908
h264_add_pixels8_clear_c: 262.0
h264_add_pixels8_clear_rvv_i64: 59.0
---
 libavcodec/riscv/h264dsp_init.c |  2 ++
 libavcodec/riscv/h264dsp_rvv.S  | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/libavcodec/riscv/h264dsp_init.c b/libavcodec/riscv/h264dsp_init.c
index 2538bc01a5..5630b08efd 100644
--- a/libavcodec/riscv/h264dsp_init.c
+++ b/libavcodec/riscv/h264dsp_init.c
@@ -26,6 +26,7 @@
 #include "libavcodec/h264dsp.h"
 
 void ff_h264_add_pixels4_clear_rvv(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_add_pixels8_clear_rvv(uint8_t *dst, int16_t *block, int stride);
 
 av_cold void ff_h264dsp_init_riscv(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
 {
@@ -35,6 +36,7 @@ av_cold void ff_h264dsp_init_riscv(H264DSPContext *c, const int bit_depth, const
     if (flags & AV_CPU_FLAG_RVV_I64) {
         if (bit_depth == 8) {
             c->h264_add_pixels4_clear = ff_h264_add_pixels4_clear_rvv;
+            c->h264_add_pixels8_clear = ff_h264_add_pixels8_clear_rvv;
         }
     }
 #endif
diff --git a/libavcodec/riscv/h264dsp_rvv.S b/libavcodec/riscv/h264dsp_rvv.S
index e6b943f57e..6a7ecb6858 100644
--- a/libavcodec/riscv/h264dsp_rvv.S
+++ b/libavcodec/riscv/h264dsp_rvv.S
@@ -40,3 +40,25 @@ func ff_h264_add_pixels4_clear_rvv, zve64x
 
         ret
 endfunc
+
+func ff_h264_add_pixels8_clear_rvv, zve64x
+        vsetivli   zero, 16, e8, m1, ta, ma
+        vle64.v    v24, (a1)
+        li         t1, 8*8
+        vsetvli    zero, t1, e16, m8, ta, ma
+        li         t0, 0xff
+        vand.vx    v24, v24, t0
+        addi       a1, a1, 8*8*2
+        vsetivli   zero, 16, e8, m1, ta, ma
+        vse64.v    v0, (a1)
+        vsetvli    zero, t1, e8, m4, ta, ma
+        vnclipu.wi v24, v24, 0
+        vsetivli   zero, 8, e8, mf2, ta, ma
+        vle64.v    v8, (a0)
+        vsetvli    zero, t1, e8, m4, ta, ma
+        vadd.vv    v24, v24, v8
+        vsetivli   zero, 8, e8, mf2, ta, ma
+        vse64.v    v24, (a0)
+
+        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] 2+ messages in thread

end of thread, other threads:[~2024-01-11 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-25  4:01 [FFmpeg-devel] [PATCH 3/3] lavc/h264dsp: R-V V h264_add_pixels8_clear flow gg
2024-01-11 16:56 ` 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