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] checkasm/hevc_sao.c: add sign for sao offset_val (PR #20730)
@ 2025-10-21  7:27 CheryDan via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: CheryDan via ffmpeg-devel @ 2025-10-21  7:27 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: CheryDan

PR #20730 opened by CheryDan
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20730
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20730.patch

This patch adds a sign bit to the randomly generated sao_offset_val.


>From 5fff7ab8459576885b3c0e0ef62cd7b7a2213c1c Mon Sep 17 00:00:00 2001
From: daichengrong <daichengrong@iscas.ac.cn>
Date: Tue, 21 Oct 2025 15:18:26 +0800
Subject: [PATCH] checkasm/hevc_sao.c: add sign for sao offset_val

Signed-off-by: daichengrong <daichengrong@iscas.ac.cn>
---
 tests/checkasm/hevc_sao.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tests/checkasm/hevc_sao.c b/tests/checkasm/hevc_sao.c
index 37f6ba8c5c..990df28313 100644
--- a/tests/checkasm/hevc_sao.c
+++ b/tests/checkasm/hevc_sao.c
@@ -53,13 +53,17 @@ static const uint32_t sao_size[5] = {8, 16, 32, 48, 64};
         int k;                                              \
         if (bit_depth == 8) {                               \
             for (k = 0; k < size; k++) {                    \
-                uint8_t r = rnd() % max_offset;             \
-                buf[k] = r;                                 \
+                uint8_t r = rnd();                          \
+                uint8_t sign = r & max_offset;              \
+                uint8_t val =  r % max_offset;              \
+                buf[k] = sign ? val : -val;                 \
             }                                               \
         } else {                                            \
             for (k = 0; k < size; k++) {                    \
-                uint16_t r = rnd() % max_offset;            \
-                buf[k] = r;                                 \
+                uint16_t r = rnd();                         \
+                uint16_t sign = r & max_offset;             \
+                uint16_t val =  r % max_offset;             \
+                buf[k] = sign ? val : -val;                 \
             }                                               \
         }                                                   \
     } while (0)
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-21  7:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-21  7:27 [FFmpeg-devel] [PATCH] checkasm/hevc_sao.c: add sign for sao offset_val (PR #20730) CheryDan via ffmpeg-devel

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