Illumination compensation device, LM prediction device, image decoding device, image coding device
By either subsampling neighbor pixels and deriving an illumination variation parameter, or deriving one normalization shift value of two normalization shift values for normalizing parameters which are used when deriving the illumination variation parameter, with a dependency on the other normalization shift value, an amount of calculation for illumination compensation is reduced.
1. An illumination compensation device for an image of a target block comprising:
circuitry that obtains pixel values which include neighboring pixel values of the target block (neighboring target pixel values) and neighboring pixel values of a reference block (neighboring reference pixel values), and derives a parameter a and a parameter b; and
a filter obtains a prediction sample value and derives a product of the parameter a and the prediction sample value in the target block and adds the parameter b for outputting a filtered image of the target block, wherein
the circuitry that
1) derives a first parameter from a sum of the neighboring target pixel values, a sum of the neighboring reference pixel values, and a sum obtained by using products of the neighboring target pixel values and the neighboring reference pixel values,
2) derives a second parameter from the sum of the neighboring reference pixel values and a sum obtained by using squares of the neighboring reference pixel values,
3) derives a second normalization shift value from the second parameter,
4) derives a first normalization shift value by subtracting a predetermined value from the second normalization shift value,
5) derives a normalization first parameter by right-shifting the first parameter by using the first normalization shift value,
6) derives a normalization second parameter by right-shifting the second parameter by using the second normalization shift value,
7) derives the parameter a by multiplying the normalization first parameter by an inverse table value corresponding to the normalization second parameter, and
8) derives the parameter b by subtracting a value, which is obtained by multiplying the sum of the neighboring reference pixel values by the parameter a, from the sum of the neighboring target pixel values,
wherein the predetermined value is less than or equal to 14.