On Fri, Sep 28, 2012 at 06:50:30PM +0300, Janne Liljeblad wrote:
>> 1. If you really want to compute three Gaussian noise values per pixel,
>> you should probably use the Ziggurat method for generating the random
>> values; the ratio method is very slow. (That, and you should not
>> do a divide per nextDouble()!)
>> 2. There's absolutely no point in counting downwards in a loop that doesn't
>> use its index; it doesn't buy any speed, and has not since sometime
>> during the nineties. The compiler is able to do such transformations if
>> it is a win.
> "rgbnoise" is a straight port from gimp. We drop it for now if
> consensus is that it is too slow.
Note that two of my three points (division in nextDouble() and pointless loop
reversal) do not come from the original source code; at least they do not
exist in the version of The GIMP that I checked.
/* Steinar */
--
Homepage:
http://www.sesse.net/