Original text(via Lobsters)
LZ-RDO lands in ARM's astc-encoder
The problem: ASTC looks like noise to LZ
How it works
- Low-pass filter the image (Gaussian, σ = 2.2).
- Take the squared difference from the original. That's the local high-frequency energy.
- Blur that energy a little (σ = 1.25) so it spreads.
- Map it to a weight that falls off with the square root of the energy.
- Endpoint history: mode, header and endpoint bits.
- Weight history: weight bits.
- the original encoding;
- the restricted encoding;
- endpoint substitution: take endpoints from the history, compute the ideal weights for this block's pixels with those endpoints, and quantize. A quick check on endpoint-axis alignment skips pairs that can't work. The best few candidates are kept.
- weight splicing: combine every weight entry in the history with each surviving endpoint candidate that has the same weight bit count. If both halves came from the same earlier block, it's one long LZ match.
- A match costs about 10 + log2(mtf_position + 32) bits.
- If the endpoints and weights match the same earlier block, they're billed as one match.
- The first two bytes (where the mode lives) are costed from an adaptive histogram, so frequently used modes get cheaper.
- A partial byte at the endpoint/weight boundary is billed as literal bits.
Using It
- λ is tuned so that a step of about 10 is a visible difference.
- Diffuse/albedo: 20–40 is usually fine.
- Normal maps: stay low, around 10 or even below, depending on your quality bar.
- -rdo-passes 2 (the -exhaustive default) squeezes out a bit more, at a real cost in encode time.
Limitations
- LDR only. Nothing prevents HDR in principle.
- In-memory size doesn't change. The gain only shows up after LZ compression on disk or over the wire.
- It costs encode time. It's meant to be paired with the higher-quality presets.
Results

Thanks
As the Arm end of the landing team on this I just wanted to say thank you, it's great to have this in the public compressor implementation =)
You are welcome! :)
Leave a Reply.
Archives
January 2025 September 2024 August 2024 November 2021 October 2021 September 2021 April 2021 February 2021 January 2021 December 2020 June 2020 May 2020 April 2020 November 2019 April 2019 August 2018 April 2017 March 2017 January 2017 November 2016 October 2016 September 2016 January 2016 March 2015 August 2013 July 2013 December 2012
Categories
All Compression Dxt
