From 384d5da4f032c3cc89087d5c153ea5112a94c7c4 Mon Sep 17 00:00:00 2001 From: pmady Date: Tue, 9 Dec 2025 20:20:42 -0600 Subject: [PATCH] fix(compare_Yee): Access correct channel in GaussianPyramid The GaussianPyramid::value() method was incorrectly accessing channel 1 instead of channel 0. This fix corrects the channel access to properly retrieve the luminance value from the single-channel pyramid levels. Update reference outputs to reflect the corrected perceptual diff results (Max error changes from 1 to 10 for the test images). Signed-off-by: pmady --- src/libOpenImageIO/imagebufalgo_yee.cpp | 4 ++-- testsuite/diff/ref/out-fmt6.txt | 6 +++--- testsuite/diff/ref/out.txt | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libOpenImageIO/imagebufalgo_yee.cpp b/src/libOpenImageIO/imagebufalgo_yee.cpp index 7ee875ebe5..25763dfdc8 100644 --- a/src/libOpenImageIO/imagebufalgo_yee.cpp +++ b/src/libOpenImageIO/imagebufalgo_yee.cpp @@ -52,7 +52,7 @@ class GaussianPyramid { if (lev >= PYRAMID_MAX_LEVELS) return 0.0f; else - return level[lev].getchannel(x, y, 0, 1); + return level[lev].getchannel(x, y, 0, 0); } #if 0 /* unused */ @@ -65,7 +65,7 @@ class GaussianPyramid { float operator()(int x, int y, int lev) const { OIIO_DASSERT(lev < PYRAMID_MAX_LEVELS); - return level[lev].getchannel(x, y, 0, 1); + return level[lev].getchannel(x, y, 0, 0); } #endif diff --git a/testsuite/diff/ref/out-fmt6.txt b/testsuite/diff/ref/out-fmt6.txt index e488da6520..1ddc33371e 100644 --- a/testsuite/diff/ref/out-fmt6.txt +++ b/testsuite/diff/ref/out-fmt6.txt @@ -16,7 +16,7 @@ Computing diff of "img1.exr" vs "img2.exr" 121 pixels (2.95%) over 1e-06 FAILURE Computing perceptual diff of "img1.exr" vs "img2.exr" - Max error = 1.0 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 + Max error = 10.0 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 121 pixels (2.95%) failed the perceptual test FAILURE Computing perceptual diff of "img1.exr" vs "img1.exr" @@ -26,7 +26,7 @@ Comparing "img1.exr" and "img2.exr" Mean error = 0 RMS error = 0 Peak SNR = 0 - Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 + Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 0 pixels (0%) over 0.008 121 pixels (2.95%) over 0.004 121 pixels (2.9541%) failed the perceptual test @@ -38,7 +38,7 @@ Comparing "img1.exr" and "img2.exr" Mean error = 0 RMS error = 0 Peak SNR = 0 - Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 + Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 0 pixels (0%) over 0.008 121 pixels (2.95%) over 1.0 121 pixels (2.9541%) failed the perceptual test diff --git a/testsuite/diff/ref/out.txt b/testsuite/diff/ref/out.txt index f5462e60c7..2000567703 100644 --- a/testsuite/diff/ref/out.txt +++ b/testsuite/diff/ref/out.txt @@ -16,7 +16,7 @@ Computing diff of "img1.exr" vs "img2.exr" 121 pixels (2.95%) over 1e-06 FAILURE Computing perceptual diff of "img1.exr" vs "img2.exr" - Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 + Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 121 pixels (2.95%) failed the perceptual test FAILURE Computing perceptual diff of "img1.exr" vs "img1.exr" @@ -26,7 +26,7 @@ Comparing "img1.exr" and "img2.exr" Mean error = 0 RMS error = 0 Peak SNR = 0 - Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 + Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 0 pixels (0%) over 0.008 121 pixels (2.95%) over 0.004 121 pixels (2.9541%) failed the perceptual test @@ -38,7 +38,7 @@ Comparing "img1.exr" and "img2.exr" Mean error = 0 RMS error = 0 Peak SNR = 0 - Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 + Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1 0 pixels (0%) over 0.008 121 pixels (2.95%) over 1 121 pixels (2.9541%) failed the perceptual test