A non-transitory computer-readable recording medium having stored therein a program for causing a computer to execute a process for decoding a picture to be decoded included in encoded moving image data, the process comprising:
- partitioning a picture edge block into a plurality of sub-blocks so that none of the plurality of sub-blocks include an edge of the picture to be decoded by partitioning the picture edge block into four in accordance with a quadtree structure when the picture edge block includes both a horizontal edge of the picture to be decoded and a vertical edge of the picture to be decoded, by partitioning the picture edge block into two in a direction orthogonal to the edge included in the picture edge block when the picture edge block includes either the horizontal edge of the picture to be decoded or the vertical edge of the picture to be decoded after a block including the picture edge block has been partitioned into two, and by partitioning the picture edge block into four in accordance with the quadtree structure or partitioning the picture edge block into two in the direction orthogonal to the edge included in the picture edge block by referring to partitioning information that is included in the encoded moving image data and that indicates whether the picture edge block has been partitioned into four in accordance with the quadtree structure or has been partitioned into two when the picture edge block includes either the horizontal edge of the picture to be decoded or the vertical edge of the picture to be decoded after the block including the picture edge block has been partitioned into four, the picture edge block being a block including at least either the horizontal edge of the picture to be decoded or the vertical edge of the picture to be decoded among a plurality of blocks obtained by partitioning the picture to be decoded;
- generating a prediction block by referring to another decoded picture or a decoded area of the picture to be decoded for each of the plurality of sub-blocks;
- and
- decoding the picture edge block by adding a prediction error between a pixel of a given sub-block included in the encoded moving image data and a corresponding pixel of the prediction block corresponding to the given sub-block, and a value of the corresponding pixel of the prediction block, for each of the plurality of sub-blocks.