A method of intra prediction of DC intra prediction mode for a block, comprising: obtaining a value of an intra prediction reference line index, refldx, of a transform block; and obtaining prediction samples of the transform block based on reference samples p[x] [y] from a reference line, wherein the reference line is indexed by the value of the intra prediction reference line index refldx, the value of refldx being non-zero; wherein the prediction samples of the transform block predSamples[x] [y] are obtained by: predSamples x y = dcVal, with x = 0.. nTbW − 1, y = 0.. nTbH − 1; wherein when nTbW is equal to nTbH, the variable dcVal is obtained by: dcVal = ∑ x ′ = 0 nTbW − 1 p x ′ − 1 − refIdx + ∑ y ′ = 0 nTbH − 1 p − 1 − refIdx y ′ + nTbW ≫ Log2 nTbW + 1; wherein when the width of the transform block is greater than the height of the transform block, only reference samples from a top reference line are used to obtain the prediction samples, and the variable dcVal is obtained by: dcVal = ∑ x ′ = 0 nTbW − 1 p x ′ − 1 − refIdx + nTbW ≫ 1 ≫ Log2 nTbW; and wherein when the height of the transform block is greater than the width of the transform block, only reference samples from a left reference line are used to obtain the prediction samples, and the variable dcVal is obtained by: dcVal = ∑ y ′ = 0 nTbH − 1 p − 1 − refIdx y ′ + nTbH ≫ 1 ≫ Log2 nTbH; p[ x '][-1 - refldx] specifying reference samples from a top reference line, p[-1 - refldx] [ y '] specifying reference samples from a left reference line, a variable nTbW specifying a width of the transform block, a variable nTbH specifying a height of the transform block; and wherein the reference samples are determined by specifying horizontal or vertical index, each of the indices is an integer value belonging to a range of integer values, and wherein the indices specify a horizontal coordinate (x ') or a vertical coordinate (y') within the reference line, respectively; and wherein the top-most reference sample of the reference line is offset vertically to the position of the top-left predicted sample of the transform block, and wherein the value of the offset is equal to the value of the intra prediction reference line index; and the left-most reference sample of the reference line is offset horizontally to the position of the top-left predicted sample of the transform block, and wherein the value of the offset is equal to the value of the intra prediction reference line index. obtaining a value of an intra prediction reference line index, refldx, of a transform block; and obtaining prediction samples of the transform block based on reference samples p[x] [y] from a reference line, wherein the reference line is indexed by the value of the intra prediction reference line index refldx, the value of refldx being non-zero; wherein the prediction samples of the transform block predSamples[x] [y] are obtained by: predSamples x y = dcVal, with x = 0.. nTbW − 1, y = 0.. nTbH − 1; wherein when nTbW is equal to nTbH, the variable dcVal is obtained by: dcVal = ∑ x ′ = 0 nTbW − 1 p x ′ − 1 − refIdx + ∑ y ′ = 0 nTbH − 1 p − 1 − refIdx y ′ + nTbW ≫ Log2 nTbW + 1; wherein when the width of the transform block is greater than the height of the transform block, only reference samples from a top reference line are used to obtain the prediction samples, and the variable dcVal is obtained by: dcVal = ∑ x ′ = 0 nTbW − 1 p x ′ − 1 − refIdx + nTbW ≫ 1 ≫ Log2 nTbW; and wherein when the height of the transform block is greater than the width of the transform block, only reference samples from a left reference line are used to obtain the prediction samples, and the variable dcVal is obtained by: dcVal = ∑ y ′ = 0 nTbH − 1 p − 1 − refIdx y ′ + nTbH ≫ 1 ≫ Log2 nTbH; p[ x '][-1 - refldx] specifying reference samples from a top reference line, p[-1 - refldx] [ y '] specifying reference samples from a left reference line, p[ x '][-1 - refldx] specifying reference samples from a top reference line, p[-1 - refldx] [ y '] specifying reference samples from a left reference line, a variable nTbW specifying a width of the transform block, a variable nTbH specifying a height of the transform block; and wherein the reference samples are determined by specifying horizontal or vertical index, each of the indices is an integer value belonging to a range of integer values, and wherein the indices specify a horizontal coordinate (x ') or a vertical coordinate (y') within the reference line, respectively; and wherein the top-most reference sample of the reference line is offset vertically to the position of the top-left predicted sample of the transform block, and wherein the value of the offset is equal to the value of the intra prediction reference line index; and the left-most reference sample of the reference line is offset horizontally to the position of the top-left predicted sample of the transform block, and wherein the value of the offset is equal to the value of the intra prediction reference line index.