According to an embodiment, to obtain the affine parameter group candidates, an upper left coordinate of the current block may be determined as a first affine parameter extraction location and an upper right coordinate of the current block may be determined as a second affine parameter extraction location. A first motion vector may be obtained from at least one adjacent block adjacent to the first affine parameter extraction location, and a second motion vector may be obtained from at least one adjacent block adjacent to the second affine parameter extraction location.
A third motion vector may be obtained from the first motion vector and the second motion vector when both right and left blocks of the current block are not decoded. Also, the third motion vector may be obtained from a lower left coordinate of the current block when the left block of the current block is decoded and the right block of the current block is not decoded. Also, the third motion vector may be obtained from a lower right coordinate of the current block when the right block of the current block is decoded and the left block of the current block is not decoded.
Also, the affine parameter group candidate may be obtained according to the obtained first through third motion vectors.
When the right and left blocks of the current block are both decoded, the third motion vector is obtained from the lower left coordinate of the current block and a fourth motion vector is obtained from the lower right coordinate of the current block. Then, at least one of a first affine parameter group candidate obtained from the first through third motion vectors, a second affine parameter group candidate obtained from the first, second, and fourth motion vectors, and a third affine parameter group candidate determined from the first and second affine parameter group candidates may be determined.