Matrix-based intra prediction device and method
An image decoding method according to the present document can comprise the steps of: receiving flag information indicating whether a matrix-based intra prediction (MIP) is used with respect to a current block; receiving matrix-based intra prediction (MIP) mode information on the basis of the flag information; generating an intra prediction sample for the current block on the basis of the MIP mode information; and generating restoration samples for the current block on the basis of the intra prediction samples.
1. An image decoding method performed by a decoding apparatus, the method comprising:
receiving information on residual;
receiving flag information related to whether matrix-based intra prediction (MIP) is used for a current block;
receiving MIP mode information based on the flag information;
generating intra prediction samples for the current block based on the MIP mode information;
deriving residual samples based on the information on the residual; and
generating reconstructed samples for the current block based on the intra prediction samples and the residual samples,
wherein the MIP mode information is index information related to an MIP matrix applied to the current block,
wherein the MIP matrix is derived based on a size of the current block and the index information, and
wherein the intra prediction samples is generated based on the MIP matrix.
2. The image decoding method of claim 1 , wherein the generating of the intra prediction samples comprises:
deriving reduced boundary samples by downsampling reference samples adjacent to the current block;
deriving reduced prediction samples based on a multiplication operation of the reduced boundary samples and the MIP matrix; and
generating the intra prediction samples for the current block by upsampling the reduced prediction samples.
3. The image decoding method of claim 1 , wherein the MIP matrix is selectable from any one of three matrix sets classified according to the size of the current block, and
wherein each of the three matrix sets comprises a plurality of MIP matrices.
4. The image decoding method of claim 2 , wherein the reduced boundary samples are downsampled by averaging the reference samples, and
wherein the intra prediction samples are upsampled by linear interpolation of the reduced prediction samples.
5. An image encoding method performed by an encoding apparatus, the method comprising:
deriving flag information related to whether matrix-based intra prediction (MIP) is applied to a current block;
deriving MIP mode information based on the flag information;
deriving intra prediction samples for the current block based on the MIP mode information; and
encoding image information including the flag information and the MIP mode information,
wherein the MIP mode information is index information related to an MIP matrix applied to the current block,
wherein the MIP matrix is derived based on a size of the current block and the index information, and
wherein the intra prediction samples is derived based on the MIP matrix.
6. The image encoding method of claim 5 , wherein the deriving of the intra prediction samples comprises:
deriving reduced boundary samples by downsampling reference samples adjacent to the current block;
deriving reduced prediction samples based on a multiplication operation of the reduced boundary samples and the MIP matrix; and
generating the intra prediction samples for the current block by upsampling the reduced prediction samples.
7. The image encoding method of claim 6 , wherein the MIP matrix is selectable from any one of three matrix sets classified according to the size of the current block, and
wherein each of the three matrix sets comprises a plurality of MIP matrices.
8. The image encoding method of claim 5 , wherein the reduced boundary samples are downsampled by averaging the reference samples, and
wherein the intra prediction samples are upsampled by linear interpolation of the reduced prediction samples.
9. A non-transitory computer-readable digital storage medium that stores a bitstream generated by a method, the method comprising:
deriving flag information related to whether matrix-based intra prediction (MIP) is applied to a current block;
deriving MIP mode information based on the flag information;
deriving intra prediction samples for the current block based on the MIP mode information; and
encoding image information including the flag information and the MIP mode information to generate the bitstream,
wherein the MIP mode information is index information related to an MIP matrix applied to the current block,
wherein the MIP matrix is derived based on a size of the current block and the index information, and
wherein the intra prediction samples is derived based on the MIP matrix.