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 method of encoding a video using an encoding apparatus, the method comprising:
obtaining, using the encoding apparatus, transform coefficients of a current block by performing inverse-quantization on quantized transform coefficients of the current block;
obtaining, using the encoding apparatus, a residual sample of the current block by performing an inverse-transform on the transform coefficients of the current block based on a transform type of the current block;
obtaining, using the encoding apparatus, a prediction sample of the current block;
reconstructing, using the encoding apparatus, a reconstructed sample of the current block using the residual sample and the prediction sample; and
encoding using the encoding apparatus, a first information indicating whether the residual sample for the current block is present and a second information indicating whether the inverse-transform is performed on the residual sample of the current block,
wherein the transform type is determined to be a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST),
wherein in response to a size of the current block not being equal to 4×4, the transform type is determined to be the DCT, and
wherein the transform type is determined independently of an intra prediction mode of the current block.
2. A non-transitory computer-readable storage medium storing a bitstream formed by a method of encoding a video using an encoding apparatus, the method comprising:
obtaining, using the encoding apparatus, transform coefficients of a current block by performing inverse-quantization on quantized transform coefficients of the current block;
obtaining, using the encoding apparatus, a residual sample of the current block by performing an inverse-transform on the transform coefficients of the current block based on a transform type of the current block;
obtaining, using the encoding apparatus, a prediction sample of the current block;
reconstructing, using the encoding apparatus, a reconstructed sample of the current block using the residual sample and the prediction sample; and
encoding, using the encoding apparatus, a first information indicating whether the residual sample for the current block is present and a second information indicating whether the inverse-transform is performed on the residual sample of the current block,
wherein the transform type is determined to be a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST),
wherein in response to a size of the current block not being equal to 4×4, the transform type is determined to be the DCT, and
wherein the transform type is determined independently of an intra prediction mode of the current block.