Using MRSSE for HDR error calculations #528
Closed
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.
Status:
Suspect I have the wrong end of the stick here - MRSEE on log values is still going to be incorrect. For MRSEE to make sense we need to use linear colors, diving in/out of LNS encoding when we need to test quantization. This is going to end up a lot more expensive ...
Description
HDR texture values are stored logarithmically.
Using absolute sum of squares on the logarithmic values (the existing behaviour on main) causes the compressor to spend too much effort preserving imperceptible shifts in dark channel values at the expense of bright values in the same block. This performs poorly in blocks with sharp luminance changes (dark texels in a bright block) and in blocks with saturated color values (dark channels in bright pixels).
Using absolute sum of squares on linearized HDR values (attempted by the first patch in this PR) avoids the compressor fixating on dark values, but instead causes the compressor to spend too much effort preserving bright values. This is because the errors in the bright channels can be orders of magnitude bigger than the errors in the dark channels, and dark values can end up quantizing close to black.
Using relative sum of square on the logarithmic values, proposed by Ryg in the blog below, encourages the compressor to find a balance of relative error across the whole block, favoring neither light nor dark channels. Blog: https://fgiesen.wordpress.com/2024/11/14/mrsse/ .
This is a perceptual error metric for HDR textures, so we expect that this will make the mPSNR score worse because we are no longer optimizing for absolute error. Test failures in HDR textures are therefore expected, and LDR textures are not affected.