Image encoding/decoding method and device, and recording medium having bitstream stored therein
An image encoding/decoding method and apparatus for performing representative sample-based intra prediction are provided. An image decoding method may comprise deriving an intra prediction mode of a current block, configuring a reference sample of the current block, and performing intra prediction for the current block based on the intra prediction mode and the reference sample, wherein the intra prediction is representative sample-based prediction.
1 . An image decoding method performed by an image decoding apparatus, the method comprising:
configuring a reference sample for intra prediction of a current block by selecting a reference sample line among a plurality of reference sample lines adjacent to the current block; and
generating an intra prediction block of the current block by performing intra prediction for the current block based on an intra prediction mode of the current block and the reference sample,
wherein, based on a first Most Probable Mode (MPM) flag and a second MPM flag, the intra prediction mode of the current block is obtained from one of a plurality of candidate lists,
wherein the plurality of candidate lists includes a first MPM list and a second MPM list,
wherein an intra prediction mode included in the first MPM list is not included in the second MPM list,
wherein whether to configure the second MPM list is determined based on the first MPM flag,
wherein whether the intra prediction mode of the current block is included in the second MPM list or not is determined based on the second MPM flag,
wherein, in response to the selected reference sample line being a first reference sample line among the plurality of reference sample lines, the first MPM flag is signaled from a bitstream,
wherein, in response to the selected reference sample line not being the first reference sample line among the plurality of reference sample lines, the first MPM flag and the second MPM flag is not signaled from the bitstream, and the intra prediction mode of the current block is obtained based on an MPM index, and
wherein the first reference sample line is a reference sample line adjacent to the current block.
2 . The method of claim 1 ,
wherein the second MPM list includes an intra prediction mode of a neighboring block of the current block.
3 . The method of claim 1 ,
wherein the first MPM list includes a planar mode.
4 . The method of claim 1 ,
wherein the plurality of reference sample lines include a first reference sample line, a second reference sample line, and a third reference sample line,
wherein the first reference sample line with an index of 0 is adjacent to the current block,
wherein the second reference sample line with an index of 1 is adjacent to the first reference sample line, and
wherein the third reference sample line with an index of 2 is adjacent to the second reference sample line.
5 . The method of claim 4 ,
wherein whether a Multi-Reference Line (MRL) index specifying an index of the reference sample line among the plurality of reference sample lines is signaled from a bitstream is determined based on whether a top boundary of the current block corresponds a boundary of a coding tree block including the current block.
6 . The method of claim 4 ,
wherein whether a Multi-Reference Line (MRL) index specifying an index of the reference sample line among the plurality of reference sample lines is signaled from a bitstream is determined based on a color component of the current block.
7 . The method of claim 1 ,
wherein the second MPM list includes a intra prediction mode in which an offset is added or subtracted from a directional intra prediction mode included in the second MPM list.
8 . The method of claim 7 ,
wherein the offset is 4.
9 . An image encoding method performed by an image encoding apparatus, the method comprising:
configuring a reference sample for intra prediction of a current block by selecting a reference sample line among a plurality of reference sample lines adjacent to the current block; and
generating an intra prediction block of the current block by performing intra prediction for the current block based on an intra prediction mode of the current block and the reference sample,
wherein, based on the intra prediction mode of the current block obtained from one of a plurality of candidate lists, a first Most Probable Mode (MPM) flag and a second MPM flag are encoded,
wherein the plurality of candidate lists includes a first MPM list and a second MPM list,
wherein an intra prediction mode included in the first MPM list is not included in the second MPM list,
wherein, based on whether to configure the second MPM list, a value of the first MPM flag is determined,
wherein, based on whether the intra prediction mode of the current block is included in the second MPM list or not, a value of the second MPM flag is determined,
wherein, in response to the selected reference sample line being a first reference sample line among the plurality of reference sample lines, the first MPM flag encoded into a bitstream,
wherein, in response to the selected reference sample line not being the first reference sample line among the plurality of reference sample lines, the first MPM flag and the second MPM flag is not encoded into the bitstream, and an MPM index is determined based on the intra prediction mode of the current block, and
wherein the first reference sample line is a reference sample line adjacent to the current block.
10 . A method of transmitting a bitstream, comprising:
configuring a reference sample for intra prediction of a current block by selecting a reference sample line among a plurality of reference sample lines adjacent to the current block;
generating an intra prediction block of the current block by performing intra prediction for the current block based on an intra prediction mode of the current block and the reference sample; and
transmitting the bitstream obtained based on intra prediction block of the current block,
wherein, based on the intra prediction mode of the current block obtained from one of a plurality of candidate lists, a first Most Probable Mode (MPM) flag and a second MPM flag are encoded,
wherein the plurality of candidate lists includes a first MPM list and a second MPM list,
wherein an intra prediction mode included in the first MPM list is not included in the second MPM list,
wherein, based on whether to configure the second MPM list, a value of the first MPM flag is determined,
wherein, based on whether the intra prediction mode of the current block is included in the second MPM list or not, a value of the second MPM flag is determined,
wherein, in response to the selected reference sample line being a first reference sample line among the plurality of reference sample lines, the first MPM flag encoded into the bitstream,
wherein, in response to the selected reference sample line not being the first reference sample line among the plurality of reference sample lines, the first MPM flag and the second MPM flag is not encoded into the bitstream, and an MPM index is determined based on the intra prediction mode of the current block, and
wherein the first reference sample line is a reference sample line adjacent to the current block.