* [FFmpeg-devel] [PATCH] tests/tiny_ssim: fixed mistake in ssim_c1 calculation (PR #20251)
@ 2025-08-15 21:41 Valerii Zapodovnikov
0 siblings, 0 replies; only message in thread
From: Valerii Zapodovnikov @ 2025-08-15 21:41 UTC (permalink / raw)
To: ffmpeg-devel
PR #20251 opened by Valerii Zapodovnikov (Balling)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20251
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20251.patch
Closes #8529. Reporter uses this code in production.
Signed-off-by: Balling <val.zapod.vz@gmail.com>
From b8f32ee7615b3f09d089e03606c0657fe9a28108 Mon Sep 17 00:00:00 2001
From: Balling <val.zapod.vz@gmail.com>
Date: Fri, 15 Aug 2025 21:40:34 +0000
Subject: [PATCH] tests/tiny_ssim: fixed mistake in ssim_c1 calculation
Closes #8529. Reporter uses this code in production.
Signed-off-by: Balling <val.zapod.vz@gmail.com>
---
tests/tiny_ssim.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/tiny_ssim.c b/tests/tiny_ssim.c
index 9740652288..8472fc3b19 100644
--- a/tests/tiny_ssim.c
+++ b/tests/tiny_ssim.c
@@ -79,11 +79,11 @@ static float ssim_end1( int s1, int s2, int ss, int s12 )
* Maximum value for 9-bit is: ss*64 = (2^9-1)^2*16*4*64 = 1069551616, which will not overflow. */
#if BIT_DEPTH > 9
typedef float type;
- static const float ssim_c1 = .01*.01*PIXEL_MAX*PIXEL_MAX*64;
+ static const float ssim_c1 = .01*.01*PIXEL_MAX*PIXEL_MAX*64*64;
static const float ssim_c2 = .03*.03*PIXEL_MAX*PIXEL_MAX*64*63;
#else
typedef int type;
- static const int ssim_c1 = (int)(.01*.01*PIXEL_MAX*PIXEL_MAX*64 + .5);
+ static const int ssim_c1 = (int)(.01*.01*PIXEL_MAX*PIXEL_MAX*64*64 + .5);
static const int ssim_c2 = (int)(.03*.03*PIXEL_MAX*PIXEL_MAX*64*63 + .5);
#endif
type fs1 = s1;
--
2.49.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-15 21:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-15 21:41 [FFmpeg-devel] [PATCH] tests/tiny_ssim: fixed mistake in ssim_c1 calculation (PR #20251) Valerii Zapodovnikov
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