A block prediction method which is performed by a decoding apparatus, the method comprising: deriving a reference block from a reference picture to predict a current block in a current picture; determining reference illumination compensation, IC, parameters; generating an illumination-compensated reference block by applying reference IC to the reference block based on the reference IC parameters; and generating prediction samples of the current block based on the illumination-compensated reference block, wherein the reference IC parameters comprise parameters a and b, and at least one of the parameters a and b is calculated based on first neighboring samples of the reference block and second neighboring samples of the current block, wherein the first neighboring samples comprise first left neighboring samples and first upper neighboring samples of the reference block, and the second neighboring samples comprise second left neighboring samples and second upper neighboring samples of the current block, wherein odd- or even-numbered samples among the first left neighboring samples, first upper neighboring samples, second left neighboring samples, and second upper neighboring samples are used to calculate the parameters a and b, wherein the first left neighboring samples and the second left neighboring samples consist of more than one column of samples, and the first upper neighboring samples and the second upper neighboring samples consist of more than one row of samples, wherein the parameters a and b are calculated based on the following equations, a = N ∑ i x i y i − ∑ i x i ∑ i y i + λ N ∑ i x i x i − ∑ i x i ∑ i x i + λ, b = ∑ i y i − a ∗ ∑ i x i, λ = ∑ i x i x i ≫ 7, where a and b represent the parameters a and b, xi represents a value of an i-th sample of the first neighboring samples, yi represents a value of an i-th sample of the corresponding second neighboring samples, N represents a normalization parameter, and λ represents a control parameter, wherein information on maximum coding unit, CU, size to which the reference IC is applicable for a slice or a picture in which the current block is included is received, wherein a reference IC flag representing whether the reference IC is applied or not for the current block is received based on a CU which is smaller than or equal to the maximum CU size to which the reference IC is applicable, wherein the CU includes the current block, and wherein the reference IC is applied to the reference block based on the reference IC flag with a value of 1. deriving a reference block from a reference picture to predict a current block in a current picture; determining reference illumination compensation, IC, parameters; generating an illumination-compensated reference block by applying reference IC to the reference block based on the reference IC parameters; and generating prediction samples of the current block based on the illumination-compensated reference block, wherein the reference IC parameters comprise parameters a and b, and at least one of the parameters a and b is calculated based on first neighboring samples of the reference block and second neighboring samples of the current block, wherein the first neighboring samples comprise first left neighboring samples and first upper neighboring samples of the reference block, and the second neighboring samples comprise second left neighboring samples and second upper neighboring samples of the current block, wherein odd- or even-numbered samples among the first left neighboring samples, first upper neighboring samples, second left neighboring samples, and second upper neighboring samples are used to calculate the parameters a and b, wherein the first left neighboring samples and the second left neighboring samples consist of more than one column of samples, and the first upper neighboring samples and the second upper neighboring samples consist of more than one row of samples, wherein the parameters a and b are calculated based on the following equations, a = N ∑ i x i y i − ∑ i x i ∑ i y i + λ N ∑ i x i x i − ∑ i x i ∑ i x i + λ, b = ∑ i y i − a ∗ ∑ i x i, λ = ∑ i x i x i ≫ 7, where a and b represent the parameters a and b, xi represents a value of an i-th sample of the first neighboring samples, yi represents a value of an i-th sample of the corresponding second neighboring samples, N represents a normalization parameter, and λ represents a control parameter, wherein information on maximum coding unit, CU, size to which the reference IC is applicable for a slice or a picture in which the current block is included is received, wherein a reference IC flag representing whether the reference IC is applied or not for the current block is received based on a CU which is smaller than or equal to the maximum CU size to which the reference IC is applicable, wherein the CU includes the current block, and wherein the reference IC is applied to the reference block based on the reference IC flag with a value of 1.