1. A method of decoding an image, the method comprising: obtaining split information about whether to divide a coding unit parsed from a received bitstream of an encoded video; determining coding units of a hierarchical structure, based on the split information about whether to divide a coding unit; determining whether a current coding unit among the determined coding units of the hierarchical structure comprises a region that deviates from a boundary of a current image; if the current coding unit is determined not to comprise the region that deviates from the boundary of the current image based on the determining whether the current coding unit comprises the region, parsing and decoding data regarding the current coding unit of the hierarchical structure; and if the current coding unit is determined to comprise the region that deviates from the boundary of the current image based on the determining whether the current coding unit comprises the region, determining sub coding units generated by dividing the current coding unit, that comprises the region that deviates from the boundary of the current image, wherein: the image is split into a plurality of maximum coding units according to information about a maximum size of a coding unit, a maximum coding unit, among the plurality of maximum coding units, is hierarchically split into one or more coding units of depths including at least one of the current depth and a lower depth, according to the split information, when the split information indicates a split for the current depth, the coding unit of the current depth is split into four rectangular coding units of a lower depth, independently from neighboring coding units; and when the split information indicates a non-split of the lower depth, the coding units of the lower depth is split into one or more prediction units.