Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

bug in DecodeEndpoints() #10

Open
richgel999 opened this issue Aug 24, 2019 · 0 comments
Open

bug in DecodeEndpoints() #10

richgel999 opened this issue Aug 24, 2019 · 0 comments

Comments

@richgel999
Copy link

Hi,
I've been comparing the output of astc-codec vs. another ASTC decoder from Google. I found a decoding issue with void extent blocks, where the output differs from what is expected by the ASTC spec in LDR mode when sRGB enabled. Here's the relevant code:

static std::vector DecodeEndpoints(const VoidExtentData& block) {
EndpointPair eps;
// Original code:
//eps.first[0] = eps.second[0] = (block.r * 255) / 65535;
//eps.first[1] = eps.second[1] = (block.g * 255) / 65535;
//eps.first[2] = eps.second[2] = (block.b * 255) / 65535;
//eps.first[3] = eps.second[3] = (block.a * 255) / 65535;

// Corrected code that generates the expected result with void extent blocks:
eps.first[0] = eps.second[0] = (block.r >> 8);
eps.first[1] = eps.second[1] = (block.g >> 8);
eps.first[2] = eps.second[2] = (block.b >> 8);
eps.first[3] = eps.second[3] = (block.a >> 8);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant