Image encoding/decoding method and device, and recording medium in which bitstream is stored
The present invention is about an image encoding/decoding method and apparatus. According to present invention, a method of decoding an image, the method comprising, deriving an initial motion vector of a current block; deriving a refined motion vector by using the initial motion vector; and generating a prediction block of the current block by using the refined motion vector.
1. An image decoding method comprising:
determining a prediction mode of a current block to be a merge mode;
deriving an initial motion vector of the current block according to the merge mode;
deriving a refinement motion vector of the current block; and
deriving a final motion vector of the current block based on the initial motion vector and the refinement motion vector, and
wherein the initial motion vector comprises an L0 initial motion vector and an L1 initial motion vector, and the refinement motion vector comprises an L0 refinement motion vector and an L1 refinement motion vector, and
wherein in response to that a POC (picture order count) difference value between an L0 reference picture of the current block and a current picture including the current block is different from a POC difference value between an L1 reference picture of the current block and the current picture, one of the L0 refinement motion vector and the L1 refinement motion vector is derived by scaling the other.
2. The method according to claim 1 , further comprising acquiring information about the refinement motion vector, and
wherein the information about the refinement motion vector comprises at least one among motion vector refinement utilization information, initial motion vector flag information, refinement motion vector magnitude index information, refinement motion vector direction index information, and refinement motion vector precision information.
3. The method according to claim 2 , wherein a magnitude of the refinement motion vector is derived based on by performing shift operation to a value that is indicate by the refinement motion vector magnitude index information.
4. The method according to claim 3 , wherein a value indicated by the refinement motion vector magnitude index information is determine based on the refinement motion vector precision information.
5. The method according to claim 2 , wherein in response to that motion vector refinement is performed in the current block, a merge index of the current block is inferred to be equal to a value indicated by the initial motion vector flag information.
6. The method according to claim 1 , wherein the final motion vector is derived based on a sum of the initial motion vector and the refinement motion vector.
7. The method according to claim 1 , wherein the POC difference value between the L0 reference picture of the current block and the current picture is larger than the POC difference value between the L1 reference picture of the current block and the current picture.
8. The method according to claim 1 , wherein in response to that a POC difference value between an L0 reference picture of the current block and a current picture including the current block is different from a POC difference value between an L1 reference picture of the current block and the current picture, the L0 refinement motion vector is derived by scaling the L1 refinement motion vector.
9. The method according to claim 8 , wherein the POC difference value between the L0 reference picture of the current block and the current picture is less than the POC difference value between the L1 reference picture of the current block and the current picture.
10. An image encoding method comprising:
determining a prediction mode of a current block to be a merge mode;
deriving an initial motion vector of the current block according to the merge mode;
deriving a refinement motion vector of the current block; and
deriving a final motion vector of the current block based on the initial motion vector and the refinement motion vector, and
wherein the initial motion vector comprises an L0 initial motion vector and an L1 initial motion vector, and the refinement motion vector comprises an L0 refinement motion vector and an L1 refinement motion vector, and
wherein in response to that a POC (picture order count) difference value between an L0 reference picture of the current block and a current picture including the current block is different from a POC difference value between an L1 reference picture of the current block and the current picture, one of the L0 refinement motion vector and the L1 refinement motion vector is derived by scaling the other.
11. The method according to claim 10 , further comprising encoding information about the refinement motion vector, and
wherein the information about the refinement motion vector comprises at least one among motion vector refinement utilization information, initial motion vector flag information, refinement motion vector magnitude index information, refinement motion vector direction index information, and refinement motion vector precision information.
12. The method according to claim 10 , wherein the final motion vector is derived based on a sum of the initial motion vector and the refinement motion vector.
13. The method according to claim 10 , wherein the POC difference value between the L0 reference picture of the current block and the current picture is larger than the POC difference value between the L1 reference picture of the current block and the current picture.
14. The method according to claim 10 , wherein in response to that a POC difference value between an L0 reference picture of the current block and a current picture including the current block is different from a POC difference value between an L1 reference picture of the current block and the current picture, the L0 refinement motion vector is derived by scaling the L1 refinement motion vector.
15. The method according to claim 14 , wherein the POC difference value between the L0 reference picture of the current block and the current picture is less than the POC difference value between the L1 reference picture of the current block and the current picture.
16. A bitstream transmitting method, the method comprising:
generating a bitstream by encoding video data based on an image encoding method; and
transmitting the generated bitstream,
wherein the image encoding method comprising:
determining a prediction mode of a current block to be a merge mode;
deriving an initial motion vector of the current block according to the merge mode;
deriving a refinement motion vector of the current block; and
deriving a final motion vector of the current block based on the initial motion vector and the refinement motion vector, and
wherein the initial motion vector comprises an L0 initial motion vector and an L1 initial motion vector, and the refinement motion vector comprises an L0 refinement motion vector and an L1 refinement motion vector, and
wherein in response to that a POC (picture order count) difference value between an L0 reference picture of the current block and a current picture including the current block is different from a POC difference value between an L1 reference picture of the current block and the current picture, one of the L0 refinement motion vector and the L1 refinement motion vector is derived by scaling the other.