1. A motion vector detecting device comprising: a motion predicting and compensating means for calculating cost values of a plurality of motion vectors, which is candidates of an optimal motion vector, with a first pixel precision every prediction mode and calculating the optimal motion vector with a second pixel precision and a cost value of the optimal motion vector with the second pixel precision on the basis of a gradient of the cost values.