An apparatus for encoding an image, the apparatus comprising a processor configured to: divide an image into a plurality of maximum coding units having a predetermined maximum size of a coding unit, and determine whether a first coding unit includes a region that extends over a boundary of the image by comparing a lower boundary of the first coding unit to a lower boundary of the image, wherein the first coding unit is one of the plurality of maximum coding units, wherein, when the first coding unit includes the region that extends over the boundary of the image, the processor is configured to divide the first coding unit into second coding units and encode only second coding units that are in an internal region of the image, from among the second coding units generated by dividing the first coding unit ; and when the first coding unit does not include the region that extends over the boundary of the image, the processor is configured to encode the first coding unit by performing prediction and transformation without dividing the first coding unit, characterized in that : when the first coding unit is divided into the second coding units , the processor is configured to divide a height and a width of the first coding unit by two; and when a Y-coordinate of the lower boundary of the first coding unit is larger than the height of the image, the processor is configured to determine that the first coding unit includes the region that extends over the lower boundary of the image, and divide the first coding unit into the second coding units , wherein flag information about division of the first coding unit into the second coding units is not encoded. divide an image into a plurality of maximum coding units having a predetermined maximum size of a coding unit, and determine whether a first coding unit includes a region that extends over a boundary of the image by comparing a lower boundary of the first coding unit to a lower boundary of the image, wherein the first coding unit is one of the plurality of maximum coding units, wherein, when the first coding unit includes the region that extends over the boundary of the image, the processor is configured to divide the first coding unit into second coding units and encode only second coding units that are in an internal region of the image, from among the second coding units generated by dividing the first coding unit ; and when the first coding unit does not include the region that extends over the boundary of the image, the processor is configured to encode the first coding unit by performing prediction and transformation without dividing the first coding unit, characterized in that : when the first coding unit is divided into the second coding units , the processor is configured to divide a height and a width of the first coding unit by two; and when a Y-coordinate of the lower boundary of the first coding unit is larger than the height of the image, the processor is configured to determine that the first coding unit includes the region that extends over the lower boundary of the image, and divide the first coding unit into the second coding units , wherein flag information about division of the first coding unit into the second coding units is not encoded. when the first coding unit is divided into the second coding units , the processor is configured to divide a height and a width of the first coding unit by two; and when a Y-coordinate of the lower boundary of the first coding unit is larger than the height of the image, the processor is configured to determine that the first coding unit includes the region that extends over the lower boundary of the image, and divide the first coding unit into the second coding units , wherein flag information about division of the first coding unit into the second coding units is not encoded. <EOS>