An apparatus for decoding an image, the apparatus comprising: an entropy decoding unit configured to restore an intra prediction mode and one-dimensional quantized coefficients; an inverse scanning unit configured to inversely scan the 1D quantized coefficients in units of sub-blocks to generate a quantized transform block; an inverse quantization unit configured to inversely quantize the quantized transform block using a quantization step size to generate a transform block; an inverse transform unit configured to inversely transform the transform block to generate a residual block; an intra prediction unit configured to generate a prediction block corresponding to a current block according to the intra prediction mode; and an adding unit configured to restore an original block by adding the residual block and the prediction block, wherein the inverse scanning unit restores a plurality of sub-blocks by applying a first scan pattern determined according to the intra prediction mode to the 1D quantized coefficients, and restores the quantized transform block by applying a second scan pattern determined according to the intra prediction mode to the plurality of sub-blocks, wherein, when the intra prediction mode is a horizontal mode, the second scan pattern is a vertical scan, wherein the first scan pattern is the same as the second scan pattern, wherein the entropy decoding unit further restores information indicating a position of the last non-zero coefficient in each sub-block, and the inverse scanning unit inversely scan the 1D quantized coefficients using the information indicating a position of the last non-zero coefficient in each sub-block, and wherein the intra prediction unit includes: a reference pixel generating unit configured to generate reference pixels using available reference pixels of the current block when unavailable reference pixels exist; a reference pixel filtering unit configured to adaptively filter reference pixels adjacent to the current block based on the intra prediction mode and a size of the current block; a prediction block generating unit configured to generate a prediction block of the current block according to the intra prediction mode; and a prediction block filtering unit configured to adaptively filter some prediction pixels of the prediction block based on the intra prediction mode and the size of the current block. an entropy decoding unit configured to restore an intra prediction mode and one-dimensional quantized coefficients; an inverse scanning unit configured to inversely scan the 1D quantized coefficients in units of sub-blocks to generate a quantized transform block; an inverse quantization unit configured to inversely quantize the quantized transform block using a quantization step size to generate a transform block; an inverse transform unit configured to inversely transform the transform block to generate a residual block; an intra prediction unit configured to generate a prediction block corresponding to a current block according to the intra prediction mode; and an adding unit configured to restore an original block by adding the residual block and the prediction block, wherein the inverse scanning unit restores a plurality of sub-blocks by applying a first scan pattern determined according to the intra prediction mode to the 1D quantized coefficients, and restores the quantized transform block by applying a second scan pattern determined according to the intra prediction mode to the plurality of sub-blocks, wherein, when the intra prediction mode is a horizontal mode, the second scan pattern is a vertical scan, wherein the first scan pattern is the same as the second scan pattern, wherein the entropy decoding unit further restores information indicating a position of the last non-zero coefficient in each sub-block, and the inverse scanning unit inversely scan the 1D quantized coefficients using the information indicating a position of the last non-zero coefficient in each sub-block, and wherein the intra prediction unit includes: a reference pixel generating unit configured to generate reference pixels using available reference pixels of the current block when unavailable reference pixels exist; a reference pixel filtering unit configured to adaptively filter reference pixels adjacent to the current block based on the intra prediction mode and a size of the current block; a prediction block generating unit configured to generate a prediction block of the current block according to the intra prediction mode; and a prediction block filtering unit configured to adaptively filter some prediction pixels of the prediction block based on the intra prediction mode and the size of the current block. a reference pixel generating unit configured to generate reference pixels using available reference pixels of the current block when unavailable reference pixels exist; a reference pixel filtering unit configured to adaptively filter reference pixels adjacent to the current block based on the intra prediction mode and a size of the current block; a prediction block generating unit configured to generate a prediction block of the current block according to the intra prediction mode; and a prediction block filtering unit configured to adaptively filter some prediction pixels of the prediction block based on the intra prediction mode and the size of the current block.