Repository navigation
Conversation
When every frame of a plane is identical, the summed squared error is 0, log10(0) gives -inf and flush() publishes the max_apsnr ceiling, e.g. 114 dB for 1080p 8-bit chroma. The per-frame psnr_y/cb/cr of the same plane are capped at psnr_max (6 * bpc + 12, or the value derived from min_sse), so the aggregate disagreed with every frame. Publish psnr_max for a scored plane with zero error. Every other input takes the existing expressions unchanged. Add tests for zero error at 8, 10, 12 and 16 bits, zero error with min_sse, zero chroma error with luma error, and the smallest non-zero error. Signed-off-by: Lusoris <lusoris@pm.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When every frame of a plane is identical, the summed squared error is 0,
log10(0)gives-inf, andflush()ininteger_psnr.cpublishes themax_apsnrceiling instead of a score: 93 dB luma and 87 dB chroma for the identical 64x64 8-bit clip in the table below, where every frame reads 60 dB. The per-framepsnr_y,psnr_cbandpsnr_crof the same plane are capped atpsnr_max(6 * bpc + 12, or the value derived frommin_sse), so the aggregate disagrees with every frame. This is one of the two concerns PR 1666 mixed together; the luma-only plane count goes in a separate PR.Fix
A scored plane (
n_pixels > 0) withsse == 0publishespsnr_max[i], aspsnr()andpsnr_hbd()do for a zero per-frame error. Every other input goes through the existing expressions unchanged.Before and after
Identical 64x64 4:2:0 reference and distorted clips,
--feature psnr=enable_apsnr=true --json, release build, Y / Cb / Cr:cf677baaaggregatemin_sse=0.5Tests
Four new cases in
test_psnr, built onflush():test_apsnr_zero_sse: zero error at 8, 10, 12 and 16 bits; each aggregate equals the plane cap6 * bpc + 12.test_apsnr_zero_sse_min_sse: zero error withmin_sseset; luma and chroma caps differ and each aggregate equals its own.test_apsnr_mixed_sse: zero chroma error next to a non-zero luma error.test_apsnr_one_sse: the smallest non-zero error still takes the existing expression.Without the fix,
test_psnrfails.Validation
cf677baa: the libvmaf unit suite passes 25 of 25,test_psnrincluded.Overlap with PR 1618
Both change
flush(). PR 1618 fixes the integer overflow in themax_apsnrceiling, and its test expects that ceiling (193 dB luma, 187 dB chroma) for a plane without error. Its fixture does not callinit(), sopsnr_maxstays 0 there: with this change applied, that test would read 0 (or 108 at 16 bit withinit()and the defaultmin_sse). Which value an error-free plane should report is the maintainers' choice; whichever PR lands second needs the other test adjusted.