2D convolution
Note: not for any h[i,j] we can implement 2D convolution
as a sequence of 2 1D convolutions. Convolution
is implemented as 4 nested loops.
Typically, in formulas the indices of filters run
in both directions from -L to L, where L is an integer.
Be careful when retrieving the filter values from
an array: you have to convert the range [-L..L] to [0..2*L]