Video encoding/decoding method and device, and recording medium storing bit stream
Disclosed is an image encoding method. The method includes deriving a motion refinement candidate from among motion information of spatial neighboring blocks, motion information of a temporal neighboring blocks, predefined motion information, and motion information that most frequently occurs in a reference picture, performing a motion information refinement on the derived motion refinement candidate, and generating a prediction block of a current block by using the motion refinement candidate having undergone the motion information refinement.
1. An image decoding method, comprising:
generating a merge candidate list of a current block, the merge candidate list including at least one of a spatial merge candidate derived based on motion information of a spatial neighboring block, and a temporal merge candidate derived based on motion information of a temporal neighboring block;
selecting a merge candidate from the merge candidate list;
deriving a first initial motion vector and a second initial motion vector of the current block from the merge candidate;
obtaining a first refined motion vector and a second refined motion vector by performing motion information refinement; and
generating a prediction block of the current block using the first refined motion vector and the second refine motion vector,
wherein the motion information refinement is performed only when inter prediction for the current block is performed bi-directionally, and a direction of an L0 reference picture and a direction of an L1 reference picture are different from each other.
2. The method of claim 1 , wherein the first refined motion vector is obtained by refining the first initial motion vector, and the second refined motion vector is obtained by refining the second initial motion vector, and
wherein whether to refine the first initial motion vector and the second initial motion vector are determined by comparing a Sum of Difference (SAD) between a first prediction block specified by the first initial motion vector and a second prediction block specified by the second initial motion vector with a threshold value.
3. The method of claim 2 , wherein refining the first initial motion vector comprises:
determining an optimal integer position among a plurality of integer positions in a search range, and
determining an optimal fractional position around the optimal integer position.
4. The method of claim 3 , wherein a first motion vector difference representing a difference between the first refined motion vector and the first initial motion vector is constituted of an integer component corresponding to the optimal integer position and a fractional component corresponding to the optimal fractional position.
5. The method of claim 3 , wherein the optimal fractional position is determined based on a SAD on the optimal integer position, and a SAD on a neighboring integer position adjacent to the optimal integer position.
6. The method of claim 3 , wherein the optimal fractional position is searched only within the search range.
7. The method of claim 1 , wherein whether the motion information refinement is applied the current block or not is determined without decoding information indicating whether the motion information refinement is applied to the current block or not.
8. An image encoding method, comprising:
generating a merge candidate list of a current block, the merge candidate list including at least one of a spatial merge candidate derived based on motion information of a spatial neighboring block, and a temporal merge candidate derived based on motion information of a temporal neighboring block;
selecting a merge candidate from the merge candidate list;
deriving a first initial motion vector and a second initial motion vector of the current block from the merge candidate;
obtaining a first refined motion vector and a second refined motion vector by performing motion information refinement; and
generating a prediction block of the current block using the first refined motion vector and the second refined motion vector,
wherein the motion information refinement is performed only when inter prediction for the current block is performed bi-directionally, and direction of an L0 reference picture and a direction of an L1 reference picture are different from each other.
9. A non-transitory storage medium containing a bit stream generated through an image encoding method, the image encoding method comprising:
generating a merge candidate list of a current block, the merge candidate list including at least one of a spatial merge candidate derived based on motion information of a spatial neighboring block, and a temporal merge candidate derived based on motion information of a temporal neighboring block;
selecting a merge candidate from the merge candidate list;
deriving a first initial motion vector and a second initial motion vector of the current block from the merge candidate;
obtaining a first refined motion vector and a second refined motion vector by performing motion information refinement; and
generating a prediction block of the current block using the first refined motion vector and the second refined motion vector,
wherein the motion information refinement is performed only when inter prediction for the current block is performed bi-directionally, and a direction of an L0 reference picture and a direction of an L1 reference picture are different from each other.