1. A method of encoding an image in a merge mode, the method comprising: determining motion information of a current prediction unit, and generating a prediction block using the motion information; generating a residual block using an original block and the prediction block, transforming the residual block to generate a transformed block, quantizing the transformed block using a quantization parameter to generate a quantized block, and scanning the quantized block to entropy-code the quantized block; and encoding the motion information using effective spatial and temporal merge candidates of the current prediction unit, wherein a motion vector of the temporal merge candidate is a motion vector of a temporal merge candidate block within a temporal merge candidate picture, and the quantization parameter is encoded using an average of two effective quantization parameters among a left quantization parameter, an upper quantization parameter and a previous quantization parameter of a current coding unit, and wherein when the quantized block is larger than a predetermined size, the quantized block is divided into a plurality of subblocks to be scanned, and a scan pattern for scanning the plurality of subblocks is the same as a scan pattern for scanning quantized coefficients within each subblock.