A method for colour component prediction, applied to an encoder and comprising: determining (S301) a neighbouring reference sample set of a current block, and determining (S301) a preset parameter value corresponding to the current block, the neighbouring reference sample set comprising at least one reference sample; buffering (S302) the neighbouring reference sample set and the preset parameter value to construct an input reference sample set; wherein the preset parameter value is placed after the neighbouring reference sample set; determining (S303) an input sample matrix by means of a first preset calculation model based on the input reference sample set; and performing (S304) colour component prediction on the current block according to the input sample matrix to obtain a prediction block of the current block, wherein the preset parameter value is 1<<BitDepth-1), where BitDepth represents a bit depth value corresponding to a to-be-predicted colour component of the current block, and wherein determining (S303) the input sample matrix by means of the first preset calculation model based on the input reference sample set comprises: for each value of i, performing, according to a sample corresponding to a (i+1) th position and a sample corresponding to a 0 th position in the input reference sample set, a subtraction operation by means of the first preset calculation model to obtain a respective input sample, wherein a minuend of the subtraction operation is set to be equal to the sample corresponding to the (i+1) th position in the reference sample set; and a subtrahend of the subtraction operation is set to be equal to the sample corresponding to the 0 th position in the reference sample set, and wherein i is an integer greater than or equal to 0 and less than N, N representing the number of elements contained in the input sample matrix; and forming the input sample matrix according to N input samples obtained. determining (S301) a neighbouring reference sample set of a current block, and determining (S301) a preset parameter value corresponding to the current block, the neighbouring reference sample set comprising at least one reference sample; buffering (S302) the neighbouring reference sample set and the preset parameter value to construct an input reference sample set; wherein the preset parameter value is placed after the neighbouring reference sample set; determining (S303) an input sample matrix by means of a first preset calculation model based on the input reference sample set; and performing (S304) colour component prediction on the current block according to the input sample matrix to obtain a prediction block of the current block, wherein the preset parameter value is 1<<BitDepth-1), where BitDepth represents a bit depth value corresponding to a to-be-predicted colour component of the current block, and wherein determining (S303) the input sample matrix by means of the first preset calculation model based on the input reference sample set comprises: for each value of i, performing, according to a sample corresponding to a (i+1) th position and a sample corresponding to a 0 th position in the input reference sample set, a subtraction operation by means of the first preset calculation model to obtain a respective input sample, wherein a minuend of the subtraction operation is set to be equal to the sample corresponding to the (i+1) th position in the reference sample set; and a subtrahend of the subtraction operation is set to be equal to the sample corresponding to the 0 th position in the reference sample set, and wherein i is an integer greater than or equal to 0 and less than N, N representing the number of elements contained in the input sample matrix; and forming the input sample matrix according to N input samples obtained. <EOS>