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 (1020, 1040) includes a region that extends over a boundary (1010, 1030) 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 (1020, 1040) is one of the plurality of maximum coding units, wherein, when the first coding unit includes the region that extends over the boundary (1010, 1030) of the image, the processor is configured to divide the first coding unit into second coding units (1150, 1160, 1170, 1180) and encode only second coding units (1150, 1160) that are in an internal region of the image, from among the second coding units (1150, 1160, 1170, 1180) generated by dividing the first coding unit; and when the first coding unit does not include the region that extends over the boundary (1010, 1030) 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 (1150, 1160, 1170, 1180), the processor is configured to divide a height and a width of the first coding unit (1020, 1040) 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 (1150, 1160, 1170, 1180), wherein flag information about division of the first coding unit into the second coding units (1150, 1160, 1170, 1180) 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 (1020, 1040) includes a region that extends over a boundary (1010, 1030) 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 (1020, 1040) is one of the plurality of maximum coding units, wherein, when the first coding unit includes the region that extends over the boundary (1010, 1030) of the image, the processor is configured to divide the first coding unit into second coding units (1150, 1160, 1170, 1180) and encode only second coding units (1150, 1160) that are in an internal region of the image, from among the second coding units (1150, 1160, 1170, 1180) generated by dividing the first coding unit; and when the first coding unit does not include the region that extends over the boundary (1010, 1030) 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 (1150, 1160, 1170, 1180), the processor is configured to divide a height and a width of the first coding unit (1020, 1040) 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 (1150, 1160, 1170, 1180), wherein flag information about division of the first coding unit into the second coding units (1150, 1160, 1170, 1180) is not encoded. when the first coding unit is divided into the second coding units (1150, 1160, 1170, 1180), the processor is configured to divide a height and a width of the first coding unit (1020, 1040) 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 (1150, 1160, 1170, 1180), wherein flag information about division of the first coding unit into the second coding units (1150, 1160, 1170, 1180) is not encoded.