Re: [AD] Faster hsv_to_rgb()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


AE wrote:
I have optimised hsv_to_rgb()

I tested it (ran through many h,s,v triples and compared with previous algorithm), and it seems correct. It's a bit faster, but not as much as one would expect: on my computer the new version takes about 95% of the time that the old version took. I tried one more optimization, replacing the switch by a binary search, which took it down to 93-94% of the time of the old version. The attached patch contains both optimizations, and also my modifications to rgb_to_hsv().

I think your further optimizations would make a lot sense as an add-on.

Sven

Attachment: color.c.diff.gz
Description: application/unix-tar



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/