Decoder Buffer Requirements

The MPEG 2 standard sets requirements for minimum decoder channel buffer size. The action of the 27 MHz clock recovery loop causes the need for additional buffer in the decoder beyond the standard specified amount.

Lock Up Time

The video for a newly acquired channel must be displayed immediately, long before the loop has achieved lock. So for some period of time (as long as a few minutes), the receiver will be decoding and displaying video, but its 27 MHz clock will be running faster or slower than the encoder"s STC. Some additional channel buffer is needed to prevent both underflow and overflow for these cases.

Assume that the encoder clock is 27 MHz + 810 Hz and that the receiver VCXO center frequency is 27MHz - 810 Hz (slow case) just prior to channel acquisition, and that a 20Mbit/s (ATSC HDTV) stream is received. Assuming a 130 second lockup time, we can envision a worst case (but unrealistic) scenario where the two clocks remain 1620 Hz apart during the entire lockup process, and then at t = 130 s, they instantly lock at 27 MHz + 810Hz. The means that for this period of time the channel buffer takes in excess data at

In 130 seconds this becomes 156 kbits of extra buffer needed to prevent overflow.

This number can be substantially reduced if we account for the actual trajectory of the VCXO frequency as it approaches 27 MHz + 810 Hz. If this is done we can multiply 156,000 by a factor equal to 1 minus the ratio of the area under the VCXO frequency acquisition curve in the Loop Characteristics  subtopic and the area under the straight line at 1620 in that same graph taken from 0 to 130 seconds.

Now assume that the encoder clock is 27 MHz - 810 Hz and that the receiver VCXO runs at 27 MHz + 810 Hz (fast case) just prior to channel acquisition. In this case the receiver must wait for an additional 156 kbits of data to arrive (at 20 Mbits/s) before it decodes in order to prevent channel buffer underflow. In other words the receiver must add 156,000/20,000,000 =  7.8 ms to all PTS"s (or subtract that amount from all PCR"s). Again this number can be substantially reduced if the actual VCXO trajectory is considered.

Assuming that the receiver does not know if it has an initially slow or initially fast VCXO, it must always add 7.8 ms to all PTS"s. This has the effect of doubling the extra buffer requirement to 312 kbits.

Jitter

To account for a possible +/- 4 ms of jitter (8 ms swing), extra buffer for 16ms x 20Mbits/s is needed.

16ms x 20x106 = 320 kbits

This extra buffer is kept half full by the decoder adding 4 ms to each PTS (or subtract same from PCR's).

Phase Difference After Lockup

Using a first order loop that locks up with a fixed phase difference also requires additional channel buffer. The worst case frequency difference between the encoder STC and the decoder VCXO center frequency is 1620 Hz (162 counts per sample). If the VCXO is slow with respect to the encoder clock, after lockup the VCXO phase will be 162/K counts behind that of the encoder clock. This will cause the decoder to present frames late by the amount in seconds of

This presentation delay requires additional buffer space of PD x 20 Mbits/s in order to prevent overflow.

 

If the receiver VCXO is initially fast with respect to the encoder clock, the receiver must delay presentation by adding some fixed value to all PTS's in order to prevent channel buffer underflow. This value is the same PD calculated above.  

Assuming that the receiver does not know if it has an initially slow or initially fast VCXO, it must always add PD to all PTS's. This has the effect of doubling the buffer requirement in the slow case to 2PD x 20 Mbits/s.

Previous: Loop Characteristics

Up to Decoder STC Synchronization