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 inter prediction unit configured to determine a reference picture and a motion vector of a current block by performing motion estimation and extract a prediction block corresponding to the current block from the reference picture when the current block is encoded using inter prediction; an intra prediction unit configured to determine an intra prediction mode of a current block and generate the prediction block corresponding to the current block according to the intra prediction mode when the current block is encoded using intra prediction; 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 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 and the quantization step size predictor is generated using a quantization step size of a left coding block of the current coding block and a quantization step size of an above coding block of the current coding block, wherein, when the quantization step size of the left coding block of the current coding block and the quantization step size of the above coding block of the current coding block are unavailable, a quantization step size of previous coding block in scan order is selected as the quantization step size predictor of the current coding block, 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 subsets, wherein, when the current block is encoded using intra prediction, the plurality of subsets are scanned according to a scan pattern determined by the intra prediction mode of the current block and the quantized transform coefficients of each subset are scanned according to a scan pattern determined by the intra prediction mode of the current block, wherein, when the current block is encoded using inter prediction, the plurality of subsets and the quantized transform coefficients of each subset are scanned according to a predetermined scan pattern, wherein the scan pattern for scanning the plurality of subsets is the same as the scan pattern for scanning the quantized transform coefficients of each subset. a picture division unit configured to determine a size and a prediction mode of each coding block; an inter prediction unit configured to determine a reference picture and a motion vector of a current block by performing motion estimation and extract a prediction block corresponding to the current block from the reference picture when the current block is encoded using inter prediction; an intra prediction unit configured to determine an intra prediction mode of a current block and generate the prediction block corresponding to the current block according to the intra prediction mode when the current block is encoded using intra prediction; 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 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 and the quantization step size predictor is generated using a quantization step size of a left coding block of the current coding block and a quantization step size of an above coding block of the current coding block, wherein, when the quantization step size of the left coding block of the current coding block and the quantization step size of the above coding block of the current coding block are unavailable, a quantization step size of previous coding block in scan order is selected as the quantization step size predictor of the current coding block, 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 subsets, wherein, when the current block is encoded using intra prediction, the plurality of subsets are scanned according to a scan pattern determined by the intra prediction mode of the current block and the quantized transform coefficients of each subset are scanned according to a scan pattern determined by the intra prediction mode of the current block, wherein, when the current block is encoded using inter prediction, the plurality of subsets and the quantized transform coefficients of each subset are scanned according to a predetermined scan pattern, wherein the scan pattern for scanning the plurality of subsets is the same as the scan pattern for scanning the quantized transform coefficients of each subset.