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] lavc/riscv: don't set vxrm if unnecessary
Date: Thu, 25 Jul 2024 17:35:17 +0300
Message-ID: <20240725143517.12683-1-remi@remlab.net> (raw)

While narrowing clip is nominally a rounding operation, the rounding mode
has no arithmetic consequence if the right shift is by zero bits.
---
 libavcodec/riscv/h263dsp_rvv.S | 5 ++---
 libavcodec/riscv/vp8dsp_rvv.S  | 1 -
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/riscv/h263dsp_rvv.S b/libavcodec/riscv/h263dsp_rvv.S
index 97503d527c..2a57284e4b 100644
--- a/libavcodec/riscv/h263dsp_rvv.S
+++ b/libavcodec/riscv/h263dsp_rvv.S
@@ -30,14 +30,13 @@ func ff_h263_h_loop_filter_rvv, zve32x
         vssseg4e8.v v8, (a0), a1
         ret
 1:
-        csrwi       vxrm, 0
-2:      auipc       t1, %pcrel_hi(ff_h263_loop_filter_strength)
+        auipc       t1, %pcrel_hi(ff_h263_loop_filter_strength)
         vwsubu.vv   v14, v10, v9       # p2 - p1
         add         t1, t1, a2
         vwsubu.vv   v12, v8, v11       # p0 - p3
         vsetvli     zero, zero, e16, m1, ta, mu
         vsll.vi     v14, v14, 2
-        lbu         t1, %pcrel_lo(2b)(t1) # strength
+        lbu         t1, %pcrel_lo(1b)(t1) # strength
         vadd.vv     v16, v12, v14
         # Divide by 8 toward 0. v16 is a signed 10-bit value at this point.
         vsrl.vi     v18, v16, 16 - 3   # v18 = (v16 < 0) ? 7 : 0
diff --git a/libavcodec/riscv/vp8dsp_rvv.S b/libavcodec/riscv/vp8dsp_rvv.S
index 7e062d9f13..e50e27ce82 100644
--- a/libavcodec/riscv/vp8dsp_rvv.S
+++ b/libavcodec/riscv/vp8dsp_rvv.S
@@ -166,7 +166,6 @@ endfunc
 
 # a3 = DC
 func ff_vp78_idct_dc_add_rvv, zve32x
-        csrwi      vxrm, 0
         vsetivli   zero, 4, e8, mf4, ta, ma
         sh         zero, (a1)
         vlse32.v   v8, (a0), a2
-- 
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-25 14:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240725143517.12683-1-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