1. A method of encoding an image by using motion prediction, the method comprising: determining weights for respective low-precision sub-pixels for interpolation between the low-precision sub-pixels; determining an interpolation direction for the low-precision sub-pixels based on a position of a high-precision sub-pixel between the low-precision sub-pixels; and performing motion prediction in units of high-precision sub-pixels determined by interpolation which applies the interpolation direction and the weights to the low-precision sub-pixels.