In S1330, the motion compensation device 1000 determines whether the horizontal complexity D1 is less than the threshold T (S1331). When the horizontal complexity D1 is less than the threshold T, the horizontal optical flow vx is set to 0 (S1332). This means that the horizontal optical flow is not applied. When the horizontal complexity D1 is greater than or equal to the threshold T, d3 is calculated (S1333), and s1 and s3 are calculated using d1 and d3 (S1334). Referring to Equations 7 to 9, when the horizontal optical flow vx is calculated, only s1 and s3 are required. Since d1 has already been calculated in S1320, d3 is calculated in S1333 and s1 and s3 are calculated in S1334 using d1 and d3. Then, the horizontal optical flow vx is calculated using s1 and s3 according to any one of Equations 7 to 9 (S1335).