ImageOptim / libimagequant

Palette quantization library that powers pngquant and other PNG optimizers
https://pngquant.org/lib
Other
780 stars 132 forks source link

de-recurse hist_item_sort_halfvar() #50

Closed skal65535 closed 3 years ago

skal65535 commented 3 years ago

This function can recurse (exhaustively) quite deep when sorted values are quite flat. We remove the recursion call totally. The API is slightly changed to return the break_at index directly.

kornelski commented 3 years ago

Thanks for the PR. That's a good idea.

skal65535 commented 3 years ago

Hi,

ok, so what are the next steps here? I tested this patch on 100's of images to verify they were giving the same output byte-wise. Do you have some equivalent tests handy, to make sure this patch doesn't break anything?

thx!

kornelski commented 3 years ago

It looks fine. Sorry, I just haven't had time to run my tests yet

skal65535 commented 3 years ago

ping? this patch has been running ok on our system since months now (i'd like to minimize the local diffs with HEAD!)

thx! skal/

kornelski commented 3 years ago

Thanks