Efficient Median Filter for Restoration of Image and Video Sequences Corrupted by Impulsive Noise