A chroma block prediction method by using linear mode (LM) prediction, wherein the method comprises: parsing a bitstream to obtain first indication information, wherein when a sample position type of a current chroma block is a first sample position type, a value of the first indication information is a first value, and when the sample position type of the current chroma block is a second sample position type, the value of the first indication information is a second value; performing a downsampling operation on a first luma block by using a first filter when the value of the first indication information is the first value or by using a second filter, which is different from the first filter, when the value of the first indication information is the second value, to obtain a second luma block, wherein for the first sample position type a sample position (xb, yb) of the current chroma block corresponds to a sample position (2*xb, 2*yb+0.5) of the first luma block, and for the second sample position type a sample position (xb, yb) of the current chroma block corresponds to a sample position (2*xb, 2*yb) of the first luma block, wherein the first luma block is a luma block corresponding to the current chroma block, and wherein an image which comprises the first luma block and the current chroma block is in a 4:2:0 or 4:2:2 format; obtaining a plurality of chroma samples and a plurality of luma samples, wherein the plurality of chroma samples comprise a plurality of neighboring chroma samples of the current chroma block, and the plurality of luma samples are obtained by performing a downsampling operation on a plurality of neighboring luma samples of the first luma block; obtaining linear model coefficients based on the plurality of chroma samples and the plurality of luma samples; and obtaining a prediction value of the current chroma block based on the second luma block and the linear model coefficients. parsing a bitstream to obtain first indication information, wherein when a sample position type of a current chroma block is a first sample position type, a value of the first indication information is a first value, and when the sample position type of the current chroma block is a second sample position type, the value of the first indication information is a second value; performing a downsampling operation on a first luma block by using a first filter when the value of the first indication information is the first value or by using a second filter, which is different from the first filter, when the value of the first indication information is the second value, to obtain a second luma block, wherein for the first sample position type a sample position (xb, yb) of the current chroma block corresponds to a sample position (2*xb, 2*yb+0.5) of the first luma block, and for the second sample position type a sample position (xb, yb) of the current chroma block corresponds to a sample position (2*xb, 2*yb) of the first luma block, wherein the first luma block is a luma block corresponding to the current chroma block, and wherein an image which comprises the first luma block and the current chroma block is in a 4:2:0 or 4:2:2 format; obtaining a plurality of chroma samples and a plurality of luma samples, wherein the plurality of chroma samples comprise a plurality of neighboring chroma samples of the current chroma block, and the plurality of luma samples are obtained by performing a downsampling operation on a plurality of neighboring luma samples of the first luma block; obtaining linear model coefficients based on the plurality of chroma samples and the plurality of luma samples; and obtaining a prediction value of the current chroma block based on the second luma block and the linear model coefficients. <EOS>