Inter prediction method based on history-based motion vector, and device therefor
An image decoding method according to the present disclosure includes deriving a history-based motion vector prediction (HMVP) buffer for a current block, deriving motion information of the current block based on an HMVP candidate included in the HMVP buffer, generating prediction samples for the current block based on the motion information, and generating reconstructed samples based on the prediction samples, and the HMVP buffer is initialized when processing a first-ordered CTU in a CTU row in which a current CTU is located, and the current block is included in the current CTU.
1 . An image decoding method performed by a decoding apparatus, the method comprising:
deriving a history-based motion vector prediction (HMVP) candidate list for a current block;
configuring a motion vector predictor (MVP) candidate list for the current block based on an HMVP candidate comprised in the HMVP candidate list;
deriving motion information of the current block based on the MVP candidate list;
generating prediction samples for the current block based on the motion information; and
generating reconstructed samples based on the prediction samples,
wherein the current block corresponds to a coding unit (CU) which is split from a coding tree unit (CTU),
wherein the HMVP candidate list is initialized at a first-ordered CTU per each CTU row of a slice,
wherein the method further comprises determining whether the CTU is a first-ordered CTU in a CTU row of a current slice, and
wherein based on the result of the determining that the CTU is the first-ordered CTU in the CTU row of the current slice, the HMVP candidate list is initialized for the CTU.
2 . An image encoding method performed by an encoding apparatus, the method comprising:
deriving a history-based motion vector prediction (HMVP) candidate list for a current block;
configuring a motion vector predictor (MVP) candidate list for the current block based on an HMVP candidate comprised in the HMVP candidate list;
deriving motion information of the current block based on the MVP candidate list;
generating prediction samples for the current block based on the motion information;
deriving residual samples based on the prediction samples; and
encoding image information comprising information on the residual samples,
wherein the current block corresponds to a coding unit (CU) which is split from a coding tree unit (CTU),
wherein the HMVP candidate list is initialized at a first-ordered CTU per each CTU row of a slice,
wherein the method further comprises determining whether the CTU is a first-ordered CTU in a CTU row of a current slice, and
wherein based on the result of the determining that the CTU is the first-ordered CTU in the CTU row of the current slice, the HMVP candidate list is initialized for the CTU.
3 . A non-transitory computer readable digital storage medium storing a bitstream generated by a method, the method comprising:
deriving a history-based motion vector prediction (HMVP) candidate list for a current block;
configuring a motion vector predictor (MVP) candidate list for the current block based on an HMVP candidate comprised in the HMVP candidate list;
deriving motion information of the current block based on the MVP candidate list;
generating prediction samples for the current block based on the motion information;
deriving residual samples based on the prediction samples; and
encoding image information comprising information on the residual samples,
wherein the current block corresponds to a coding unit (CU) which is split from a coding tree unit (CTU),
wherein the HMVP candidate list is initialized at a first-ordered CTU per each CTU row of a slice,
wherein the method further comprises determining whether the CTU is a first-ordered CTU in a CTU row of a current slice, and
wherein based on the result of the determining that the CTU is the first-ordered CTU in the CTU row of the current slice, the HMVP candidate list is initialized for the CTU.
4 . The image decoding method of claim 1 , wherein deriving the HMVP) candidate list for the current block and configuring the MVP candidate list for the current block based on an HMVP candidate comprised in the HMVP candidate list comprise deriving a HMVP buffer for the current block and deriving merge candidates for configuring a merge candidate list for the current block, wherein the merge candidates include spatial candidates derived based on spatial candidate blocks and a temporal candidate derived based on a temporal candidate block, wherein an HMVP candidate comprised in the HMVP buffer is inserted as a merge candidate of the merge candidate list, wherein the HMVP candidate is inserted after the temporal candidate in the merge candidate list, wherein the HMVP buffer is initialized at a first-ordered CTU per each CTU row of a slice, wherein the method further comprises determining whether the CTU is a first-ordered CTU in the CTU row of the current slice, and wherein based on the result of the determining that the CTU is the first-ordered CTU in the CTU row of the current slice, the HMVP buffer is initialized for the CTU.
5 . The image decoding method of claim 4 , wherein based on the HMVP buffer being initialized, the number of HMVP candidates comprised in the HMVP buffer is set to zero.
6 . The image decoding method of claim 4 , wherein based on a determination that the current CTU is the first-ordered CTU in the CTU row of the slice, the HMVP buffer comprises an HMVP candidate derived based on motion information of a block decoded earlier than the current block in the current CTU, and wherein based on a determination that the current CTU is not the first-ordered CTU in the CTU row of the slice, the HMVP buffer comprises an HMVP candidate derived based on motion information of a block decoded earlier than the current block in the current CTU and an HMVP candidate derived based on motion information of a block previously decoded in a previous CTU in the CTU row.
7 . The image decoding method of claim 4 , wherein whether the current CTU is the first-ordered CTU in the CTU row of the slice is determined based on the following equation: ctu_jdx % Num where the ctu_idx refers to an index of the current CTU, the % refers to modulus operator, and the Num refers to the number of CTUs in the CTU row.
8 . The image decoding method of claim 1 , further comprising obtaining image information including merge index information from a bitstream.
9 . The image encoding method of claim 2 , wherein deriving the HMVP candidate list for the current block and configuring the MVP candidate list for the current block based on the HMVP candidate comprised in the HMVP candidate list comprise deriving a HMVP buffer for the current block; and deriving merge candidates for configuring a merge candidate list for the current block, wherein the merge candidates includes spatial candidates derived based on spatial candidate blocks and a temporal candidate derived based on a temporal candidate block, wherein an HMVP candidate comprised in the HMVP buffer is inserted as a merge candidate of the merge candidate list, wherein the HMVP candidate is inserted after the temporal candidate in the merge candidate, wherein the HMVP buffer is initialized at the first-ordered CTU per each CTU row of the slice, wherein the method further comprises determining whether the CTU is the first-ordered CTU in the CTU row of the current slice, and wherein based on the result of the determining that the CTU is the first-ordered CTU in the CTU row of the current slice, the HMVP buffer is initialized for the CTU list.
10 . The image encoding method of claim 9 , wherein based on the HMVP buffer being initialized, the number of HMVP candidates comprised in the HMVP buffer is set to zero.
11 . The image encoding method of claim 9 , wherein based on a determined that the current CTU is the first-ordered CTU in the CTU row of the slice, the HMVP buffer comprises an HMVP candidate derived based on motion information of a block encoded earlier than the current block in the current CTU, and wherein based on a determined that the current CTU is not the first-ordered CTU in the CTU row of the slice, the HMVP buffer comprises an HMVP candidate derived based on motion information of a block encoded earlier than the current block in the current CTU and an HMVP candidate derived based on motion information of a block previously encoded in a previous CTU in the CTU row.
12 . The image encoding method of claim 9 , whether the current CTU is the first-ordered CTU in the CTU row of the slice is determined based on the following equation: ctu_jdx % Num where the ctu_idx refers to an index of the current CTU, the % refers to modulus operator, and the Num refers to the number of CTUs in the CTU row.
13 . The non-transitory computer readable digital storage medium of claim 3 , wherein deriving a history-based motion vector prediction (HMVP) candidate list for a current block; and configuring the motion vector predictor (MVP) candidate list for the current block based on an HMVP candidate comprised in the HMVP candidate list comprise deriving a HMVP buffer for the current block; and deriving merge candidates for configuring a merge candidate list for the current block, wherein the merge candidates includes spatial candidates derived based on spatial candidate blocks and a temporal candidate derived based on a temporal candidate block, wherein an HMVP candidate comprised in the HMVP buffer is inserted as a merge candidate of the merge candidate list, wherein the HMVP candidate is inserted after the temporal candidate in the merge candidate list, the HMVP buffer is initialized at the first-ordered CTU per each CTU row of the slice, wherein the method further comprises determining whether the CTU is the first-ordered CTU in the CTU row of the current slice, and wherein based on the result of the determining that the CTU is the first-ordered CTU in the CTU row of the current slice, the HMVP buffer is initialized for the CTU.
14 . The non-transitory computer-readable storage medium of claim 13 , wherein based on the HMVP buffer being initialized, the number of HMVP candidates comprised in the HMVP buffer is set to zero.
15 . The non-transitory computer-readable storage medium of claim 13 , wherein based on a determination that the current CTU is the first-ordered CTU in the CTU row of the slice, the HMVP buffer comprises an HMVP candidate derived based on motion information of a block encoded earlier than the current block in the current CTU, and wherein based on a determination that the current CTU is not the first-ordered CTU in the CTU row of the slice, the HMVP buffer comprises an HMVP candidate derived based on motion information of a block encoded earlier than the current block in the current CTU and an HMVP candidate derived based on motion information of a block previously encoded in a previous CTU in the CTU row.
16 . The non-transitory computer-readable storage medium of claim 13 , wherein whether the current CTU is the first-ordered CTU in the CTU row of the slice is determined based on the following equation:
ctu_jdx % Num where the ctu_idx refers to an index of the current CTU, the % refers to modulus operator, and the Num refers to the number of CTUs in the CTU row.