Method and apparatus for processing video signal
An image decoding method according to the present invention may comprise the steps of: deriving a merge candidate from a candidate block; generating a first merge candidate list including the merge candidate; specifying any one of a plurality of merge candidates included in the first merge candidate list; deriving affine vectors of a current block on the basis of motion information of the specified merge candidate; deriving a motion vector of a sub-block in the current block on the basis of the affine vectors; and performing motion compensation on the sub-block on the basis of the motion vector.
1 . A method of decoding a video, the method comprising:
deriving an affine merge candidate from a neighboring block adjacent to a current block;
generating a merge candidate list including the affine merge candidate;
selecting one of a plurality of affine merge candidates included in the merge candidate list;
deriving corner motion vectors of the current block based on the selected affine merge candidate, a number of the corner motion vectors of the current block being 2 or 3;
deriving a motion vector of a sub-block in the current block based on the corner motion vectors of the current block; and
performing motion compensation for the sub-block based on the motion vector,
wherein the affine merge candidates comprise a first affine merge candidate derived based on a top neighboring block that is determined to be the first available among top neighboring blocks and a second affine merge candidate derived based on a left neighboring block that is determined to be the first available among top neighboring blocks, and
wherein, based on whether the top neighboring block adjoins the current block at a CTU (Coding Tree Unit) boundary, it is determined whether a top-left corner motion vector and a top-right corner motion vector of the neighboring block are used to derive the first affine merge candidate.
2 . The method of claim 1 , wherein the merge candidate list comprises a constructed affine merge candidate which is generated by combining translation motion vectors of a plurality of neighboring blocks.
3 . The method of claim 2 , wherein when the neighboring block is included in the same CTU as the current block, the top-left corner motion vector and the top-right corner motion vector of the neighboring block are used to derive the affine merge candidate, and
wherein when the neighboring block is not included in the same CTU as the current block, motion vectors of a bottom-left corner and a bottom-right corner of the neighboring block are used to derive the affine merge candidate.
4 . A method of encoding a video, the method comprising:
deriving an affine merge candidate from a neighboring block adjacent to a current block;
generating a merge candidate list including the affine merge candidate;
specifying one of a plurality of affine merge candidates included in the merge candidate list;
deriving corner motion vectors of the current block based on the specified affine merge candidate, a number of the corner motion vectors of the current block being 2 or 3;
deriving a motion vector of a sub-block in the current block based on the corner motion vectors of the current block; and
performing motion compensation for the sub-block based on the motion vector,
wherein the affine merge candidates comprise a first affine merge candidate derived based on a top neighboring block that is determined to be the first available among top neighboring blocks and a second affine merge candidate derived based on a left neighboring block that is determined to be the first available among top neighboring blocks, and
wherein, based on whether the top neighboring block adjoins the current block at a CTU (Coding Tree Unit) boundary, it is determined whether a top-left corner motion vector and a top-right corner motion vector of the neighboring block are used to derive the first affine merge candidate.
5 . The method of claim 4 , wherein the merge candidate list comprises a constructed affine merge candidate which is generated by combining translation motion vectors of a plurality of neighboring blocks.
6 . The method of claim 5 , wherein when the neighboring block is included in the same CTU as the current block, the top-left corner motion vector and the top-right corner motion vector of the neighboring block are used to derive the affine merge candidate, and
wherein when the neighboring block is not included in the same CTU as the current block, motion vectors of a bottom-left corner and a bottom-right corner of the neighboring block are used to derive the affine merge candidate.
7 . The method of claim 4 , wherein the affine merge candidate is derived from one of top neighboring blocks adjacent to the current block, and
wherein the affine merge candidate is derived from available one which is found firstly by searching the top neighboring blocks in a pre-defined order.
8 . A method of transmitting data for a video signal, the method comprising:
obtaining a bitstream for the video signal, wherein obtaining the bitstream comprises:
deriving an affine merge candidate from a neighboring block adjacent to a current block;
generating a merge candidate list including the affine merge candidate;
specifying one of a plurality of affine merge candidates included in the merge candidate list;
deriving corner motion vectors of the current block based on the specified affine merge candidate, a number of the corner motion vectors of the current block being 2 or 3;
deriving a motion vector of a sub-block in the current block based on the corner motion vectors of the current block; and
performing motion compensation for the sub-block based on the motion vector,
transmitting the data including the bitstream,
wherein the affine merge candidates comprise a first affine merge candidate derived based on a top neighboring block that is determined to be the first available among top neighboring blocks adjacent to the current block and a second affine merge candidate derived based on a left neighboring block that is determined to be the first available among top neighboring blocks adjacent to the current block, and
wherein, based on whether the top neighboring block adjoins the current block at a CTU (Coding Tree Unit) boundary, it is determined whether a top-left corner motion vector and a top-right corner motion vector of the neighboring block are used to derive the first affine merge candidate.