Method and device for encoding/decoding image, and recording medium in which bitstream is stored
An image decoding method can be performed by an image decoding apparatus. The image decoding method can include obtaining image information including prediction mode information for a current block, deriving a prediction mode of the current block based on the prediction mode information, deriving reference samples neighboring the current block, deriving prediction samples of the current block based on the prediction mode of the current block and the reference samples, and generating reconstructed samples of the current block based on the prediction samples. The reference samples include top reference samples of the current block and left reference samples of the current block. Further, whether a filtering is applied to the reference samples is determined based on the prediction mode of the current block and a size of the current block.
1 . An image decoding method performed by an image decoding apparatus, the method comprising:
obtaining image information including prediction mode information for a current block;
deriving a prediction mode of the current block based on the prediction mode information;
deriving reference samples neighboring the current block;
deriving prediction samples of the current block based on the prediction mode of the current block and the reference samples; and
generating reconstructed samples of the current block based on the prediction samples,
wherein the reference samples include top reference samples of the current block and left reference samples of the current block,
wherein whether a filtering is applied to the reference samples is determined based on the prediction mode of the current block and a size of the current block,
wherein, for the filtering for the reference samples, a 3-tap filter or a 5-tap filter is used based on the size of the current block,
wherein based on the prediction mode being a directional mode, a 4-tap interpolation filter is used for deriving the prediction samples,
wherein based on a case that the filtering is applied to the reference samples, the filtering for the reference samples is performed based on neighboring samples of a reference sample, and
wherein the neighboring samples of the reference sample include a first sample adjacent to the reference sample in a horizontal direction and a second sample adjacent to the reference sample in a vertical direction.
2 . An image encoding method performed by an image encoding apparatus, the method comprising:
deriving a prediction mode of a current block;
deriving reference samples neighboring the current block;
deriving prediction samples of the current block based on the prediction mode of the current block and the reference samples;
generating residual samples of the current block based on the prediction samples; and
encoding image information including prediction mode information for the current block,
wherein the reference samples include top reference samples of the current block and left reference samples of the current block,
wherein whether a filtering is applied to the reference samples is determined based on the prediction mode of the current block and a size of the current block,
wherein, for the filtering for the reference samples, a 3-tap filter or a 5-tap filter is used based on the size of the current block,
wherein based on the prediction mode being a directional mode, a 4-tap interpolation filter is used for deriving the prediction samples,
wherein based on a case that the filtering is applied to the reference samples, the filtering for the reference samples is performed based on neighboring samples of a reference sample, and
wherein the neighboring samples of the reference sample include a first sample adjacent to the reference sample in a horizontal direction and a second sample adjacent to the reference sample in a vertical direction.
3 . A transmission method for image data, the method comprising:
obtaining a bitstream for the image data, wherein the bitstream is generated based on deriving a prediction mode of a current block, deriving reference samples neighboring the current block, deriving prediction samples of the current block based on the prediction mode of the current block and the reference samples, generating residual samples of the current block based on the prediction samples, and encoding image information including prediction mode information for the current block; and
transmitting the image data comprising the bitstream,
wherein the reference samples include top reference samples of the current block and left reference samples of the current block,
wherein whether a filtering is applied to the reference samples is determined based on the prediction mode of the current block and a size of the current block,
wherein, for the filtering for the reference samples, a 3-tap filter or a 5-tap filter is used based on the size of the current block,
wherein based on the prediction mode being a directional mode, a 4-tap interpolation filter is used for deriving the prediction samples,
wherein based on a case that the filtering is applied to the reference samples, the filtering for the reference samples is performed based on neighboring samples of a reference sample, and
wherein the neighboring samples of the reference sample include a first sample adjacent to the reference sample in a horizontal direction and a second sample adjacent to the reference sample in a vertical direction.