A decoding apparatus for an image decoding, the decoding apparatus comprising: a memory; and at least one processor connected to the memory, the at least one processor configured to: derive a cross-component linear model, CCLM, mode as an intra prediction mode of a current chroma block; derive a specific value for the current chroma block; compare 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, derive 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; derive 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; derive CCLM parameters based on the specific top neighboring chroma samples, the specific left neighboring chroma samples, and the down-sampled neighboring luma samples; derive prediction samples for the current chroma block based on the CCLM parameters and the down-sampled luma samples; and generate reconstructed samples for the current chroma block based on the prediction samples, characterized in that the derived specific value is 2, when the width is greater than the specific value, down-sampled top neighboring luma samples of specific top positions corresponding to the specific top neighboring chroma samples are derived, when the width of the current chroma block is 4, the specific top positions are (1, -1) and (3, -1), when the height is greater than the specific value, down-sampled left neighboring luma samples of specific left positions corresponding to the specific left neighboring chroma samples are derived, and when the height of the current chroma block is 4, the specific left positions are (-1, 1) and (-1, 3). a memory; and at least one processor connected to the memory, the at least one processor configured to: derive a cross-component linear model, CCLM, mode as an intra prediction mode of a current chroma block; derive a specific value for the current chroma block; compare 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, derive 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; derive 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; derive CCLM parameters based on the specific top neighboring chroma samples, the specific left neighboring chroma samples, and the down-sampled neighboring luma samples; derive prediction samples for the current chroma block based on the CCLM parameters and the down-sampled luma samples; and generate reconstructed samples for the current chroma block based on the prediction samples, derive a cross-component linear model, CCLM, mode as an intra prediction mode of a current chroma block; derive a specific value for the current chroma block; compare 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, derive 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; derive 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; derive CCLM parameters based on the specific top neighboring chroma samples, the specific left neighboring chroma samples, and the down-sampled neighboring luma samples; derive prediction samples for the current chroma block based on the CCLM parameters and the down-sampled luma samples; and generate reconstructed samples for the current chroma block based on the prediction samples, characterized in that the derived specific value is 2, when the width is greater than the specific value, down-sampled top neighboring luma samples of specific top positions corresponding to the specific top neighboring chroma samples are derived, when the width of the current chroma block is 4, the specific top positions are (1, -1) and (3, -1), when the height is greater than the specific value, down-sampled left neighboring luma samples of specific left positions corresponding to the specific left neighboring chroma samples are derived, and when the height of the current chroma block is 4, the specific left positions are (-1, 1) and (-1, 3).