9c289fc621
This change significantly improves compression speed. Explanation: If we take a closer look at the color endpoint refinement, we can see that the input for the color refinement comes directly from the color endpoint optimization step, while the selector codebook computation does not affect the color endpoint refinement at all. Therefore color endpoint refinement can be safely moved into the endpoint optimization thread. Testing: The modified algorithm has been tested on the Kodak test set using 64-bit build with default settings (running on Windows 10, i7-4790, 3.6GHz). All the decompressed test images are identical to the images being compressed and decompressed using original version of Crunch. [Compressing Kodak set without mipmaps] Original: 1582222 bytes / 28.899 sec Modified: 1494501 bytes / 24.043 sec Improvement: 5.54% (compression ratio) / 16.80% (compression time) [Compressing Kodak set with mipmaps] Original: 2065243 bytes / 36.884 sec Modified: 1945365 bytes / 31.586 sec Improvement: 5.80% (compression ratio) / 14.36% (compression time)