Motion vector calculation method
When a block (MB 22 ) of which motion vector is referred to in the direct mode contains a plurality of motion vectors, 2 motion vectors MV 23 and MV 24 , which are used for inter picture prediction of a current picture (P 23 ) to be coded, are determined by scaling a value obtained from averaging the plurality of motion vectors or selecting one of the plurality of the motion vectors.
1. An image decoding method comprising:
assigning smaller first indices to pictures preceding a current picture in display order than first indices assigned to pictures following a current picture, the first indices associating blocks included in a current picture with each picture that is referred to by the blocks;
assigning smaller second indices to pictures following a current picture in display order than second indices assigned to pictures preceding a current picture, the second indices associating blocks included in a current picture with each picture that is referred to by the blocks;
selecting, as a first reference picture, a picture with the smallest first index out of a plurality of pictures that are referred to by a plurality of neighboring blocks, the plurality of neighboring blocks being at the neighborhood of a current block in a current picture;
selecting, as a second reference picture, a picture with the smallest second index out of the plurality of pictures; and
decoding the current block by using the first reference picture and the second reference picture.
2. The image decoding method according to claim 1 , further comprising:
determining, when the plurality of neighboring blocks have only one motion vector referring to the first reference picture, the motion vector as a first motion vector;
determining, when the plurality of neighboring blocks have only one motion vector referring to the second reference picture, the motion vector as a second motion vector; and
decoding the current block by using the first motion vector and the second motion vector.
3. The image decoding method according to claim 1 , further comprising:
determining, when the plurality of neighboring blocks have a plurality of motion vectors referring to the first reference picture, a first median value of the plurality of motion vectors as a first motion vector;
determining, when the plurality of neighboring blocks have a plurality of motion vectors referring to the second reference picture, a second median value of the plurality of motion vectors as a second motion vector; and
decoding the current block by using the first motion vector and the second motion vector.
4. An image decoding method comprising:
referring to a first list in which smaller indices are assigned to pictures preceding a current picture in display order than indices assigned to pictures following a current picture, the first list being a list of index associating blocks included in a current picture with each picture that is referred to by the blocks;
selecting, from the first list, as a first reference picture, a picture with the smallest index out of a plurality of pictures that are referred to by a plurality of neighboring blocks, the plurality of neighboring blocks being at the neighborhood of a current block in a current picture;
referring to a second list in which smaller indices are assigned to pictures following a current picture in display order than indices assigned to pictures preceding a current picture, the second list being a list of index associating blocks included in a current picture with each picture that is referred to by the blocks;
selecting, from the second list, as a second reference picture, a picture with the smallest index out of the plurality of pictures; and
decoding the current block by using the first reference picture and the second reference picture.
5. The image decoding method according claim 4 , further comprising:
determining, when the plurality of neighboring blocks have only one motion vector referring to the first reference picture, the motion vector as a first motion vector;
determining, when the plurality of neighboring blocks have only one motion vector referring to the second reference picture, the motion vector as a second motion vector; and
decoding the current block by using the first motion vector and the second motion vector.
6. The image decoding method according to claim 4 , further comprising:
determining, when the plurality of neighboring blocks have a plurality of motion vectors referring to the first reference picture, a first median value of the plurality of motion vectors as a first motion vector;
determining, when the plurality of neighboring blocks have a plurality of motion vectors referring to the second reference picture, a second median value of the plurality of motion vectors as a second motion vector; and
decoding the current block by using the first motion vector and the second motion vector.