Abstract:
The present invention relates to a method for dynamically allocating bandwidth to each encoder in an ensemble of video encoders whose output bit streams share a single communications channel. In accordance with the present invention, the channel bandwidth is allocated to the individual encoders in the ensemble in such a way that differences in a quality measure among the decoders are reduced. The quality measure includes a term that behaves like a peak-signal-to-noise ratio (PSNR) and a term that measures the &#34;masking effect&#34; in a video signal. The &#34;masking effect&#34; results because an encoded frame with a high visual complexity masks coding artifacts from the viewer when it is decoded and displayed.

Description:
This is a continuation of application Ser. No. 08/573,932, filed Dec. 18, 1995, now abandoned. 
    
    
     FIELD OF THE INVENTION 
     The present invention relates to a method for dynamically allocating bandwidth to each encoder in an ensemble of video encoders whose output bit streams share a single communications channel. In accordance with the present invention, the channel bandwidth is allocated to the individual encoders in the ensemble in such a way that differences in a quality measure among the encoders are reduced. The quality measure includes a term that behaves like a peak-signal-to-noise ratio (PSNR) and a term that measures the &#34;masking effect&#34; in a video signal. The &#34;masking effect&#34; results because an encoded frame with a high visual complexity masks coding artifacts from the viewer when the frame is decoded and displayed. 
     BACKGROUND OF THE INVENTION 
     An ensemble of video encoder systems is illustrated in FIG. 1. The ensemble 10 comprises a plurality of video encoder systems 20-i, i=0, 1, 2, . . . , P-1. Each encoder system receives uncompressed video at an input 22-i and outputs a compressed digital video bitstream at an output 24-i. Illustratively, each encoder system 20-i outputs a compressed digital bit stream which complies with the syntax specified in the MPEG-2 video specification (ISO\IEC13818-2; Recommendation ITU-TH.262 (1995E) produced by ISO, the contents of which are incorporated herein by reference). 
     The digital bit streams output by the encoder systems 20-i are multiplexed together by the system multiplexer 30 and the multiplexed bitstream is transmitted to one or more decoders via the common channel 40. A system controller 50 controls the system multiplexer 30. The system controller 50 allocates a fraction of the bandwidth of the channel 40 to each of the encoder systems. The system controller 50 may be implemented as a microprocessor or microcontroller. The present invention relates to a novel method for allocating the bandwidth of the channel 40 among the encoder systems 20-i. 
     A video encoder system 20 is illustrated in FIG. 2. The system 20 includes a preprocessor 14, a video encoder 16, a rate buffer 18 and a rate controller 19. The preprocessor 14 receives a digital video signal comprising a sequence of frames from a source 12. The source 12 of video is, for example, a video camera, or a telecine machine which converts a sequence of film images into a sequence of video frames, or other device which outputs a sequence of video frames. The preprocessor 14 performs a variety of functions to place the sequence of video frames into a format in which the frames can be compressed by the encoder. For example, in case the video source is a telecine machine which outputs 30 frames per second, the preprocessor 14 converts the video signal into 24 frames per second for compression in the encoder 16 by detecting and eliminating duplicate fields produced by the telecine machine. 
     In addition, the preprocessor may spatially scale each frame of the source video so that it has a format which meets the parameter ranges specified by the encoder 16. 
     The video encoder 16 is preferably an encoder which utilizes a video compression algorithm to provide an MPEG-2 compatible bit stream. The MPEG-2 bit stream has six layers of syntax. There are a sequence layer (random access unit, context), Group of Pictures layer (random access unit, video coding), picture layer (primary coding layer), slice layer (resynchronization unit), macroblock (motion compensation unit), and block layer (DCT unit). A group of pictures (GOP) is a set of frames which starts with an I-frame and includes a certain number of P and B frames. The number of frames in a GOP may be fixed. A macroblock in a video frame illustratively comprises four 8×8 pixel blocks of luminance information and two 8×8 pixel blocks of chrominance information. 
     The encoder distinguishes between three kinds of frames, (i.e., pictures) I, P, and B. The coding of I frames results in the most bits. In an I-frame, each macroblock is coded as follows. Each 8×8 block of pixels in a macroblock undergoes a DCT (discrete cosine) transform to form an 8×8 array of transform coefficients. The transform coefficients are then quantized with a variable quantizer matrix. The resulting quantized DCT coefficients are zig-zag scanned to form a sequence of DCT coefficients. The DCT coefficients are then organized into run, level pairs. The run, level pairs are then entropy encoded. In an I-frame, each macroblock is encoded according to this technique. It should be noted that the quantizer matrix used to quantize each macroblock is multiplied by a scale factor which can vary from one macroblock to the next. 
     In a P-frame, a decision is made to code each macroblock as an I macroblock, which is then encoded according to the technique described above, or to code the macroblock as a P macroblock. For each P macroblock, a prediction of the macroblock in a previous video frame is obtained. The prediction is identified by a motion vector which indicates the translation between the macroblock to be coded in the current frame and its prediction in the previous frame. (A variety of block matching algorithms can be used to find the particular macroblock in the previous frame which is the best match with the macroblock to be coded in the current frame. This &#34;best match&#34; macroblock becomes the prediction for the current macroblock.) The predictive error between the predictive macroblock and the current macroblock is then coded using the DCT, quantization, zig-zag scanning, run, level pair encoding, and entropy encoding. In order to do predictive encoding of this type, the video encoder 16 inherently includes a decoder. This decoder decodes a frame which is compressed by the encoder. The decoded frame is then stored and used to make the motion compensated predictions described above. 
     In the coding of a B-frame, a decision has to be made as to the coding of each macroblock. The choices are (a) intracoding (as in an I macroblock), (b) unidirectional backward predictive coding using a subsequent frame to obtain a motion compensated prediction, (c) unidirectional forward predictive coding using a previous frame to obtain a motion compensated prediction, and (d) bidirectional predictive coding wherein a motion compensated prediction is obtained by interpolating a backward motion compensated prediction and a forward motion compensated prediction. In the cases of forward, backward, and bidirectional motion compensated prediction, the predictive error is encoded using DCT, quantization, zig-zag scanning, run, level pair encoding and entropy encoding. 
     B frames have the smallest number of bits when encoded, then P frames, with I frames having the most bits when encoded. Thus, the greatest degree of compression is achieved for B frames. For each of the I, B, and P frames, the number of bits resulting from the encoding process can be controlled by controlling the quantization step size. A macroblock of pixels or pixel errors which is coded using a large quantizer step size results in fewer bits than if a smaller quantizer step size is used. 
     After encoding by the video encoder, the bit stream is stored in the encoder rate buffer 18. Then, the encoded bits are transmitted via the system multiplexer 30 and channel 40 (see FIG. 1) to a decoder, where the encoded bits are received in a buffer of a decoder. 
     Each individual encoder system 20 has its own rate controller 19. The purpose of the rate controller 19 is to maximize the perceived quality of the encoded video sequence when it is decoded at a decoder by intelligently allocating the number of bits used to encode each frame. The sequence of bit allocations to successive frames preferably ensures that a channel bit rate assigned by the system controller 50 of FIG. 1 is maintained and that decoder buffer exceptions (overflow or underflow) are avoided. The process of allocating bits to individual frames takes into account the frame type (I, P or B) and scene dependent coding complexity. To accomplish rate control at each individual encoder system 20, the rate controller 19 receives input information indicating the occupancy of the rate buffer 18. The rate controller 19 executes a rate control algorithm and feeds back control signals to the encoder 16 (and possibly to the preprocessor 14, as well) to control the number of bits generated by the encoder for succeeding frames. 
     Several rate control algorithms are known. An illustrative rate control algorithm is disclosed in U.S. patent application Ser. No. 08/573,933 entitled RATE CONTROL FOR A VIDEO CONTROLLER, filed for Michael Perkins and David Arnstein on even date herewith and assigned to the assignee hereof. The contents of this related application are incorporated herein by reference. 
     Dynamic rate optimization or statistical multiplexing is a method for making more effective use of the bandwidth of a single communication channel through which several MPEG-2 or other digital video bitstreams are transmitted. A satellite transponder is an example of such a communication channel. Such a channel typically has a bandwidth of 40 MHz which is shared among 10-15 bitstreams. A dynamic rate optimizing or statistical multiplexing strategy dynamically allocates the channel bandwidth among several encoder systems that share the communication channel. Each encoder system 20-i transmits periodically (e.g., once per frame interval) a measure of video quality via a communication path to the system controller 50. The system controller 50 determines adjusted bitrate allocations for the individual video encoder systems 20. The system controller 50 transmits the adjusted bit rate allocations to the rate controllers of the individual encoder systems 20 in order to drive the video quality measurements to equality. Naturally, the sum of these bitrate allocations must equal the total channel bitrate. The rate controller at the individual encoder systems take into account the adjustments in allocation of channel bitrate when allocating bits to the frames that are encoded by the encoder systems. 
     In conventional video encoder ensembles, the quality measure outputted by each individual video encoder system to the system controller is a Peak-Signal-to-Noise Ratio (PSNR). The encoder can output this information because, as indicated above, it has available both the encoded and decoded frames. The system controller determines channel bandwidth allocation adjustments so as to equalize the average Peak-Signal-to-Noise Ratio across all of the video encoder systems. More bitrate is allocated to encoders with a small PSNR and less bit rate is allocated to encoders with large PSNR. 
     The problem with using PSNR as a quality measure is that the &#34;masking effect&#34; is not taken into account. A frame with a lot of visual complexity can hide coding artifacts from the viewer when the frame is decoded and displayed. It is well known that a quality measure in the form of a PSNR does not take into account the masking effect and does not take into account subjective image quality. 
     It is an object of the present invention to provide a dynamic rate optimizing or statistical multiplexing process for an ensemble of video encoder systems, which overcomes the shortcomings of the above-described prior art dynamic rate optimizing or statistical multiplexing process. 
     In particular, it is an object of the invention to allocate bandwidth to a plurality of video encoder systems which share a common transmission channel in a manner which takes into account the masking effect and subjective image quality. 
     SUMMARY OF THE INVENTION 
     In accordance with the present invention, the quality measure which is equalized across encoder systems in the conventional dynamic rate optimizing or statistical multiplexing process is replaced with a quality measure which takes into account the masking effect. 
     The quality measure used in the bandwidth allocation process of the present invention includes a term that behaves like PSNR. This term is a measure of the quantization used by the encoder to quantize the DCT coefficient derived from each macroblock. The other term in the quality measure is the term that measures the visual complexity of the frames being encoded. The visual complexity measure is obtaining by differencing adjacent pixels, horizontal and vertical, and summing these differences. These sums are then averaged over a plurality of frames to obtain the visual complexity term used in the quality measure. 
     In a preferred embodiment of the invention, the individual encoder systems periodically (e.g., once per frame interval) transmit the quantization measure and visual complexity measure to the system controller. The multiplexer controller then determines the quality measure for all the video encoder systems. The system controller also determines channel bandwidth allocation adjustments for the individual encoder systems. The adjustments in channel bandwidth allocation are determined so as to decrease quality measure differences among the encoder systems. 
     The adjustments in bandwidth allocation are communicated from the system controller to the rate controllers of the individual video encoder systems. The individual rate controllers then allocate bits to the frames to be encoded in accordance with the updated bandwidth allocation. 
     In an illustrative embodiment, the video signals to be compressed by the encoder systems have 24-30 frames per second. The system controller receives the quantization measure and the visual complexity measure once per frame period and adjusts the bandwidth allocations more than twenty times per second. The individual video encoder systems need not be genlocked with each other. 
     Preferably, only relatively small adjustments to the bandwidth allocations are made. At each rate update, however, the cumulative rate change over time can be large. Thus, in some embodiments of the invention, there is imposed an upper limit on the size of each individual bandwidth adjustment. 
    
    
     BRIEF DESCRIPTION OF THE DRAWING 
     FIG. 1 schematically illustrates an ensemble of video encoder systems which share a common transmission channel. 
     FIG. 2 schematically illustrates a video encoder system in the ensemble of FIG. 1. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     As indicated above, the present invention is a method for operating a collection of video encoder systems which share the bandwidth of a transmission channel. As shown in FIG. 1, the bitstreams of the individual encoder systems 20-i, are multiplexed together by a system multiplexer 30. The fraction of the channel bandwidth allocated to each encoder system is determined by a system controller 50 (implemented as a microprocessor for example). The system controller 50 receives certain information from the individual encoder systems 20-i and outputs back to the encoder systems bandwidth allocation adjustment information. 
     The hardware used to implement the encoder systems, system controller and system multiplexer is conventional. The difference of the present invention lies in the specific measures transmitted from the individual encoder systems to the system controller, and the steps carried out by the system controller to determine the bandwidth allocation adjustments. 
     In this discussion, subscripts (typically the letter i) will indicate a choice of an individual video encoder system (e.g. 20-i of FIG. 1) within the ensemble 10 of video encoder systems. A letter in parentheses (typically the letters n and m) will indicate a frame number. 
     Each encoder system i transmits to the system controller 50 a measure of quantization, which is reported for each frame n. This quantization measure is called QSCALE i  (n) It is computed by a processor in the video encoder circuit 16 and is proportional to the sum (over macroblocks) of the quantization values used to code DCT coefficients. 
     A moving average of the QSCALEs over H frames will be maintained as ##EQU1## 
     Here, H is a tuning parameter. 
     Each encoder system i also provides to the system encoder a measure of spatial complexity that is used to measure masking effects. For encoder system i and frame n, this quantity is called INTRA --  MASK i  (n). It is computed by the processor in the video encoder circuit 16 (see FIG. 2) and measures complexity by differencing adjacent pixels in the same frame, in both horizontal and vertical pairs. These differences are then summed to obtain 25 INTRA --  MASK i  (n) This measure is averaged over time as ##EQU2## 
     The system controller 50 averages the above complexity measures M i  (n) over all of the P encoder systems. This averaging is performed once per iteration of the bandwidth allocation adjustment process by the system controller. This frequency would be equal to the encoder frame rate, if all the encoders were genlocked. However, this is not necessarily the case. For this reason, the (n) notation is not featured in statistics maintained by the system controller. The average over video encoder systems is ##EQU3## 
     Here, P is the number of participating video encoder systems, and M i  is the latest M i  (n) taken from video encoder system i. 
     The quality measure used to make the bandwidth allocation adjustments by the system controller is given as ##EQU4## 
     Once again M i  is the latest M i  (n) taken from video encoder system i, and Q i  is the latest Q i  (n) taken from video encoder system i. β is a tuning parameter. 
     In this definition of T i , the term 1/Q i  is used as an error measure, somewhat like a PSNR. 
     The modifier (βM i  +M)/(M i  +βM) applies a correction which is largest when the masking measure M i  for encoder i is much higher than the average over encoder systems M. In such a case, the correction factor approaches β. This behavior would occur when frame n from encoder system i exhibits strong masking effects, hiding the coding artifacts which are measured by I/Q i . 
     Having defined a target measure T i  to be equalized across all encoder systems i, a method carried out by the system controller 50 is provided for gently adjusting the channel bitrates in order to reach this goal. This typically requires several frames worth of adjustments. 
     The system controller 50 first generates an average over encoders of the quality measures T i  : ##EQU5## 
     Next, the system controller 50 determines deviations from the above average, and identifies individual video encoder systems which are above and below this average: 
     
         d.sub.i =T.sub.i -T 
    
     
         θ.sub.- ={i|T.sub.i &lt;T} 
    
     
         θ.sub.+ ={i|T.sub.i &gt;T}                     EQ (6) 
    
     The system controller 50 sums up the one-sided deviations as follows: ##EQU6## 
     Note that D is positive. Also, from the definition of T, ##EQU7## 
     The following term will be featured in the bandwidth allocation adjustment. It expresses the relative deviation from the norm of one of the video encoder systems: ##EQU8## 
     Each time the bitrates are adjusted, Δ bits per second will be transferred from the video encoder systems with greater than average quality to the video encoder systems with less than average quality. Δ is given by the following expression: ##EQU9## 
     Here R is the total channel bandwidth and α is a tuning parameter, which is given a small value. 
     Having computed these various statistics on video encoder system performance, the system controller 50 determines the following additive correction to the channel bitrate of video encoder system i: 
     
         δ.sub.i =-γ.sub.i Δ.                     EQ (10) 
    
     It can be shown that ##EQU10## so that the summed bandwidth of the participating video encoder systems does not change. It can also be shown that ##EQU11## 
     This indicates that Δ is the total number of bits per second to be reassigned from the video encoder systems which are performing above the average T to those which are performing below this average. Equation 10 states that this total pool of bits is redistributed among the video encoder systems in a weighted fashion, the weights are the y i . These weights cause a large fraction of the pool to be applied to an encoder system that departs significantly from the average T, and a small fraction to be applied to an encoder system whose quality measure T is near this average. 
     Alternatively, there is a slightly more economical way to compute D. Define the absolute central moment of the {T·} as ##EQU12## then it turns out: ##EQU13## The number of operations necessary to compute D and M abs  is approximately the same, except that computing M abs  does not involve comparisons. 
     Using simulation studies, the following values have been is selected: 
     
         α=0.0005 
    
     
         β=2.0 
    
     
         H=5                                                        EQ (14) 
    
     Consider the following expanded expression for δ i  : ##EQU14## 
     This is the additive correction to be applied to the bitrate for encoder system i. Note that the bitrates themselves are not featured in this expression. Therefore, no attempt is made to relate channel bitrate to the quality measures {T i  }. Instead, the method simply seeks to gently decrease the fraction of channel bandwidth assigned to encoder systems producing higher than average quality, and to gently increase the fraction of channel bandwidth assigned to encoders producing less than average quality. This is the effect of the term  T i  -T!. The inventive method for controlling an ensemble of video encoder systems limits the amount of change that is permissible. This is the effect of the term Rα. The remaining multiplicative term ##EQU15## applies scaling in response to the degree of variability of the individual scores {T i  }. 
     It will be useful to set an absolute limit on the amount of change that is permissible to the individual bitrates. This is most easily accomplished by temporarily setting α to a lower value. This is equivalent to the following: 
     1. Compute the δ i  as above. Record the largest absolute value of these numbers as C. 
     2. If C is larger than the desired maximum U, then simply scale the corrections according to ##EQU16## 
     Another approach would be to separate encoder systems into two groups: those whose δ i  values are below the maximum U in absolute value, and those whose δ i  values are not. For the following, refer to these as the first and second group of encoders, respectively. The encoders whose δ i  are too large (second group) would be assigned the maximum change ±U. The second group of encoders does not play a part in the rest of the computation. 
     The encoders in the first group would be the subject of the bandwidth allocation adjustment method described above, but with R reduced by the sum of the bitrates used by the encoders in the first group. 
     The above two part process would have to be iterated, until none of the δ i  exceeded U in absolute value. This alternate method would presumably select larger values for the δ i , resulting in faster overall convergence to the desired condition of all encoder systems exhibiting the same image quality. 
     In short, a method for dynamically allocating bandwidth among a plurality of video encoder systems which share the same transmission channel has been disclosed. Finally, the above described embodiments of the invention are intended to be illustrative only. Numerous alternative embodiments may be devised by those skilled in the art without departing from the spirit and scope of the following claims.