Method and apparatus for encoding/decoding image
Disclosed herein are an image encoding method and an image decoding method. The image decoding method includes determining an initial motion vector of a current block using a motion vector of a reconstructed region, searching for the motion vector of the current block based on the initial motion vector, and generating a prediction sample of the current block using the motion vector. The initial motion vector includes a motion vector in a past direction and a motion vector in a future direction.
1. An image decoding method comprising:
determining initial motion vectors of a current block using motion vectors of a reconstructed region;
searching for the motion vectors of the current block based on the initial motion vectors; and
generating a prediction sample of the current block using the searched motion vectors,
wherein the initial motion vectors comprise a motion vector in a past direction and a motion vector in a future direction, and
wherein the searched motion vectors are stored to derive motion vectors of a block decoded after the current block.
2. The image decoding method of claim 1 , wherein the searching of the motion vectors comprises searching for the motion vectors using a difference between a prediction block in a past direction indicated by the motion vector in the past direction and a prediction block in a future direction indicated by the motion vector in the future direction.
3. The image decoding method of claim 2 , wherein the searching of the motion vectors comprises searching for the motion vectors based on prediction error generated by applying a difference between the prediction block in the past direction and the prediction block in the future direction to a sum of absolute difference (SAD) calculation method.
4. The image decoding method of claim 1 , wherein the searching of the motion vectors comprises searching for the motion vectors in a search region having a predefined size.
5. The image decoding method of claim 1 , wherein the motion vectors of the reconstructed region are candidate motion information of a merge mode.
6. The image decoding method of claim 5 , wherein the candidate motion information of the merge mode comprises at least one of motion information of spatial candidate blocks of the current block and motion information of a temporal candidate block.
7. The image decoding method of claim 1 , further comprising decoding decoder-side motion vector derivation (DMVD) mode operation information,
wherein, when the DMVD mode operation information indicates DMVD mode operation, the motion vectors of the current block are searched based on the initial motion vectors.
8. An image encoding method comprising:
determining initial motion vectors of a current block using motion vectors of a reconstructed region;
searching for optimal motion vectors of the current block based on the initial motion vectors; and
generating a prediction sample of the current block using the optimal motion vectors,
wherein the initial motion vectors comprise a motion vector in a past direction and a motion vector in a future direction, and
wherein the optimal motion vectors are stored to derive motion vectors of a block encoded after the current block.
9. The image encoding method of claim 8 , wherein the searching of the optimal motion vectors comprises searching for the optimal motion vectors using a difference between a prediction block in a past direction indicated by the motion vector in the past direction and a prediction block in a future direction indicated by the motion vector in the future direction.
10. The image encoding method of claim 9 , wherein the searching of the optimal motion vectors comprises searching for the optimal motion vector based on prediction error generated by applying a difference between the prediction block in the past direction and the prediction block in the future direction to a sum of absolute difference (SAD) calculation method.
11. The image encoding method of claim 8 , wherein the searching of the optimal motion vectors comprises searching for the optimal motion vectors in a search region having a predefined size.
12. The image encoding method of claim 8 , wherein the motion vectors of the reconstructed region are candidate motion information of a merge mode.
13. The image encoding method of claim 12 , wherein the candidate motion information of the merge mode comprises at least one of motion information of spatial candidate blocks of the current block and motion information of a temporal candidate block.
14. A non-transitory computer-readable recording medium including a bitstream generated by an image encoding method, the method comprising:
determining initial motion vectors of a current block using motion vectors of a reconstructed region;
searching for optimal motion vectors of the current block based on the initial motion vectors; and
generating a prediction sample of the current block using the optimal motion vectors,
wherein the initial motion vectors comprise a motion vector in a past direction and a motion vector in a future direction, and
wherein the optimal motion vectors are stored to derive a motion vectors of a block encoded after the current block.