A method and apparatus for determining the quality of a block match for a candidate
motion vector in a video encoder system using motion vectors representing the difference
in coordinates of a macroblock of data in a current frame of video data and coordinates
of a related macroblock of data in a reference frame of video data. The method
can include defining a search pattern, searching a region based on the search pattern
for a candidate motion vector for evaluation, calculating a difference metric,
calculating a bias based on the difference between a predictor motion vector and
a candidate motion vector, determining a modified difference metric by adding the
difference metric to the bias, and defining a final motion vector based on the
modified difference metric.