To prevent image quality deterioration, without losing motion detection accuracy for the motion of a real image in the horizontal direction, even when the posture of a device changes.SOLUTION: An encoder includes coding means performing motion prediction of a coding object image for each block, and compression coding the image, and control means for changing the pixel number in the vertical direction of a reference image for use in the motion prediction, according to the posture of the encoder. When the encoder is in the posture of vertical position, the control means increases the pixel number in the vertical direction of the reference image, compared with that when the encoder is in the posture of horizontal position.SELECTED DRAWING: Figure 1
展开▼