Demultiplexing a statistically multiplexed MPEG transport stream into CBR single program transport streams

Abstract: Demultiplexing of a statistically multiplexed MPEG transport stream into a constant bit rate single program transport stream for decoding uses a smoothing buffer where the pictures from a variable bit rate single program transport stream extracted from the statistically multiplexed MPEG transport stream are input at the constant bit rate as soon as possible after a specified time interval before they are to be decoded - preferably at least a fixed number of seconds prior to the decode time. The constant bit rate single program transport stream is transferred to the decoder when needed to be decoded, and in the event of buffer overflow B-type pictures are replaced with null B-type pictures until the overflow ceases, and the prior picture is repeated by the decoder.

Description: BACKGROUND OF THE INVENTION The present invention relates to video compression, and more particularly to a simple method for demultiplexing a statistically multiplexed MPEG transport stream (MPTS) into constant bit rate (CBR) single program transport streams (SPTSs) without making any changes to the video elementary streams. The video elementary streams in the MPTS are all typically encoded with a variable bit rate (VBR). Only if the constant bit rate is too low does it becomes impossible to demultiplex a single stream from the MPTS without modifying the video elementary stream. Obviously this is the case if the average bit rate of the VBR stream is greater than the constant bit rate of the CBR stream. Even in this case, it is usually possible to ameliorate the potential visual artifacts by replacing B-type pictures with null B-type pictures. Prior efforts that achieve the demultiplexing of a statistically multiplexed MPTS into multiple CBR SPTSs do so by modifying (transcoding) the video streams ― while more general, it is a much more compute intensive process and can negatively impact the quality of the resultant video. Examples of such products are the CherryPicker 7000 video re-multiplexer from Terayon Communication Systems located in Santa Clara, California, United States of America and possibly the PS5030 Multiplexer Module from PixStream Incorporated located in Waterloo, Ontario, Canada. In a statistically multiplexed MPTS, video streams are encoded as VBR with a wide distribution of bit rates per picture. The transport packets (TPs) for a given video stream arrive in almost as bursty a pattern, though there is some smoothing. What is desired is to fit a complete SPTS with VBR video and CBR audio within a CBR network connection without recoding or modifying the video in any way. BRIEF SUMMARY OF THE INVENTION Accordingly the present invention provides a simple method for demultiplexing a statistically multiplexed MPEG transport stream into CBR single program transport streams without recoding or modifying the video in any way. The method starts sending a picture at a fixed interval, on the order of tens or hundreds of milliseconds, before it is to be decoded or as soon thereafter as possible. A separate logical smoothing buffer is used for each variable bit rate single program transport stream. When the decode time arrives the picture is transferred from the smoothing buffer for decoding. In the event there is buffer overflow, B-type frames are replaced with null B-type frames, which has the effect of a freeze frame by repeating the prior decoded picture, until the overflow condition ceases. The objects, advantages and other novel features of the present invention are apparent from the following detailed description when read in conjunction with the appended claims and attached drawing. BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING Fig. 1 is an illustrative view of a statistically multiplexed MPEG Transport Stream having variable bit rate single program transport streams. Fig. 2 is an illustrative view of the relationship between the input variable bit rate single program transport stream and the constant bit rate single program transport stream produced using a smoothing buffer according to the present invention. Fig. 3 is an illustrative timing view showing the loading of the pictures into the smoothing buffer at the constant bit rate starting at a fixed time prior to the decode time, or as soon as possible thereafter, according to the present invention. DETAILED DESCRIPTION OF THE INVENTION Referring now to Fig. 1 a statistically multiplexed MPEG Transport Stream (MPTS) having a plurality of programs of variable bit rates multiplexed together is illustrated. The shadowed packets represent a single program transport stream, Program 1, the packets of which all are a part of the same program. As shown between PCR 0 ms and PCR 1.8048 ms Program 1 has one-third of the packets that are interleaved with those of other programs at an MPTS stream rate of 10 Mbs, i.e., 0.1504 ms per MTS packet. The bit rate for Program 1 over that interval is 3.33333 Mbs. Between the next two PCRs at 1.8048 ms and 2.1056 ms are only two Program 1 packets with no interleaved packets so the Program 1 bit rate is that of the MTS stream, i.e., 10 Mbs. The different bit rates for Program 1 depend upon, for example, image complexity and the type of MPEG frame ― I, P or B. The SPTS(VBR) is separated from the MTS based upon the packet PIDs, and is input to a logical smoothing buffer at the desired constant bit rate to produce an SPTS having a Constant Bit Rate (CBR). The SPTS (CBR) may then be decoded at the time indicated by the decode time stamp (DTS) for each frame to recover the original images in the video stream. As shown in Fig. 2 for an SPTS (VBR) that has an Average Bit Rate (ABR) less than the desired CBR, there are times when the SPTS (VBR) exceeds the CBR. In the absence of the present invention this causes those pictures not to be decoded, resulting in repeated frames since the prior frame is repeated if the next frame is not decoded. The still frame remains until the next complete image or frame is available for the decoder at the time indicated by the associated decode time stamp (DTS). To prevent this undesired anomaly, the solution according to the present invention is to start loading the buffer early with the packets for a frame so that when decode time comes the full data for the frame is available for decoding, as illustrated in Fig. 3 and described in more detail below. Buf n represents the smoothing buffer for variable bit rate (VBR) video elementary stream n within a statistically multiplexed MPEG transport stream (MPTS). The variable td n (j) is a decode time for the j'th picture of the video elementary stream n in a system target decoder. Decode time is measured in seconds and is with respect to a system clock PCR for the program containing elementary stream n . The variable t n i (j) is a time at which the i'th transport stream (TS) packet of the j'th picture of elementary stream n enters the smoothing buffer Buf n . Again time is measured in seconds and is with respect to the system clock for the program containing elementary stream n . R n is based on the desired bit rate shown in Fig. 2 ― it is the desired bit rate less the bit rate of the packets in the SPTS not carrying video. R n is a constant rate at which the TS packets with the video elementary stream n enter the smoothing buffer Buf n . The rate is given in units of bits per second. Finally δ n is the earliest time before the decode time that a video elementary stream TS packet can enter the smoothing buffer Buf n . Again time is given in seconds. The buffer size is given by |Buf n I = R n δ n . TS packets containing video elementary stream n enter Buf n as early as possible subject to the following constraints: 1. The rate at which the packets can enter Buf n is limited by R n . 2. For any picture j of video elementary stream n and for all TS packets containing picture j, t n i (j) + δ n ≥ td n (j). 3. At time td n (j) all of the packets t n i (j) are removed. 4. If the buffer Buf n is full, i.e., contains R n δ n bits, then no new packets can enter. The buffer model is satisfied if the buffer Buf n never overflows or underflows. An overflow or underflow occurs when for any picture j of video elementary stream n and any TS packet containing picture j, t n i (j) > td n (j). In the event of overflow a B-type frame is replaced by a null B-type frame until the overflow ceases, which has the effect of repeating the prior video frame by the decoder, as described in co-pending U.S. Patent Application No. 09/113,669 entitled "Readjustment of Bit Rates When Switching Between Compressed Video Streams" by Douglas C. Stevens et al. The above is illustrated in Fig. 3 where a series of frames of variable bit rates is shown. At time δ before the DTS for frame 1, frame 1 is loaded into the buffer. The buffer may be thought of as having a plurality of equal capacity slots between consecutive DTS times. Since frame 1 has fewer bits than the capacity of one slot, there is a gap before frame 2 is loaded into the buffer, again at time δ before the DTS for frame 2. Likewise frame 3 is loaded at time δ before DTS 3 . Frame 3 has more bits than fit into one slot, so that frame 4 is loaded into the buffer as soon as possible thereafter. Then frame 5 is loaded into the buffer as soon as possible. The end of frame 5 almost exceeds the DTS time for frame 5 and the buffer is in danger of overflowing. However the next few frames 6, 7 and 8 each have fewer bits than one slot so that the capacity of the buffer is alleviated. Thus the present invention provides for demultiplexing a statistically multiplexed MPEG transport stream into a constant bit rate single program transport stream using a smoothing buffer with the video pictures in the stream being loaded into the smoothing buffer at the desired constant bit rate as early as possible up to a fixed time interval before the pictures need to be decoded.

Claims: A method of demultiplexing a statistically multiplexed MPEG transport stream into a constant bit rate single program transport stream comprising the steps of: separating a variable bit rate single program transport stream from the statistically multiplexed MPEG transport stream; loading a picture from the variable bit rate single program transport stream at the constant bit rate into a smoothing buffer at a specified time, or as soon as possible thereafter, prior to a decode time for the picture; and transferring the picture from the smoothing buffer at the decode time. The method as recited in claim 1 further comprising the step of replacing B-type pictures at the input to the smoothing buffer with null B-type pictures when the smoothing buffer is in an overflow condition until the overflow condition ceases.

Inventors: HEGAR RYAN P, SCHWARTZ MAYER D, HEGAR, RYAN P., SCHWARTZ, MAYER D.
Applicants: TUT SYSTEMS INC, TUT SYSTEMS, INC.
Application year: 2001
Main classification: H04N7
IPC codes: H04N7, H04J3