Speedup c median filter

By the defer calculating sorted values we gaining speed on multiply
numbers insert.

google translate:
using a deferred calculation, we've increased the speed of insertion of several numbers in succession