Skip to content

Conversation

@solidpixel
Copy link
Contributor

@solidpixel solidpixel commented Nov 4, 2022

For the RGB/RGBA base+offset endpoint formats the compressor can fail to detect cases that incorrectly do/do not trigger blue-contraction for the encoding path it is trying. This can result in endpoint encodings that are incorrect when decompressed because the blue-contraction the data was expecting is/is not applied.

This occurs because the compressor arithmetic is using shifted values for the implementation of bit_transfer_signed() and follow on arithmetic, but doesn't factor in the shift when computing whether the endpoint R+G+B sum is invalid for the desired direction of blue-contraction. This only impacts the compressor; the decompressor is correct.

Fixes #382

@solidpixel solidpixel merged commit 440b2fd into main Nov 4, 2022
@solidpixel solidpixel deleted the fix_rgb_delta branch November 4, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad endpoint encoding

2 participants