Watch this Author's files
You can get at least a 5-10x speedup in the integer routines by changing the routines to cast floats to the correct uint** type and replacing the fix(0.5*k) with bitshift(k, -1).
For the 10-12 bit long codes I'm working with, graytest(10) and (12), the ratio goes from ~ 400 to 1500/2800 upon changing the routine, including the appropriate type checking and casting.
Also, the fix() call in int2gray() at least doesn't play nicely with a uint** passed in. I haven't checked gray2int().
That said, I've gotten great use out of (my modified versions of) these routines. Thanks for providing them.
great stufff ;)