Image encoding/decoding method and device, and recording medium having bitstream stored thereon
The present invention relates to a method for encoding and decoding an image. The method for decoding an image includes: deriving an initial motion vector from a merge candidate list of a current block; deriving a refined motion vector using the initial motion vector; and generating a prediction block of the current block using the refined motion vector.
1. A method for decoding an image, the method comprising:
deriving a first prediction direction initial motion vector and a second prediction direction initial motion vector from a merge candidate list of a current block;
deriving, in units of a sub-block of the current block, a first prediction direction search area and a second prediction direction search area based on the first prediction direction initial motion vector and the second prediction direction initial motion vector, respectively; and
deriving, in units of a sub-block of the current block, a first prediction direction refined motion vector and a second prediction direction refined motion vector based on the first prediction direction search area and the second prediction direction search area,
wherein the first prediction direction is different from the second prediction direction,
wherein the first prediction direction search area is an area having square shape centered on a pixel position of a reference picture indicated by the first prediction direction initial motion vector and the second prediction direction search area is an area having square shape centered on a pixel position of a reference picture indicated by the second prediction direction initial motion vector.
2. The method of claim 1 , wherein the first prediction direction refined motion vector and the second prediction direction refined motion vector is derived based on a difference between a prediction block in the first prediction direction search area and a prediction block in the second prediction direction search area.
3. The method of claim 2 , wherein the difference is derived based on sum of absolute differences (SAD).
4. The method of claim 2 , wherein at least one of the prediction block in the first prediction direction search area and the prediction block in the second prediction direction search area is derived by applying a bi-linear filter.
5. The method of claim 1 , wherein the second prediction direction refined motion vector is derived based on the first prediction direction refined motion vector.
6. The method of claim 1 , when a candidate block of the merge candidate list is decoded using a refined motion vector, the merge candidate list does not include the refined motion vector of the candidate block.
7. The method of claim 1 , wherein the size of the sub-block of the current block is determined based on the size of the current block.
8. A method for encoding an image, the method comprising:
deriving a first prediction direction initial motion vector and a second prediction direction initial motion vector from a merge candidate list of a current block;
deriving, in units of a sub-block of the current block, a first prediction direction search area and a second prediction direction search area based on the first prediction direction initial motion vector and the second prediction direction initial motion vector, respectively; and
deriving, in units of a sub-block of the current block, a first prediction direction refined motion vector and a second prediction direction refined motion vector based on the first prediction direction search area and the second prediction direction search area,
wherein the first prediction direction is different from the second prediction direction,
wherein the first prediction direction search area is an area having square shape centered on a pixel position of a reference picture indicated by the first prediction direction initial motion vector and the second prediction direction search area is an area having square shape centered on a pixel position of a reference picture indicated by the second prediction direction initial motion vector.
9. A non-transitory computer-readable recording medium storing a bitstream encoded by a method for encoding an image, the method comprising:
deriving a first prediction direction initial motion vector and a second prediction direction initial motion vector from a merge candidate list of a current block;
deriving, in units of a sub-block of the current block, a first prediction direction search area and a second prediction direction search area based on the first prediction direction initial motion vector and the second prediction direction initial motion vector, respectively; and
deriving, in units of a sub-block of the current block, a first prediction direction refined motion vector and a second prediction direction refined motion vector based on the first prediction direction search area and the second prediction direction search area,
wherein the first prediction direction is different from the second prediction direction, wherein the first prediction direction search area is an area having square shape centered on a pixel position of a reference picture indicated by the first prediction direction initial motion vector and the second prediction direction search area is an area having square shape centered on a pixel position of a reference picture indicated by the second prediction direction initial motion vector.