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 comprising one or more transform coefficient levels other than 0 when the first information indicates that the residual signal is present in the current block;
in response to the first information indicating that the residual signal is present in the current block, acquiring the residual signal of the current block based on a scanning direction (scanldx) for the residual signal of the current block, the scanning direction being determined based on an intra prediction mode of the current block and the scanning direction being determined to be a vertical scan, a horizontal scan, or an upper right scan;
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, in response to the second information indicating that the inverse-transform is performed on the current block; and
performing the inverse-transform on the residual signal of the current block based on the determined transform type,
wherein the transform type is determined to be a DCT (Discrete Cosine Transform) or a DST (Discrete Sine Transform), and
wherein the transform type is determined independently to an intra prediction mode of the current block.
2. The video decoding method of claim 1 , wherein:
the first information includes luma information indicating whether a residual signal for a luma signal of the current block is present and chroma information indicating whether a residual signal for a chroma signal of the current block is present,
only a scanning direction for the luma signal of the current block is derived, in response to the luma information indicating that the residual signal for the luma signal of the current block is present and the chroma information indicating that the residual signal for the chroma signal of the current block is not present, and
only a scanning direction for the chroma signal of the current block is derived, in response to the luma information indicating that the residual signal for the chroma signal of the current block is not present and the chroma information indicating that the residual signal for the chroma signal of the current block is present.
3. The video decoding method of claim 1 , further comprising:
acquiring information indicating a difference value between a quantization parameter for the current block and a predicted value of the quantization parameter, in response to the first information indicating that the residual signal is present in the current block.
4. The video decoding method of claim 1 , wherein:
the second information is acquired, in response to a current picture including the current block being a picture that is allowed to selectively apply the inverse-transform, a coding block including the current block is not coded in mode not to perform the inverse-transform and an inverse-quantization, and the current block has a size of 4×4.
5. The video decoding method of claim 1 , wherein:
in response to the current block being a block for the luma signal, the scanning direction for the residual signal of the current block is derived based on the intra prediction mode for the luma signal of the current block, and
in response to the current block being a block for the chroma signal, the scanning direction for the residual signal of the current block is derived based on the intra prediction mode for the chroma signal of the current block.