Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi@remlab.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 2/2] lavc/h264dsp: R-V V high-depth add_pixels8
Date: Sat, 13 Jul 2024 16:01:53 +0300
Message-ID: <20240713130154.77672-2-remi@remlab.net> (raw)
In-Reply-To: <20240713130154.77672-1-remi@remlab.net>

---
 libavcodec/riscv/h264addpx_rvv.S | 22 ++++++++++++++++++++++
 libavcodec/riscv/h264dsp_init.c  |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/libavcodec/riscv/h264addpx_rvv.S b/libavcodec/riscv/h264addpx_rvv.S
index fd36bd4896..3d307b2cb8 100644
--- a/libavcodec/riscv/h264addpx_rvv.S
+++ b/libavcodec/riscv/h264addpx_rvv.S
@@ -87,3 +87,25 @@ func ff_h264_add_pixels8_8_rvv, zve64x
         vsse64.v        v8, (a0), a2
         ret
 endfunc
+
+func ff_h264_add_pixels8_16_rvv, zve32x
+        li      t0, 8
+        vsetivli    zero, 8, e16, m1, ta, ma
+1:
+        vle32.v     v16, (a1)
+        addi    t0, t0, -1
+        vle16.v     v8, (a0)
+        addi    a1, a1, 8 * 4
+        vncvt.x.x.w v24, v16
+        .equ    offset, 0
+        .rept   256 / __riscv_xlen
+        sx      zero, offset(a1)
+        .equ    offset, offset + (__riscv_xlen / 8)
+        .endr
+        vadd.vv     v8, v8, v24
+        vse16.v     v8, (a0)
+        add     a0, a0, a2
+        bnez    t0, 1b
+
+        ret
+endfunc
diff --git a/libavcodec/riscv/h264dsp_init.c b/libavcodec/riscv/h264dsp_init.c
index a6d06b3ac4..ea89314952 100644
--- a/libavcodec/riscv/h264dsp_init.c
+++ b/libavcodec/riscv/h264dsp_init.c
@@ -63,6 +63,7 @@ void ff_h264_idct8_add_14_rvv(uint8_t *dst, int16_t *block, int stride);
 
 void ff_h264_add_pixels8_8_rvv(uint8_t *dst, int16_t *block, int stride);
 void ff_h264_add_pixels4_8_rvv(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_add_pixels8_16_rvv(uint8_t *dst, int16_t *block, int stride);
 void ff_h264_add_pixels4_16_rvv(uint8_t *dst, int16_t *block, int stride);
 
 extern int ff_startcode_find_candidate_rvb(const uint8_t *, int);
@@ -126,6 +127,7 @@ av_cold void ff_h264dsp_init_riscv(H264DSPContext *dsp, const int bit_depth,
             dsp->h264_idct8_add = ff_h264_idct8_add_14_rvv;
         }
         if (bit_depth > 8 && zvl128b) {
+            dsp->h264_add_pixels8_clear = ff_h264_add_pixels8_16_rvv;
             if (flags & AV_CPU_FLAG_RVV_I64)
                 dsp->h264_add_pixels4_clear = ff_h264_add_pixels4_16_rvv;
         }
-- 
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".

  reply	other threads:[~2024-07-13 13:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-13 13:01 [FFmpeg-devel] [PATCH 1/2] lavc/h264dsp: R-V V add_pixels4 and 8-bit add_pixels8 Rémi Denis-Courmont
2024-07-13 13:01 ` Rémi Denis-Courmont [this message]
2024-07-13 17:50   ` [FFmpeg-devel] [PATCH 2/2] lavc/h264dsp: R-V V high-depth add_pixels8 Rémi Denis-Courmont
2024-07-13 17:49 ` [FFmpeg-devel] [PATCH 1/2] lavc/h264dsp: R-V V add_pixels4 and 8-bit add_pixels8 Rémi Denis-Courmont

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=20240713130154.77672-2-remi@remlab.net \
    --to=remi@remlab.net \
    --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