An image decoding method performed by a decoding apparatus, the method comprising: deriving a cross-component linear model, CCLM, mode as an intra prediction mode of a current chroma block; deriving a specific value for the current chroma block; comparing a width and a height of the current chroma block with the specific value; based on the width and the height being greater than the specific value, selecting specific top neighboring chroma samples whose number is equal to the specific value of the current chroma block, and specific left neighboring chroma samples whose number is equal to the specific value; deriving down-sampled neighboring luma samples and down-sampled luma samples of a current luma block, wherein the neighboring luma samples correspond to the specific top neighboring chroma samples and the specific left neighboring chroma samples; deriving CCLM parameters based on the specific top neighboring chroma samples, the specific left neighboring chroma samples, and the down-sampled neighboring luma samples; deriving prediction samples for the current chroma block based on the CCLM parameters and the down-sampled luma samples; and generating reconstructed samples for the current chroma block based on the prediction samples, characterized in that the derived specific value is 2, top neighboring chroma samples of specific top positions among top neighboring chroma samples of the current chroma block are selected as the specific top neighboring chroma samples, wherein the specific top positions are derived based on the number of the specific top neighboring chroma samples and the width of the current chroma block, left neighboring chroma samples of specific left positions among left neighboring chroma samples of the current chroma block are selected as the specific left neighboring chroma samples, and wherein the specific left positions are derived based on the number of the specific left neighboring chroma samples and the height of the current chroma block, wherein when the width of the current chroma block is 4, the specific top positions are (1, -1) and (3, -1), and wherein when the height of the current chroma block is 4, the specific left positions are (-1, 1) and (-1,3). deriving a cross-component linear model, CCLM, mode as an intra prediction mode of a current chroma block; deriving a specific value for the current chroma block; comparing a width and a height of the current chroma block with the specific value; based on the width and the height being greater than the specific value, selecting specific top neighboring chroma samples whose number is equal to the specific value of the current chroma block, and specific left neighboring chroma samples whose number is equal to the specific value; deriving down-sampled neighboring luma samples and down-sampled luma samples of a current luma block, wherein the neighboring luma samples correspond to the specific top neighboring chroma samples and the specific left neighboring chroma samples; deriving CCLM parameters based on the specific top neighboring chroma samples, the specific left neighboring chroma samples, and the down-sampled neighboring luma samples; deriving prediction samples for the current chroma block based on the CCLM parameters and the down-sampled luma samples; and generating reconstructed samples for the current chroma block based on the prediction samples, characterized in that the derived specific value is 2, top neighboring chroma samples of specific top positions among top neighboring chroma samples of the current chroma block are selected as the specific top neighboring chroma samples, wherein the specific top positions are derived based on the number of the specific top neighboring chroma samples and the width of the current chroma block, left neighboring chroma samples of specific left positions among left neighboring chroma samples of the current chroma block are selected as the specific left neighboring chroma samples, and wherein the specific left positions are derived based on the number of the specific left neighboring chroma samples and the height of the current chroma block, wherein when the width of the current chroma block is 4, the specific top positions are (1, -1) and (3, -1), and wherein when the height of the current chroma block is 4, the specific left positions are (-1, 1) and (-1,3).