Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Valerii Zapodovnikov <code@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] tests/tiny_ssim: fixed mistake in ssim_c1 calculation (PR #20251)
Date: Sat, 16 Aug 2025 00:41:05 +0300 (EEST)
Message-ID: <20250815214105.4EC2968C9CC@ffbox0-bg.ffmpeg.org> (raw)

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".

                 reply	other threads:[~2025-08-15 21:41 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=20250815214105.4EC2968C9CC@ffbox0-bg.ffmpeg.org \
    --to=code@ffmpeg.org \
    --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