An image decoding method performed by a decoding apparatus, the method comprising: receiving a bitstream; deriving prediction samples based on an intra prediction mode applied to a target block of a picture; obtaining a two-dimensional array of transform coefficients based on the received bitstream; deriving a plurality of first transform coefficients from a top-left 4x4 region of the two-dimensional array of transform coefficients; deriving a plurality of second transform coefficients based on an inverse secondary transform of the plurality of first transform coefficients; deriving a two-dimensional array of values based on the plurality of second transform coefficients, wherein the plurality of second transform coefficients are mapped to a top-left 8x8 region of the two-dimensional array of values, excluding a bottom-right 4x4 region within the top-left 8x8 region; deriving an array of residual samples based on an inverse primary transform of the two-dimensional array of values; and generating a reconstructed picture based on the array of residual samples and the prediction samples, wherein the deriving the plurality of second transform coefficients based on the inverse secondary transform of the plurality of first transform coefficients comprises: performing a matrix operation between a transform kernel matrix and the plurality of first transform coefficients, in which the plurality of first transform coefficients are arranged according to a forward diagonal scanning order of the top-left 4x4 region of the two-dimensional array of transform coefficients, wherein the transform kernel matrix is a 48 × 16 matrix, and wherein the matrix operation between the transform kernel matrix and the plurality of first transform coefficients of the top-left 4x4 region is (48 × 16 matrix) * (16 × 1 transform coefficient vector). receiving a bitstream; deriving prediction samples based on an intra prediction mode applied to a target block of a picture; obtaining a two-dimensional array of transform coefficients based on the received bitstream; deriving a plurality of first transform coefficients from a top-left 4x4 region of the two-dimensional array of transform coefficients; deriving a plurality of second transform coefficients based on an inverse secondary transform of the plurality of first transform coefficients; deriving a two-dimensional array of values based on the plurality of second transform coefficients, wherein the plurality of second transform coefficients are mapped to a top-left 8x8 region of the two-dimensional array of values, excluding a bottom-right 4x4 region within the top-left 8x8 region; deriving an array of residual samples based on an inverse primary transform of the two-dimensional array of values; and generating a reconstructed picture based on the array of residual samples and the prediction samples, wherein the deriving the plurality of second transform coefficients based on the inverse secondary transform of the plurality of first transform coefficients comprises: performing a matrix operation between a transform kernel matrix and the plurality of first transform coefficients, in which the plurality of first transform coefficients are arranged according to a forward diagonal scanning order of the top-left 4x4 region of the two-dimensional array of transform coefficients, wherein the transform kernel matrix is a 48 × 16 matrix, and wherein the matrix operation between the transform kernel matrix and the plurality of first transform coefficients of the top-left 4x4 region is (48 × 16 matrix) * (16 × 1 transform coefficient vector). performing a matrix operation between a transform kernel matrix and the plurality of first transform coefficients, in which the plurality of first transform coefficients are arranged according to a forward diagonal scanning order of the top-left 4x4 region of the two-dimensional array of transform coefficients, wherein the transform kernel matrix is a 48 × 16 matrix, and wherein the matrix operation between the transform kernel matrix and the plurality of first transform coefficients of the top-left 4x4 region is (48 × 16 matrix) * (16 × 1 transform coefficient vector).