Adaptive Algorithm for Fast Motion Estimation in H.264/MPEG-4 AVC