LZ-RDO has been integrated into ARM’s ASTC encoder, adding an option to make ASTC textures compress more efficiently in packages using LZ codecs such as zstd, zlib, LZ4, or Oodle. ASTC blocks have a fixed size, but their independently fitted endpoints and weights tend to look random, leaving general-purpose compressors few repeated patterns to exploit. The new rate-distortion optimization selects among visually similar encodings to encourage those patterns. The resulting texture remains a valid ASTC file of the same in-memory size; the benefit appears only after package compression, trading some image quality and encoding time for smaller downloads.
The encoder compares normal and more restricted encodings, then builds candidates by reusing recent endpoint or weight data from other blocks. It estimates how well an LZ compressor could encode each candidate and balances that cost against perceptually weighted image error: smooth areas receive tighter error limits, while busy or edge-rich regions can tolerate more. Processing uses multiple passes over chunks, with histories that track recently used values. Users control the trade-off with a lambda setting; suggested values are 20-40 for diffuse or albedo textures and around 10 or lower for normal maps. More passes can improve compression at additional encoding cost. The feature currently supports LDR textures and is intended for higher-quality encoding presets.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.