The texture complexity for the current block may be set to any of the minimum Min(D1, D5), the maximum Max(D1, D5), or the average Ave(D1, D5) of the horizontal complexity and the vertical complexity. The motion compensation device 1000 skips the BIO process when the texture complexity is less than a threshold T, and applies the BIO process when the texture complexity is greater than or equal to the threshold T. When the BIO process is applied, d1 to d6 calculated in Equation 14 may be used for calculation of s1 to s6. That is, according to this embodiment, the texture complexity of the current block is obtained using values to be calculated during the BIO process and whether to skip the BIO process is determined based thereon. Accordingly, additional computation for determining whether to skip the BIO process may be reduced.
For the threshold T, a method of scaling the normalization parameter used in Equations 7 to 9 may be used. The normalization parameters r and m have relations of s1>m?r and s5>m?r. When s1<=m?r, vx is 0 even if BIO is performed. When s5<=m?r, vy is 0 even if BIO is performed.
Therefore, when the threshold value T is set based on the relations of the normalization parameters, the BIO may be skipped by pre-determining, on a CU basis, a region that is set to 0 even if the BIO is performed. D1 is the sum of d1 for all pixel positions in the CU and s1 is the sum of d1 in the mask Ω. Therefore, when the size of the CU is W×H and the size of the mask Ω is (2M+1)×(2M+1), the threshold T may be set as in Equation 17.