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.
The current code computes a sincos table index based on the ideal weight for each texel, which is computed based on the current ideal endpoints. Ideal endpoints can be closer to the mean value than the principal axis projection for some texels and, for these texels, the ideal weights will be outside of the [0,1] range. The current code doesn't allow for this, which results in computed sincos table indices that end up wrapping inside the table bounds.
As part of fixing this I've replaced the float-to-int conversion that was implemented via float bit-twiddling with a straight round-to-nearest, which is faster on modern hardware.
Fixing this does change weight selection, and image PSNR changes are noisy in both directions, so regenerated test reference scores are required.