An image encoding apparatus includes a quantization control section that
supplies a rounded Q-scale to a quantization section for quantizing each
macroblock according to the rounded Q-scale. A Q-scale is generated for
each macroblock based on the amount of generated codes produced by
encoding. The Q-scale is rounded within a set range by a rounding control
section. The rounded Q-scale is smaller in amount than the Q-scale. Since
the same Q-scale values will continue in succession, these can be omitted
from a stream, allowing the reduced amount of quantization information
and the increased amount of information allocated to images.