Method and apparatus for video coding
Aspects of the disclosure provide methods and apparatuses for video coding. In some examples, an apparatus includes processing circuitry. The processing circuitry obtains prediction information of a first block in a picture and generates reconstructed samples of the first block according to one of bi-directional prediction and uni-directional prediction and the prediction information. When a motion information candidate is to be stored according to the prediction information of the first block as a History-based Motion Vector Prediction (HMVP) candidate, the processing circuitry stores the motion information candidate that includes at least first motion information and a first weight parameter indicating a first weight for performing the bi-directional prediction for the first block when the first block is coded according to the bi-directional prediction, and stores the first motion information and a default weight parameter indicating a default weight when the first block is coded according to the uni-directional prediction.
1. A method for video decoding in a decoder, comprising:
obtaining prediction information of a first block in a picture from a coded video bitstream;
generating reconstructed samples of the first block for output according to the prediction information and one of bi-directional prediction and uni-directional prediction;
when the prediction information of the first block is determined to be used to add a History-based Motion Vector Prediction (HMVP) candidate in an HMVP list,
storing motion information and a first bi-prediction weight index in the HMVP candidate,
the stored first bi-prediction weight index indicating bi-prediction weights used for performing the bi-directional prediction for the first block when the first block is coded according to the bi-directional prediction, and
the stored first bi-prediction weight index having a default value when the first block is coded according to the uni-directional prediction, the default value indicating equal bi-prediction weights; and
generating reconstructed samples of a second block in the picture for output, including:
when the second block is determined to be decoded based on the HMVP candidate that includes the first bi-prediction weight index, the motion information from the HMVP candidate is stored as a merge candidate, and the second block is coded according to the bi-directional prediction,
setting a second bi-prediction weight index to the first bi-prediction weight index.
2. The method of claim 1 , wherein the generating the reconstructed samples of the second block comprises:
when the second block in the picture is determined to be decoded based on another motion information stored in a candidate that is neither a regular spatial merge candidate nor from the HMVP list, and the second block is coded according to the bi-directional prediction,
setting the second bi-prediction weight index for the second block to the default value.
3. The method of claim 1 , wherein the generating the reconstructed samples of the second block comprises:
when the first block is in a Coding Tree Unit (CTU) row different from that of a current CTU in which the second block is included, the second block in the picture is determined to be decoded based on another motion information stored in a regular merge candidate or an affine merge candidate, and the second block is coded according to the bi-directional prediction,
setting the second bi-prediction weight index for the second block to the default value.
4. The method of claim 1 , wherein the generating the reconstructed samples of the second block comprises:
when the first block is outside a current CTU in which the second block is included, the second block in the picture is determined to be decoded based on another motion information stored in a translational merge candidate or an inherited affine merge candidate, and the second block is coded according to the bi-directional prediction,
setting the second bi-prediction weight index for the second block to the default value.
5. The method of claim 1 , wherein
the first block is coded according to the one of the bi-directional prediction and the uni-directional prediction with the picture as a reference picture.
6. The method of claim 1 , wherein
the first block is coded according to the bi-directional prediction, and
both of a first weight applicable to a first reference picture in a first list and a second weight applicable to a second reference picture in a second list are positive when the first and second reference pictures correspond to different reference pictures.
7. The method of claim 1 , wherein
the first block is coded according to the bi-directional prediction, and
one of a first weight applicable to a first reference picture in a first list and a second weight applicable to a second reference picture in a second list is negative when the first and second reference pictures correspond to a same reference picture.
8. The method of claim 1 , wherein
the first block is coded according to the bi-directional prediction,
a first weight w 1 applicable to a first reference picture in a first list is determined according to
w
1
=
w
F
,
and
a second weight w 0 applicable to a second reference picture in a second list is determined according to
w 0 =1− w 1 ,
where w and F are integers, w represents a weight parameter indicated by the first bi-prediction weight index, and F represents a precision factor.
9. The method of claim 1 , wherein
the bi-prediction weights used for performing the bi-directional prediction for the first block are determined according to a weight parameter indicated by the first bi-prediction weight index and a precision factor F, and
the precision factor F is 8.
10. An apparatus, comprising:
processing circuitry configured to:
obtain prediction information of a first block in a picture from a coded video bitstream;
generate reconstructed samples of the first block for output according to the prediction information and one of bi-directional prediction and uni-directional prediction;
when the prediction information of the first block is determined to be used to add a History-based Motion Vector Prediction (HMVP) candidate in an HMVP list,
store motion information and a first bi-prediction weight index in the HMVP candidate,
the stored first bi-prediction weight index indicating bi-prediction weights used for performing the bi-directional prediction for the first block when the first block is coded according to the bi-directional prediction, and
the stored first bi-prediction weight index having a default value when the first block is coded according to the uni-directional prediction, the default value indicating equal bi-prediction weights; and
generate reconstructed samples of a second block in the picture for output, including the processing circuitry being configured to:
when the second block is determined to be decoded based on the HMVP candidate that includes the first bi-prediction weight index, the motion information from the HMVP candidate is stored as a merge candidate, and the second block is coded according to the bi-directional prediction,
set a second bi-prediction weight index to the first bi-prediction weight index.
11. The apparatus of claim 10 , wherein the processing circuitry is further configured to:
when the second block in the picture is determined to be decoded based on another motion information stored in a candidate that is neither a regular spatial merge candidate nor from the HMVP list, and the second block is coded according to the bi-directional prediction,
set the second bi-prediction weight index for the second block to the default value.
12. The apparatus of claim 10 , wherein the processing circuitry is further configured to:
when the first block is in a Coding Tree Unit (CTU) row different from that of a current CTU in which the second block is included, the second block in the picture is determined to be decoded based on another motion information stored in a regular merge candidate or an affine merge candidate, and the second block is coded according to the bi-directional prediction,
set the second bi-prediction weight index for the second block to the default value.
13. The apparatus of claim 10 , wherein the processing circuitry is further configured to:
when the first block is outside a current CTU in which the second block is included, the second block in the picture is determined to be decoded based on another motion information is-stored in a translational merge candidate or an inherited affine merge candidate, and the second block is coded according to the bi-directional prediction,
set the second bi-prediction weight index for the second block to the default value.
14. The apparatus of claim 10 , wherein
the first block is coded according to the bi-directional prediction,
a first weight w 1 applicable to a first reference picture in a first list is determined according to
w
1
=
w
F
,
and
a second weight w 0 applicable to a second reference picture in a second list is determined according to
w 0 =1− w 1 ,
where w and F are integers, w represents a weight parameter indicated by the first bi-prediction weight index, and F represents a precision factor.
15. The apparatus of claim 10 , wherein
the bi prediction weights used for performing the bi-directional prediction for the first block are determined according to a weight parameter indicated by the first bi-prediction weight index and a precision factor F, and
the precision factor F is 8.
16. A non-transitory computer-readable medium storing instructions which when executed by a computer for video decoding causes the computer to perform:
obtaining prediction information of a first block in a picture from a coded video bitstream;
generating reconstructed samples of the first block for output according to the prediction information and one of bi-directional prediction and uni-directional prediction;
when the prediction information of the first block is determined to be used to add a History-based Motion Vector Prediction (HMVP) candidate in an HMVP list,
storing motion information and a first bi-prediction weight index in the HMVP candidate,
the stored first bi-prediction weight index indicating bi-prediction weights used for performing the bi-directional prediction for the first block when the first block is coded according to the bi-directional prediction, and
the stored first bi-prediction weight index having a default value when the first block is coded according to the uni-directional prediction, the default value indicating equal bi-prediction weights; and
generating reconstructed samples of a second block in the picture for output, including:
when the second block in the picture is determined to be decoded based on HMVP candidate that includes the first bi-prediction weight index, the motion information from the HMVP candidate is stored as a merge candidate, and the second block is coded according to the bi-directional prediction,
setting a second bi-prediction weight index to the first bi-prediction weight index.
17. The method of claim 1 , wherein a prediction sample of the second block P bi-pred is generated according to
P bi-pred =((8− w )* P 0 +w*P 1 +4)>>3,
P 0 and P 1 being reference samples from reference pictures in list-0 and list-1, respectively, and
w being one of plural integer weights selected according to the second bi-prediction weight index.
18. The apparatus of claim 10 , wherein a prediction sample of the second block P bi-pred is generated according to
P bi-pred =((8− w )* P 0 +w*P 1 +4)>>3,
P 0 and P 1 being reference samples from reference pictures in list-0 and list-1, respectively, and
w being one of plural integer weights selected according to the second bi-prediction weight index.
19. The non-transitory computer-readable medium of claim 16 , wherein a prediction sample of the second block P bi-pred is generated according to
P bi-pred =((8− w )* P 0 +w*P 1 +4)>>3,
P 0 and P 1 being reference samples from reference pictures in list-0 and list-1, respectively, and
w being one of plural integer weights selected according to the second bi-prediction weight index.