Method and system for controlling a video data encoder buffer

Abstract: A system and method for controlling a data encoder buffer is disclosed, including an encoder for encoding input data as a first bit sequence in a bitstream; a processor having a predetermined size for converting the first bit sequence to a sequence having the predetermined size; and a decoder for decoding the modified bit sequence. The modified bit sequence is generated by inserting bits to the first bit sequence. The encoder encodes the input data at a rate such that a final capacity of the data buffer is less than a function of the predetermined size, a desired decoding rate, and an initial capacity of the encoder buffer. The data buffer has a total buffer capacity which is less than a function of the actual rate and the desired decoding rate. In an exemplary embodiment, the capacity of the data buffer is less than one half the capacity of the decoder buffer. A method is also disclosed for controlling a data buffer comprising the steps of receiving input data; encoding the input data using an encoder to generate a first bit sequence; detecting a condition of the first bit sequence having a size of less than a predetermined size; converting the first bit sequence having the less than the predetermined size to a second bit having the predetermined size; receiving the bitstream; and decoding the second bit sequence.

Description: BACKGROUND OF THE INVENTION FIELD OF THE INVENTION This disclosure relates to data buffers and, in particular, to a system and method for controlling a data buffer for transmitting compressed data. DESCRIPTION OF THE RELATED ART In server applications it is desirable to convert input data to bit sequences insertable in a bit stream for transmission. For example, in the Motion Picture Experts Group Standard (MPEG), input video data is encoded as compressed bitstreams as specified in the MPEG standard specification; i.e. MPEG TEST MODEL 4, "Coded Representation of Picture and Audio Information", ISO-IEC/JTC1/SC29/EG11, CCITT SG XV, Working Party XV/1, Document AVC-445b, February 1993. It is advantageous to store the compressed input data in short independently decodable bit sequences representing clips such as video clips, where a clip is defined to be a sequence of video frames. It is preferable to have such clips encoded and stored for later transmission in an arbitrary order. Such decoding from concatenated bit sequences allows for seamless switching to be performed between different bitstreams at certain access points. It is preferred that switching be performed without gaps or loss of data at the switching points and without buffer underflow or overflow at times after performing the switching. These features would be applicable for inserting advertisement clips into MPEG bitstreams, as well as jumping from one access point to another in the same bitstream or looping on a particular clip. EP-A-0 515 101 discloses a method and apparatus for overcoming the problems of buffer overflow and underflow encountered when employing actually variable or effectively variable bit-rate channels for communicating encoded video images by jointly controlling the number of bits employed to encode each video frame and the transmission bit-rate of the variable bit-rate channel as experienced by the encoder. The selection of the number of bits employed to encode each video frame, and hence the encoder bit-rate, as well as the associated channel bit-rate are determined from the encoder buffer fullness, a determination of the decoder buffer fullness and any constraint imposed on the channel. The encoder is responsive to the selected encoder bit-rate and accordingly adjusts its encoding parameters so as to achieve the selected encoder bit-rate. Summary of the Invention A system and method according to the invention are as set out in the independent claims. Preferred forms are set out in the dependent claims. A system and method for controlling a data buffer is disclosed, with the system including an encoder for encoding input data as a first bit sequence; a processor including the data buffer and operatively associated with the encoder for detecting a condition of the first bit sequence having a size of less than a predetermined size, and for converting the first bit sequence to a first modified bit sequence in the bitstream, the second bit sequence having the predetermined size, and a decoder for decoding the second bit sequence. The processor generates the second bit sequence by inserting at least one predetermined bit, such as a logical 0 bit, into the first bit sequence. In addition, the encoder and decoder include means for encoding and decoding, respectively, the input data according to the Motion Picture Experts Group (MPEG) standard, with the decoder buffer having a predetermined fixed capacity. The method controls a data buffer comprising the steps of receiving input data; encoding the input data using an encoder to generate a first bit sequence; detecting a condition of the first bit sequence having a size of less than a predetermined size; converting the first bit sequence having a size less than the predetermined size to a modified bit sequence in the bitstream, the modified bit sequence having the predetermined size; receiving the bitstream; and decoding the modified bit sequence. BRIEF DESCRIPTION OF THE DRAWINGS The features of the disclosed data buffer control system and method will become more readily apparent and may be better understood by referring to the following detailed description of an illustrative embodiment of the present invention, taken in conjunction with the accompanying drawings, where: FIG. 1 is a block diagram of the disclosed data buffer control system; FIG. 2 is a block diagram of an exemplary video encoder; FIG. 3 is a block diagram of a postprocessor; FIG. 4 illustrates an exemplary bitstream; FIG. 5 illustrates the exemplary bitstream of FIG. 4 modified according to the disclosed video encoder control system; and FIG. 6 is a flow chart of the method and operation of the disclosed video encoder control system. DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring now in specific detail to the drawings, with like reference numerals identifying similar or identical elements, as shown in FIG. 1, the present disclosure relates to a data buffer control system and method for processing encoded data. Referring to an exemplary embodiment shown in FIG. 1, input data such as input video data is input to an encoder 12 which encodes the input data to a compressed data bitstream. A postprocessor 14 processes the bitstream to insert bit sequences therein, and the modified bitstream is then transmitted via a transmission channel 16 for reception by a decoder buffer 18 associated with a decoder 20. The decoder 20 decodes the modified bitstream to extract the video data. As shown in the exemplary embodiment of FIG. 2, the encoder 12 includes: a preprocessor 22 for detecting film frames and scene changes in a video input; a rate controller 24; an encoder module 26; a prediction module 28; a formatter 30; a perceptual model module 32; a motion estimation module 34; and a decoder module 36. These components of the video encoder 12 may be implemented in a manner known in the art, as described, for example, in U.S. Patent Nos. 5,144,423 to Knauer et al.; 5,231,484 to Gonzales at al.; 5,247,363 to Sun et al.; 5,293,229 to Iu; and 5,325,125 to Naimpally et al., each of which are incorporated herein by reference. In an exemplary embodiment, the compressed buffer control system 10 having encoder 12 and decoder 20 are implemented according to the Motion Picture Experts Group (MPEG) standard. Generally, for the data buffer control system and method disclosed herein, the preprocessor 22 receives input video data and removes redundant fields from video data corresponding to a film source. The rate controller 24 receives data signals such as flags from the preprocessor 22 to control the operation of the encoder 12 for performing encoding functions. The rate controller 24 also controls communications of the encoder 12 with external systems in order to maintain the encoded bit rate within an operating bandwidth using control signals such as a video buffer verify delay (VBV_DLY) signal. The encoder module 26 receives processed video data from the preprocessor 22 as well as prediction estimates from the prediction module 28 for encoding the preprocessed video data. The formatter 30 combines the various data fields with blocks of pixels of video frames to generate an encoded output signal for output through an output channel. The perceptual model module 32 calculates coding parameters for the encoding process, and the motion estimation module 24 performs block matching of video data in a current block of pixels with previous image data to generate motion factors. The decoder module 36 generates a reconstructed prediction error from the encoding process to construct a decoded image. As shown in FIG. 3, the postprocessor 14 includes an encoder buffer 38 having memory for receiving and storing the incoming bitstream and the VBV_DLY signal from the encoder 12. A processor 40 processes the bitstream to insert bits and bit sequences to the bitstream as described hereafter, as well as to revise the VBV_DLY signal to reflect the modification of the bitstream. In an exemplary embodiment, the postprocessor 14 is a SPARC workstation available from Sun Microsystems, Inc. having about 10 Megabytes associated RAM memory; a display, keyboard, and other input and output devices; and a hard or fixed drive storage device, with the encoder buffer 38 having means known in the art for capturing and storing the incoming bitstream. The decoder buffer 18 and the decoder 20 are implemented in a manner known in the art. In particular, for the exemplary embodiment disclosed herein for an MPEG system, the decoder 20 implements MPEG decoding as specified in the MPEG standard specification. The following discloses exemplary embodiments of the compressed data buffer system and method. GENERATING EQUAL SIZE CLIPS MPEG encoding generates a variable number of bits per frame, with a clip being at least one frame having associated bits, while the number of transmitted bits from the encoder 12 (which may be included in a server device) to decoder 20 per frame time is constant. This discontinuity is accounted for by including an elastic encoder buffer 38 in the postprocessor 14 between the encoder 12 and the transmission channel 16 or alternatively a transmitter or storage device. The difference between the actual number of bits generated for a series of frames and the number of bits in that many average frames is bounded by the size or capacity of the encoder buffer 38. In an exemplary embodiment, the method of generating fixed length clips of size T is to encode the video clip at some actual rate R a that is less than the desired decoding rate R d and then to add "stuffing" or "padding"; i.e. irrelevant bits which may be predetermined such as logical 0 bits, to bring the clip up to the desired rate. As illustrated in FIG. 4, an exemplary bitstream 42 is shown having a first bit sequence 44 and a second bit sequence 46 from the encoder 12, represented by F's and S's respectively, in the MPEG standard prior to padding. As disclosed herein, the postprocessor 14 inserts a first sequence 48 of padding bits X and a second sequence 50 of padding bits Y to the bit sequences 44, 46, respectively, to generate the first modified bit sequence 52 and the second modified bit sequence 54, respectively, as shown in FIG. 5, wherein the modified bit sequences 52, 54 have equal predetermined sizes. As stated above, the padding bits 48, 50 may be logical 0 bits. It is understood that the padding bits 48, 50 may be distributed throughout the respective bit sequences 44, 46. The actual number of bits generated over the length of the clip T at rate R a is less than or equal to the average number of bits that would be generated at rate R d so that the clip may be stuffed up to the desired decoding rate. For an initial buffer occupancy B i and a final buffer occupancy B f , then R a T + B f - B i ≤ R d T or ( R d - R a ) * T ≥ B f - B i Setting ΔR = R d - R a and, in a worst case situation, B f - B i = B e , the overall encoder buffer capacity, then T ΔR ≥ B e Eq. (3) shows that the encoder buffer capacity is to be less than the product of the length of the clip and the difference in actual and desired rates in order to stuff the clips or other data sequences to attain the desired decoding rate. This is determined by replacing B f - B i with B e , the overall capacity of the encoder buffer 38, in the worst case situation for the encoder buffer 38. Clips of equal size may then be generated by satisfying the condition of Eq. (3) above as a first constraint. For bitstreams placing such equal size clips end to end for decoding by the decoder 20, additional constraints are to be provided for the generation of the clips. When stuffing is added at a constant rate to a clip to pad the clip up to the predetermined size, decoding of the padded clips may cause a buffer underflow in the decoder 20. Underflow of the decoder 20 may be prevented by setting the sum of the encoder buffer capacity B e and the maximum amount of stuffing T ΔR to be less than the capacity B d of the decoder buffer 18. This prevention method is expressed as: B e + TΔR ≤ B d - B e or TΔR ≤ B d - B e Thus Eq. (5) is a second constraint for preventing underflow in the decoder 20. Combining Eq. (3) and (5), then B e ≤ TΔR ≤ B d - B e or B e B d ≤ TΔR B d ≤ 1 - B e B d since the buffer capacities are positive numbers. From the outer terms of Eq. (7), one may obtain B e B d ≤ 1 2 The capacity B d of the decoder buffer 18 is fixed according to the MPEG standard. For an encoder buffer 38 being as large as possible as a third constraint, then from Eq. (8), B e B d = 1 2 and from Eq. (7) and (9), then TΔR B d = 1 2 Eq. (10) then gives a relationship between T, the length or time duration of the clips, and ΔR, the difference between the actual encoded rate and the rate at which the clip is decoded. For example, in a decoder having a 1.75 megabit (Mbit) capacity, exemplary lengths and rate values are listed in Table 1 below. Length (sec) ΔR (Mbit/sec) % of 3 Mbit/sec .5 1.75 58 1 .875 29 2 .438 15 5 .175 6 10 .088 3 30 .029 1 60 .015 .5 For example, for a 3 Mbit/sec desired decoding bit rate, a value of T = 10 sec. reduces the effective bit rate by 3%, having only a relatively small impact, whereas a value of T = 2 sec. reduces the effective bit rate by a noticeable 15%. Thus, by putting relatively minor restrictions on the operation of a MPEG encoder such as encoder 12, the output of the encoder 12 may be formatted by the postprocessor 14 into equal size concatenable clips. As shown in Table 1, there is a trade-off between the size of the clip and the effective bit rate or effective quality of the encoded bitstream. Referring to FIG. 6, the disclosed data buffer control system operates by the method disclosed herein, including the steps of starting the controlling of the data buffer in step 56; receiving input video data in step 58; encoding the input video data using the encoder 12 to generate bit sequences in step 60; transmitting the bit sequences in a bitstream in step 62; and generating a control signal, for example, the VBV_DLY signal associated with the bit sequences in step 64. The postprocessor 14 detects a condition of the bit sequences having a size of less than a predetermined size in step 66; converts the bit sequences having the size less than the predetermined size to modified bit sequences in the bitstream having the predetermined size in step 68; and modifying the control signal in step 70. The decoder buffer 18 receives the bitstream in step 72, and the decoder 20 decodes the modified bit sequences in step 74. While the disclosed data buffer control system and method has been particularly shown and described with reference to the preferred embodiments, it will be understood by those skilled in the art that various modifications in form and detail may be made therein without departing from the scope of the invention.

Claims: A system for controlling a video encoder data buffer (38), said video encoder data buffer having a capacity B e and being connected between an encoder (12) arranged to encode input video data as a first bitstream and a processor (40) arranged to receive as input the first bitstream and to generate a second bitstream for transmission to a decoder (20) having a decoder buffer (18) with a capacity B d ; CHARACTERISED IN THAT : the encoder (12) is arranged to encode the input video data at an actual rate R a that is less than a desired decoding bit rate R d ; the processor (40) is arranged to control the generation of the second bitstream to bring the actual bit rate R a to a bit rate approximately equal to the desired decoding bit rate R d by inserting padding bits into the first bitstream so that the second bitstream consists of equal length bit sequences, each of said equal length bit sequences being developed from a respective portion of said first bitstream; and each of the equal length bit sequences is an independently decodeable video clip consisting of a sequence of video frames and having a duration T when decoded at the decoding bit rate R d ; wherein the following relationships are satisfied: B e ≤ T ( R d - R a ) ≤ B d - B e and T ( R d - R a ) B d = 1 2 . The system of claim 1 wherein B e / B d ≤ 1 / 2. The system of claim 1 wherein the encoder (12) and decoder (20) include means for encoding and decoding the input data according to the Motion Picture Experts Group (MPEG) standard. The system of claim 1 wherein the padding bits are each the same predetermined logic level. The system of claim 1 wherein the encoder (12) generates a VBV_DLY signal corresponding to a first bit sequence of the first bitstream; and the processor (40) responds to the generation of a bit sequence of the second bitstream to update to VBV_DLY signal to correspond to the bit sequence of the second bitstream. A method for controlling a video encoder data buffer (38), said video encoder data buffer having a capacity B e , comprising: receiving input video data; encoding the input video data as a first bitstream; applying the first bitstream to said video encoder data buffer; and processing the first bitstream to generate a second bitstream for transmission to a decoder (20) having a decoder buffer (18) with a capacity B d ; CHARACTERISED IN THAT : said encoding step encodes the input video data at an actual rate R a that is less than a desired decoding bit rate R d ; said processing step controls the generation of the second bitstream to bring the actual bit rate R a to a bit rate approximately equal to the desired decoding bit rate R d by inserting padding bits into the first bitstream so that the second bitstream consists of equal length bit sequences, each of said equal length bit sequences being developed from a respective portion of said first bitstream; and each of the equal length bit sequences is an independently decodeable video clip consisting of a sequence of video frames and having a duration T when decoded at the decoding bit rate R d ; wherein the following relationships are satisfied: B e ≤T ( R d - R a ) ≤B d - B e and T ( R d - R a ) B d = 1 2 .

Inventors: BOTSFORD NELSON III, HINGORANI RAJESH, THOMAS DAVID, BOTSFORD, NELSON III, HINGORANI, RAJESH, THOMAS, DAVID
Applicants: AT & T CORP, AT&T CORP.
Application year: 1995
Main classification: H04N7
IPC codes: H04N7, H03M7