A statistical multiplexer for coding and multiplexing multiple channels of
digital television data, or multiple panels of HDTV digital television
data. A bit rate need parameter is determined for each encoder in a stat
mux group, and an encoding bit rate is allocated to each channel based on
its need parameter. A transmission bit rate is allocated to each channel
as a time-lagged version of its need parameter to minimize a rate
mismatch between the output and the input of a decoder buffer. A packet
processor checks for impending decoder buffer overflow or underflow
events to set minimum and maximum limits on the transmission bit rate.
Moreover, these limits are set based on whether a new transmission bit
rate can be implemented before the decoding time stamp (DTS) of the
current or next frame.