An Integrated Approach to Block Based Motion Estimation for Video Coding