1. A method of decoding an image, the method comprising: extracting information that includes an intra prediction mode of a current block to be decoded, from a bitstream; determining one of neighboring pixels adjacent to the current block and filtered neighboring pixels as reference pixels, based on a size of the current block and the intra prediction mode of the current block; performing intra prediction on the current block using the intra prediction mode of the current block and the determined reference pixels, wherein the image is split into a plurality of maximum coding units, according to information about a maximum size of a coding unit, wherein a coding unit of a current depth is one of rectangular data units split from a coding unit of an upper depth, wherein the coding unit is split into coding units of a lower depth, independently from neighboring coding units, and wherein the coding unit of the current depth is split into at least one prediction unit.