An electronic apparatus, comprising a decoder module configured to: decode a first denominator for a luma weighting factor of a target image from encoded data; derive a first reference value of the luma weighting factor according to the first denominator, wherein the first reference value is equal to a value obtained by a left shift of "1" by at least one binary digit, the number of binary digits being specified by the first denominator; decode a first difference value of the luma weighting factor from the encoded data, wherein the first difference value is equal to a value of a difference between the luma weighting factor and the first reference value, wherein the first difference value is in a fixed range of -128 to +127 regardless of the first denominator; derive the luma weighting factor by adding the first reference value and the first difference value, wherein the luma weighting factor is in a range of (the first reference value - 128) to (the first reference value + 127); derive a second reference value of a chroma offset of the target image by subtracting a value obtained by both multiplying a median value of a maximum pixel value by a chroma weighting factor and shifting to the right for a number of binary digits specified by a second denominator for the chroma weighting factor, from the median value; decode a second difference value of the chroma offset from the encoded data, wherein the second difference value is equal to a value of a difference between the chroma offset and the second reference value; derive the chroma offset by adding the second reference value and the second difference value; decode a luma offset of the target image from the encoded data; derive a predicted luma value by using at least multiplication of a luma component of a reference image by the luma weighting factor, right shift by the number of binary digits specified by the first denominator, and addition of the luma offset; and derive a predicted chroma value by using at least multiplication of a chroma component of the reference image by the chroma weighting factor, right shift by the number of binary digits specified by the second denominator, and addition of the chroma offset, wherein the weighting factors are used for making a motion-compensated prediction of a change in a pixel value. decode a first denominator for a luma weighting factor of a target image from encoded data; derive a first reference value of the luma weighting factor according to the first denominator, wherein the first reference value is equal to a value obtained by a left shift of "1" by at least one binary digit, the number of binary digits being specified by the first denominator; decode a first difference value of the luma weighting factor from the encoded data, wherein the first difference value is equal to a value of a difference between the luma weighting factor and the first reference value, wherein the first difference value is in a fixed range of -128 to +127 regardless of the first denominator; derive the luma weighting factor by adding the first reference value and the first difference value, wherein the luma weighting factor is in a range of (the first reference value - 128) to (the first reference value + 127); derive a second reference value of a chroma offset of the target image by subtracting a value obtained by both multiplying a median value of a maximum pixel value by a chroma weighting factor and shifting to the right for a number of binary digits specified by a second denominator for the chroma weighting factor, from the median value; decode a second difference value of the chroma offset from the encoded data, wherein the second difference value is equal to a value of a difference between the chroma offset and the second reference value; derive the chroma offset by adding the second reference value and the second difference value; decode a luma offset of the target image from the encoded data; derive a predicted luma value by using at least multiplication of a luma component of a reference image by the luma weighting factor, right shift by the number of binary digits specified by the first denominator, and addition of the luma offset; and derive a predicted chroma value by using at least multiplication of a chroma component of the reference image by the chroma weighting factor, right shift by the number of binary digits specified by the second denominator, and addition of the chroma offset,