Constant Bit Rate Operation
Because the total buffer delay is known, the time at which a particular access unit should be decoded can be easily calculated by the encoder and transmitted as the presentation time stamp (PTS) (or decoder time stamp ,DTS if present).
The decoder synchronizes the decoder buffer as follows:
Assume that the decoder system time clock is synchronized. When a PTS or DTS is received, it is inserted into a PTS/DTS list with a pointer to the buffer location of the corresponding access unit. At the instant of reception and decoder buffer loading, the decoder system time clock (STC) will have a value equal to the (instantaneous) coding time plus the encoder buffer delay. The STC will be less than the PTS, because the PTS equals the coding instant plus the total buffer delay (encoder + decoder). Later, when the STC equals the PTS, the whole access unit is extracted, decoded, and displayed. (In case of reordering, the access unit is decoded when the STC equals the DTS, but it is not displayed until the STC equals the PTS).
It is required not to overflow or underflow the buffers. This means also that an entire access unit must be present in the decoder buffer before it is instantaneously read and decoded. To accomplish this, the encoder buffer must
a) never overflow (the requirement if decoding were bit-by-bit)
b) must be emptied of each complete access unit at its DTS time.
The buffer fill rate is controlled by changing the variable quantization (see MPEG 2 Quantization ). The control feedback always works on buffer fullness and may also have feed forward features to estimate ahead of time the bit rate needed for each picture. In addition, it must constrain the number of bits in each access unit so that when it is inserted into the encoder buffer, there is enough time for it to be transmitted before its DTS/PTS time. An practical encoder that looks at least one frame ahead will be capable of this. Each access unit is reduced if necessary to a size that fits between the end of the previous access unit and the data position in the buffer that will be transmitted before the next DTS/PTS time.
In the case of a practical non-instantaneous encoder (or decoder), additional buffer space equal to one picture period times the constant bit rate may be required.
Next: Variable Bit Rate Operation
Up to Buffer Synchronization and Startup