Coding apparatus, decoding apparatus and computer-readable recording medium for encoding/decoding video data using syntax elements and weight coefficients
An apparatus that decodes (or codes) multiple syntax elements, including a first syntax element and a second syntax element, is provided. The first syntax element is associated with a picture parameter set and the second syntax element is associated with a slice header. The apparatus derives a weight coefficient according to the first and second syntax elements, and generates a prediction image using the weight coefficient.
1 . A video decoding apparatus comprising:
a parameter decoding circuit configured to:
decode a first syntax element, from a picture parameter set, indicating a value of a variable NumRefIdxActive[1] for B slices with a first flag equal to 0,
decode a second flag, from the picture parameter set, indicating whether or not a weighted prediction is applied to the B slices referring to the picture parameter set,
decode a third flag, from the picture parameter set, indicating whether weighted prediction information is present in a picture header or in a slice header,
decode the first flag, from the slice header, wherein the first flag equal to 0 specifies that a second syntax element is not present,
decode the second syntax element, from the slice header, used to derive the variable NumRefIdxActive[1],
decode a third syntax element, from a weighted prediction table, for deriving a weight coefficient,
decode a fourth syntax element, from the weighted prediction table, indicating a number of weights signaled for entries in a reference picture list 1, and
decode a fifth syntax element, from a reference picture list structure, indicating a number of entries in the reference picture list structure; and
a weighted prediction circuit configured to derive the weight coefficient and generate a prediction image by using the weight coefficient,
wherein the parameter decoding circuit sets the variable NumRefIdxActive[1] to be equal to a value of the second syntax element plus 1 in a case that a value of the first flag is equal to 1,
the parameter decoding circuit sets the variable NumRefIdxActive[1] to be equal to a value of the first syntax element plus 1 in a case that the value of the first flag is equal to 0 and a value of the fifth syntax element is greater than or equal to the value of the first syntax element plus 1,
the parameter decoding circuit sets the variable NumRefIdxActive[1] to be equal to the value of the fifth syntax element in a case that the value of the first flag is equal to 0 and the value of the fifth syntax element is less than the value of the first syntax element plus 1,
the weighted prediction circuit sets a variable NumWeightsL1 to be equal to 0 in a case that the second flag indicates that the weighted prediction is applied to the B slices, the third flag indicates that the weighted prediction information is present in the picture header, and the value of the fifth syntax element is equal to 0,
the weighted prediction circuit sets the variable NumWeightsL1 to be equal to a value of the fourth syntax element otherwise if the third flag indicates that the weighted prediction information is present in the picture header,
the weighted prediction circuit sets the variable Num WeightsL1 to be equal to a value of the variable NumRefIdxActive[1] else if the third flag indicates the weighted prediction information is present in the slice header,
the parameter decoding circuit further decodes a sixth syntax element, from the weighted prediction table based on the variable NumWeightsL1, indicating a difference of the weight coefficient applied to a luma prediction value, and
the weighted prediction circuit derives the weight coefficient by using the third syntax element and the sixth syntax element.
2 . A video coding apparatus comprising:
a parameter coding circuit configured to:
code a first syntax element, into a picture parameter set, indicating a value of a variable NumRefIdxActive[1] for B slices with a first flag equal to 0,
code a second flag, into the picture parameter set, indicating whether or not a weighted prediction is applied to the B slices referring to the picture parameter set,
code a third flag, into the picture parameter set, indicating whether weighted prediction information is present in a picture header or in a slice header,
code the first flag, into the slice header, wherein the first flag equal to 0 specifies that a second syntax element is not present,
code the second syntax element, into the slice header, used to derive the variable NumRefIdxActive[1],
code a third syntax element, into a weighted prediction table, for deriving a weight coefficient,
code a fourth syntax element, into the weighted prediction table, indicating a number of weights signaled for entries in a reference picture list 1, and
code a fifth syntax element, into a reference picture list structure, indicating a number of entries in the reference picture list structure; and
a weighted prediction circuit configured to derive the weight coefficient and generate a prediction image by using the weight coefficient,
wherein the parameter coding circuit sets the variable NumRefIdxActive[1] to be equal to a value of the second syntax element plus 1 in a case that a value of the first flag is equal to 1,
the parameter coding circuit sets the variable NumRefIdxActive[1] to be equal to a value of the first syntax element plus 1 in a case that the value of the value of the first flag is equal to 0 and a value of the fifth syntax element is greater than or equal to the value of the first syntax element plus 1,
the parameter coding circuit sets the variable NumRefIdxActive[1] to be equal to the value of the fifth syntax element in a case that the value of the first flag is equal to 0 and the value of the fifth syntax element is less than the value of the first syntax element plus 1,
the weighted prediction circuit sets a variable NumWeightsL1 to be equal to 0 in a case that the second flag indicates that the weighted prediction is applied to the B slices, the third flag indicates that the weighted prediction information is present in the picture header, and the value of the fifth syntax element is equal to 0,
the weighted prediction circuit sets the variable NumWeightsL1 to be equal to a value of the fourth syntax element otherwise if the third flag indicates that the weighted prediction information is present in the picture header,
the weighted prediction circuit sets the variable Num WeightsL1 to be equal to a value of the variable NumRefIdxActive[1] else if the third flag indicates the weighted prediction information is present in the slice header,
the parameter coding circuit further codes a sixth syntax element, into the weighted prediction table based on the variable Num WeightsL1, indicating a difference of the weight coefficient applied to a luma prediction value, and
the weighted prediction circuit derives the weight coefficient by using the third syntax element and the sixth syntax element.
3 . A non-transitory computer-readable medium storing one or more instructions for causing an electronic device to decode a video, the one or more instructions, when executed by at least one processor of the electronic device, causing the electronic device to:
generate a picture parameter set, wherein the picture parameter set includes:
a first syntax element, wherein the first syntax element indicates a value of a variable NumRefIdxActive[1] for B slices with a first flag equal to 0,
a second flag, wherein the second flag indicates whether or not a weighted prediction is applied to the B slices referring to the picture parameter set, and
a third flag, wherein the third flag indicates whether weighted prediction information is present in a picture header or in a slice header,
generate the slice header, wherein the slice header includes:
the first flag, wherein the first flag equal to 0 specifies that a second syntax element is not present, and
the second syntax element, wherein the second syntax element is used to derive the variable NumRefIdxActive[1];
generate a weighted prediction table, wherein the weighted prediction table includes:
a third syntax element, wherein the third syntax element is used for deriving a weight coefficient,
a fourth syntax element, wherein the fourth syntax element indicates a number of weights signaled for entries in a reference picture list 1, and
a sixth syntax element, wherein the sixth syntax element is a syntax element based on a variable NumWeightsL1, and that indicates a difference of the weight coefficient applied to a luma prediction value,
generate a reference picture list structure, wherein the reference picture list structure includes a fifth syntax element, wherein the fifth syntax element indicates a number of entries in the reference picture list structure;
derive the weight coefficient by using the third syntax element and the sixth syntax element; and
generate a prediction image by using the weight coefficient, wherein
the variable NumRefIdxActive[1] is set to be equal to a value of the second third syntax element plus 1 in a case that a value of the first flag is equal to 1,
the variable NumRefIdxActive[1] is set to be equal to a value of the first syntax element plus 1 in a case that the value of the first flag is equal to 0 and a value of the fifth second syntax element is greater than or equal to the value of the first syntax element plus 1,
the variable NumRefIdxActive[1] is set to be equal to the value of the fifth syntax element in a case that the value of the first flag is equal to 0 and the value of the fifth syntax element is less than the value of the first syntax element plus 1,
the variable NumWeightsL1 is set to be equal to 0 in a case that the second flag indicates that the weighted prediction is applied to the B slices, the third flag indicates that the weighted prediction information is present in the picture header, and the value of the fifth syntax element is equal to 0,
the variable NumWeightsL1 is set to be equal to a value of the fourth syntax element otherwise if the third flag indicates that the weighted prediction information is present in the picture header, and
the variable NumWeightsL1 is set to be equal to a value of the variable NumRefIdxActive[1] else if the third flag indicates the weighted prediction information is present in the slice header.