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:
determining whether a combination of intra prediction and inter prediction is used for prediction on a current block;
generating a first prediction block of the current block by an inter prediction mode and generating a second prediction block of the current block by an intra prediction mode in response to the combination of intra prediction and inter prediction being used for prediction on the current block; and
generating a final prediction block of the current block based on the combination of the first prediction block and the second prediction block,
wherein,
a final prediction sample in the final prediction block is determined based on a weighted sum of a first prediction sample in the first prediction block and a second prediction sample in the second prediction block,
the intra prediction mode is fixed to a planar mode and decoding of intra prediction mode information regarding the intra prediction mode is skipped for the current block in response to a determination that the combination of intra prediction and inter prediction is determined to be used for prediction on the current block, and
the inter prediction mode is fixed to a merge mode in response to a determination that the combination of intra prediction and inter prediction is determined to be used for prediction on the current block.
2. The method of claim 1 , wherein a sum of the first weight and the second weight is 4.
3. The method of claim 1 , wherein, in case the prediction block of the current block is generated by the weighted sum of the intra-predicted block and the inter-predicted block, the reference sample of the intra prediction of the current block is configured based on a first reference sample line adjacent to the current block among the plurality of reference sample lines.
4. The method of claim 1 ,
wherein the determining the intra prediction mode of the current block comprises
determining whether or not the reference sample line used for configuring the reference sample is a first reference sample line adjacent to the current block among the plurality of reference sample lines; and
parsing, from a bitstream, an MPM flag indicating whether or not the intra prediction mode of the current block is identical to at least one among a plurality of candidate intra prediction modes included in an MPM list in case the reference sample line used for configuring the reference sample is determined to be the first reference sample line.
5. The method of claim 1 ,
wherein the image decoding method further comprises
determining whether or not the reference sample line used for configuring the reference sample is a first reference sample line adjacent to the current block among the plurality of reference sample lines; and
performing filtering for the generated prediction block of the current block in case the reference sample line used for configuring the reference sample is determined to be the first reference sample line.
6. An image encoding method performed by an image encoding apparatus, the method comprising:
determining whether a combination of intra prediction and inter prediction is used for prediction on a current block;
generating a first prediction block of the current block by an inter prediction mode and generating a second prediction block of the current block by an intra prediction mode in response to the combination of intra prediction and inter prediction being used for prediction on the current block; and
generating a final prediction block of the current block based on the combination of the first prediction block and the second prediction block;
wherein,
a final prediction sample in the final prediction block is determined based on a weighted sum of a first prediction sample in the first prediction block and a second prediction sample in the second prediction block,
the intra prediction mode is fixed to a planar mode and decoding encoding of intra prediction mode information regarding the intra prediction mode is skipped for the current block in response to a determination that the combination of intra prediction and inter prediction is determined to be used for prediction on the current block, and
the inter prediction mode is fixed to a merge mode in response to a determination that the combination of intra prediction and inter prediction is determined to be used for prediction on the current block.
7. The method of claim 6 , wherein, in case the prediction block of the current block is generated by the weighted sum of the intra-predicted block and the inter-predicted block, the reference sample of the intra prediction of the current block is configured based on a first reference sample line adjacent to the current block among the plurality of reference sample lines.
8. The method of claim 6 ,
wherein the image encoding method further comprises encoding the determined intra prediction mode of the current block, and
wherein the encoding the intra prediction mode of the current block comprises
determining whether or not the reference sample line used for configuring the reference sample is a first reference sample line adjacent to the current block among the plurality of reference sample lines; and
encoding, into a bitstream, an MPM flag indicating whether or not the intra prediction mode of the current block is identical to at least one among a plurality of candidate intra prediction modes included in an MPM list in case the reference sample line used for configuring the reference sample is determined to be the first reference sample line.
9. The method of claim 6 , wherein the image encoding method further comprises
determining whether or not the reference sample line used for configuring the reference sample is a first reference sample line adjacent to the current block among the plurality of reference sample lines; and
performing filtering for the generated prediction block of the current block in case the reference sample line used for configuring the reference sample is determined to be the first reference sample line.
10. A non-transitory computer-readable recording medium storing a bitstream that is generated by an image encoding method, wherein the image encoding method comprises:
determining whether a combination of intra prediction and inter prediction is used for prediction on a current block;
generating a first prediction block of the current block by an inter prediction mode and generating a second prediction block of the current block by an intra prediction mode in response to the combination of intra prediction and inter prediction being used for prediction on the current block; and
generating a final prediction block of the current block based on the combination of the first prediction block and the second prediction block,
wherein,
a final prediction sample in the final prediction block is determined based on a weighted sum of a first prediction sample in the first prediction block and a second prediction sample in the second prediction block,
the intra prediction mode is fixed to a planar mode and encoding of intra prediction mode information regarding the intra prediction mode is skipped for the current block in response to a determination that the combination of intra prediction and inter prediction is determined to be used for prediction on the current block,
the inter prediction mode is fixed to a merge mode in response to a determination that the combination of intra prediction and inter prediction is determined to be used for prediction on the current block.