Method and device for encoding/decoding images
A method and a device for encoding/decoding images are disclosed. The method for encoding images comprises the steps of: deriving a scan type of a residual signal for a current block according to whether or not the current block is a transform skip block; and applying the scan type to the residual signal for the current block, wherein the transform skip block is a block to which transform for the current block is not applied and is specified on the basis of information indicating whether or not transform for the current block is to be applied.
1. A video decoding method comprising:
obtaining first information indicating whether a residual signal is present in a current block, the current block including one or more transform coefficient levels other than 0 when the first information indicates that the residual signal is present in the current block;
when the first information indicates that the residual signal is present in the current block, obtaining the residual signal of the current block;
obtaining second information indicating whether an inverse-transform is performed on the residual signal of the current block;
determining a transform type of the current block when the second information indicates that the inverse-transform is performed on the current block; and
obtaining residual samples of the current block by performing the inverse-transform on the residual signal of the current block based on the determined transform type; and
obtaining prediction samples of the current block based on an intra prediction mode of the current block; and
reconstructing the current block based on the residual samples and the prediction samples,
wherein the transform type is determined to be a DCT (Discrete Cosine Transform) or a DST (Discrete Sine Transform),
wherein the transform type is determined independently to the intra prediction mode of the current block, and
wherein the transform type is determined based on a size of the current block.
2. A video encoding method comprising:
obtaining prediction samples of a current block;
determining whether a residual signal is present in the current block, wherein when the current block including one or more transform coefficient levels other than 0, the residual signal is present in the current block;
when the residual signal is present in the current block, obtaining the residual signal of the current block;
determining whether an inverse-transform is performed on the residual signal of the current block;
determining a transform type of the current block when the inverse-transform is performed on the current block;
obtaining residual samples of the current block by performing the inverse-transform on the residual signal of the current block based on the determined transform type;
reconstructing the current block based on the residual samples and the prediction samples; and
encoding first information indicating whether the residual signal is present in the current block and second information indicating whether the inverse-transform is performed on the residual signal of the current block,
wherein the transform type is determined to be a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST),
wherein the transform type is determined independently of an intra prediction mode of the current block, and
wherein the transform type is determined based on a size of the current block.
3. A non-transitory recording medium storing a bitstream formed by a method of encoding a video, the method comprising:
obtaining prediction samples of a current block;
determining whether a residual signal is present in the current block, wherein when the current block including one or more transform coefficient levels other than 0, the residual signal is present in the current block;
when the residual signal is present in the current block, obtaining the residual signal of the current block;
determining whether an inverse-transform is performed on the residual signal of the current block;
determining a transform type of the current block when the inverse-transform is performed on the current block;
obtaining residual samples of the current block by performing the inverse-transform on the residual signal of the current block based on the determined transform type;
reconstructing the current block based on the residual samples and the prediction samples; and
encoding first information indicating whether the residual signal is present in the current block and second information indicating whether the inverse-transform is performed on the residual signal of the current block,
wherein the transform type is determined to be a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST),
wherein the transform type is determined independently of an intra prediction mode of the current block, and
wherein the transform type is determined based on a size of the current block.