Method and apparatus of harmonizing weighted prediction with non-rectangular merge modes
A method of coding is described. The method can include obtaining a bitstream for a current picture, obtaining a value of a first indicator for the current picture according to the bitstream indicating a slice type, and obtaining a value of a second indicator for the current picture according to the bitstream indicating whether a weighted prediction parameter is present in a picture header or slice header of the bitstream. The method can also include parsing a value of the weighted prediction parameter for a current block of a current slice of the current picture from the bitstream. Furthermore, the method can include predicting the current block according to the value of the weighted prediction parameter.
1. A method of coding implemented by a decoding device, the method comprising:
obtaining a bitstream for a current picture;
obtaining a value of a first indicator for the current picture according to the bitstream, wherein the first indicator indicates a slice type;
obtaining a value of a second indicator for the current picture according to the bitstream, wherein the second indicator indicates whether a weighted prediction parameter is present in a picture header or is present in a slice header;
parsing a value of the weighted prediction parameter for a current block from the bitstream, when the value of the first indicator is equal to a first preset value and the value of the second indicator is equal to a second preset value, wherein the current block is comprised in a current slice of the current picture, the first preset value is a first integer value, and the second preset value is a second integer value; and
predicting the current block according to the value of the weighted prediction parameter.
2. The method of claim 1 , wherein the value of the first indicator is obtained according to a picture header comprised in the bitstream, or wherein the value of the second indicator is obtained according to a picture parameter set comprised in the bitstream, or wherein the value of the weighted prediction parameter is parsed from the picture header comprised in the bitstream.
3. The method of claim 1 , wherein the first preset value is 1 and the second preset value is 1.
4. The method of claim 1 , wherein the value of the first indicator being equal to the first preset value represents that a slice type of at least one slice comprised in the current picture is an inter slice.
5. The method of claim 4 , wherein the inter slice comprises a B slice or a P slice.
6. A decoder, comprising:
one or more processors; and
a non-transitory computer-readable storage medium coupled to the one or more processors and storing programming for execution by the one or more processors to cause the decoder to carry out operations comprising:
obtaining a bitstream for a current picture;
obtaining a value of a first indicator for the current picture according to the bitstream, wherein the first indicator indicates a slice type;
obtaining a value of a second indicator for the current picture according to the bitstream, wherein the second indicator indicates whether a weighted prediction parameter is present in a picture header or is present in a slice header;
parsing a value of the weighted prediction parameter for a current block from the bitstream, when the value of the first indicator is equal to a first preset value and the value of the second indicator is equal to a second preset value, wherein the current block is comprised in a current slice of the current picture, the first preset value is a first integer value, and the second preset value is a second integer value; and
predicting the current block according to the value of the weighted prediction parameter.
7. The decoder of claim 6 , wherein the value of the first indicator is obtained according to a picture header comprised in the bitstream, or wherein the value of the second indicator is obtained according to a picture parameter set comprised in the bitstream, or wherein the value of the weighted prediction parameter is parsed from the picture header comprised in the bitstream.
8. The decoder of claim 6 , wherein the first preset value is 1 and the second preset value is 1.
9. The decoder of claim 6 , wherein the value of the first indicator being equal to the first preset value represents that a slice type of at least one slice comprised in the current picture is an inter slice.
10. The decoder of claim 9 , wherein the inter slice comprises a B slice or a P slice.