An apparatus for spatial predictive decoding of video data, comprising: a first prediction controller determining similarity among a plurality of previous data units that are spatially adjacent to a current data unit and determining a reference data unit for spatial predictive encoding of the current data unit according to the determined similarity; and a first prediction unit determining predicted values of pixels of the current data unit using values of pixels of the reference data unit, wherein the plurality of previous data units is data units obtained by decoding before the current data unit among data units spatially adjacent to the current data unit, wherein the plurality of previous data units includes a first data unit that is located on the left side of the current data unit, a second data unit that is located up from the current data unit, and a third data unit that is located on the upper left side of the current data unit, wherein if the first data unit and the third data unit are similar to each other, the first prediction controller determines the second data unit to be the reference data unit, and if the second data unit and the third data unit are similar to each other, the prediction controller determines the first data unit to be the reference data unit, and wherein the first prediction controller determines similarity between the first data unit and the third data unit by comparing a mean value of values of pixels included in the right-most line of the first data unit and a mean value of values of pixels included in the bottom-most line of the third data unit, and determines similarity between the second data unit and the third data unit by comparing a mean value of values of pixels included in the bottom-most line of the second data unit and a mean value of values of pixels included in the right-most line of the third data unit. a first prediction controller determining similarity among a plurality of previous data units that are spatially adjacent to a current data unit and determining a reference data unit for spatial predictive encoding of the current data unit according to the determined similarity; and a first prediction unit determining predicted values of pixels of the current data unit using values of pixels of the reference data unit, wherein the plurality of previous data units is data units obtained by decoding before the current data unit among data units spatially adjacent to the current data unit, wherein the plurality of previous data units includes a first data unit that is located on the left side of the current data unit, a second data unit that is located up from the current data unit, and a third data unit that is located on the upper left side of the current data unit, wherein if the first data unit and the third data unit are similar to each other, the first prediction controller determines the second data unit to be the reference data unit, and if the second data unit and the third data unit are similar to each other, the prediction controller determines the first data unit to be the reference data unit, and wherein the first prediction controller determines similarity between the first data unit and the third data unit by comparing a mean value of values of pixels included in the right-most line of the first data unit and a mean value of values of pixels included in the bottom-most line of the third data unit, and determines similarity between the second data unit and the third data unit by comparing a mean value of values of pixels included in the bottom-most line of the second data unit and a mean value of values of pixels included in the right-most line of the third data unit.