The motion compensation device 1000 calculates a horizontal gradient Ix(k) and a vertical gradient Iy(k) for each pixel in the first reference block and the second reference block (S1102). Then, d1 to d6 are calculated using Equation 15, and horizontal complexity D1 and vertical complexity D5 are calculated according to Equation 14 using d1 and d5 (S1104). It is determined whether the texture complexity of the current block, which is the minimum between the horizontal complexity D1 and the vertical complexity D5, is less than the threshold T (S1106). While the texture complexity of the current block is described in this example as being the minimum between the horizontal complexity D1 and the vertical complexity D5, the texture complexity may be set to the maximum or average value.
When the texture complexity of the current block is less than the threshold T, the BIO process is skipped and a prediction block of the current block is generated by typical motion compensation (S1108). That is, the prediction block of the current block is generated by averaging or weighted-averaging the first reference block and the second reference block.