Constant time median filter for AviSynth