To improve the image quality by reducing deterioration in decoded image quality produced in the case of reception of a special image without causing a remarkable cost increase.
The coder is provided with a 1st image memory 16 to store a forward reference image, a 1st motion vector detection means 19 to read image data of the 1st image memory 16 to detect a motion vector, a 2nd image memory 17 to store a backward reference image, a 3rd image memory 18 to store the extended forward reference image, and a 2nd motion vector detection means 20 to read the image data in the 2nd image memory 17 or in the 3rd image memory 18 to detect a motion vector. In the case of forward prediction, the 2nd motion vector detection means 20 references the image data in the 3rd image memory 18 to detect the motion vector from the extended forward reference image.