1. An image decoding method comprising: obtaining variables for weighted prediction, including at least one multiplied value (W) and at least one additive value (O), wherein the additive value is obtained according to a bit depth of a pixel, when the weighted prediction is applied to a block; and obtaining a predicted pixel value of the block using the weighted prediction based on the variables, wherein the additive value is obtained based on a value of 2 (N-M) , where N represents the bit depth of the pixel and M represents a constant, and the additive value being added to a result of a multiplication operation using the at least one multiplied value.