D. Coltuc et I. Pitas, ON FAST RUNNING MAX-MIN FILTERING, IEEE transactions on circuits and systems. 2, Analog and digital signal processing, 44(8), 1997, pp. 660-663
The problem of fast running max/min filters for arbitrary-size windows
is addressed, The size of the filter window is increased to the least
power of two greater than the given size and, the input sequence is e
xpanded, The running max/min computation uses a fast algorithm for pow
er of two window sizes, The computational complexity (comparisons per
sample) of the proposed algorithm is very close to log(2)n, where n is
the size of the given window, A flexible hardware implementation for
n ranging between two consecutive powers of two is discussed.