1. A method of decoding an image, the method comprising: restoring a residue image between a current image and a prediction image from a bitstream; deriving a motion vector of an auxiliary reference image by using a motion vector of a main reference image; generating a prediction image of the current image by using the motion vector of the main reference image or the motion vector of the auxiliary reference image; and restoring the current image by adding the restored residue image to the generated prediction image, wherein the motion vector of the auxiliary reference image is derived by linearly transforming the motion vector of the main reference image.