-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New BC7 CPU encoder #86
base: main
Are you sure you want to change the base?
Conversation
Thanks. I appreciate the work here and the contribution. I do need to take some time to review it in detail, and I'm a little concerned about the comingling of various licenses here (i.e. it's just not MIT). |
The Squish license and the Convection license are both MIT, so it's all one license. |
What exactly came from libsquish? |
Just the initial endpoint selector code (a.k.a. the EndpointSelectorRGB and EndpointSelectorRGBA). It's just 8-round Power Method so it can probably be rewritten if that's a problem. |
… moved the many safe-denominator switches to a function, fixed a bunch of math to handle channel weights more accurately.
Replaced the Squish dependency with a fresh implementation and fixed channel weighting in the process, merged in an important speed optimization. I think that should be it for any significant changes until review. |
Is this PR still in progress? It would be very useful on Linux Edit: I just tried it. It is indeed way faster than the current version, but still 4-10 times slower than bc7_enc_rdo. So I will keep using the latter |
New BC7 CPU encoder, significantly improves speed and quality.
Uses a mix of existing techniques (PCA + k-means clustering/LLS refinement) and a new one that tries to trade index precision for endpoint precision, and processes 8 blocks at once using SSE2.
Based on benchmarks against every other BC7 compressor that I'm aware of (both existing DirectXTex encoders, FasTC, Intel ISPC Texture Compressor, NVTT, Compressonator, bc7_gpu), it's roughly tied for best quality with NVTT and Compressonator, but is about 35x as fast as both of those and 10x as fast as the existing BC7 CPU encoder.