`
`1. An encoder, comprising:
`
`circuitry; and
`
`memory, wherein
`
`using the memory, the circuitry:
`
`performs a transform processof G) applying a first transform to
`
`a prediction residual signal indicating a difference between a current block to
`
`be encoded and a prediction image of the current block and Gi) further applying
`
`a second transform to a transform result of the first transform; and
`
`10
`
`in the second transform, selects one transform basis G) from a
`
`first group of candidates whena size of the current block is a first block size and
`
`Gi) from a second group of candidates when the size of the current block is a
`
`second block size different from the first block size, the first group including
`
`one or more candidates for a transform basis, the second group being different
`
`15
`
`from thefirst group.
`
`2. The encoder according to claim 1, wherein
`
`the first block size is a size of the current block having a shorter side
`
`whose length is less than 8, and the second block size is a size of the current
`
`20
`
`block having the shorter side whose length is greater than or equal to 8.
`
`3. The encoder according to claim 1, wherein
`
`the first block size is 4x4 and the second block size is 8x8.
`
`25
`
`4. The encoderaccording to claim 1, wherein
`
`the circuitry applies the second transform to sixteen samples among
`
`samples resulting from thefirst transform.
`
`125
`
`
`
`5. The encoder according to claim 1, wherein
`
`the circuitry selects the one transform basis from the second group
`
`whenthe size of the current block is a third block size different from the first
`
`5
`
`block size and the second block size.
`
`6. The encoder according to claim 1, wherein
`
`whenthesize of the current block is larger than a predetermined block
`
`size,
`
`it
`
`is determined that the second transform is to be applied to the
`
`10
`
`transform result.
`
`7. The encoderaccording to claim 6, wherein
`
`when the size of the current block is smaller than the predetermined
`
`block size, it is determined that the second transform is not to be applied to the
`
`15‘
`
`transform result.
`
`8. The encoder according to claim 6, wherein
`
`the predetermined block size is 44.
`
`20
`
`9. The encoderaccording to claim 6, wherein
`
`the predetermined block size is 4x8 or 8X4.
`
`10. The encoderaccording to claim 6, wherein
`
`the predetermined block size is a smallest block size applicable to the
`
`25
`
`current block.
`
`11. A decoder, comprising:
`
`126
`
`
`
`circuitry; and
`
`memory, wherein
`
`using the memory, the circuitry:
`
`performs an inverse transform process of G) applying a second
`
`transform to transform coefficients obtained by inverse quantizing a current
`
`block to be decoded and Gi) further applying a first transform to a transform
`
`result of the second transform, and generates an image based on a prediction
`
`residual signal obtained through the inverse transform process; and
`
`in the second transform, selects one transform basis G) from a
`
`10
`
`first group of candidates whena size of the current block is a first block size and
`
`Gi) from a second group of candidates when the size of the current block is a
`
`second block size different from the first block size, the first group including
`
`one or more candidates for a transform basis, the second group being different
`
`from thefirst group.
`
`15
`
`20
`
`12. The decoder according to claim 11, wherein
`
`the first block size is a size of the current block having a shorter side
`
`whose length is less than 8, and the second block size is a size of the current
`
`block having the shorter side whose length is greater than or equal to 8.
`
`13. The decoder according to claim 11, wherein
`
`the first block size is 4x4 and the second block size is 8x8.
`
`14. The decoder according to claim 11, wherein
`
`25
`
`the circuitry generates sixteen samples in the second transform.
`
`15. The decoder according to claim 11, wherein
`
`127
`
`
`
`the circuitry selects the one transform basis from the second group
`
`whenthe size of the current block is a third block size different from the first
`
`block size and the second block size.
`
`5
`
`16. The decoder according to claim 11, wherein
`
`whenthesize of the current block is larger than a predetermined block
`
`size,
`
`it
`
`is determined that the second transform is to be applied to the
`
`transform coefficients.
`
`10
`
`17. The decoder according to claim 16, wherein
`
`when the size of the current block is smaller than the predetermined
`
`block size, it is determined that the second transform is not to be applied to the
`
`transform coefficients.
`
`15
`
`18. The decoder according to claim 16, wherein
`
`the predetermined block size is 4x4.
`
`19. The decoder according to claim 16, wherein
`
`the predetermined block size is 4<8 or 8x4.
`
`20
`
`20. The decoder according to claim 16, wherein
`
`the predetermined block size is a smallest block size applicable to the
`
`current block.
`
`25
`
`21. An encoding method, comprising:
`
`performing a transform process of G) applying a first transform to a
`
`prediction residual signal indicating a difference between a current block to be
`
`128
`
`
`
`encoded and a prediction image of the current block and Gi) further applying a
`
`second transform to a transform result of the first transform; and
`
`in the second transform, selecting one transform basis (Gi) fromafirst
`
`group of candidates when a size of the current block is a first block size and Gi)
`
`from a second group of candidates whenthesize of the current block is a second
`
`block size different from the first block size, the first group including one or
`
`more candidates for a transform basis, the second group being different from
`
`the first group.
`
`10
`
`22. A decoding method, comprising:
`
`performing an inverse transform process of G) applying a second
`
`transform to transform coefficients obtained by inverse quantizing a current
`
`block to be decoded and Gi) further applying a first transform to a transform
`
`result of the second transform, and generating an image based on a prediction
`
`15
`
`residual signal obtained through the inverse transform process; and
`
`in the second transform, selecting one transform basis Gi) fromafirst
`
`group of candidates whena size of the current block is a first block size and Gi)
`
`from a second group of candidates when thesize of the current block is a second
`
`block size different from the first block size, the first group including one or
`
`20
`
`more candidates for a transform basis, the second group being different from
`
`the first group.
`
`129
`
`