Reduce

The 2D reduce operation consists of convolution with a Gaussian lowpass filter followed by downsampling by a factor of two:

Convolving an image with the 5 x 5 Gaussian lowpass kernel

       1   5   8   5   1
       5  25  40  25   5
1/400  8  40  64  40   8
       5  25  40  25   5
       1   5   8   5   1
can be implemented by consecutive 1D convolutions of the rows and columns with the kernel, 1/20 [ 1 5 8 5 1 ]. Similiarly, the downsampling operation in 2D can be accomplished by consecutive 1D downsampling operations on the rows and columns. Consequently, the 2D reduce operation can be implemented as:

The final simplification results by combining the 1D convolution and the 1D downsampling into a single operation:

For example, to do the reduce operation in the y-direction, output[i,j] = 0.05*input[i,2*j-2] + 0.25*input[i,2*j-1] + 0.4*input[i,2*j] + 0.25*input[i,2*j+1] + 0.05*input[i,2*j+2].