A method of processing video data, the method comprising: obtaining a current block (602; 702; 810; 902; 1002; 1110; 1210; 1220) of the video data; determining a quantity of samples neighboring a first side (820; 830) of the current block; determining a quantity of samples neighboring a second side (830; 820) of the current block; selecting the first side as a basis for determining one or more illumination compensation parameters for the current block based on a comparison between the quantity of samples neighboring the first side and the quantity of samples neighboring the second side; determining one or more samples neighboring the current block that are excluded from use in determining the one or more illumination compensation parameters for the current block; and determining the one or more illumination compensation parameters for the current block based on a plurality of samples neighboring the current block and based on the quantity of samples neighboring the first side, wherein the one or more samples are excluded from the plurality of samples used for determining the one or more illumination compensation parameters; characterized in that the one or more samples that are excluded from use in determining the one or more illumination compensation parameters for the current block (902; 1002) include one or more intra-coded samples (914, 924; 1014, 1024); and the method further comprises: identifying one or more replacement samples (1012, 1022) neighboring a reference block (604; 704, 706; 1004), the reference block distinct from the current block; and replacing the one or more intra-coded samples with the one or more replacement samples, wherein the plurality of samples used for determining the one or more illumination compensation parameters includes the one or more replacement samples in place of the one or more intra-coded samples. obtaining a current block (602; 702; 810; 902; 1002; 1110; 1210; 1220) of the video data; determining a quantity of samples neighboring a first side (820; 830) of the current block; determining a quantity of samples neighboring a second side (830; 820) of the current block; selecting the first side as a basis for determining one or more illumination compensation parameters for the current block based on a comparison between the quantity of samples neighboring the first side and the quantity of samples neighboring the second side; determining one or more samples neighboring the current block that are excluded from use in determining the one or more illumination compensation parameters for the current block; and determining the one or more illumination compensation parameters for the current block based on a plurality of samples neighboring the current block and based on the quantity of samples neighboring the first side, wherein the one or more samples are excluded from the plurality of samples used for determining the one or more illumination compensation parameters; characterized in that the one or more samples that are excluded from use in determining the one or more illumination compensation parameters for the current block (902; 1002) include one or more intra-coded samples (914, 924; 1014, 1024); and the method further comprises: identifying one or more replacement samples (1012, 1022) neighboring a reference block (604; 704, 706; 1004), the reference block distinct from the current block; and replacing the one or more intra-coded samples with the one or more replacement samples, wherein the plurality of samples used for determining the one or more illumination compensation parameters includes the one or more replacement samples in place of the one or more intra-coded samples. identifying one or more replacement samples (1012, 1022) neighboring a reference block (604; 704, 706; 1004), the reference block distinct from the current block; and replacing the one or more intra-coded samples with the one or more replacement samples, wherein the plurality of samples used for determining the one or more illumination compensation parameters includes the one or more replacement samples in place of the one or more intra-coded samples.