Method and device for processing video signal by using affine motion prediction
Disclosed are a method for processing a video signal by using an affine motion prediction and an apparatus thereof. A method for processing a video signal according to the present disclosure may include: adding, to an affine candidate list, an affine coded block coded in an affine prediction mode among neighbor blocks of a current block; obtaining a syntax element indicating a candidate used for the affine motion prediction of the current block in the affine candidate list; deriving a control point motion vector predictor of the current block based on an affine motion model of the candidate indicated by the syntax element; deriving a control point motion vector of the current block by adding a control point motion vector difference to the control point motion vector predictor; and generating a prediction block of the current block by using the control point motion vector of the current block.
1 . A method for decoding a video signal, the method comprising:
determining a block coded in an affine prediction mode among neighbor blocks of a current block as an affine candidate based on the block having a same reference picture as a reference picture of the current block;
obtaining a syntax element related to the affine candidate used for affine motion prediction of the current block;
deriving a control point motion vector predictor of the current block based on the affine candidate related to the syntax element;
deriving a control point motion vector of the current block based on a control point motion vector difference and the control point motion vector predictor;
generating prediction samples of the current block based on the control point motion vector of the current block; and
generating reconstructed samples of the current block based on the prediction samples of the current block, wherein the determining of the block further
comprises:
grouping the neighbor blocks of the current block into a first group and a second group; and
searching the block coded in the affine prediction mode based on a predefined order in respective ones of the first group and the second group,
wherein the first group includes left neighbor blocks of the current block, and the second group includes top neighbor blocks of the current block.
2 . The method of claim 1 , wherein the determining of the block further comprises:
determining a predefined maximum number of blocks coded in the affine prediction mode as affine candidates, and wherein the predefined maximum number is two.
3 . The method of claim 1 , wherein the determining of the block further comprises:
searching a valid affine coded block among blocks having the same reference picture as the reference picture of the current block in the first group according to the predefined order, and
searching a valid affine coded block among blocks having the same reference picture as the reference picture of the current block in the second group according to the predefined order.
4 . The method of claim 1 , wherein the determining of the block further comprises:
determining an affine candidate scaled based on a picture order count between reference pictures when there is no affine coded block among the neighbor blocks of the current block.
5 . The method of claim 1 , wherein the determining of the block further comprises:
determining 0 or 1 block coded in the affine prediction mode in the respective ones of the first group and the second group as the affine candidate.
6 . A method for encoding a video signal, the method comprising:
determining a block coded in an affine prediction mode among neighbor blocks of a current block as an affine candidate based on the block having a same reference picture as a reference picture of the current block;
selecting the affine candidate used for the affine motion prediction of the current block among affine candidates;
deriving a control point motion vector predictor of the current block based on the selected affine candidate;
deriving a control point motion vector of the current block based on a control point motion vector difference and the control point motion vector predictor;
generating prediction samples of the current block based on the control point motion vector of the current block;
generating residual samples of the current block based on the prediction samples; and
generating a syntax element related to the selected affine candidate among the affine candidates,
wherein the determining of the block further comprises:
grouping the neighbor blocks of the current block into a first group and a second group; and
searching the block coded in the affine prediction mode based on a predefined order in respective ones of the first group and the second group,
wherein the first group includes left neighbor blocks of the current block, and the second group includes top neighbor blocks of the current block.
7 . The method of claim 6 , wherein the determining of the block further comprises:
determining a predefined maximum number of blocks coded in the affine prediction mode as the affine candidates, and wherein the predefined maximum number is two.
8 . The method of claim 6 , wherein the determining of the block further comprises:
searching a valid affine coded block among blocks having the same reference picture as the reference picture of the current block in the first group according to the predefined order, and
searching a valid affine coded block among blocks having the same reference picture as the reference picture of the current block in the second group according to the predefined order.
9 . The method of claim 6 , wherein the determining of the block further comprises:
determining 0 or 1 block coded in the affine prediction mode in the respective ones of the first group and the second group as the affine candidate.
10 . A method for transmitting data for a video signal, the method comprising:
generating a bitstream for the video signal, wherein the bitstream is generated based on:
determining a block coded in an affine prediction mode among neighbor blocks of a current block as an affine candidate based on the block having a same reference picture as a reference picture of the current block;
selecting the affine candidate used for the affine motion prediction of the current block among affine candidates;
deriving a control point motion vector predictor of the current block based on the selected affine candidate;
deriving a control point motion vector of the current block based on a control point motion vector difference and the control point motion vector predictor;
generating prediction samples of the current block based on the control point motion vector of the current block;
generating residual samples of the current block based on the prediction samples; and
generating a syntax element related to the selected affine candidate among the affine candidates; and
transmitting the data comprising the bitstream,
wherein the determining of the block further comprises:
grouping the neighbor blocks of the current block into a first group and a second group; and
searching the block coded in the affine prediction mode based on a predefined order in respective ones of the first group and the second group,
wherein the first group includes left neighbor blocks of the current block, and the second group includes top neighbor blocks of the current block.