On 19-02-12 18:23, Krzysztof KosiĆski wrote:
2012/2/19 Johan Engelen <jbc.engelen@...2592...>:
fixed-point.h: assuming it is actually used, it should be rewritten to take advantage of Boost operator helpers and moved to 2Geom.
I can comment on that one, as I wrote it :) It's used in gaussian blur (or at least, it used to be), although it's used less than I initially planned for (the IIR code really seems to need the added precision of doubles, one reason I'm still looking for a replacement). It doesn't make sense to me to move it to 2geom, as it has nothing to do with geometry, but using Boost to simplify/clean up the code sounds like an excellent plan.
Also, it might be worth seeing whether it actually is still worth it in terms of speed. It should be relatively simple to make the FIR code use "float" instead of a fixed point type and see if that makes any speed difference. There is a typedef on line 66 of nr-filter-gaussian.cpp, if someone (preferably multiple someones) with a reasonable modern machine could check whether changing that typedef to set FIRValue to "float" makes a (huge) speed difference, that would be great. If not, the time might have come to simply remove this optimization.
When testing the speed of the FIR code, it helps to set "use_IIR_?" on lines 601/602 to false, then you know for sure that you're using the FIR code, and not the IIR code.
... mathfns.h: should be moved to 2Geom.
The triangle area makes sense to move to 2geom, but I'm not so sure about the other ones, they look like they might be related to grids or something. (At least I see no reason to put them in 2geom.)
Great effort btw!