An image decoding apparatus for inverse transforming a transform coefficient for each transform unit, the image decoding apparatus comprising: a transform unit decoder configured to decode, from coded data, (i) a secondary index, stIdx, indicating whether or not an inverse secondary transform is used and a transform basis, and (ii) a multiple transform selection index, mts_idx, indicating a transform matrix of a Multiple Transform Selection, MTS and being a switch index for selecting a transform basis of an inverse core transform; an inverse quantization unit configured to perform an inverse quantization on a quantized transform coefficient and derive the transform coefficient; a secondary transformer configured to derive a modified transform coefficient by applying the inverse secondary transform to the transform coefficient by using a transform matrix in a case that the inverse secondary transform is enabled; and a core transformer (1521, 31123) configured to apply the inverse core transform including vertical transform and horizontal transform to the transform coefficient or the modified transform coefficient, wherein the core transformer (1521, 31123) includes an MTS configuration unit and an implicit MTS configuration unit, the MTS configuration unit derives a horizontal transform type and a vertical transform type according to the multiple transform selection index, mts_idx, in a case that an explicit MTS is enabled, the implicit MTS configuration unit disables implicit MTS in a case that all of following conditions are true: (a) the secondary index, stIdx, is not equal to 0, (b) a first MTS by an intra subpartition mode is not used, and (c) a second MTS by a subblock transform is not used, and sets the horizontal transform type equal to 1 in a case that the secondary index, stIdx, is equal to 0 and a width of a transform unit is within a prescribed range, otherwise sets the horizontal transform type equal to 0, and sets the vertical transform type equal to 1 in a case that the secondary index, stIdx, is equal to 0 and a height of the transform unit is within the prescribed range, othewise sets the vertical transform type equal to 0, wherein the core transformer (1521, 31123) performs inverse transform according to the vertical transform type, and inverse transform according to the horizontal transform type. a transform unit decoder configured to decode, from coded data, (i) a secondary index, stIdx, indicating whether or not an inverse secondary transform is used and a transform basis, and (ii) a multiple transform selection index, mts_idx, indicating a transform matrix of a Multiple Transform Selection, MTS and being a switch index for selecting a transform basis of an inverse core transform; an inverse quantization unit configured to perform an inverse quantization on a quantized transform coefficient and derive the transform coefficient; a secondary transformer configured to derive a modified transform coefficient by applying the inverse secondary transform to the transform coefficient by using a transform matrix in a case that the inverse secondary transform is enabled; and a core transformer (1521, 31123) configured to apply the inverse core transform including vertical transform and horizontal transform to the transform coefficient or the modified transform coefficient, wherein the core transformer (1521, 31123) includes an MTS configuration unit and an implicit MTS configuration unit, the MTS configuration unit derives a horizontal transform type and a vertical transform type according to the multiple transform selection index, mts_idx, in a case that an explicit MTS is enabled, the implicit MTS configuration unit disables implicit MTS in a case that all of following conditions are true: (a) the secondary index, stIdx, is not equal to 0, (b) a first MTS by an intra subpartition mode is not used, and (c) a second MTS by a subblock transform is not used, and sets the horizontal transform type equal to 1 in a case that the secondary index, stIdx, is equal to 0 and a width of a transform unit is within a prescribed range, otherwise sets the horizontal transform type equal to 0, and sets the vertical transform type equal to 1 in a case that the secondary index, stIdx, is equal to 0 and a height of the transform unit is within the prescribed range, othewise sets the vertical transform type equal to 0, wherein the core transformer (1521, 31123) performs inverse transform according to the vertical transform type, and inverse transform according to the horizontal transform type.