Fast maximum-minimum filters implemented in C++