Image coding method based on transform, and device therefor
An image decoding method according to the present document can comprise the steps of: deriving a transform coefficient for a current block on the basis of residual information; determining whether an effective coefficient is in a second area that excludes the upper left first area of the current block; parsing an MTS index from a bitstream if the effective coefficient is not in the second area; and deriving a residual sample by applying, to transform coefficients of the first area, an MTS kernel derived on the basis of the MTS index.
1 . An image decoding apparatus, comprising:
a memory; and
at least one processor connected to the memory, wherein the at least one processor is configured to:
obtain residual information from a bitstream;
derive transform coefficients for a current block based on the residual information;
determine whether a significant coefficient is present in a second region other than a first region at the top-left of the current block;
parse a multiple transform selection (MTS) index from the bitstream based on the significant coefficient being not present in the second region;
derive residual samples by applying an MTS kernel derived based on the MTS index to the transform coefficients of the first region; and
generate a reconstructed picture based on the residual samples,
wherein a low frequency non-separable transform (LFNST) index and the MTS index are obtained in a coding unit level,
wherein the LFNST index indicates an LFNST kernel applied to the current block,
wherein the MTS index is obtained immediately after the LFNST index is obtained,
wherein whether to obtain the MTS index is determined based on a tree type of the current block, and
wherein, based on the tree type of the current block being a dual tree chroma, the MTS index is not obtained.
2 . The image decoding apparatus of claim 1 , wherein the first region is the top-left 16×16 region of the current block.
3 . The image decoding apparatus of claim 1 , wherein the at least one processor is further configured to derive a variable value related to whether the significant coefficient is present in the second region in the decoding process of a residual coding level,
wherein the variable value is initially set to 1, and
wherein based on the significant coefficient being present in the second region, the variable value is changed to 0, and the MTS index is not parsed.
4 . The image decoding apparatus of claim 1 , wherein based on the tree type of the current block being a dual tree luma or a single tree and the value of the LFNST index being 0, the MTS index is signaled.
5 . An image encoding apparatus, comprising:
a memory; and
at least one processor connected to the memory, wherein the at least one processor is 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 based on a multiple transform selection (MTS) for the residual samples; and
encode the residual information derived through the quantization of the transform coefficients and an MTS index related to an MTS kernel,
wherein a low frequency non-separable transform (LFNST) index and the MTS index are signaled in a coding unit level,
wherein the LFNST index indicates an LFNST kernel applied to the current block,
wherein the MTS index is signaled immediately after the signaling of the LFNST index,
wherein whether to signal the MTS index is determined based on a tree type of the current block, and
wherein, based on the tree type of the current block being a dual tree chroma, the MTS index is not signaled.
6 . The image encoding apparatus of claim 5 , wherein the at least one processor is further configured to zero out a second region of the current block other than a first region at the top-left of the current block,
wherein the first region is the top-left 16×16 region of the current block.
7 . The image encoding apparatus of claim 5 , wherein based on the tree type of the current block being a dual tree luma or a single tree and the value of the LFNST index being 0, the MTS index is signaled.
8 . An apparatus for transmitting data for image information comprising:
at least one processor configured to generate a bitstream for the image information, wherein the bitstream is generated based on obtaining a bitstream of the image information including residual information, wherein the residual information is generated by 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 based on a multiple transform selection (MTS) for the residual samples; and encoding residual information derived through the quantization of the transform coefficients and an MTS index related to an MTS kernel to generate the bitstream; and
a transmitter configured to transmit the data comprising the bitstream of the image information,
wherein a low frequency non-separable transform (LFNST) index and the MTS index are signaled in a coding unit level,
wherein the LFNST index indicates an LFNST kernel applied to the current block,
wherein the MTS index is signaled immediately after the signaling of the LFNST index,
wherein whether to signal the MTS index is determined based on a tree type of the current block, and
wherein, based on the tree type of the current block being a dual tree chroma, the MTS index is not signaled.