1. An encoding device comprising: a determination unit configured to determine, when performing detection of a motion vector using the decoded image of a frame image encoded in increments of blocks prior to the frame image to be encoded regarding an encoded block to be encoded of a plurality of blocks included in this frame image to be encoded at the time of encoding a frame image included in a moving image where a first image and a second image are arrayed using inter-image prediction encoding processing, correlation height as to the image of the encoded block regarding each of the image of a first area corresponding to the first image and the image of a second area corresponding to the second image included in a boundary block straddling a boundary between the first image and the second image of a block included in the decoded image, based on local information relating to the encoded block; and a substitution unit configured to perform substitution processing for substituting, of the image of the first area and the image of the second area included in the boundary block, a substitution image generated using the pixel values of an area determined to be higher in correlation with the image of the encoded block, for the image of an area determined to be lower in correlation with the image of the encoded block.