Method for refining a motion vector derived under a merge mode using a difference vector
An image decoding method according to the present invention comprises: a step of acquiring an initial motion vector of a current block; a step of deriving a refined motion vector for each of a plurality of search points on the basis of the initial motion vector; and a step of acquiring a motion vector of the current block on the basis of the refined motion vector of any one of the plurality of search points.
1 . A method of decoding a video, the method comprising:
obtaining a motion vector of a current block based on one of a plurality of inter modes pre-defined in a decoding apparatus, the inter modes including a motion vector prediction mode and a merge mode; and
obtaining a prediction block of the current block based on the motion vector of the current block; and
reconstructing the current block based on the prediction block of the current block,
wherein, under the motion vector prediction mode, the motion vector of the current block is obtained by adding a motion vector difference to one of a plurality of motion vector predictors,
wherein, under the merge mode, obtaining the motion vector of the current block comprises:
obtaining an initial motion vector of the current block based on a merge candidate selected from a plurality of merge candidates;
determining whether to refine the initial motion vector of the current block or not;
when it is determined to refine the initial motion vector, obtaining a difference vector for refining the initial motion vector of the current block; and
obtaining a refined motion vector of the current block by adding the difference vector to the initial motion vector,
wherein the merge candidate is selected from the plurality of merge candidates based on first index information parsed from a bitstream, the first index information indicating an index of the merge candidate,
wherein the difference vector is determined based on a difference value candidate selected from a plurality of difference value candidates,
wherein the difference value candidate is selected, from the plurality of difference value candidates, based on second index information parsed from the bitstream, the second index information indicating an index of the difference value candidate,
wherein the plurality of difference value candidates are pre-defined in the decoding apparatus, and
wherein refining the initial motion vector based on the difference value candidate is allowed only for the merge mode, but is not allowed for the motion vector prediction mode.
2 . The method according to claim 1 , wherein the method further comprises:
decoding candidate set information from the bitstream,
wherein, based on the candidate set information, one of a first candidate set or a second candidate set is selected, and
wherein the difference value candidate is selected from the plurality of difference vector candidates included in the selected one of the first candidate set or the second candidate set.
3 . A method of encoding a video, the method comprising:
obtaining a motion vector of a current block based on one of a plurality of inter modes pre-defined in an encoding apparatus, the inter modes including a motion vector prediction mode and a merge mode;
obtaining a prediction block of the current block based on the motion vector; and
obtaining a residual block of the current block by subtracting the prediction block from an original block,
wherein, under the motion vector prediction mode, a motion vector difference representing a difference between the motion vector and a motion vector predictor is encoded into a bitstream,
wherein, under the merge mode, obtaining the motion vector of the current block comprises:
obtaining an initial motion vector of the current block;
obtaining a difference vector for refining the initial motion vector of the current block; and
obtaining a refined motion vector of the current block by adding a difference vector to the initial motion vector,
wherein first index information is encoded, into the bitstream, to indicate an index of one of a plurality of merge candidates, the initial motion vector of the current block being determined based on the one of the plurality of merge candidates,
wherein second index information is encoded, into the bitstream, to indicate an index of one of a plurality of difference value candidates for determining the difference vector,
wherein the plurality of difference vector candidates are pre-defined in the encoding apparatus, and
wherein refining the initial motion vector based on the difference value candidate is allowed only for the merge mode, but is not allowed for the motion vector prediction mode.
4 . The method according to claim 3 ,
wherein the plurality of difference value candidates are included in one of a first candidate set or a second candidate set, and
wherein candidate set information, indicating one of the first candidate set or the second candidate set, is encoded into the bitstream.
5 . A device storing compressed video data which being generated with instructions, when the instructions being executed, a processor included in the device being configured to:
obtaining a motion vector of a current block based on one of a plurality of inter modes pre-defined in an encoding apparatus, the inter modes including a motion vector prediction mode and a merge mode;
obtaining a prediction block of the current block based on the motion vector; and
obtaining a residual block of the current block by subtracting the prediction block from an original block,
wherein, under the motion vector prediction mode, a motion vector difference representing a difference between the motion vector and a motion vector predictor is encoded into a bitstream,
wherein, under the merge mode, obtaining the motion vector of the current block comprises:
obtaining an initial motion vector of the current block;
obtaining a difference vector for refining the initial motion vector of the current block; and
obtaining a refined motion vector of the current block by adding a difference vector to the initial motion vector,
wherein first index information is encoded, into the bitstream, to indicate an index of one of a plurality of merge candidates, the initial motion vector of the current block being determined based on the one of the plurality of merge candidates,
wherein second index information is encoded, into the bitstream, to indicate an index of one of a plurality of difference value candidates for determining the difference vector,
wherein the plurality of difference vector candidates are pre-defined in the encoding apparatus, and
wherein refining the initial motion vector based on the difference value candidate is allowed only for the merge mode, but is not allowed for the motion vector prediction mode.