Method and device for encoding/decoding image, and recording medium in which bitstream is stored
An image encoding/decoding method and apparatus for performing intra prediction using a plurality of reference sample lines are provided. An image decoding method may comprise configuring a plurality of reference sample lines, reconstructing an intra prediction mode of a current block, and performing intra prediction for the current block based on the intra prediction mode and the plurality of reference sample lines.
1. An image decoding method performed by an image decoding apparatus, the image decoding method comprising:
deriving an intra prediction mode for a chroma block;
deriving prediction samples for the chroma block based on the intra prediction mode;
performing filtering on the prediction samples; and
generating a reconstructed picture based on residual samples for the chroma block and the prediction samples,
wherein the chroma block is a square block,
wherein the intra prediction mode for the chroma block is set to an intra prediction mode of a corresponding luma position corresponding to a specific position of the chroma block,
wherein based on a luma position corresponding to a top-left position of the chroma block being (x, y), the corresponding luma position is derived as (x+width of a corresponding luma block/2, y+height of the corresponding luma block/2), and
wherein the filtering is performed based on the intra prediction mode of the chroma block, a size of the chroma block, and a position of a prediction sample.
2. The image decoding method of claim 1 , wherein the filtering is performed based on the intra prediction mode for the chroma block being a planar mode.
3. An image encoding method performed by an image encoding apparatus, the image encoding method comprising:
deriving an intra prediction mode for a chroma block;
deriving prediction samples for the chroma block based on the intra prediction mode;
performing filtering on the prediction samples;
deriving residual samples for the chroma block based on the prediction samples; and
encoding image information including residual information related to the residual samples,
wherein the chroma block is a square block,
wherein the intra prediction mode for the chroma block is set to an intra prediction mode of a corresponding luma position corresponding to a specific position of the chroma block,
wherein based on a luma position corresponding to a top-left position of the chroma block being (x, y), the corresponding luma position is derived as (x+width of a corresponding luma block/2, y+height of the corresponding luma block/2), and
wherein the filtering is performed based on the intra prediction mode of the chroma block, a size of the chroma block, and a position of a prediction sample.
4. The image encoding method of claim 3 , wherein the filtering is performed based on the intra prediction mode for the chroma block being a planar mode.
5. A transmitting method for image data, the method comprising:
obtaining a bitstream of encoded image information, wherein the encoded image information is generated based on deriving an intra prediction mode for a chroma block, deriving prediction samples for the chroma block based on the intra prediction mode, performing filtering on the prediction samples, deriving residual samples for the chroma block based on the prediction samples, and encoding image information including residual information related to the residual samples; and
transmitting the image data comprising the bitstream,
wherein the chroma block is a square block,
wherein the intra prediction mode for the chroma block is set to an intra prediction mode of a corresponding luma position corresponding to a specific position of the chroma block,
wherein based on a luma position corresponding to a top-left position of the chroma block being (x, y), the corresponding luma position is derived as (x+width of a corresponding luma block/2, y+height of the corresponding luma block/2), and
wherein the filtering is performed based on the intra prediction mode of the chroma block, a size of the chroma block, and a position of a prediction sample.