Skip to content

Add optimization to LZ RDO backend - #784

Merged
solidpixel merged 8 commits into
mainfrom
opt-lz-rdo
Nov 17, 2026
Merged

solidpixel merged 8 commits into
mainfrom
opt-lz-rdo

Conversation

@solidpixel

@solidpixel solidpixel commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Change adds optimizations to the LZ RDO backend, keeping existing algorithm untouched. Main classes of change:

SIMD vectorization:

  • Using VLA N-scalars per register code for data in SoA by-channel arrangement.
  • Using VLA N-quads per register code for data in AoS by-texel arrangement.
  • Avoiding loop tails by using in-loop SIMD masks.

Caching:

  • Cache block error to avoid recomputation when it doesn't change.
  • Cache endpoints and projection to avoid recomputation when it doesn't change.
  • Caching weights saves another percent or two, but it's a bit more invasive so I discarded that idea.

Overall RDO encoding pass for the Kodak suite is about 30% faster for 4x4, 18% faster for 6x6. Should be bit exact.

@solidpixel
solidpixel force-pushed the opt-lz-rdo branch 3 times, most recently from 6f68db0 to f11091a Compare November 17, 2026 14:11
@solidpixel solidpixel changed the title Add vectorization optimization to LZ RDO backend Add optimization to LZ RDO backend Nov 17, 2026
@solidpixel
solidpixel merged commit feb050d into main Nov 17, 2026
22 checks passed
@solidpixel
solidpixel deleted the opt-lz-rdo branch November 17, 2026 15:06
@solidpixel

Copy link
Copy Markdown
Contributor Author

@rygorous FYI, just in case it's useful if you are keeping your existing version internally.

@rygorous

Copy link
Copy Markdown
Contributor

Thanks!

We fully plan on getting off having a custom fork entirely given the opportunity, you previously sounded kinda lukewarm on the earlier RDO patches so we figured we might have to, but if we can have this functionality (and with no API changes so it's not even any adaptation work for us!) in mainline astc-encoder we'd much rather stick with that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants