From 25a0366a6e3db4331cd4a8e8ee9820fdba14298d Mon Sep 17 00:00:00 2001 From: Wang Hangjie Date: Thu, 24 Oct 2024 09:54:34 -0700 Subject: [PATCH 1/2] Enhance PSNR Check for Luma (Y) Channel in VPP Sharpen Filter The current implementation of the PSNR check for the Luma (Y) channel raises exceptions for actual values exceeding reference values. This behavior is not reflective of typical processing scenarios where higher actual values are expected. Updated the `compare` function to only raise exceptions if the actual Luma (Y) value is lower than the reference value. Signed-off-by: Wang Hangjie --- lib/mixin/vpp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/mixin/vpp.py b/lib/mixin/vpp.py index bc3cce8b..83e23102 100644 --- a/lib/mixin/vpp.py +++ b/lib/mixin/vpp.py @@ -132,7 +132,10 @@ def compare(k, ref, actual): assert actual[-2] == 100, "Cb(U) should not be affected by SHARPEN filter" assert actual[-1] == 100, "Cr(V) should not be affected by SHARPEN filter" assert ref is not None, "Invalid reference value" - assert abs(ref[-3] - actual[-3]) < 0.25, "Luma (Y) out of baseline range" + # Only assert if actual Luma (Y) is lower than reference, using specified range condition + if actual[-3] < ref[-3]: + # Ensure the difference is within the acceptable range [0, 0.25) + assert 0 <= ref[-3] - actual[-3] < 0.25, f"Luma (Y) is lower than reference value: {actual[-3]} < {ref[-3]}" metrics2.check( metric = dict(type = "psnr"), compare = compare, From 5d9ed4fe2c70325bca7677334e9fb6e67c29445c Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Fri, 22 Nov 2024 09:48:00 -0500 Subject: [PATCH 2/2] Revert "Enhance PSNR Check for Luma (Y) Channel in VPP Sharpen Filter" This reverts commit 25a0366a6e3db4331cd4a8e8ee9820fdba14298d. --- lib/mixin/vpp.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/mixin/vpp.py b/lib/mixin/vpp.py index 83e23102..bc3cce8b 100644 --- a/lib/mixin/vpp.py +++ b/lib/mixin/vpp.py @@ -132,10 +132,7 @@ def compare(k, ref, actual): assert actual[-2] == 100, "Cb(U) should not be affected by SHARPEN filter" assert actual[-1] == 100, "Cr(V) should not be affected by SHARPEN filter" assert ref is not None, "Invalid reference value" - # Only assert if actual Luma (Y) is lower than reference, using specified range condition - if actual[-3] < ref[-3]: - # Ensure the difference is within the acceptable range [0, 0.25) - assert 0 <= ref[-3] - actual[-3] < 0.25, f"Luma (Y) is lower than reference value: {actual[-3]} < {ref[-3]}" + assert abs(ref[-3] - actual[-3]) < 0.25, "Luma (Y) out of baseline range" metrics2.check( metric = dict(type = "psnr"), compare = compare,