The gray prediction search algorithm for block motion estimation