A VLD decodes MPEG2 data so as to generate RUN and Level therefrom. A
multiplication unit multiplies target data to be added to the Level, and
sends a multiplied result to an adder. The adder adds the target data to
the Level. The VLC codes the MPEG2 data, using the RUN and the Level to
which the target data is added. The selector compares the data length of
the MPEG2 data which has been decoded by the VLC with the data length of
the original MPEG2 data. If those data lengths coincide with each other,
the selector selects the MPEG2 data output by the VLC. On the contrary,
if those data lengths do not coincide with each other, the selector
selects and outputs the original MPEG2 data. A counter counts the number
of times the selector has done the selection, while another counts the
number of times the selector has selected the data output by the VLC. The
comparator compares the counted values of both of the counters, and
adjusts the insertion degree based on a result of the comparison.