Encoding method and decoding method, and device using same
The present invention relates to an encoding method and decoding method, and a device using the same. The encoding method according to the present invention comprises the steps of: specifying an intra prediction mode for a current block; and scanning a residual signal by intra prediction of the current block, wherein the step of scanning the residual signal can determine a scanning type for a luminance signal and a chroma signal of the current block according to an intra prediction mode for a luminance sample of the current block.
1. A method for decoding a video signal, comprising:
deriving an intra prediction mode of a current block;
deriving prediction samples of the current block based on the intra prediction mode of the current block;
determining a scan type of the current block based on the intra prediction mode of the current block;
deriving residual coefficients of the current block based on the scan type of the current block,
determining a transform type of the current block to be a DCT (Discrete Cosine Transform) or a DST (Discrete Sine Transform);
deriving residual samples of the current block by performing an inverse-transform on the residual coefficients based on the transform type; and
reconstructing the current block by using the prediction samples and the residual samples,
wherein when a size of the current block corresponds to 4×4 and a color component of the current block is a luma component, the inverse-transform is performed by using DST in horizontal and vertical transform directions, for all intra prediction direction mode and a planar mode of the current block.
2. A method for encoding a video signal, comprising:
determining an intra prediction mode of a current block;
deriving prediction samples of the current block based on the intra prediction mode of the current block;
determining a scan type of the current block based on the intra prediction mode of the current block;
deriving residual coefficients of the current block based on the scan type of the current block,
determining a transform type of the current block to be a DCT (Discrete Cosine Transform) or a DST (Discrete Sine Transform);
deriving residual samples of the current block by performing an inverse-transform on the residual coefficients based on the transform type; and
reconstructing the current block by using the prediction samples and the residual samples,
wherein when a size of the current block corresponds to 4×4 and a color component of the current block is a luma component, the inverse-transform is performed by using DST in horizontal and vertical transform directions, for all intra prediction direction mode and a planar mode of the current block.
3. A method for transmitting a bitstream formed by a method of encoding a video, the method of encoding the video comprising:
determining an intra prediction mode of a current block;
deriving prediction samples of the current block based on the intra prediction mode of the current block; determining a scan type of the current block based on the intra prediction mode of the current block;
deriving residual coefficients of the current block based on the scan type of the current block,
determining a transform type of the current block to be a DCT (Discrete Cosine Transform) or a DST (Discrete Sine Transform); and
deriving residual samples of the current block by performing an inverse-transform on the residual coefficients based on the transform type; and
reconstructing the current block by using the prediction samples and the residual samples,
wherein when a size of the current block corresponds to 4×4 and a color component of the current block is a luma component, the inverse-transform is performed by using DST in horizontal and vertical transform directions, for all intra prediction direction mode and a planar mode of the current block.