Repository navigation
Conversation
With enable_chroma=false, or a YUV400P input, flush() still wrote apsnr_cb and apsnr_cr. Their pixel counts stay zero, so both aggregates came out as NaN and the JSON output showed them as null. Use the same plane count as extract() and close(), so the chroma aggregates appear only when chroma is measured. Add tests for the luma-only case at 8 and 16 bits and for the three-plane case with chroma enabled. 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.
With
enable_chroma=false, or a YUV400 input,flush()ininteger_psnr.cstill publishesapsnr_cbandapsnr_cr. Their pixel counts stay zero, so both aggregates come out as NaN and the JSON output shows them asnull. This is one of the two concerns PR 1666 mixed together; the zero-error cap goes in a separate PR.Fix
flush()aggregatesenable_chroma ? 3 : 1planes, the same plane countextract()andclose()already use. With chroma enabled nothing changes.Before and after
64x64 4:2:0 clip,
--feature psnr=enable_apsnr=true:enable_chroma=false --json, release build:cf677baaapsnr_yapsnr_yapsnr_cb,apsnr_crnullTests
Three new cases in
test_psnr, built onflush():test_apsnr_luma_only(8 bit) andtest_apsnr_luma_only_16b:apsnr_yhas the expected value,apsnr_cbandapsnr_crare absent.test_apsnr_chroma_enabled: with chroma on, all three aggregates are present and finite.Without the fix,
test_psnrfails on the unexpectedapsnr_cb.Validation
cf677baa: the libvmaf unit suite passes 25 of 25,test_psnrincluded.