1. A coding method comprising: an analyzing step of analyzing an input image; a quantization parameter calculating step of calculating a quantization parameter by using analysis results in the analyzing step; and an encoding step of encoding the input image by using the quantization parameter calculated in the quantization parameter calculating step, wherein a first region to be analyzed in the analyzing step has a variable size.