A method of decoding an image, the method comprising: determining coding units of a hierarchical structure by using split information about whether to divide a coding unit parsed from a received bitstream; determining a prediction unit of a current coding unit by splitting the current coding unit into at least one prediction unit; obtaining a first predicted value of pixels of a current prediction unit by using an average of neighboring pixels of the current prediction unit; and obtaining a second predicted value of pixels located on the top border and the left border of the current prediction unit by using a weighted average of the obtained first predicted value and at least one neighboring pixel, wherein a second predicted value of the current prediction unit is obtained by using the at least one neighboring pixel and a weighted value of the obtained first predicted value, and the second predicted value of a top-left pixel of the current prediction unit is obtained by using a first neighboring pixel located at a same column as the top-left pixel and a second neighboring pixel located at a same row as the top-left pixel, wherein the image is split into a plurality of maximum coding units, according to information about a maximum size of a coding unit, the maximum coding unit is hierarchically split into one or more coding units of depths according to the split information, a coding unit of a current depth is one of rectangular data units split from a coding unit of an upper depth, when the split information indicates a split for the current depth, the coding unit of the current depth is split into coding units of a lower depth, independently from neighboring coding units, and when the split information indicates a non-split of the current depth, at least one prediction unit is obtained from the coding unit of the current depth.. determining coding units of a hierarchical structure by using split information about whether to divide a coding unit parsed from a received bitstream; determining a prediction unit of a current coding unit by splitting the current coding unit into at least one prediction unit; obtaining a first predicted value of pixels of a current prediction unit by using an average of neighboring pixels of the current prediction unit; and obtaining a second predicted value of pixels located on the top border and the left border of the current prediction unit by using a weighted average of the obtained first predicted value and at least one neighboring pixel, wherein a second predicted value of the current prediction unit is obtained by using the at least one neighboring pixel and a weighted value of the obtained first predicted value, and the second predicted value of a top-left pixel of the current prediction unit is obtained by using a first neighboring pixel located at a same column as the top-left pixel and a second neighboring pixel located at a same row as the top-left pixel, wherein the image is split into a plurality of maximum coding units, according to information about a maximum size of a coding unit, the maximum coding unit is hierarchically split into one or more coding units of depths according to the split information, a coding unit of a current depth is one of rectangular data units split from a coding unit of an upper depth, when the split information indicates a split for the current depth, the coding unit of the current depth is split into coding units of a lower depth, independently from neighboring coding units, and when the split information indicates a non-split of the current depth, at least one prediction unit is obtained from the coding unit of the current depth..