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;
determining a scan type of the current block to be an up-right diagonal scan, a horizontal scan, or a vertical scan based on the intra prediction mode of the current block;
obtaining transform coefficients of the current block based on the scan type of the current block;
determining a transform type of the current block to be DCT (Discrete Cosine Transform) or a DST (Discrete Sine Transform);
performing an inverse-transform on the transform coefficients based on the transform type of the current block to generate residual samples; and
reconstructing the current block by using 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 mode and a planar mode of the current block.
2. The method of claim 1 , wherein determining the transform type of the current block comprises:
determining a transform type of the current block based on the intra prediction mode of the current block, and a color component the current block.
3. The method of claim 1 , wherein determining the transform type of the current block comprises:
determining the transform type of the current block based on the intra prediction mode of the current block and a transform size of the current block.
4. The method of claim 1 , further comprising:
obtaining prediction mode information of the current block, the prediction mode information specifying whether the current block is an inter-coded block or an intra-coded block.
5. The method of claim 4 , wherein deriving the intra prediction mode of the current block comprises:
deriving the intra prediction mode of the current block in response to the current block being the intra-coded block.