Repository navigation
libvmaf/feature/integer_adm: keep Barten CSF weights within their fixed-point types - #1734
Open
Shakhtar-Sankur wants to merge 1 commit into
Open
Shakhtar-Sankur wants to merge 1 commit into
Shakhtar-Sankur wants to merge 1 commit into
Conversation
…ed-point types With adm_csf_mode=1 and the default adm_csf_scale/adm_csf_diag_scale, the Barten weights are about 1.2 at scale 0 and 5 at scale 1. They do not fit the Q21/Q23 uint16_t (scale 0) and Q32 uint32_t (scales 1 to 3) weights of the integer extractor, so integer_adm2_csf_1 came out near 0.002 or NaN instead of matching float_adm (0.965404 on frame 0 of src01). When a weight of a scale does not fit its type, scale all three weights of that scale down by a shared 2^k that brings each one to at most the Watson97 weight of the same band, and multiply the cubed contrast-masking sum back by 2^(3k). Weights that already fit (Watson97 and the blend modes) give k = 0 and are unchanged. The SIMD CSF and contrast-masking kernels are used only when k = 0; otherwise the C versions run. Fixes Netflix#1662.
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.
Fixes #1662.
With adm_csf_mode=1 and the default adm_csf_scale / adm_csf_diag_scale, the Barten CSF weights are about 1.2 at scale 0 and 5 at scale 1. The integer extractor stores them as Q21/Q23 in uint16_t (scale 0) and Q32 in uint32_t (scales 1 to 3), so they overflow, and integer_adm2_csf_1 comes out near 0.008 instead of matching float_adm.
This follows the shared-exponent approach described in #1662:
Results on src01_hrc00/hrc01 576x324 (48 frames), master cf677ba vs this branch:
Run log: https://www.kaggle.com/code/sankurkundu/notebook987cf8a98e