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 method comprising:
deriving prediction mode for a current block;
deriving reference samples adjacent to a left and a top of the current block based on an intra prediction being applied to the current block according to the prediction mode;
deriving prediction samples for the current block based on the reference samples; and
generating a reconstructed picture based on the prediction samples,
wherein a position of a top-left corner sample of the current block is (0, 0), a width of the current block is w and a height of the current block is h,
wherein the height h of the current block is greater than the width w of the current block, and
wherein reference samples in a top reference line adjacent to the top of the current block are derived by performing padding on at least one reference sample with x-coordinate value in the range from w to (w+h−1) without determining availability of a reference sample.
2 . The image decoding method of claim 1 , wherein at least one reference sample is padded with adjacent reference sample to its left.
3 . An image encoding method performed by an image encoding apparatus, the method comprising:
deriving prediction mode for a current block;
deriving reference samples adjacent to a left and a top of the current block based on an intra prediction being applied to the current block;
deriving prediction samples for the current block based on the reference samples;
generating residual samples based on the prediction samples, and
encoding image information comprising prediction mode information for the current block,
wherein a position of a top-left corner sample of the current block is (0, 0), a width of the current block is w and a height of the current block is h,
wherein the height h of the current block is greater than the width w of the current block, and
wherein reference samples in a top reference line adjacent to the top of the current block are derived by performing padding on at least one reference sample with x-coordinate value in the range from w to (w+h−1) without determining availability of a reference sample.
4 . The image encoding method of claim 3 , wherein at least one reference sample is padded with adjacent reference samples to its left.
5 . A transmission method for image data, the method comprising:
obtaining a bitstream for the image data, wherein the bitstream is generated based on deriving prediction mode for a current block, deriving reference samples adjacent to a left and a top of the current block based on an intra prediction being applied to the current block, deriving prediction samples for the current block based on the reference samples, generating residual samples based on the prediction samples, and encoding image information comprising prediction mode information for the current block; and
transmitting the image data comprising the bitstream,
wherein a position of a top-left corner sample of the current block is (0, 0), a width of the current block is w and a height of the current block is h,
wherein the height h of the current block is greater than the width w of the current block, and
wherein reference samples in a top reference line adjacent to the top of the current block are derived by performing padding on at least one reference sample with x-coordinate value in the range from w to (w+h−1) without determining availability of a reference sample.
6 . The image encoding method of claim 5 , wherein at least one reference sample is padded with adjacent reference samples to its left.