constant mode for median_filter
move for loop to c