Image/video coding method and device
A video decoding method performed by a video decoding device according to the present document comprises the steps of: parsing a flag pertaining to a weighted prediction from a bitstream; parsing the syntax of a prediction weighted table from the bitstream based on the flag; performing a weighted prediction for the current block in the current picture based on the prediction weighted table syntax to generate prediction samples for the current block; generating residual samples based on residual information acquired from the bitstream; and generating reconstructed samples for the current block based on the prediction samples and the residual samples, wherein the prediction weighted table syntax can be parsed from the picture header of the bitstream based on the value of the flag being 1, and can be parsed from the slice header of the bitstream based on the value of the flag being 0.
1. A decoding apparatus for an image decoding, the decoding apparatus comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
parse a flag related to weighted prediction from a bitstream;
parse a prediction weighted table syntax from the bitstream based on the flag;
generate prediction samples for a current block by performing weighted prediction on the current block in a current picture based on the prediction weighted table syntax;
generate residual samples based on residual information obtained from the bitstream; and
generate reconstructed samples for the current block based on the prediction samples and the residual samples,
wherein the prediction weighted table syntax is parsed from a picture header of the bitstream based on a value of the flag being 1,
wherein information on the weighted prediction comprised in the prediction weighted table syntax is applied to all slices in the current picture based on the value of the flag being 1, and
wherein the information on the weighted prediction comprised in the prediction weighted table syntax is applied to a slice associated with a slice header among the slices in the current picture based on the value of the flag being 0.
2. An encoding apparatus for an image encoding, the encoding apparatus comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
derive motion information on a current block;
perform weighted prediction on the current block based on the motion information;
generate prediction-related information on the current block based on the weighted prediction; and
encode image information comprising the prediction-related information,
wherein the prediction-related information comprises a flag related to the weighted prediction and a prediction weighted table syntax, and
wherein the prediction weighted table syntax is comprised in a picture header of the image information based on a value of the flag being 1,
wherein the value of the flag is determined as 1 based on information on the weighted prediction comprised in the prediction weighted table syntax being applied to all slices in a current picture comprising the current block, and
wherein the value of the flag is determined as 0 based on the information on the weighted prediction comprised in the prediction weighted table syntax being applied to a slice associated with a slice header among the slices in the current picture.
3. An apparatus for transmitting data for an image, the apparatus comprising:
at least one processor configured to obtain a bitstream generated based on deriving motion information on a current block, performing weighted prediction on the current block based on the motion information, generating prediction-related information on the current block based on the weighted prediction, and encoding image information comprising the prediction-related information; and
a transmitter configured to transmit the data comprising the bitstream,
wherein the prediction-related information comprises a flag related to the weighted prediction and a prediction weighted table syntax, and
wherein the prediction weighted table syntax is comprised in a picture header of the image information based on a value of the flag being 1,
wherein the value of the flag is determined as 1 based on information on the weighted prediction comprised in the prediction weighted table syntax being applied to all slices in a current picture comprising the current block, and
wherein the value of the flag is determined as 0 based on the information on the weighted prediction comprised in the prediction weighted table syntax being applied to a slice associated with a slice header among the slices in the current picture.