Referring to FIG. 17, a decoder according to an embodiment of the present invention includes an intra prediction unit 1700 and an inter prediction unit 1750. The intra prediction unit 1700 includes a macroblock type obtaining unit 1710, a DC transform size determining unit 1720 and a sub-macroblock prediction value obtaining unit 1730. The inter prediction unit 1750 includes a macroblock type obtaining unit 1760, a DC transform size determining unit 1770 and a sub-macroblock prediction value obtaining unit 1780. The macroblock type obtaining unit 1710/1760 obtains a macroblock type. If the macroblock includes a plurality of coded sub-macroblocks according to the macroblock type, the macroblock type obtaining unit 1710/1760 obtains a sub-macroblock type. The DC transform size determining unit 1720/1770 obtains flag information indicating a DC (discrete cosine) transform size and then determines a DC transform size of a coded sub-macroblock based on the flag information. If the sub-macroblock is coded using intra prediction based on the the sub-macroblock type, the sub-macroblock prediction value obtaining unit 1730 determines a prediction size of the sub-macroblock coded using the intra prediction based on the determined DC transform size, obtains prediction direction information from a block adjacent to the sub-macroblock based on the prediction size of the sub-macroblock, and then obtains a prediction value of the sub-macroblock based on the prediction direction information. If the sub-macroblock is coded using inter prediction based on the sub-macroblock type, the sub-macroblock prediction value obtaining unit 1780 obtains motion information from a block adjacent to the sub-macroblock and then obtains a prediction value of the sub-macroblock based on the motion information.