Encoder, decoder, encoding method, and decoding method
Provided is an encoder including: circuitry; and memory coupled to the circuitry, in which the circuitry: derives a prediction residual indicating a difference between a current block and a prediction image of the current block; performs primary transform on the prediction residual, and performs secondary transform on a result of the primary transform; performs quantization on a result of the secondary transform; and encodes a result of the quantization. In the performing of the secondary transform, when a matrix weighted intra prediction included in intra prediction and having prediction modes is used, the circuitry uses, as a transform set for the secondary transform, a common transform set shared among the prediction modes. The matrix weighted intra prediction generates the prediction image by performing matrix calculation on a pixel sequence obtained from pixel values of surrounding pixels of the current block.
1. An encoder that encodes an image, the encoder comprising:
circuitry; and
memory coupled to the circuitry,
wherein the circuitry:
derives a prediction residual indicating a difference between a current block and a prediction image of the current block;
performs primary transform on the prediction residual, and performs secondary transform on a result of the primary transform;
performs quantization on a result of the secondary transform; and
encodes a result of the quantization,
wherein in the performing of the secondary transform,
when a matrix weighted intra prediction included in intra prediction and having a plurality of prediction modes is used, the circuitry uses, as a transform set for the secondary transform, a common transform set shared among the plurality of prediction modes, the matrix weighted intra prediction generating the prediction image by performing matrix calculation on a pixel sequence obtained from pixel values of surrounding pixels of the current block, the transform set for the secondary transform being applied to primary transform coefficients obtained from the result of the primary transform, and
wherein the transform set includes a plurality of transform matrices.
2. A decoder that decodes an image, the decoder comprising:
circuitry; and
memory coupled to the circuitry,
wherein the circuitry:
performs inverse quantization on a current block to be decoded;
performs secondary inverse transform on a result of the inverse quantization, and performs primary inverse transform on a result of the secondary inverse transform; and
derives the image based on a prediction image of the current block and a prediction residual which is a result of the primary inverse transform,
wherein in the performing of the secondary inverse transform,
when a matrix weighted intra prediction included in intra prediction and having a plurality of prediction modes is used, the circuitry uses, as an inverse transform set for the secondary inverse transform, a common inverse transform set shared among the plurality of prediction modes, the matrix weighted intra prediction generating the prediction image by performing matrix calculation on a pixel sequence obtained from pixel values of surrounding pixels of the current block, the inverse transform set for the secondary inverse transform being applied to quantized coefficients obtained from the result of the inverse quantization, and
wherein the inverse transform set includes a plurality of transform matrices.
3. An encoding method of encoding an image, the encoding method comprising:
deriving a prediction residual indicating a difference between a current block and a prediction image of the current block;
performing primary transform on the prediction residual, and performing secondary transform on a result of the primary transform;
performing quantization on a result of the secondary transform; and
encoding a result of the quantization,
wherein in the performing of the secondary transform,
when a matrix weighted intra prediction included in intra prediction and having a plurality of prediction modes is used, a common transform set shared among the plurality of prediction modes is used as a transform set for the secondary transform, the matrix weighted intra prediction generating the prediction image by performing matrix calculation on a pixel sequence obtained from pixel values of surrounding pixels of the current block, the transform set for the secondary transform being applied to primary transform coefficients obtained from the result of the primary transform, and
wherein the transform set includes a plurality of transform matrices.
4. A decoding method of decoding an image, the decoding method comprising:
performing inverse quantization on a current block to be decoded;
performing secondary inverse transform on a result of the inverse quantization, and performing primary inverse transform on a result of the secondary inverse transform; and
deriving the image based on a prediction image of the current block and a prediction residual which is a result of the primary inverse transform,
wherein in the performing of the secondary inverse transform,
when a matrix weighted intra prediction included in intra prediction and having a plurality of prediction modes is used, a common inverse transform set shared among the plurality of prediction modes is used as an inverse transform set for the secondary inverse transform, the matrix weighted intra prediction generating the prediction image by performing matrix calculation on a pixel sequence obtained from pixel values of surrounding pixels of the current block, the inverse transform set for the secondary inverse transform being applied to quantized coefficients obtained from the result of the inverse quantization, and
wherein the inverse transform set includes a plurality of transform matrices.
5. A non-transitory computer readable medium storing a bitstream, the bitstream comprising:
a parameter according to which a decoder selects a prediction mode from among a plurality of prediction modes; and
a picture including a current block on which a decoding process is performed,
wherein in the decoding process:
inverse quantization is performed on the current block to be decoded;
secondary inverse transform is performed on a result of the inverse quantization, and primary inverse transform is performed on a result of the secondary inverse transform; and
an image is derived based on a prediction image of the current block and a prediction residual which is a result of the primary inverse transform,
wherein in the performing of the secondary inverse transform,
when a matrix weighted intra prediction included in intra prediction and having the plurality of prediction modes is used, a common inverse transform set shared among the plurality of prediction modes is used as an inverse transform set for the secondary inverse transform, the matrix weighted intra prediction generating the prediction image by performing matrix calculation on a pixel sequence obtained from pixel values of surrounding pixels of the current block, the inverse transform set for the secondary inverse transform being applied to quantized coefficients obtained from the result of the inverse quantization, and
wherein the inverse transform set includes a plurality of transform matrices.