A non-transitory computer-readable storage medium storing a program for executing an image decoding method that decodes encoded data resulting from hierarchical encoding for images with a plurality of layers, the images being divided into multiple areas, the images composing a moving image, the image decoding method comprising:
- decoding a first area in a first image of a non-base layer, and a second area, corresponding to the first area, in the second image of a base layer different from the non-base layer, the second image corresponding to the first image;
- and
- decoding information which indicates that reference to an area except for the second area is constrained in the inter-layer prediction in a case where the second image is referred to in the first area,
- wherein, in a case where the first area in the first image of the non-base layer is an area being constrained so as not to refer to an area in the first image except for the first area, and the first area in the first image of the non-base layer is an area to be decoded using inter-layer prediction which refers to at least a part of an area of the second image of the base layer, and the information is decoded;
- decoding the first area with solely reference to the second area as the part of the area in the second image, and;
- decoding the second area without reference to another area in the second image;
- and
- a boundary of the first area and a boundary of the second area are constrained so that the boundary of the first area and the boundary of the second area are aligned.