Method and apparatus for image encoding/decoding
The present invention provides a method and apparatus for encoding/decoding an image to enhance inter prediction. According to the present invention, the method includes: determining a first reference picture and a second reference picture of a current block; determining both a first reference block in the first reference picture and a second reference block in the second reference picture; partitioning the current block into a plurality of sub blocks; and obtaining a prediction block of each of the sub blocks on the basis of reference candidate block index information of each of the sub blocks.
1 . A method for decoding an image, the method comprising:
determining a first reference block and a second reference block;
obtaining weight information from a bitstream;
deriving a prediction block of a current block based on the weight information, the first reference block and the second reference block;
obtaining a residual block of the current block; and
deriving a reconstruction block of the current block based on the prediction block and the residual block,
wherein the prediction block is calculated by respectively applying a first weight and a second weight to one and the other of the first reference block and the second reference block,
wherein the first weight is determined as one of weight candidates belonging to a predefined weight candidate set, the second weight is determined based on the first weight, and the weight information is index information for specifying the first weight in the weight candidate set,
wherein the weight information is obtained from the bitstream based on a truncated rice binarization method, and
wherein the predefined weight candidate set includes a weight candidate having a positive sign and a weight candidate having a negative sign.
2 . A method for encoding an image, the method comprising:
determining a first reference block and a second reference block;
deriving a prediction block of a current block based on a weighted sum of the first reference block and the second reference block;
generating a residual block of the current block based on the prediction block; and
encoding weight information,
wherein the weighted sum is calculated by respectively applying a first weight and a second weight to one and the other of the first reference block and the second reference block,
wherein the first weight is determined as one of weight candidates belonging to a predefined weight candidate set, and the second weight is determined based on the first weight,
wherein the weight information includes index for specifying the first weight in the weight candidate set,
wherein the index is encoded based on a truncated rice binarization method, and
wherein the predefined weight candidate set includes a weight candidate having a positive sign and a weight candidate having a negative sign.
3 . A method for storing a bitstream associated with video data, the method comprising:
generating the bitstream comprising information for deriving a first reference block and a second reference block, information for obtaining a residual block of a current block, and weight information for deriving a prediction block of the current block, and
storing the bitstream in a non-transitory computer-readable medium,
wherein the prediction block is derived based on a weighted sum calculated by respectively applying a first weight value and a second weight value to one and the other of the first reference block and the second reference block,
wherein the first weight is determined as one of weight candidates belonging to a predefined weight candidate set, the second weight is determined based on the first weight, and the weight information includes index information for specifying the first weight in the predefined weight candidate set,
wherein the weight information is encoded based on a truncated rice binarization method, and
wherein the predefined weight candidate set includes a weight candidate having a positive sign and a weight candidate having a negative sign.