A computer-readable storage medium storing a motion vector decoding program for decoding a motion vector which was encoded by executing a motion vector encoding operation used in a motion-picture encoding method which uses motion-compensating interframe prediction, the encoding operation including a first step of calculating a length component of a motion vector, a second step of encoding the calculated length component and outputting the encoded result as a length component information, a third step of calculating a direction component of the motion vector, and a fourth step of encoding the calculated direction component and outputting the encoded result as direction component information, the decoding program including:
- a fifth step of decoding the length component of the motion vector based on the length component information obtained by the motion vector encoding method;
- a sixth step of decoding the direction component of the motion vector based on the direction component information obtained by the motion vector encoding method subsequent to performing the fifth step;
- wherein in the sixth step, one of a plurality of decoding tables is selected, the selected table corresponding to the value of the length component decoded in the fifth step, wherein each decoding table stores values of the direction component corresponding to the code of the decoded direction component, and the number of possible values for the decoded direction component of the motion vector depends on the value of the decoded length component of the motion vector, and the encoded direction component of the motion vector is decoded with reference to the selected table;
- and
- a seventh step of synthesizing the motion vector using the length and direction components decoded in the fifth and sixth steps.