Patent ID: 8737481

Claim:
An image encoding method comprising: generating a motion vector of a current block to be encoded by performing motion prediction of the current block, the motion vector having fractional pixel resolution; determining an adjacent area of a reference picture corresponding to an adjacent area of the current block, the adjacent area of the current block having been encoded and decoded prior to the current block; generating an interpolation filter for interpolating fractional pixels between integer pixels in the adjacent area of the reference picture according to fractional pixel resolution of the motion vector of the current block, the interpolation filter interpolating the adjacent area of the reference picture to minimize a difference between the interpolated adjacent area of the reference picture and a corresponding adjacent area of the current block; and interpolating a corresponding block of the current block, which is indicated by the motion vector having the fractional pixel resolution, using the generated interpolation filter, wherein the generating the interpolation filter comprises: interpolating the fractional pixel to be interpolated between integer pixels in the adjacent area of the reference picture by combining a mask for assigning weights to the adjacent integer pixels based in the fractional pixel and calculating a weighted sum obtained by multiplying the adjacent integer pixels in the mask by the assigned weights and adding the multiplied results; calculating a sum of error values between pixels in the adjacent area of the current block and corresponding interpolated fractional pixels in the adjacent area of the reference picture; and determining weights of the mask to minimize the sum of error values, wherein the determining the weights of the masks comprises determining the weights of the mask by partially differentiating the sum of error values using the weights assigned to the adjacent integer pixels as variable and calculating weights such that the partially differentiated sum of error values is 0.