1. A method for selecting a matching block, comprising: selecting a candidate block included in a second image that corresponds to a processing block of a first image; computing a first probability for the processing block and the candidate block; selecting a random block for the candidate block; computing a second probability for the processing block and the random block; saving a greater of the first probability and the second probability as a first comparison result; computing a third probability for the processing block, a first neighboring block of the processing block, a matching block in the second image that is matched to the first neighboring block, and a second neighboring block of the matching block; and saving a greater of the first comparison result and the third probability as a second comparison result.