Transform-based image coding method and device therefor
An image decoding method according to the present document comprises a step of deriving a corrected transform coefficient, wherein the step of deriving the corrected transform coefficient comprises the steps of: determining whether LFNST can be applied to the height and width of a divided sub-partition block when an ISP is applied to a current block; parsing a LFNST index when the LFNST can be applied; and deriving the corrected transform coefficient on the basis of the LFNST index and a LFNST matrix.
1. An image decoding method performed by a decoding apparatus, comprising:
obtaining residual information from a bitstream;
deriving transform coefficients for a current block based on the residual information;
deriving modified transform coefficients by applying a low-frequency non-separable transform (LFNST) to the transform coefficients;
deriving residual samples for the current block by applying an inverse primary transform to the modified transform coefficients; and
generating a reconstructed picture based on the residual samples,
wherein the deriving the modified transform coefficients comprises:
determining a height and a width of a subpartition block based on an intra sub partitions (ISP) being applied to the current block,
parsing an LFNST index based on the height and the width of the subpartition block; and
deriving the modified transform coefficients by applying the LFNST based on an LFNST matrix related to the LFNST index to the transform coefficients, and
wherein in case a tree-type of the current block is a dual-tree luma or single-tree, based on the height and the width of the subpartition block corresponding to a luma component block for the current block being equal to 4 or more, the LFNST index is parsed.
2. The method of claim 1 ,
wherein in case the ISP is not applied to the current block and the tree-type of the current block is a dual-tree chroma, based on a height and a width of a chroma component block for the current block being equal to 4 or more, the LFNST index is parsed.
3. The method of claim 1 ,
wherein the current block is a coding unit, and
wherein when a width and a height of the coding unit are equal to or less than a maximum luma transform size that is available for transform, the LFNST index is parsed.
4. An image encoding method performed by an encoding apparatus, comprising:
deriving prediction samples for a current block;
deriving residual samples for the current block based on the prediction samples;
deriving transform coefficients for the current block by applying a primary transform to the residual samples;
deriving modified transform coefficients by applying an low-frequency non-separable transform (LFNST) based on an LFNST matrix to the transform coefficients; and
encoding residual information on the modified transform coefficients, and an LFNST index related to the LFNST matrix to output a bitstream,
wherein the deriving the modified transform coefficients comprises:
determining a height and a width of a subpartition block based on an intra sub partitions (ISP) being applied to the current block,
wherein an LFNST index is encoded based on the height and the width of the subpartition block, and
wherein in case a tree-type of the current block is a dual-tree luma or single-tree, based on the height and the width of the subpartition block corresponding to a luma component block for the current block being equal to 4 or more, the LFNST index is encoded.
5. The method of claim 4 ,
wherein in case the ISP is not applied to the current block and the tree-type of the current block is a dual-tree chroma, based on a height and a width corresponding to a chroma component block for the current block being equal to 4 or more, the LFNST index is encoded.
6. The method of claim 4 ,
wherein the current block is a coding unit, and
wherein when a width and a height of the coding unit are equal to or less than a maximum luma transform size that is available for transform, the LFNST index is encoded.
7. A non-transitory computer-readable storage medium storing a bitstream generated by the image encoding method of claim 1 .
8. The method of claim 1 ,
wherein a first flag related to whether the current block is partitioned into subpartitions and a second flag related to which direction the current block is split are obtained from the bitstream.
9. The method of claim 4 ,
wherein a first flag related to whether the current block is partitioned into subpartitions and a second flag related to which direction the current block is split are encoded to output the bitstream.
10. A transmission method of data for an image, the method comprising:
obtaining a bitstream for the image, wherein the bitstream is generated based on deriving prediction samples for a current block, deriving residual samples for the current block based on the prediction samples, deriving transform coefficients for the current block by applying a primary transform to the residual samples, deriving modified transform coefficients by applying an low-frequency non-separable transform (LFNST) based on an LFNST matrix to the transform coefficients, and encoding residual information on the modified transform coefficients, and an LFNST index related to the LFNST matrix; and
transmitting the data comprising the bitstream,
wherein the deriving the modified transform coefficients comprises:
determining a height and a width of a subpartition block based on an intra sub partitions (ISP) being applied to the current block,
wherein an LFNST index is encoded based on the height and the width of the subpartition block, and
wherein in case a tree-type of the current block is a dual-tree luma or single-tree, based on the height and the width of the subpartition block corresponding to a luma component block for the current block being equal to 4 or more, the LFNST index is encoded.