Tuesday, June 9, 2026

Intra-Residual Weight Grid DCT/DST for BC7/ASTC

This GPU texture supercompression method for weights (or "indices", or "selectors") uses neighboring blocks to predict the weight grid of the current block, before applying a forward 2D DCT/DST to the weights, quantizing the coefficients, and coding them. The current working prototype (which I've been showing live on X) creates weight predictions using weights from a small neighborhood of already coded/decoded blocks to predict the current block's weight grid(s). 

See this thread on X here for more details:

https://x.com/richgel999/status/2064523919504109764

Or see this pastebin for the prototype's code (created in the public Basis Universal codebase).

It's the next step after XUASTC LDR's absolute weight grid DCT, which didn't use predictions (making it JPEG-like, not WebP-like).

In BC7 this method is easy: you just compute the 4x4 dequantized [0,64] weight grid that's going to be used as the predictor, and subtract that from the current weight grid (also dequantized) before 2D DCT coding it. In ASTC you would have to resample the predictor's weight grid to match the current block's weight grid resolution.

Here's the forward transform from the prototype (inverse is obvious). It's reusing the XUASTC LDR spec's weight grid DCT machinery almost verbatim, except for subtracting the predicted weight grid:

There are 17 total predictors in the prototype - first (0) is absolute (XUASTC/JPEG-style) DCT, rest are residual DCT. The reduction in the # of AC coefficients needed vs. absolute DCT is large: 20-35% in my experiments so far.




No comments:

Post a Comment

Note: Only a member of this blog may post a comment.