Transform-based image coding method and apparatus therefor
An image decoding method according to the present document comprises the steps of: deriving a transform coefficient for a current block on the basis of residual information; when LFNST is applied to the current block, receiving an LFNST index related to an LFNST matrix; and deriving a modified transform coefficient for the current block on the basis of the LFNST matrix, wherein the LFNST index may be signaled for a luma component of the current block.
1. An image decoding method performed by a decoding apparatus, the method comprising:
receiving residual information from a bitstream;
deriving a transform coefficient for a current block based on the residual information;
receiving a low-frequency non-separable transform (LFNST) index related to an LFNST matrix in response to a case where an LFNST is applied to the current block;
receiving a multiple transform selection (MTS) index related to an MTS matrix in response to a case where an MTS is applied to the current block; and
deriving a modified transform coefficient for the current block based on the LFNST matrix,
wherein before a transform coefficient for a luma component of the current block and a transform coefficient for a chroma component of the current block are derived, a variable is set to 1 in a transform unit level, based on at least one of (i) the current block being a block to which an intra sub-partitions (ISP) is not applied or (ii) the current block being a last partition block in a case that the ISP is applied to the current block,
wherein after the transform coefficient for the luma component of the current block is derived and before the transform coefficient for the chroma component of the current block is derived, the LFNST index for the luma component of the current block is obtained in the transform unit level, based on a tree type of the current block being not dual tree chroma and the variable being equal to 1,
wherein after the transform coefficient for the luma component of the current block is derived and before the transform coefficient for the chroma component of the current block is derived, the MTS index for the luma component of the current block is obtained in the transform unit level, based on the tree type of the current block being not dual tree chroma, and
wherein after the transform coefficient for the chroma component of the current block is derived, the LFNST index for the chroma component of the current block is obtained in the transform unit level, based on the variable being equal to 1.
2. An image encoding method performed by an encoding apparatus, the method comprising:
deriving prediction samples for a current block;
deriving residual samples for the current block based on the prediction samples;
encoding a transform coefficient for the current block from the residual samples based on a low-frequency non-separable transform (LFNST) or a multiple transform selection (MTS);
encoding an LFNST index related to an LFNST matrix in response to a case where the LFNST is applied to the current block; and
encoding an MTS index related to an MTS matrix in response to a case where the MTS is applied to the current block,
wherein before a transform coefficient for a luma component of the current block and a transform coefficient for a chroma component of the current block are derived, a variable is set to 1 in a transform unit level, based on at least one of (i) the current block being a block to which an intra sub-partitions (ISP) is not applied or (ii) the current block being a last partition block in a case that the ISP is applied to the current block,
wherein after the transform coefficient for the luma component of the current block is encoded and before the transform coefficient for the chroma component of the current block is encoded, the LFNST index for the luma component of the current block is encoded in a transform unit level based on a tree type of the current block being not dual tree chroma and the variable being equal to 1,
wherein after the transform coefficient for the luma component of the current block is encoded and before the transform coefficient for the chroma component of the current block is encoded, the MTS index for the luma component of the current block is encoded in the transform unit level, based on the tree type of the current block being not dual tree chroma, and
wherein after the transform coefficient for the chroma component of the current block is encoded, the LFNST index for a chroma component of the current block is signaled in the transform unit level.
3. A method for transmitting data for image information comprising:
deriving prediction samples for a current block;
deriving residual samples for the current block based on the prediction samples;
encoding a transform coefficient for the current block from the residual samples based on a low-frequency non-separable transform (LFNST) or a multiple transform selection (MTS);
encoding an LFNST index related to an LFNST matrix in response to a case where the LFNST is applied to the current block; and
encoding an MTS index related to an MTS matrix in response to a case where the MTS is applied to the current block,
wherein before a transform coefficient for a luma component of the current block and a transform coefficient for a chroma component of the current block are derived, a variable is set to 1 in a transform unit level, based on at least one of (i) the current block being a block to which an intra sub-partitions (ISP) is not applied or (ii) the current block being a last partition block in a case that the ISP is applied to the current block,
wherein after the transform coefficient for the luma component of the current block is encoded and before the transform coefficient for the chroma component of the current block is encoded, the LFNST index for the luma component of the current block is encoded in a transform unit level based on a tree type of the current block being not dual tree chroma and the variable being equal to 1,
wherein after the transform coefficient for the luma component of the current block is encoded and before the transform coefficient for the chroma component of the current block is encoded, the MTS index for the luma component of the current block is encoded in the transform unit level, based on the tree type of the current block being not dual tree chroma, and
wherein after the transform coefficient for the chroma component of the current block is encoded, the LFNST index for a chroma component of the current block is signaled in the transform unit level.