Image encoding/decoding method and device
The image encoding/decoding method and device according to the present invention can construct a merge candidate list of a current block, derive motion information of the current block on the basis of the merge candidate list and a merge index of the current block, derive a motion vector difference of the current block, correct a motion vector of the current block by means of the motion vector difference, and carry out motion compensation on the current block by means of the corrected motion vector.
1. A decoding method of an image, the method comprising:
deriving motion information of a current block based on a merge index and a merge candidate list of the current block, wherein the motion information includes at least one of a motion vector or a reference picture index, and wherein the merge candidate list includes at least one merge candidate; and
performing inter prediction of the current block based on the motion information of the current block,
wherein a maximum number of merge candidates available for the current block is adaptively determined based on a first flag indicating whether to use a motion vector difference value for inter prediction of the current block,
wherein the motion vector of the current block is modified with the motion vector difference value based on the first flag indicating that the motion vector difference value is used for the inter prediction of the current block,
wherein the motion vector difference value is derived based on a merge offset vector,
wherein the merge offset vector is determined based on a length candidate and a direction candidate,
wherein the length candidate is determined based on a first index specifying one of a plurality of length candidates, and the direction candidate is determined based on a second index specifying one of a plurality of direction candidates,
wherein a range of the length candidates is determined differently based on a second flag indicating whether only integer sample precision is used, and
wherein the second flag equal to a first value indicates that only the integer sample precision is used, and the second flag equal to a second value indicates that either fractional or integer sample precision is used.
2. The method of claim 1 , wherein the merge candidate list includes at least one of a spatial merge candidate or a temporal merge candidate of the current block,
wherein motion information of a previous block belonging to a motion information list of the current block is added to the merge candidate list, and
wherein the previous block is one or more blocks which are decoded before the current block.
3. The method of claim 1 , wherein the direction candidates include a left, right, top and bottom direction.
4. The method of claim 1 , wherein the motion vector difference value is derived by applying a predetermined scaling factor to the merge offset vector, and
wherein the scaling factor is determined based on a POC difference between a current picture to which the current block belongs and a reference picture of the current block.
5. An encoding method of an image, the method comprising:
determining motion information of a current block based on a merge candidate list, wherein the motion information includes at least one of a motion vector or a reference picture index, wherein a merge index for specifying the motion information of the current block is encoded into a bitstream, and wherein the merge candidate list includes at least one merge candidate; and
performing inter prediction of the current block based on the motion information of the current block,
wherein a maximum number of merge candidates available for the current block is adaptively determined based on whether to use a motion vector difference value for inter prediction of the current block,
wherein the motion vector of the current block is modified with the motion vector difference value based on a determination that the motion vector difference value is used for the inter prediction of the current block,
wherein the motion vector difference value is determined based on a merge offset vector,
wherein the merge offset vector is determined based on a length candidate and a direction candidate,
wherein a first index specifying the length candidate among a plurality of length candidates and a second index specifying the direction candidate among a plurality of direction candidates are encoded into the bitstream,
wherein a range of the length candidates is determined differently based on a flag indicating whether only integer sample precision is used, and
wherein the flag equal to a first value indicates that only the integer sample precision is used, and the flag equal to a second value indicates that either fractional or integer sample precision is used.
6. A method of transmitting a bitstream, the method comprising:
generating the bitstream based on determining motion information of a current block based on a merge candidate list, wherein the motion information includes at least one of a motion vector or a reference picture index, wherein a merge index for specifying the motion information of the current block is encoded into the bitstream, and wherein the merge candidate list includes at least one merge candidate;
performing inter prediction of the current block based on the motion information of the current block; and
transmitting the bitstream,
wherein a maximum number of merge candidates available for the current block is adaptively determined based on whether to use a motion vector difference value for inter prediction of the current block,
wherein the motion vector of the current block is modified with the motion vector difference value based on a determination that the motion vector difference value is used for the inter prediction of the current block,
wherein the motion vector difference value is determined based on a merge offset vector,
wherein the merge offset vector is determined based on a length candidate and a direction candidate,
wherein a first index specifying the length candidate among a plurality of length candidates and a second index specifying the direction candidate among a plurality of direction candidates are encoded into the bitstream,
wherein a range of the length candidates is determined differently based on a flag indicating whether only integer sample precision is used, and
wherein the flag equal to a first value indicates that only the integer sample precision is used, and the flag equal to a second value indicates that either fractional or integer sample precision is used.