2D Summed-area tables algorithm.
Ported from the gpufilter-CUDA-library http://code.google.com/p/gpufilter/
(also MIT licensed)