A quantizer scale value is detected with high accuracy. The number of
effective samples of results of which DCT coefficients are quantized with
each of quantizer scale values Q=1 to 31 is counted. In addition,
fractional parts of quantized values are cumulated. When the number of
effective samples of a cumulated value does not satisfy a predetermined
value, the cumulated value is not used. When a dip point of a considered
normalized cumulated value [q] quantized with the number of effective
samples corresponding to each of the quantizer scale values Q clearly
exists, using the relation between the normalized cumulated value [q] and
normalized cumulated values [q-1] and [q+1] whose quantizer scale codes
are immediately preceded and immediately followed by the quantizer scale
code of the normalized cumulated value [q], it is determined whether or
not the quantizer scale value Q corresponding to the normalized cumulated
value [q] is a quantizer scale value Q used in the preceding encoding
process.