Image encoding/decoding method and apparatus
An image encoding/decoding method and apparatus according to the present invention may: determine an intra prediction mode of a current block; determine one or more reference lines of the current block from among a plurality of reference line candidates available for the current block; generate a prediction sample of the current block on the basis of the intra prediction mode and the one or more reference lines, which have been determined; and correct the generated prediction sample.
1 . A method of decoding an image, the method comprising:
determining an intra prediction mode of a current block;
determining one or more reference lines of the current block among a plurality of reference line candidates available for the current block;
generating a prediction sample of the current block based on the intra prediction mode and the one or more reference lines which have been determined; and
correcting the generated prediction sample to obtain a corrected prediction sample,
wherein in response to the intra prediction mode of the current block being one of pre-defined directional intra prediction modes, the corrected prediction sample is generated based on a difference between two reference samples belonging to the one or more reference lines, and
wherein the two reference samples include a first reference sample having a same x-coordinate or y-coordinate as the prediction sample and a second reference sample at a projected position from the first reference sample according to a prediction direction according to the intra prediction mode of the current block.
2 . The method of claim 1 , wherein in response to the intra prediction mode of the current block being a non-directional mode, the prediction sample is corrected based on at least one of a first difference between the first reference sample having the same x-coordinate as the prediction sample and a reference sample at a reference position and a second difference between the second reference sample having the same y-coordinate as the prediction sample and the reference sample at the reference position.
3 . The method of claim 2 , wherein
the corrected prediction sample is generated based on a weighted sum of the prediction sample, the first difference and the second difference.
4 . The method of claim 1 , wherein a position of the first reference sample is determined based on the intra prediction mode of the current block.
5 . The method of claim 1 , wherein the corrected prediction sample is generated based on a weighted sum of the prediction sample and a difference between the two reference samples.
6 . The method of claim 5 , wherein a weight for the weighted sum is determined based on the intra prediction mode of the current block and a derived intra prediction mode of the current block, the derived intra prediction mode being derived based on a cost calculated from a predetermined template region adjacent to the current block.
7 . The method of claim 6 , wherein the cost is calculated for each of a plurality of candidate modes belonging to a candidate list of the current block, and
wherein, based on the cost of each of the plurality of candidate modes, one of the plurality of candidates modes is determined to be the derived intra prediction mode.
8 . The method of claim 1 , wherein a plurality of reference lines are used to correct the prediction sample of the current block.
9 . The method of claim 8 , wherein any one of the plurality of reference lines is a reference line used to generate the prediction sample of the current block,
wherein another one of the plurality of reference lines is specified based on information signaled through a bitstream.
10 . A method of encoding an image, the method comprising:
determining an intra prediction mode of a current block;
determining one or more reference lines of the current block among a plurality of reference line candidates available for the current block;
generating a prediction sample of the current block based on the intra prediction mode and the one or more reference lines which have been determined; and
correcting the generated prediction sample to obtain a corrected prediction sample,
wherein in response to the intra prediction mode of the current block being one of pre-defined directional intra prediction modes, the corrected prediction sample is generated based on a difference between two reference samples belonging to the one or more reference lines, and
wherein the two reference samples include a first reference sample having a same x-coordinate or y-coordinate as the prediction sample and a second reference sample at a projected position from the first reference sample according to a prediction direction according to the intra prediction mode of the current block.
11 . A device for transmitting compressed video data, comprising:
a processor to obtain the compressed video data; and
a transmitter to transmit the compressed video data,
wherein obtaining the compressed video data comprises:
determining an intra prediction mode of a current block;
determining one or more reference lines of the current block among a plurality of reference line candidates available for the current block;
generating a prediction sample of the current block based on the intra prediction mode and the one or more reference lines which have been determined; and
correcting the generated prediction sample to obtain a corrected prediction sample,
wherein in response to the intra prediction mode of the current block being one of pre-defined directional intra prediction modes, the corrected prediction sample is generated based on a difference between two reference samples belonging to the one or more reference lines, and
wherein the two reference samples include a first reference sample having a same x-coordinate or y-coordinate as the prediction sample and a second reference sample at a projected position from the first reference sample according to a prediction direction according to the intra prediction mode of the current block.