Decoding method, encoding method, decoder, and encoder
View Patent ↗A decoding method, an encoding method, a decoder, and an encoder are provided. The decoding method includes the following. A bitstream is decoded to obtain a first transform coefficient of a current block. A first transform is performed on the first transform coefficient of the current block to obtain a second transform coefficient of the current block. A second transform is performed on the second transform coefficient to obtain a residual block of the current block. The current block is predicted based on a first prediction mode and a second prediction mode which correspond to a geometric partitioning mode (GPM) to obtain a prediction block of the current block. A reconstructed block of the current block is obtained based on the prediction block of the current block and the residual block of the current block.
1 . A decoding method, comprising:
decoding a bitstream to obtain a first transform coefficient of a current block;
determining a weight derivation mode used for a geometric partitioning mode (GPM);
determining a transform matrix set adapted to an intra prediction mode corresponding to the weight derivation mode as a transform matrix set used for a first transform;
performing the first transform on the first transform coefficient to obtain a second transform coefficient of the current block;
performing a second transform on the second transform coefficient to obtain a residual block of the current block;
predicting the current block based on a first prediction mode and a second prediction mode which correspond to the GPM to obtain a prediction block of the current block; and
obtaining a reconstructed block of the current block based on the prediction block of the current block and the residual block of the current block.
2 . The method of claim 1 , wherein performing the first transform on the first transform coefficient to obtain the second transform coefficient of the current block comprises:
decoding the bitstream to obtain a first flag and a second flag; and
when the first flag indicates that the GPM is allowed to be used for predicting a block in a current sequence and the second flag indicates that the first transform is allowed to be used for transforming the block in the current sequence, performing the first transform on the first transform coefficient to obtain the second transform coefficient.
3 . The method of claim 2 , wherein performing the first transform on the first transform coefficient to obtain the second transform coefficient of the current block comprises:
when the first flag indicates that the GPM is allowed to be used for predicting the block in the current sequence and the second flag indicates that the first transform is allowed to be used for transforming the block in the current sequence, in a case where a height and/or a width of the current block is greater than or equal to a first threshold, performing the first transform on the first transform coefficient to obtain the second transform coefficient.
4 . An encoding method, comprising:
predicting a current block based on a first prediction mode and a second prediction mode which correspond to a geometric partitioning mode (GPM) to obtain a prediction block of the current block;
obtaining a residual block of the current block based on the prediction block of the current block;
performing a third transform on the residual block of the current block to obtain a third transform coefficient of the current block;
determining a weight derivation mode used for the GPM;
determining a transform matrix set adapted to an intra prediction mode corresponding to the weight derivation mode as a transform matrix set used for a fourth transform;
performing the fourth transform on the third transform coefficient to obtain a fourth transform coefficient of the current block; and
encoding the fourth transform coefficient.
5 . The method of claim 4 , wherein encoding the fourth transform coefficient comprises:
encoding a first flag, a second flag, and the fourth transform coefficient;
wherein the first flag indicates that the GPM is allowed to be used for predicting a block in a current sequence, and the second flag indicates that the fourth transform is allowed to be used for transforming the block in the current sequence.
6 . The method of claim 5 , wherein performing the fourth transform on the third transform coefficient to obtain the fourth transform coefficient of the current block comprises:
in a case where a height and/or a width of the current block is greater than or equal to a first threshold, performing the fourth transform on the third transform coefficient to obtain the fourth transform coefficient.
7 . A decoder, comprising:
a processor; and
a non-transitory computer-readable storage medium storing a computer program which, when executed by the processor, causes the processor to:
decode a bitstream to obtain a first transform coefficient of a current block;
determine a weight derivation mode used for a geometric partitioning mode (GPM);
determine a transform matrix set adapted to an intra prediction mode corresponding to the weight derivation mode as a transform matrix set used for a first transform;
perform the first transform on the first transform coefficient to obtain a second transform coefficient of the current block;
perform a second transform on the second transform coefficient to obtain a residual block of the current block;
predict the current block based on a first prediction mode and a second prediction mode which correspond to the GPM to obtain a prediction block of the current block; and
obtain a reconstructed block of the current block based on the prediction block of the current block and the residual block of the current block.
8 . The decoder of claim 7 , wherein performing the first transform on the first transform coefficient to obtain the second transform coefficient of the current block comprises:
decoding the bitstream to obtain a first flag and a second flag; and
when the first flag indicates that the GPM is allowed to be used for predicting a block in a current sequence and the second flag indicates that the first transform is allowed to be used for transforming the block in the current sequence, performing the first transform on the first transform coefficient to obtain the second transform coefficient.
9 . The decoder of claim 8 , wherein performing the first transform on the first transform coefficient to obtain the second transform coefficient of the current block comprises:
when the first flag indicates that the GPM is allowed to be used for predicting the block in the current sequence and the second flag indicates that the first transform is allowed to be used for transforming the block in the current sequence, in a case where a height and/or a width of the current block is greater than or equal to a first threshold, perform the first transform on the first transform coefficient to obtain the second transform coefficient.
10 . An encoder, comprising:
a processor; and
a non-transitory computer-readable storage medium storing a computer program which, when executed by the processor, causes the processor to:
predict a current block based on a first prediction mode and a second prediction mode which correspond to a geometric partitioning mode (GPM) to obtain a prediction block of the current block;
obtain a residual block of the current block based on the prediction block of the current block;
perform a third transform on the residual block of the current block to obtain a third transform coefficient of the current block;
determine a weight derivation mode used for the GPM;
determine a transform matrix set adapted to an intra prediction mode corresponding to the weight derivation mode as a transform matrix set used for a fourth transform;
perform the fourth transform on the third transform coefficient to obtain a fourth transform coefficient of the current block; and
encode the fourth transform coefficient.
11 . The encoder of claim 10 , wherein encoding the fourth transform coefficient comprises:
encode a first flag, a second flag, and the fourth transform coefficient;
wherein the first flag indicates that the GPM is allowed to be used for predicting a block in a current sequence, and the second flag indicates that the fourth transform is allowed to be used for transforming the block in the current sequence.
12 . The encoder of claim 11 , wherein performing the fourth transform on the third transform coefficient to obtain the fourth transform coefficient of the current block comprises:
in a case where a height and/or a width of the current block is greater than or equal to a first threshold, perform the fourth transform on the third transform coefficient to obtain the fourth transform coefficient.