[FFmpeg-devel] [PATCH 1/1] lavu/riscv: fix av_clip_int16

remi at remlab.net remi at remlab.net
Wed Sep 14 20:34:19 EEST 2022


From: Rémi Denis-Courmont <remi at remlab.net>

Some serious copy-paste / squash / rebase mismanipulation here.
---
 libavutil/riscv/intmath.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/riscv/intmath.h b/libavutil/riscv/intmath.h
index 78f7ba930a..3263a79dc4 100644
--- a/libavutil/riscv/intmath.h
+++ b/libavutil/riscv/intmath.h
@@ -41,10 +41,10 @@ static av_always_inline av_const int8_t av_clip_int8_rvi(int a)
 #define av_clip_int16 av_clip_int16_rvi
 static av_always_inline av_const int16_t av_clip_int16_rvi(int a)
 {
-    union { uint8_t u; int8_t s; } u = { .u = a };
+    union { uint16_t u; int16_t s; } u = { .u = a };
 
     if (a != u.s)
-        a = ((a >> 31) ^ 0x7F);
+        a = ((a >> 31) ^ 0x7FFF);
     return a;
 }
 
-- 
2.37.2



More information about the ffmpeg-devel mailing list