Patent ID: 7995651

Claim:
A coding method for coding blocks of picture data, said coding method comprising: generating, by a command generation unit, a sequence of commands for respectively assigning frame-indices, used for frame coding, to reference frames of the blocks of picture data; adaptively switching, by a processor and on a block-by-block basis of the blocks of picture data, between frame coding and field coding; specifying, by a reference frame specification unit and in a case where frame coding is performed on a block of picture data of the blocks of picture data, a reference frame, which is referred to when coding the block of picture data, according to a frame-index included in the assigned frame-indices assigned by the sequence of commands; specifying, by a reference field specification unit and in a case where field coding is performed on the block of picture data, a reference field, which is referred to when coding the block of picture data, according to a field-index, which is for field coding the block of picture data and which is generated using the frame-index included in the assigned frame-indices; coding, by a reference index coding unit and as a reference index, the frame-index, which is used for specifying the reference frame, in the case where frame coding is performed on the block of picture data; coding, by the reference index coding unit and as a reference index, the field-index, which is used for specifying the reference field, in the case where field coding is performed on the block of picture data; coding information indicating a maximum number of frame-indices; and determining a maximum number of field-indices to be double a value of the maximum number of frame-indices, wherein said specifying of the reference field includes: determining the field-index so that a number of specified reference fields is not greater than the determined maximum number of field-indices; specifying, as the field-index, a doubled value of a value of the frame-index, which is used for specifying a reference frame including the reference field, in a case where the reference field has a same parity as a parity of a field including the block of picture data; and specifying, as the field-index, a value obtained by adding one to the doubled value of the value of the frame-index, which is used for specifying the reference frame including the reference field, in a case where the reference field has a different parity from the parity of the field including the block of picture data.