Skip to content

Conversation

RunDevelopment
Copy link
Collaborator

@RunDevelopment RunDevelopment commented Sep 14, 2025

I changed the Oklab conversion code to make better use of SIMD operations. So instead of calculating expensive operations for each channel individually, they are now calculated in parallel using SIMD. This makes encoding BC1/2/3 images with perceptual error metric around 15% faster.

I also want to note that none of the 3 expensive operations I vectorized (all the *_vec functions) are particularly SIMD-friendly. Especially cbrt_vec is. This function alone currently eats up 25% of the total benchmark time. If different approximations were used, another 15% could likely be gained. However, I haven't spent much time looking for that yet.

@RunDevelopment RunDevelopment merged commit aedee69 into image-rs:main Sep 21, 2025
10 checks passed
@RunDevelopment RunDevelopment deleted the better-oklab-simd branch September 21, 2025 11:08
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.

1 participant