In the present exemplary embodiment, the transform block size of the H.264 is taken as the TU size at the time of recoding to the HEVC. In the conventional technique, on the other hand, there is a method in which the transform and the coding processing are performed by all possible TU sizes and the TU size in which the amount of generated code is the smallest is selected.