Motion search is by far the most complex operation to be performed in a video encoder. This paper proposes a novel fast matching algorithm to help speed up the computation of the matching (distance) metric used in the search, e.g., the sum of absolute difference (SAD). Based on a partial distance technique, our algorithm reduces complexity by terminating the SAD calculation early once it becomes clear that, given the partial SAD, it is likely that the total SAD will exceed that of the best candidate encountered so far in the search. The key idea is to introduce models to describe the probability distribution of the total distance given a measured partial distance. These models enable us to evaluate the risk involved in trusting a distance estimate obtained from a partial distance. By varying the amount of risk we are willing to take, we ran increase the speed, but we may also eliminate some good candidates too early, and thus increase the distortion of the decoded sequence. Because our approach requires knowledge of the statistical characteristics of the input, we also propose two approaches that allow these models to be obtained online. Our experimental results (based on an actual software implementation of an MPEG encoder) demonstrate that significant gains can be achieved with this approach. For example, reductions in the motion estimation computation time as compared with the original partial-distance search (where computation stops if the partial SAD is already larger than the SAD of the best candidate so far) can be as high as 45% for 2-D log search and 65% for exhaustive full search with a small penalty of 0.1-dB degradation in PSNR of the reconstructed sequences.