Cython median filtering code implemented.