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. A decoding apparatus for image decoding, the decoding apparatus comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
obtain residual information from a bitstream;
derive transform coefficients for a current block based on the residual information;
derive modified transform coefficients by applying a low-frequency non-separable transform (LFNST) to the transform coefficients;
derive residual samples for the current block by applying an inverse primary transform to the modified transform coefficients; and
generate a reconstructed picture based on the residual samples,
wherein the at least one processor further configured to:
determine a height and a width of a subpartition block based on an intra sub partitions (ISP) being applied to the current block;
parse an LFNST index based on the height and the width of the subpartition block; and
derive 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. An encoding apparatus for image encoding, the encoding apparatus comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
derive prediction samples for a current block;
derive residual samples for the current block based on the prediction samples;
derive transform coefficients for the current block by applying a primary transform to the residual samples;
derive modified transform coefficients by applying an low-frequency non-separable transform (LFNST) based on an LFNST matrix to the transform coefficients; and
encode residual information on the modified transform coefficients, and an LFNST index related to the LFNST matrix to output a bitstream,
wherein the at least one processor further configured to:
determine 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.
3. An apparatus for transmitting data for an image, the apparatus comprising:
at least one processor configured to obtain 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 to output the bitstream; and
a transmitter configured to transmit 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.