A method of intra prediction of a block, comprising the steps of: - determining a value of a matrix-based intra prediction, MIP, indication information for a current block based on the block size (W, H) of the current block, wherein the MIP indication information is defined as idx W H = 0 for W = H = 4 1 for max W H = 8 2 for max W H > 8. for a rectangular block of width W and height H; - obtaining (S1100, S1104) two lines of reconstructed neighboring samples and a MIP intra prediction mode; - deriving (S700, S1108) a set of reference samples based on the two lines of reconstructed neighboring samples, the value of MIP indication information and the MIP intra prediction mode; - obtaining (S704, S1106) a set of MIP coefficients based on the value of MIP indication information and the MIP intra prediction mode; wherein a magnitude of any MIP coefficient C MIP of the set of MIP coefficients is represented as the following series: C MIP = ∑ i = 0 M a i ⋅ 2 i wherein a i = {-1, 0, 1} or a i = {0, 1}, and M is a non-negative integer; and - obtaining (S702, S706, S1110) a prediction block (265, 365, 806) based on the set of reference samples and the set of MIP coefficients, wherein obtaining a prediction block comprises i) obtaining a reduced prediction block by calculating a matrix vector multiplication based on the set of reference samples and the set of MIP coefficients and ii) upsampling the reduced prediction block by interpolation, wherein the matrix vector multiplication is replaced by addition/subtraction and shift operations, wherein a reconstructed picture is obtained based on the prediction block (265, 365, 806), wherein the number of non-zero bits in the MIP coefficient C MIP is not greater than a threshold NTHR, that is, ∑ i = 0 M abs a i ≤ N THR, with N THR ≤ M, and wherein N THR is equal to 2, and the MIP coefficient C MIP is represented as the following series: C MIP = a i ⋅ 2 i + a j ⋅ 2 j, wherein i ≠ j. - determining a value of a matrix-based intra prediction, MIP, indication information for a current block based on the block size (W, H) of the current block, wherein the MIP indication information is defined as idx W H = 0 for W = H = 4 1 for max W H = 8 2 for max W H > 8. for a rectangular block of width W and height H; - obtaining (S1100, S1104) two lines of reconstructed neighboring samples and a MIP intra prediction mode; - deriving (S700, S1108) a set of reference samples based on the two lines of reconstructed neighboring samples, the value of MIP indication information and the MIP intra prediction mode; - obtaining (S704, S1106) a set of MIP coefficients based on the value of MIP indication information and the MIP intra prediction mode; wherein a magnitude of any MIP coefficient C MIP of the set of MIP coefficients is represented as the following series: C MIP = ∑ i = 0 M a i ⋅ 2 i wherein a i = {-1, 0, 1} or a i = {0, 1}, and M is a non-negative integer; and wherein a magnitude of any MIP coefficient C MIP of the set of MIP coefficients is represented as the following series: C MIP = ∑ i = 0 M a i ⋅ 2 i wherein a i = {-1, 0, 1} or a i = {0, 1}, and M is a non-negative integer; and - obtaining (S702, S706, S1110) a prediction block (265, 365, 806) based on the set of reference samples and the set of MIP coefficients, wherein obtaining a prediction block comprises i) obtaining a reduced prediction block by calculating a matrix vector multiplication based on the set of reference samples and the set of MIP coefficients and ii) upsampling the reduced prediction block by interpolation, wherein the matrix vector multiplication is replaced by addition/subtraction and shift operations, wherein a reconstructed picture is obtained based on the prediction block (265, 365, 806), wherein the number of non-zero bits in the MIP coefficient C MIP is not greater than a threshold NTHR, that is, ∑ i = 0 M abs a i ≤ N THR, with N THR ≤ M, and wherein N THR is equal to 2, and the MIP coefficient C MIP is represented as the following series: C MIP = a i ⋅ 2 i + a j ⋅ 2 j, wherein i ≠ j.