Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance PSNR Check for Luma (Y) Channel in VPP Sharpen Filter #697

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/mixin/vpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]}"
Comment on lines +135 to +138
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If luma is 100 in non-passthrough sharpen level, then it's a bug and this will cause that bug to escape.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will not capture the issue reported in intel/media-driver#1881


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