Re: [AD] Faster hsv_to_rgb()

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


Eric Botcazou wrote:
Inspired by your efforts, I rearranged rgb_to_hsv() (conversion the
other way) a bit. A call to the new version takes 60% of the time that a
call to previous version took.

The speed improvement is 48.5% on my machine.

Actually, I noticed now that the time taken by the new routine divided by the time taken by the original varies between 0.65 and 0.85 on my machine, depending on what the test program does before the profiling (i.e., probably depending on how well aligned the test code becomes).

Why not 0.0f?

On some of these places it doesn't matter technically, since the conversion is at compile time, but maybe you are right that it's better to be explicit. Committed after implementing your changes and re-validated.

Sven





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