Activities are normalized corresponding to a characteristic of a pattern
of a frame. The picture quality is optimized by adaptive quantization. A
normalized activity norm_act [m] of each macro block is obtained with an
average activity avg_act of the frame and the activity act [m] of each
macro block according to the following formulas (1) and (2). In the
following formulas, att is a parameter, for example att=0.125.
norm_gain=att.times.avg_act+1 (1)
norm_act[m]={(norm_gain.times.act[m].times.act[m])+(avg_act.times.avg_act-
)}/{(act[m].times.act[m])+(norm_gain.times.avg_act.times.avg_act)}
(2)Thus, the normalized activities norm_act [m] are normalized in the
range from 1/norm_gain to norm_gain. Since norm_gain is proportional to
the average activity avg_act, when a picture has a flat pattern whose
average activity avg_act is small, the normalizing range becomes small.
Thus, the quantized values of macro blocks are not largely different. As
a result, the picture is equally quantized. In contrast, when a picture
has a complex pattern whose average activity avg_act is large, the
normalizing range becomes large. Thus, the quantized values of macro
block are largely different. As a result, a macro block having a flat
pattern is finely quantized, whereas a macro block having a complex
pattern is coarsely quantized.