A lossless encoding apparatus encodes audio data and a lossless decoding
apparatus restores the losslessly compression encoded audio data on a
real-time basis, and a method therefor. The lossless encoding apparatus
includes a lossless compression unit which losslessly compression encodes
the audio data stored in an input buffer in units of predetermined data
and outputs the encoded data in sequence, and an output buffer which
stores the encoded audio data output from the lossless compression unit.
A bitrate controller divides a plurality of the encoded audio data stored
in the output buffer into first data having a data amount exceeding the
maximum bitrate and second data having a data amount less than the
maximum bitrate, divides the first data into third data being the encoded
audio data having a data amount of the maximum bitrate and fourth data
being the encoded data of the portion exceeding the maximum bitrate, and
controls the output buffer so that the fourth data is output together
with the second data.