Apparatus for decoding an image
Provided is an apparatus for decoding an image. The apparatus restores a plurality of sub-blocks by applying a scan pattern determined according to the intra prediction mode of the current block on the quantization coefficient sequence and restores the quantized transform block by applying a scan pattern determined according to the intra prediction mode of the current block on the plurality of sub-blocks. Therefore, it is possible to reduce the amount of coding bits and computing resources required to decode a current prediction block.
1. An apparatus for decoding an image, comprising:
an entropy decoding unit configured to restore an intra prediction mode index and a quantization coefficient sequence;
an inverse scanning unit configured to generate a quantized transform block by inversely scanning the quantized coefficient sequence in the unit of sub-block when a size of the quantized transform block is larger than a predetermined size;
an inverse quantization unit configured to generate a quantization step size predictor, restore a quantization step size by adding the quantization step size predictor and a remaining quantization step size, and generate a transform block by inversely quantizing the quantized transform block using the quantization step size;
an inverse transform unit configured to restore a residual block by inversely transforming the transform block;
an intra prediction unit configured to restore an intra prediction mode of the current block based on the intra prediction mode index and generate a prediction block of the current block according to the intra prediction mode; and
an adding unit configured to generate an original block by adding the prediction block and the residual block,
wherein, the inverse scanning unit restores a plurality of sub-blocks by applying a first scan pattern on the quantization coefficient sequence, and restores the quantized transform block by applying a second scan pattern on the plurality of sub-blocks, wherein the first scan pattern is the same as the second scan pattern,
wherein, when a quantization step size of a left coding block of a current coding block and a quantization step size of an above coding block of the current coding block are unavailable, the inverse quantization unit determines a quantization step size of a previous coding block according to scan order as the quantization step size predictor of the current coding block, and
wherein the quantization step size is determined on each coding block.
2. The apparatus of claim 1 , wherein the inverse scanning unit inversely scans the quantization coefficient sequence and the plurality of sub-blocks in a reverse direction.