ASTC decoding part 1: Decoder base and low dynamic range support#46
Draft
Erik-White wants to merge 8 commits into
Draft
ASTC decoding part 1: Decoder base and low dynamic range support#46Erik-White wants to merge 8 commits into
Erik-White wants to merge 8 commits into
Conversation
4 tasks
d8e77b1 to
306335b
Compare
306335b to
5f07655
Compare
This was referenced May 17, 2026
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.
Prerequisites
Description
The first part of ASTC (Adaptive scalable texture compression) decoding. ASTC is used with KTX containers to compress texture data.
This adds the main ASTC decoder with support for low dynamic range. Implementing an ASTC decoder was a major challenge, but I was able to use the ARM astc-encoder in C++ as a reference implementation.
ASTC is very complex, with different combinations of modes, block sizes and partitions, so I'm afraid that the diff is very large.
Prerequisites
To follow
Limitations
Intentionally omitted
Test data
Everything used is either created by myself, or sourced from
https://github.com/KhronosGroup/KTX-Software (Apache 2.0 license)
https://github.com/KhronosGroup/KTX-Software-CTS (Apache 2.0 license)
https://github.com/ARM-software/astc-encoder (Apache-2.0 license)
Performance
This implementation compares very favourably to the ARM C++ implementation. Single shot benchmarks show 3-4 faster on this small test set:
...however this includes the allocation overhead of the ARM decoder. Re-using the same decoder context in the ARM decoder shows a probably more realistic comparison: