An image decoding method according to this document includes deriving a residual sample by applying at least one of LFNST and MTS to a transform coefficient; generating a reconstructed picture based on the residual samples, wherein the LFNST is performed based on an LFNST transform set, an LFNST kernel included in the LFNST transform set, and an LFNST index indicating the LFNST kernel, The first bin of the syntax element bin string for the LFNST index may be derived based on different context information according to the tree type of the current block, and the second bin of the syntax element bin string may be derived based on preset context information. there is.
展开▼