Method for encoding/decoding video signal, and apparatus therefor
A method for decoding a video, according to the present invention, may comprise the steps of: parsing a first flag indicating whether inter prediction on the basis of a merge mode is applied to a current block; if the first flag is true, parsing a second flag indicating whether a regular merge mode or a merge offset encoding mode is applied to the current block; and if the second flag is true, parsing a third flag indicating whether the merge offset encoding mode is applied to the current block.
1. A method of decoding a video, the method comprising:
obtaining one or more spatial merge candidates of a current block;
obtaining a temporal merge candidate of the current block;
generating a merge candidate list of the current block by adding the spatial and temporal merge candidates thereto;
obtaining motion information of the current block from one among merge candidates included in the merge candidate list;
obtaining a prediction sample of the current block based on the motion information of the current block; and
determining, based on a position of the current block, whether to update a motion information table with the motion information of the current block,
wherein when the current block is included in a pre-determined region, the motion information table is updated with the motion information of the current block only when the current block is located on bottom-right of the pre-determined region, and
wherein when a number of the spatial and temporal merge candidates included in the merge candidate list is less than a threshold value, a motion information candidate included in the motion information table is added to the merge candidate list as a merge candidate.
2. The method of claim 1 , wherein information for determining a size of the pre-determined region is signaled via a bitstream.
3. The method of claim 1 , wherein when the current block is included in the pre-determined region, the motion information table is not updated with motion information of a previous block that is included in the same region as the current block.
4. The method of claim 1 , wherein the method further comprises performing a redundancy check for the motion information candidate included in the motion information table, and
wherein the redundancy check for the motion information candidate is performed with a merge candidate that is derived from a top neighboring block or a left neighboring block.
5. A method of encoding a video, the method comprising:
obtaining one or more spatial merge candidates of a current block;
obtaining a temporal merge candidate of the current block;
generating a merge candidate list of the current block by adding the spatial and temporal merge candidates thereto;
obtaining motion information of the current block from one among merge candidates included in the merge candidate list;
obtaining a prediction sample of the current block based on the motion information of the current block;
determining, based on a position of the current block, whether to update a motion information table with the motion information of the current block,
wherein when the current block is included in a pre-determined region, the motion information table is updated with the motion information of the current block only when the current block is located on bottom-right of the pre-determined region; and
generating a bitstream representing the video based on the prediction sample,
wherein when a number of the spatial and temporal merge candidates included in the merge candidate list is less than a threshold value, a motion information candidate included in the motion information table is added to the merge candidate list as a merge candidate.
6. The method of claim 5 , wherein information for determining a size of the pre-determined region is encoded into the bitstream.
7. The method of claim 5 , wherein when the current block is included in pre-determined region, the motion information table is not updated with motion information of a previous block that is included in the same region as the current block.
8. The method of claim 5 , wherein the method further comprises performing a redundancy check for the motion information candidate included in the motion information table, and
wherein the redundancy check for the motion information candidate is performed with a merge candidate that is derived from a top neighboring block or a left neighboring block.
9. A non-transitory computer-readable medium for storing data associated with a video signal, comprising:
a data stream stored in the non-transitory computer-readable medium, the data stream being encoded by an encoding method comprising:
obtaining one or more spatial merge candidates of a current block;
obtaining a temporal merge candidate of the current block;
generating a merge candidate list of the current block by adding the spatial and temporal merge candidates thereto;
obtaining motion information of the current block from one among merge candidates included in the merge candidate list;
obtaining a prediction sample of the current block based on the motion information of the current block; and
determining, based on a position of the current block, whether to update a motion information table with the motion information of the current block,
wherein when the current block is included in a pre-determined region, the motion information table is updated with the motion information of the current block only when the current block is located on bottom-right of the pre-determined region,
wherein when a number of the spatial and temporal merge candidates included in the merge candidate list is less than a threshold value, a motion information candidate included in the motion information table is added to the merge candidate list as a merge candidate.