Image data is encoded using a buffer memory, and code amount of image data
occupying the buffer memory upon coding is detected and buffer
information related to the detected code amount is outputted. The coded
image data and the buffer information are recorded on a recording medium.
In a case where additional recording or overwriting is started, the
buffer information in a position immediately before a start position of
the additional recording or overwriting is read out, and coding is
started based on value, thereby buffer overflow can be prevented.