Patent ID: 8345748

Claim:
An image decoding method comprising: determining which of an intra mode, an inter mode, and a weighted prediction mode pixel value of a block of interest of a current image has been encoded in; when the determining indicates that the pixel value of the block of interest has been encoded in the weighted prediction mode, adaptively adjusting one or more existing weighting factors to be operated on, in a multiplication operation, pixel values of blocks of the current image having a pixel value close to the pixel value of the block of interest among blocks included in a restored previous image, according to a number of bits used to express a pixel of the current image using the following equations: W 1 ′=W 1 W 2 ′=W 2 O 1 ′=O 1 ·2 (N-M) O 2 ′=O 2 ·2 (N-M) where W 1 ′ and W 2 ′ represent a first weighting factor after the adjustment to be used in the multiplication operation, W 1 and W 2 represent the first weighting factor before the adjustment, and O 1 ′, and O 2 ′ represent a second weighting factor after the adjustment to be added to the result of the multiplication operation, O 1 and O 2 represent a second weighting factor before the adjustment, N represents the number of bits, and M represents a constant; and restoring the predicted pixel value of the block of interest, using the one or more adjusted weighting factors.