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;
generating an intra-predicted 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;
determining whether to perform filtering the intra-predicted block based on the reference sample line; and
filtering the intra-predicted block based on whether to perform filtering,
wherein the reference sample line is selected based on whether a top boundary of the current block corresponds to a boundary of a coding tree block,
wherein, in response to the top boundary of the current block not corresponding to the boundary of the coding tree block, the reference sample line is selected based on index information indicating the reference sample line among the plurality of reference sample lines, index information being signaled from a bitstream,
wherein, in response to the top boundary of the current block corresponding to the boundary of the coding tree block, the reference sample line is selected without signaling the index information, a first reference sample line immediately adjacent to the current block among the plurality of reference sample lines being selected as the reference sample line,
wherein, in response to the first reference sample line immediately adjacent to the current block among the plurality of reference sample lines being selected as the reference sample line, the intra-predicted block is filtered, and
wherein, in response to the first reference sample line not being selected as the reference sample line, the intra-predicted block is not filtered.
2. The method of claim 1 ,
wherein the intra prediction mode of the current block is determined based on whether
the selected reference sample line is the first reference sample line among the plurality of reference samples lines, and
wherein, in response to the selected reference sample line being the first reference sample line,
an MPM flag indicating whether the intra prediction mode is identical to at least one among a plurality of intra prediction mode candidates included in an MPM list is signaled from the bitstream.
3. The method of claim 1 , wherein whether to perform filtering the intra-predicted block is determined based on at least one of a size of the current block or the intra prediction mode, or combinations thereof.
4. The method of claim 1 , wherein the configuring the reference sample comprises:
filtering the reference sample in response to the selected reference sample line being the first reference sample line.
5. An image encoding method performed by an image encoding apparatus, the method comprising:
configuring a reference sample of intra prediction for a current block by selecting a reference sample line among a plurality of reference sample lines adjacent to the current block;
generating an intra-predicted 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;
determining whether to perform filtering the intra-predicted block based on the reference sample line; and
filtering the intra-predicted block based on whether to perform filtering,
wherein the reference sample line is selected based on whether a top boundary of the current block corresponds to a boundary of a coding tree block,
wherein, in response to the top boundary of the current block not corresponding to the boundary of the coding tree block, the reference sample line is selected from among the plurality of reference sample lines, and index information indicating the reference sample line among the plurality of reference sample lines is encoded into a bitstream,
wherein, in response to the top boundary of the current block corresponding to the boundary of the coding tree block, a first reference sample line immediately adjacent to the current block among the plurality of reference sample lines is selected as the reference sample line, and the index information is not encoded into the bitstream,
wherein, in response to the first reference sample line immediately adjacent to the current block among the plurality of reference sample lines being selected as the reference sample line, the intra-predicted block is filtered, and
wherein, in response to the first reference sample line not being selected as the reference sample line, the intra-predicted block is not filtered.
6. The method of claim 5 ,
wherein the intra prediction mode of the current block is determined based on whether
the selected reference sample line is the first reference sample line among the plurality of reference sample lines, and
wherein, in response to the selected reference sample line being the first reference sample line, an MPM flag indicating whether the intra prediction mode is identical to at least one among a plurality of intra prediction mode candidates included in an MPM list is encoded into the bitstream.
7. The method of claim 5 , wherein whether to perform filtering the intra-predicted block is determined based on at least one of a size of the current block or the intra prediction mode of the current block, or combinations thereof.
8. The method of claim 5 ,
wherein the configuring the reference sample comprises:
filtering the reference sample in response to the selected reference sample line being the first reference sample line.
9. A non-transitory computer-readable recording medium storing a bitstream which is generated by an image encoding method,
wherein the image encoding method comprises:
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-predicted 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;
determining whether to perform filtering the intra-predicted block based on the reference sample line; and
filtering the intra-predicted block based on whether to perform filtering,
wherein the reference sample line is selected based on whether a top boundary of the current block corresponds to a boundary of a coding tree block,
wherein, in response to the top boundary of the current block not corresponding to the boundary of the coding tree block, the reference sample line is selected based on index information indicating the reference sample line among the plurality of reference sample lines, index information being signaled from a bitstream,
wherein, in response to the top boundary of the current block corresponding to the boundary of the coding tree block, the reference sample line is selected without signaling the index information, a first reference sample line immediately adjacent to the current block among the plurality of reference sample lines being selected as the reference sample line,
wherein, in response to the first reference sample line immediately adjacent to the current block among the plurality of reference sample lines being selected as the reference sample line, the intra-predicted block is filtered, and
wherein, in response to the first reference sample line not being selected as the reference sample line, the intra-predicted block is not filtered.