Skip to content

Commit

Permalink
Enhance PSNR Check for Luma (Y) Channel in VPP Sharpen Filter
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Hangjie22Coder committed Oct 25, 2024
1 parent 9b17a37 commit f7fd5b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/mixin/vpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ 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"
# Check if the actual Luma (Y) value is significantly lower than the reference value.
# If the actual value is lower than the reference by more than 0.25, raise an exception.
assert ref[-3] - actual[-3] < 0.25, "Luma (Y) out of baseline range"

metrics2.check(
metric = dict(type = "psnr"), compare = compare,
Expand Down

0 comments on commit f7fd5b0

Please sign in to comment.