Patent ID: 8634471

Claim:
A moving image encoding apparatus configured to divide an input image into a plurality of blocks, and to perform predictive encoding using motion compensation for each of the plurality of blocks, the moving image encoding apparatus comprising: a first motion search unit configured to calculate, using the input image and an image that is positioned temporally immediately preceding the input image, a difference between pixel values for each of the plurality of blocks, and to calculate a first motion vector for each of the plurality of blocks based on a positional relationship in which the difference is minimal; a motion vector memory configured to store the first motion vectors in association with positions of the plurality of blocks of the input image, and to hold the first motion vectors related to a plurality of temporally successive images; a search position determination unit configured to determine for each of the plurality of blocks, in accordance with the first motion vectors held in the motion vector memory, a position where motion search is to be performed in a reference image that is referenced when motion compensation is performed; a second motion search unit configured to set, based on the position determined by the search position determination unit, a search area of a prescribed size in the reference image for each of the plurality of blocks, and to determine, within the search area, a second motion vector for each of the plurality of blocks; and an encoding unit configured to perform predictive encoding using motion compensation based on the second motion vector determined by the second motion search unit, wherein, if an image that is not temporally adjacent to the input image is the reference image, with a method for selecting, using each of the plurality of blocks of the input image as a starting point, a block of an immediately preceding image in accordance with the first motion vector corresponding to a position of the block, the search position determination unit tracks a plurality of the first motion vectors related to images between the input image and the reference image, calculates a composite motion vector that is obtained by adding the plurality of tracked first motion vectors such that the plurality of first motion vectors are successive, and determines, based on the composite motion vector, a position where motion search is to be performed in the reference image for each of the plurality of blocks.