A method for illumination compensation for inter prediction coding of a picture, comprising: obtaining inter-predicted sample values for a current block of the picture, using motion compensation; obtaining a first target luma value ( x A ) and a second target luma value ( x B ) of neighboring samples from a set L of neighboring samples of a reference block, said reference block being a reference block of the current block, wherein said set L comprises all or part of all neighboring samples of said reference block of the current block, and obtaining corresponding positions A of the sample having the first target luma value and B of the sample having the second target luma value relative to the position of the reference block; obtaining respective luma values of neighboring samples ( y A , y B ) of the current block at the obtained positions A and B relative to the position of the current block, wherein the relative positions of the neighboring samples of the reference block and the current block match; obtaining values of updating parameters as calculated values using only the first target luma value ( x A ) and the second target luma value (x B ) of the neighboring samples from the set L of neighboring samples of the reference block, and the respective luma values of the neighboring samples ( y A , y B ) of the current block; and updating the values of the inter-predicted samples based on the updating parameters; wherein the first target luma value ( x A ) and the second target luma value ( x B ) correspond to a minimum value ( x A ) and a maximum value (x B ) of neighboring samples of said reference block, respectively. obtaining inter-predicted sample values for a current block of the picture, using motion compensation; obtaining a first target luma value ( x A ) and a second target luma value ( x B ) of neighboring samples from a set L of neighboring samples of a reference block, said reference block being a reference block of the current block, wherein said set L comprises all or part of all neighboring samples of said reference block of the current block, and obtaining corresponding positions A of the sample having the first target luma value and B of the sample having the second target luma value relative to the position of the reference block; obtaining respective luma values of neighboring samples ( y A , y B ) of the current block at the obtained positions A and B relative to the position of the current block, wherein the relative positions of the neighboring samples of the reference block and the current block match; obtaining values of updating parameters as calculated values using only the first target luma value ( x A ) and the second target luma value (x B ) of the neighboring samples from the set L of neighboring samples of the reference block, and the respective luma values of the neighboring samples ( y A , y B ) of the current block; and updating the values of the inter-predicted samples based on the updating parameters; wherein the first target luma value ( x A ) and the second target luma value ( x B ) correspond to a minimum value ( x A ) and a maximum value (x B ) of neighboring samples of said reference block, respectively. <EOS>