An apparatus for encoding a moving picture, comprising: a picture division unit configured to determine a size and a prediction mode of each coding block; an intra prediction unit configured to determine an intra prediction mode of a current block and generate a prediction block corresponding to the current block according to the intra prediction mode of the current block; a transform unit configured to transform a residual block obtained by calculating difference between the current block and the prediction block to generate a transform block; a quantization unit configured to determine a quantization step size of a current coding block and quantize the transform block using the quantization step size to generate a quantized transform block; a scanning unit configured to scan quantized transform coefficients of the quantized transform block to generate one-dimensional, 1D, quantized transform coefficients; and an entropy coding unit configured to entropy-code the 1D quantized transform coefficients, wherein the quantization step size is encoded using a quantization step size predictor, wherein a first available quantization step size is determined as the quantization step size predictor of a current coding unit when scanning in the order of a left coding unit neighbored to a left side of the current coding unit, an above coding unit neighbored to an upper side of the current coding unit and a previous coding unit, wherein, when a size of the transform block is larger than 4x4, the quantized transform coefficients of the quantized transform block are divided into a plurality of sub-blocks, wherein the plurality of sub-blocks are scanned according to a scan pattern determined by the intra prediction mode of the current block and the quantized transform coefficients of each sub-block are scanned according to a scan pattern determined by the intra prediction mode of the current block, wherein the scan pattern for scanning the plurality of sub-blocks is the same as the scan pattern for scanning the quantized transform coefficients of each sub-block. a picture division unit configured to determine a size and a prediction mode of each coding block; an intra prediction unit configured to determine an intra prediction mode of a current block and generate a prediction block corresponding to the current block according to the intra prediction mode of the current block; a transform unit configured to transform a residual block obtained by calculating difference between the current block and the prediction block to generate a transform block; a quantization unit configured to determine a quantization step size of a current coding block and quantize the transform block using the quantization step size to generate a quantized transform block; a scanning unit configured to scan quantized transform coefficients of the quantized transform block to generate one-dimensional, 1D, quantized transform coefficients; and an entropy coding unit configured to entropy-code the 1D quantized transform coefficients, wherein the quantization step size is encoded using a quantization step size predictor, wherein a first available quantization step size is determined as the quantization step size predictor of a current coding unit when scanning in the order of a left coding unit neighbored to a left side of the current coding unit, an above coding unit neighbored to an upper side of the current coding unit and a previous coding unit, wherein, when a size of the transform block is larger than 4x4, the quantized transform coefficients of the quantized transform block are divided into a plurality of sub-blocks, wherein the plurality of sub-blocks are scanned according to a scan pattern determined by the intra prediction mode of the current block and the quantized transform coefficients of each sub-block are scanned according to a scan pattern determined by the intra prediction mode of the current block, wherein the scan pattern for scanning the plurality of sub-blocks is the same as the scan pattern for scanning the quantized transform coefficients of each sub-block.