1. An image processing apparatus comprising: a deblocking filter that performs deblocking processing on a decoded image obtained by decoding a second image that is used for motion estimation of a first image in a case where the first image is encoded and that is encoded prior to the first image; and a feature quantity calculation unit configured to calculate a feature quantity representing the complexity of the second image, the feature quantity being obtained based on a generated code amount of the second image and an average of quantizer scales applied to the second image, wherein the deblocking filter controls whether or not the deblocking processing is to be applied to the decoded image or controls the degree to which the deblocking processing is to be applied to the decoded image, on the basis of the feature quantity.