1. A method of decoding an image, the method comprising: obtaining information that indicates an intra prediction mode of a current block to be decoded, from a bitstream, the intra prediction mode indicating a particular direction among a plurality of directions, the particular direction being indicated by one of dx number in a horizontal direction and a fixed integer number in a vertical direction, and dy number in the vertical direction and the fixed integer number in the horizontal direction where the dx number and the dy number are integers determined according to the intra prediction mode of the current block; obtaining a number of neighboring pixels located on one side among a left side of the current block and an upper side of the current block according to a position of a current pixel, the dx number in the horizontal direction and the dy number in the vertical direction; determining one of a location of a neighboring pixel located on the left side of the current block determined based on the dy number in the vertical direction and the fixed number in the horizontal direction and a location of a neighboring pixel located on the upper side of the current block determined based on the dx number in the horizontal direction and the fixed number in the vertical direction; and obtaining a prediction value of the current pixel based on the number of neighboring pixels and the location of the neighboring pixel located on the left side of the current block or the location of the neighboring pixel located on the upper side of the current block, wherein the dx number and the dy number are determined among {32, 26, 21, 17, 13, 9, 5, 2, 0, −2, −5, −9, −13, −17, −21, −26} according to the intra prediction mode of the current block, wherein the fixed integer number is power of 2, wherein the image is split into a plurality of maximum coding units according to information about the maximum size of the coding unit, a maximum coding unit, from among the plurality of maximum coding units, is hierarchically split into one or more coding units of depths including at least one of a current depth and a lower depth according to split information, when the split information indicates a split for the current depth, the coding unit of a current depth is split into four coding units of a lower depth, independently from neighboring coding units, and when the split information indicates a non-split for the current depth, one or more prediction units are obtained from the coding unit of the current depth.