From: "Rémi Denis-Courmont" <remi@remlab.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 2/2] lavc/h264dsp: R-V V 8-bit MBAFF loop filter
Date: Mon, 1 Jul 2024 18:23:37 +0300
Message-ID: <20240701152338.9624-2-remi@remlab.net> (raw)
In-Reply-To: <20240701152338.9624-1-remi@remlab.net>
Performance is (unfortunately) the same as with non-MBAFF, since the
hardware under test does not short-circuit vector tail calculations.
(IMO, a generic solution or work-around should be agreed on, rather
than bespoke approaches all over the place.)
---
libavcodec/riscv/h264dsp_init.c | 4 ++++
libavcodec/riscv/h264dsp_rvv.S | 14 ++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/libavcodec/riscv/h264dsp_init.c b/libavcodec/riscv/h264dsp_init.c
index 0d4d541992..ab412a9924 100644
--- a/libavcodec/riscv/h264dsp_init.c
+++ b/libavcodec/riscv/h264dsp_init.c
@@ -31,6 +31,8 @@ void ff_h264_v_loop_filter_luma_8_rvv(uint8_t *pix, ptrdiff_t stride,
int alpha, int beta, int8_t *tc0);
void ff_h264_h_loop_filter_luma_8_rvv(uint8_t *pix, ptrdiff_t stride,
int alpha, int beta, int8_t *tc0);
+void ff_h264_h_loop_filter_luma_mbaff_8_rvv(uint8_t *pix, ptrdiff_t stride,
+ int alpha, int beta, int8_t *tc0);
extern int ff_startcode_find_candidate_rvb(const uint8_t *, int);
extern int ff_startcode_find_candidate_rvv(const uint8_t *, int);
@@ -48,6 +50,8 @@ av_cold void ff_h264dsp_init_riscv(H264DSPContext *dsp, const int bit_depth,
if (bit_depth == 8 && ff_rv_vlen_least(128)) {
dsp->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_8_rvv;
dsp->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_8_rvv;
+ dsp->h264_h_loop_filter_luma_mbaff =
+ ff_h264_h_loop_filter_luma_mbaff_8_rvv;
}
dsp->startcode_find_candidate = ff_startcode_find_candidate_rvv;
}
diff --git a/libavcodec/riscv/h264dsp_rvv.S b/libavcodec/riscv/h264dsp_rvv.S
index 77bf40db1f..008f33d4b8 100644
--- a/libavcodec/riscv/h264dsp_rvv.S
+++ b/libavcodec/riscv/h264dsp_rvv.S
@@ -138,3 +138,17 @@ func ff_h264_h_loop_filter_luma_8_rvv, zve32x
vssseg6e8.v v8, (a0), a1
ret
endfunc
+
+func ff_h264_h_loop_filter_luma_mbaff_8_rvv, zve32x
+ vsetivli zero, 4, e16, m1, ta, ma
+ vle8.v v4, (a4)
+ li t0, 0x0101
+ vzext.vf2 v6, v4
+ addi a0, a0, -3
+ vmul.vx v6, v6, t0 # tc_orig
+ vsetivli zero, 8, e8, m1, ta, ma
+ vlsseg6e8.v v8, (a0), a1
+ jal t0, ff_h264_loop_filter_luma_8_rvv
+ vssseg6e8.v v8, (a0), a1
+ ret
+endfunc
--
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".
next prev parent reply other threads:[~2024-07-01 15:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 15:23 [FFmpeg-devel] [PATCHv2 1/2] lavc/h264dsp: R-V V 8-bit luma " Rémi Denis-Courmont
2024-07-01 15:23 ` Rémi Denis-Courmont [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-30 9:05 [FFmpeg-devel] [PATCH " Rémi Denis-Courmont
2024-06-30 9:05 ` [FFmpeg-devel] [PATCH 2/2] lavc/h264dsp: R-V V 8-bit MBAFF " 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=20240701152338.9624-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