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 both 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; and
deriving a reconstruction block of a current block using the prediction block of the current block,
wherein the weighted sum of the first reference block and the second reference block is calculated by applying a first weight and a second weight to each of the first reference block and the second reference block,
wherein the second weight is determined by one of weight candidates belonging to a predefined weight candidate set,
wherein the method further comprises obtaining weight information of the current block from a bitstream,
wherein the weight information is index information for specifying the second 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 first weight is determined based on the second weight.
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; and
encoding weight information,
wherein the weighted sum of the first reference block and the second reference block is calculated by applying a first weight and a second weight to each of the first reference block and the second reference block,
wherein the second weight is determined by one of weight candidates belonging to a predefined weight candidate set,
wherein the weight information is index for specifying the second weight in the weight candidate set, and the index is encoded based on a truncated rice binarization method, and
wherein the first weight is determined based on the second weight.
3. A non-transitory computer readable recording medium comprising a bitstream,
the bitstream comprising:
information for deriving a first reference block and a second reference block; and
weight information for deriving a prediction block of a current block,
wherein the prediction block of the current block is derived based on a weighted sum calculated by applying a first weight value and a second weight value to the first reference block and the second reference block, respectively,
wherein the weight information is index information for specifying the second weight among weight candidates belonging to a predefined weight candidate set,
wherein the weight information is encoded based on a truncated rice binarization method, and
wherein the first weight is determined based on the second weight.