Abstract:
In a digital video compression system that includes both a real buffer of size B max , and a smaller virtual buffer of size B virtual , a method for controlling the generated bit rate of compressed video information to keep within the maximum buffer capacity is disclosed. The method includes the steps of (a) receiving blocks of digital information, (b) determining whether a current block can be compressed by one of one or more shortcuts and using the shortcut if possible; (c) if the current block cannot be compressed with any shortcut, determining whether the virtual buffer capacity will be exceeded if the current received block is compressed only by arithmetic coding and using only arithmetic coding if possible; (d) if the current block cannot be compressed with any shortcut and the virtual buffer capacity would be exceeded with only arithmetic coding, determining whether the virtual buffer capacity will be exceeded if the current block is compressed with both downsampling and arithmetic coding and using both downsampling and arithmetic coding if possible; and (e) if all else fails, compressing the current block with a default mode of compression even if the virtual buffer capacity is exceeded with such compression.

Description:
BACKGROUND OF THE INVENTION 
     I. Field of the Invention 
     The present invention relates to techniques for compression of object based digital image information, and more specifically, to encoding shape information as part of an MPEG-4 or similar type coding scheme. 
     II. Description of the Related Art 
     In recent years, the field of digital video has increasingly focused on object based compression schemes. While existing commercial video compression techniques encode video (and associated audio) information based on pixel or frames, object based compression procedures seek to encode individual video objects, such as persons, faces and other items in a scene, in order to generate a more robust representation of such video information in the compressed domain and to permit both flexibility in scene composition and interactivity with scene content. 
     In particular, the International Standardization Organization (ISO) has recently adopted the MPEG-4 video compression standard, as described in ISO document ISO/IEC JTC1/SC29/WG11N2201 (May 15, 1998), the disclosure of which is incorporated by reference herein. The MPEG-4 standard specifies the syntax of a compliant bitstream, rather than the actual encoding process or any hardware used in that process, and hence references in the foregoing disclosure to MPEG-4 encoding are made with the understanding that although the specifics of such encoding are open ended, the generated bitstream must be MPEG-4 compliant. 
     Under the MPEG-4 rubric, the parlance of Video Objects (&#34;VOs&#34;) and Video Object Planes (&#34;VOPs&#34;) are used to represent encoded information. VOs correspond to independently coded entities that can be accessed and manipulated by a user, e.g., by cut and paste, and which are saved as separate bitstreams. VOPs correspond to instances of a VO at a particular time. 
     An MPEG-4 video encoder includes two main parts, a so called shape coder and a more traditional texture coder, both of which operate on the same VOPs. While the shape coder defines the outer border of a VO at a particular time, the texture coder encodes color information for pixels within that VO. 
     Both the texture coder itself and motion estimation circuitry within the MPEG-4 encoder operate similarly to coders and circuitry used in other state-of-the-art standards, such as MPEG-2. However, although the problem of shape representation have been previously investigated in the fields of computer vision, image understanding, image compression and computer graphics, MPEG-4 represents the first standardization effort which mandates the adoption of a shape representation technique in an encoding process. 
     In MPEG-4, two types of shape data are used in the compression process: grey scale and binary shape information. Binary shape information is set to a constant value within any VOP, so that any pixel within the VOP is assigned one value while pixels outside of the VOP are assigned a different value. The grey scale shape information assigns to each pixel in such a VOP a value from a range of possible values, usually 0 to 255, that represent the degree of transparency of that pixel. Thus, if the binary shape data for pixels within a VOP is set to 255, the grey scale data will represent an offset to 255, with a 0 offset value meaning that the pixel is in full view and increasing offset values meaning that the VO corresponding to the VOP is either fading in or fading out from the scene. 
     State of the art video compressiontechniques such as MPEG-2 divide frames of video information into macroblocks, which in turn form the basis of the compression algorithm. In MPEG-4 parlance, Binary Alpha Planes of binary shape information are divided into an array of Binary Alpha Blocks (&#34;BABs&#34;) 120. Referring to FIG. 1, each BAB 100 is defined as a set of 16×16 binary pixels 110, and is comprised of a 4×4 array of pixel blocks (&#34;PBs&#34;) 120, which themselves are 4×4 arrays of pixels 110. 
     An important step in the MPEG-4 compression process focuses on reducing the data needed to adequately represent shape information. Referring to FIG. 2, current rate control and rate reduction in MPEG-4 is realized through size conversion of the binary alpha information. An original BAB 210 is downsampled at a certain conversion ratio (&#34;CR&#34;) value to generate a size compressed BAB 220. The compressed BAB is then upsampled at the same CR value to generate an approximated binary alpha block BAB&#39; 230. The distortion between the original BAB 210 and the approximated binary alpha block BAB&#39; 230 is measured. In this size conversion process, the determination of an acceptable CR is effected based on a given distortion threshold alpha --  th. That is, it is necessary to ascertain whether the compression of a certain BAB at a specific size conversion CR yields acceptable quality. 
     Given the current original BAB and an approximation of the BAB at a particular size conversion value, BAB&#39;, an acceptable quality function ACQ may be defined as shown in equation (1): 
     
         ACQ(BAB&#39;)=MIN(acq.sub.1, acq.sub.2, . . . , acq.sub.16,)   (1) 
    
     where ##EQU1## and SAD --  PB, (BAB, BAB&#39;) is defined as the sum of absolute differences for PB i , where an opaque pixel has the value 255 and a transparent pixel has the value 0. The parameter alpha --  th has values {0,16,32,64, . . . , 256}. If alpha --  th =0 then encoding will be lossless. A value of alpha --  th=256 means that the accepted distortion is at a maximum. 
     In this process, consider the down-sampling case first. For CR=1/2, if the average pixel value in a 2×2 pixel block is equal to or greater than 128, the pixel value of the down-sampled block is set to 255, otherwise to 0. For CR=1/4, if the average pixel value in a 4×4 pixel block is equal to or greater than 128, the pixel value of the down-sampled block is set to 255, otherwise to 0. 
     Up-sampling is carried out for any BAB having a CR other than 1. The value of an interpolated pixel is determined by examining its neighboring pixels. For the pixel value calculation, the value of &#34;0&#34; is used for a transparent pixel, and &#34;1&#34; for an opaque pixel. Referring to FIG. 3, pixels A, B, C, D, E, F, G, H, I, J, K, L, are each assigned different index values to coefficient c k , and are used in the generation of values of the interpolated pixels at the top-left point (P1) 310, top-right point (P2) 320, bottom-left point (P3) 330, and bottom-right point (P4) 340, as given by equations 2-5: 
     
         P1: if(4×A+2×(B+C+D)+(E+F+G+H+I+J+K+L)&gt;Th[C.sub.f ]) then `1` else &#34;0&#34;.                                                 (2) 
    
     
         P2: if(4×B+2×(A+C+D)+(E+F+G+H+I+J+K+L)&gt;Th[C.sub.f ]) then `1` else &#34;0&#34;.                                                 (3) 
    
     
         P3: if(4×C+2×(A+C+D)+(E+F+G+H+I+J+K+L)&gt;Th[C.sub.f ]) then `1` else &#34;0&#34;.                                                 (4) 
    
     
         P4: if(4×D+2×(A+C+D)+(E+F+G+H+I+J+K+L)&gt;Th[C.sub.f ]) then `1` else &#34;0&#34;.                                                 (5) 
    
     where the 8-bit filter coefficient, C f , is given by equation (6): ##EQU2## 
     In equations 2-6, representative values of c k  are used for C f , and values of lettered pixel values are used for the interpolated pixels P1, P2, P3 and P4. Note that the two representations imply the same value, e.g., for interpolated pixel P1, the values of F and c 0 , E and c 1 , L and c 2 , K and C 3 , J and c 4 , I and c 5 , H and c 6 , and G and c 7 , are all the same values. Based on the calculated C f , the threshold value Th[C f ,] can be obtained from the look-up table as shown in the MPEG-4 Verification Model Version 8.0, ISO/IEC JTC1/SC29/WG11 (July 1997), as those skilled in the art will appreciate. 
     Note that after interpolation, the pixels in the low-resolution image, e.g., pixels A-L, are not contained in the upsampled image, i.e., all pixels in the upsampled image are interpolated. When the BAB is on the left and/or top border of the VOP, the left and/or top borders are extended from the outermost pixels inside the BAB. In the case that CR=1/4, the BAB is first interpolated into the size corresponding to CR=1/2, then interpolated into the full size, i.e., representing CR=1. The decision to accept a certain CR value for a specific BAB is based on ACQ(BAB&#39;). If the quality is acceptable, that CR is adopted for that BAB. Once the value of CR is determined, size conversion is effected with that CR value for the BAB. 
     After the size conversion process of FIG. 2 has been accomplished, each BAB is further compressed according to one of seven different &#34;lossless&#34; modes, which utilize shape motion vectors (&#34;MVs&#34;) and a shape motion vector predictors (&#34;MVPs&#34;) to perform context-based arithmetic encoding(&#34;CAE&#34;). In the listed lossless compression modes, the quantity called motion vector difference of shape (&#34;MVDs&#34;) is determined with reference to both MVs and MVPs such that MVDs=MVs-MVPs. 
     1. MVDs==0 &amp;&amp; No Update 
     2. MVDs!=0 &amp;&amp; No Update 
     3. all --  0 
     4. all --  255 
     5. intraCAE 
     6. MVDs==0 &amp;&amp; interCAE 
     7. MVDs?=0 &amp;&amp; interCAL 
     In intra-coded VOP&#39;s (&#34;I-VOPs&#34;), only the coding modes, &#34;all --  0&#34;, &#34;all --  255&#34; and &#34;ntra-CAE&#34; are allowed. MVPs are determined by referring certain candidate MVs and texture motion vectors around the macroblock that corresponds to the current shape block. FIG. 4 illustrates the locations of such candidate macroblocks. In FIG. 4, for a current macroblock 410, three candidate texture motion vectors that have been rounded to integer valeus 411, 412, 414, denoted MV1, MV2 and MV3, and three corresponding shape motion vectors 421, 422, 423 designated as MVs1, MVs2, MVs3 are show. By looking at MVs1, MVs2, MVs3, MV1, MV2 and MV3 in this order, MVPs is determined by taking the first encountered MV that is valid. If no candidate MV is valid, MVPs is regarded as 0. 
     Based on the MVPs determined above, MVs is computed by the following procedure: The MC error is computed by comparing the predicted BAB (by MVPs) and current BAB. If the computed MC error is less or equal to 16×AlphaTH, where AlphaTH is a threshold used when comparing two 4×4 sub-blocks, the MVPs is directly employed as MVs, and the procedure terminates. If the above condition is not satisfied. MV is searched around the prediction vector MVPs. The search range is +/-16 pixels around MVPs along both horizontal and vertical directions. The MV that minimizes the SADs is taken as MVs and this is further interpreted as MVDs for shape. 
     While the current MPEG-4 shape coding technique described above takes into account the quality of the compressed bitstream in both the size and lossless phases of compression, it fails to address in any manner actual buffer constraints. Thus, although the existing technique may generate a bitstream having an acceptable level of quality, the bitstream may be useless in the event that the encoder&#39;s buffer has reached an overflow condition. Thus, there exists a need for an MPEG-4 shape coding technique which both generates a bistream having acceptable quality and takes into consideration actual buffer constraints. 
     SUMMARY OF THE INVENTION 
     An object of the present invention is to provide a MPEG-4 shape information coding technique which takes into account both the quality of the compressed bitstream and the actual buffer constraints of the system. 
     An additional object of the present invention is to incorporate a rate control algorithm in a process for encoding object based shape information. 
     A further object of the present invention is to provide an optimized MPEG-4 shape information encoding technique. 
     A still further object of the present invention is to provide a technique which represents a fast yet accurate approximation to an optimized MPEG-4 shape information encoding technique. 
     In order to meet these and other objects which will become apparent with reference to further disclosure set forth below, the present invention provides a method for controlling the generated bit rate of compressed video information in a digital video compression system that includes both a real buffer of size B max , and a smaller virtual buffer of size B visual , in order to ensure that the generated bit rate stay within the maximum buffer capacity. The method includes the steps of (a) receiving blocks of digital information that represent at least one identifiable characteristic for a portion of a frame of video, (b) determining whether a current block can be compressed by one of one or more shortcuts, and if so, compressing using a shortcut to compress the current block; (c) if the current block cannot be compressed with any of the shortcuts, determining whether the virtual buffer capacity will be exceeded if the current received block is compressed only by arithmetic coding, and if not, compressing the current block with only arithmetic coding; (d) if the current received block cannot be compressed with the shortcuts and if the virtual buffer capacity would be exceeded with only arithmetic coding, determining whether the virtual buffer capacity will be exceeded if the current block is compressed with both downsampling and arithmetic coding, and if not, compressing the current block with both downsampling and arithmetic coding; and (e) if all else fails, compressing the current block with a default mode of compression even if the virtual buffer capacity is exceeded with such compression. 
     Preferably, the digital video compression system is an MPEG-4 compliant shape code, the blocks of digital information are binary alpha blocks, and the identifiable characteristic is binary shape. In accordance with MPEG-4, the one or more shortcuts include a lossless compression mode representing an entirely white binary alpha block, a lossless compression mode representing an entirely black binary alpha block, and a lossless compression mode representing no change in an binary alpha block. The arithmetic coding is likewise content-based arithmetic encoding including intra-coding, inter-coding, intra-coding of a transpose, and inter-coding of a transpose. Advantageously, the selecting step in a preferred technique requires choosing the content-based arithmetic encoding yielding the fewest bits. 
     In one process, the downsampling is size compression at a ratio of 1:2, and the step of compressing a block with both downsampling and arithmetic coding includes both size compressing the current binary alpha block to 1/2 it original size and then selecting between intra-coding, inter-coding, intra-coding of a transpose, and inter-coding of a transpose of the size compressed binary alpha block. In a highly preferred process, if the current binary alpha block cannot be compressed with the shortcuts and if the virtual buffer capacity would be exceeded with either only arithmetic coding or with both size compression at a ratio of 1:2 and with arithmetic coding, the block is size compressed to 1/4 it original size before selecting between intra-coding, inter-coding, intra-coding of a transpose, and inter-coding of a transpose of the size compressed binary alpha block. 
     The default mode of compression advantageously calls for size compressing the current binary alpha block to 1/4 it original size and then selecting, from intra-coding of said size compressed binary alpha block, inter-coding of said size compressed binary alpha block, intra-coding of a transpose of said size compressed binary alpha block, and inter-coding of a transpose of said size compressed binary alpha block, the lossless compression mode yielding the fewest bits. 
     The accompanying drawings, which are incorporated and constitute part of this disclosure, illustrate a preferred embodiment of the invention and serve to explain the principles of the invention. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is an illustrative diagram of a Binary Alpha Block in accordance with the MPEG-4 standard; 
     FIG. 2 is a schematic diagram of the size conversion process implemented in a typical MPEG-4 shape coding technique; 
     FIG. 3 is an illustrative diagram showing actual and interpolated pixels; 
     FIG. 4 is an illustrative diagram showing candidate shape and texture motion vectors for a representative macroblock; 
     FIGS. 5(a) and 5(b) are illustrative diagrams showing rate and distortion characteristics for M blocks of data under N possible quantizers, and an unacceptable rate choice, respectively; 
     FIG. 6 is an illustrative drawing showing possible coding choices for a VOP and its associated macroblocks; 
     FIG. 7 is a flow diagram showing an optimized buffered shape coding method in accordance with the present invention; 
     FIG. 8 is an illustrativedrawingrelatinga virtualbufferto an actual buffer; 
     FIG. 9 is a flow diagram showing a marginal buffered shape coding method in accordance with a preferred embodiment of the present invention; 
     FIGS. 10-15 are decoded outputs from an MPEG-4 shape decoder showing experimental results using the method of FIG. 9; 
     FIGS. 16(a)-(c) are charts plotting buffer occupancy vs. macroblock number were B max , is 1000 bits; and 
     FIGS. 17(a)-(c) are charts plotting buffer occupancy vs. macroblock number were B max , is 500 bits. 
    
    
     DESCRIPTION OF PREFERRED EMBODIMENT 
     As discussed in the Background of the Invention, known MPFG-4 shape coding techniques fail to account for the limited size of the encoder&#39;s buffer which temporarily stores encoded information prior to transmission or permanent storage. The present invention solves this problem by providing an MPEG-4 shape coding technique which, in accordance with known techniques, generates a bistream having acceptable quality, but unlike known techniques additionally takes into consideration actual buffer constraints. In order to provide such an improvement over the existing compression scheme, the present invention relies on principles from the general solution to the optimal buffered compression problem, and adapts those principles to the specifics of the MPEG-4 shape coding compression problem. 
     Trellis-based buffered compression is a well known technique for effecting rate control in state of the art video compression algorithms such as MPEG-2. For example, A. Ortega et al., &#34;Optimal Trellis-Based Buffered Compression And Fast Approximatios,&#34; IEEE Transactions On Image Processing, 3(1) 26-40 (1994) describes a technique to provide optimal buffer control for video sequences in a finite buffer environment. The problem of optimal buffered compression is defined as follows: Given a set of quantizers, a sequence of blocks to be quantized, and a finite buffer, select the optimal quantizer for each block so that the total cost measure is minimized and the finite buffer never overflows. 
     With reference to FIG. 5(a), for the general case of N blocks 510 and M available quantizers 511 to code each block, d ij  and r ij  represent the distortion and the number of bits produced by the coding, respectively, of block i with quantizer j, where r indicates the channel rate per block. Each block 510 in the sequence has a different rate 521, 531, 541 and distortion 522, 532, 542 characteristics. For a given choice of M quantizers 511 for the N blocks 510 in the sequence, R and D points can be used to form a composite characteristic. With reference to FIG. 5(b), the R at time t 2  is not a feasible solution for buffer size B max  550. 
     If an admissible solution x is defined as a selection of one quantizer for each block, i.e., a mapping from 1,2, . . . , N to 1,2, . . . , M, x=x(1),x(2), . . . , x(N), where each x(i) is the index of one of the M quantizers for block i. Therefore, (r 1x (1), . . . , r Mx (N)), and (d 1x (1), . . . , d  Mx (N)) are, respectively, the rate and distortion for each block and a given choice of quantizers x. 
     Next, define the buffer occupancy at stage i, B(i) for a given admissible solution x. To account for the fact that the buffer occupancy cannot be negative at any stage (i.e., underflow means the buffer occupancy is 0), a recursive definition is used. Let B(1)=r 1x (1) +B(0), B(2)=max (B(1)+r 2x (2) -r,0) and, in general 
     
         B(i)=max(B(i-1)+r.sub.ix(i) -r,0)                          (7) 
    
     where the buffer occupancy at each block instant is increased by the coding rate of the current block and decreased by the channel rate, and B(0) is the initial buffer state. 
     Accordingly, the problem is to find the mappingx that solves equation (8): ##EQU3## subject to 
     
         B(i)≦B.sub.max,∀i=1, . . . N             (9) 
    
     where B max  is the buffer size. 
     In the MPEG-4 video context, the above described optimal buffered compression can be viewed of as the optimal solution for texture coding. The following description explains how to apply this solution to shape coding. 
     As described in the Background of the Invention, the current MPEG-4 binary shape coding process consists of two steps, both of which may impact buffer rate. Distortion is introduced during the first step, the size conversion process, by the way shape data are scaled down and up based on the value chosen for the threshold alpha --  th. During the second step, content-based arithmetic encoding is applied. Since arithmetic coding itself is lossless, the size conversion process may be viewed as a &#34;virtual quantizer.&#34; 
     In the size conversion process, distortion is introduced in two levels, during VOP level size conversion and during the following macroblock level size conversion. Viewing these conversion precesses as a virtual quantizer, the buffer rate control problem may be formulated with reference to equations (8) and (9). If B(i) is the ith macroblock, B(i) --  CR the CR value chosen in the size conversion process for that macroblock, VOP(B(i)) the corresponding VOP which includes the ith macroblock, and VOP(B(i)) --  CR the CR value chosen in the size conversion process for that VOP, and x is defined as {x(1),x(2), . . . , x(N)} where x(i)=(VOP(B(i)) --  CR, B(i) --  CR), the problem is reformulated as one to find the mapping x that solves equation (8) to minimize distortion while not violating equation (9). 
     Referring now to FIG. 6, the possible values of CR for a certain VOP 600 and for the N macrblocks within that VOP are shown. A certain path in the figure implies a quality and rate of a specific output shape data sequence. Each branch has two values involved: VOP --  CR and MB --  CR. In the foregoing description, the case were VOP --  CR=1 will be considered. however, those skilled in the art will appreciate that with minor modifications, the technique described herein applies equally to the case where VOP --  CR may be either 1 or 1/2. 
     The problem of optimal shape coding is to choose a certain path which minimizes overall distortion yet keeps the buffer occupancy under B max  as defined in Equations (8) and (9). Note that in this problem formulation, a global minimum is sought. However, if distortion is considered independent and additive with respect to each macroblock, an optimal path can be obtained by Bellman&#39;s principle. 
     Bellman&#39;s principle states that a subpath is also optimal if a path is optimal when the objective function is independent and additive with respect to each branch. This means that a CR value can be chosen which minimizes distortion at each macroblock stage. Such a rule of decision implies both local and global minimization. For example, if there is no buffer limitation involved, the path which has CR=1 at every macroblock (the lowest path in the figure) is the optimal path. In reality, the optimal path is chosen based on the occupancy of the encoder buffer. If a branch is not allowed due to current buffer occupancy, other branches which generate smaller bits are considered. The decision is made only by the buffer status at the current BAB. 
     The optimal path can thus be obtained by the following rule: at each macroblock, a CR which generates smallest distortion is chosen unless the buffer is overflowed. If there is more than one branch which produce the same distortion, the CR which produces fewer bits is chosen. Since the number of virtual quantizers is just 3, i.e., corresponding to CR values of 1, 1/2, and 1/4, this algorithm is computationally efficient. 
     Once a CR is chosen for a specific macroblock, a decision regarding which &#34;lossless&#34; compression mode to be used must be made. To ensure bitstream compatibility in the MPEG-4 context, the each of the 7 BAB coding modes required by MPEG-4 are utilized. 
     The all --  0 and all --  255 modes generate fewer bits than the &#34;No Update&#34; modes when all data in a BAB are 0 or 255, respectively, and therefore should be considered before the &#34;No Update&#34; modes. The all --  0 and all --  255 modes are only considered at CR=1. The &#34;No Update&#34; modes are used when MC --  BAB exactly matches the current BAB. The intra-coding mode, &#34;IntraCAE,&#34; is carried out after previous modes are tried, and from the second frame on after previous modes are tried. 
     The quality of the generated bitstream is essentially independent of the choice in BAB mode since codes are lossless. Thus, any quality distortion comes only from the size conversion process. Since all BAB modes yield the same quality but generate different quantities of bits, the best policy is to choose the BAB mode which yields the smallest number of bits, as long as the buffer is not overflowed. 
     When CR=1, the lossless encoding mode which yields the fewest bits should be chosen since there is no distortion at th is CR value. Of course, if a CR value of 1/2 or 1/4 also produces no distortion for the same BAB, the latter value should be chosen to further reduce the number of bits needed to represent the BAB, regardless of lossless compression. 
     When CR=1/2 or 1/4, distortion usually occurs. In such cases, the encoding mode which realizes the minimum distortion should be chosen among the BAB coding modes, as long as the choice does not create buffer overflow. When there is more than one mode which creates the same distortion, the mode which generates the smallest bits should be chosen. Again, if both CR values of 1/2 or 1/4 produce similar distortion for the same BAB, the latter value should be chosen to further reduce the numnber of bits needed to represent the BAB, regardless of lossless compression. 
     The final step in the BAB mode decision is to compare the shortest intra code with shortest inter code. For this comparison, it is necessary to add the number of bits for MVDs to the inter code length. Note that for the same value of CR, the same distortion can be expected. Thus, the shortest code length should be chosen. 
     Note that the allowance of an interCAE mode necessitates the used of motion vectors. In order to comply with MPEG-4, alpha --  th should be set to 0, meaning that the mode where the search range of MV is +/-16 pixels around MVPs is always &#34;turned on.&#34; Note that +/-16 pixels area is quite large. Therefore, in most cases, the motion vectors of shape coding will be closed to the motion vectors used in texture coding. 
     If all possible compression modes for a certain macroblock generate buffer overflow, the previous macroblock should be recompressed with fewer bits in order to find a feasible optimal path. In theory, the buffer size and all past data should be kept until the entire coding procedure ends, because the possibility of buffer overflow during the compression of any future macroblock may require backstepping through the compression process. 
     Referring to FIG. 7, a flow chart showing illustratingthe optimized shape encoding process will now be described. If all bits in the BAB are 0, the all --  0 mode is chosen 710. If all bits in the BAB are 255, the all --  255 mode is chosen 720. Steps 710 and 720 correspond to conditions where the BAB is black or white. If steps 710 and 720 are inapplicable, a comparison of MC --  BAB and BAB is made to determine whether to use the No Update modes 730. If steps 730 is also inapplicable, the distortion an number of bits required for intra-coded, inter-coded, transposed intra-coded and transposed inter-coded BABs at CR values of 1, 1/2 and 1/4 is determined 740. If the distortion is minimized for any type of lossless encoding at CR=1/4, CR=1/4 is chosen along with the mode of lossless encoding which generates the fewest bits 750. If the distortion is minimized for any type of lossless encoding at CR=1/2, CR=1/2 is chosen along with that mode of lossless encoding which generates the fewest bits 760. If the distortion is minimized for any type of lossless encoding at CR=1, CR=1 is chosen along with that mode of lossless encoding which generates the fewest bits 770. Finally, if all else fails, the default backwards mode 780 is adopted. 
     Appendix I contains exemplary psudo-code for implementingthe optimal path decision process described above. In Appendix 1, MODE min  represents the choice function for an encoding mode among various candidate modes, and is defined to select the mode which generates the smallest number of bits when more than one distortion parameters are of the same value. The nomenclature D.sub.(encode) (CR=cr) is used to connote the distortion when a particular encoding method is used for the compression at a particular size conversion, and is defined as infinite when there is no encoding mode which makes the current buffer occupancy under the maximum buffer size. Thus, D intraCAE . (CR=1), D interCAE  (CR=1), D intraCAE  (CR=1/2), D interCAE  (CR=1/2), D intraCAE  (CR=1/4), and D intraCAE  (CR=1/4) represent the distortion after a particular BAB has been subjected to size compression at the CR value indicated, and to noisless compression of the type indicated in the subscript. Likewise, the terms D T   intraCAE  (CR=1), D T   intraCAE  (CR=1), D T   intraCAE  (CR=1/2), D T   interCAE  (CR=1/2), D T   intraCAE  (CR=1/4) and D T   intraCAE  (CR=1/4) are all representative of distortion just after &#34;transposed data&#34; are context-based arithmetic encoded. Note that if the selected coding condition involves transposition of the BAB, then &#34;ST&#34; flag inthe bitstreamis set &#34;1&#34; instead of the default &#34;0&#34; value. 
     As described above, for the theoretically optimal solution, the past buffer size and data should be preserved while the coding procedure is going on. However, this is impractical, since the algorithm makes the coding delay extremely long. In addition, to consider all the modes of lossless compression under the various values of CR requires certain amount of computation. To make the algorithm more feasible and make computational demands realistic, two assumptions can be made. 
     First, it is assumed that an image reconstructed from data which was compressed at the value of CR=1/2 shows less distortionthan one recovered from CR=1/4, and that an image that was not subject to size compression (CR=1) is likewise superior to one compressed at CR=1/2. Based on this assumption, CR=1 should always be chosen over CR=1/2, and CR=1/2 over CR=1/4, if the choice does not cause buffer overflow. Therefore, once we meet such an image which gives non-overflow buffer condition, we don&#39;t need to go further; the algorithm for CR ends here. In reality, this assumption is almost always true. Use ofthis assumption avoids the unnecessary computation of distortion values, since the distortion is the same whatever BAB coding mode is selected. 
     Second, it is assumed that the number of permissible backward steps may be limited The backward unit of the optimal algorithm discussed above is computationally intensive, requiring infinite memory for the optimal path computation. The optimal path algorithm can be modified to exploit a finite number of backward steps when the current buffer cannot be lower than B max  with any CR value. Exemplary pseudo-code for realizing such a modified algorithm is presented in Appendix II, which uses the terms defined as follows. B intraCAE  (CR=1) means the current buffer size just after intraCAE(CR=1) is applied. B intraCAE  (CR=1)means the currentbuffer size just after interCAE(CR=1) is applied. Similar meanings are ascribed to B intraCAE  (CR=1/2), B intraCAE  (CR=1/2) B intraCAE  (CR=1/4), and B intraCAE  (CR=1/4). Likewise, the terms B T   intraCAE  (CR=1), B T   intraCAE  (CR=1), B T   intraCAE  (CR=1/2), B T   intraCAE  (CR=1/2), B T   intraCAE  (CR=1/4) and B T   intraCAE  (CR=1/4) are all the expressions for the buffer size just after &#34;transposed data&#34; are context-based arithmetic encoded. 
     Experimental testing has shown that the changing the maximum buffer size does not significantly impact the steady state quality of the reconstructed image. Building on this finding an using the above discussed assumptions, a description of a marginal buffer reservation process which approximates the optimum solution but does not require the preservation of past data is now discussed. 
     Since varying the maximum size of the buffer does not significantly impact the performance of the above-described buffered compression process, it follows that the process may be applied with reference to a &#34;virtual&#34; buffer having less capacity than the actual (physical) buffer. Referring to FIG. 8, a virtual buffer 810 of size B visual  is shown. B visual  is chosen to be less than the actual buffer size B max  820. Choosing virtual buffer 810 in this way permits a compression process to overflow B visual  without causing actual overflow. 
     Whenever B visual  is exceeded, the process requires all future BABs to be encoded at CR=1/4 until the buffer occupancy is again below B visual . If B visual  810 is defined sufficiently below B max  820, B max  820 will not be exceeded even when the buffer occupancy is nearly at B visual  830, and the buffer is filled with a CR=1 BAB 840. The buffer occupancy will thus have the opportunity to return to a level below B visual  within a few macroblocks. Under such circumstances, the backwards mode discussed above is completely avoided. 
     Referring now to FIG. 9, a flow chart showing illustrating the marginal shape encoding process will now be described. Note that the first three steps are identical to those described with reference to FIG. 7. Thus, if all bits in the BAB are 0, the all --  0 mode is chosen 910; if all bits in the BAB are 255, the all --  255 mode is chosen 920, and if steps 910 and 920 are inapplicable, a comparison of MC --  BAB and BAB is made to determine whether to use the No --  Update mode 930. 
     If step 930 is also inapplicable, CR is chosen to be 1 and four possible buffer occupancies, indicating how full the buffer would be if the BAB under consideration is intra-coded, inter-coded. transposed and intra-coded, or transposed and inter-coded for the size compression value of CR=1, are determined 940. If the smallest of the four possible buffer occupancies is less than the virtual buffer size B visual  950, CR is set to 1 and the compression mode yielding that buffer occupancy is chosen as the lossless compression mode for the BAB 951. If none of the four possible compression modes yields a buffer occupancy less than the virtual buffer size B virtual , CR is chosen to be 1/2 and four possible buffer occupancies, indicating how full the buffer would be if the BAB under consideration is intra-coded, inter-coded, transposed and intra-coded, or transposed and inter-coded for the size compression value of CR=1/2, are determined 952. 
     Next, if the smallest of the four possible buffer occupancies is less than the virtual buffer size B visual  960, CR is set to 1/2 and the compression mode yielding that buffer occupancy is chosen as the lossless compression mode for the BAB 961. If none of the four possible compression modes yields a buffer occupancy less than the virtual buffer size B visual , CR is chosen to be 1/4 and four possible buffer occupancies, indicating how full the buffer would be if the BAB under consideration is intra-coded, inter-coded, transposed and intra-coded, or transposed and inter-coded for the size compression value of CR=1/4, are determined 962. 
     If the smallest of the four possible buffer occupancies is less than the virtual buffer size B visual  970, CR is set to 1/4 and the compression mode yielding that buffer occupancy is chosen as the lossless ompression mode for the BAB 971. If none of the four possible compression modes yields a buffer occupancy less than the virtual buffer size B visual , a situation has occurred wherein the virtual buffer will overflow. However, since the virtual buffer size B visual  was chosen to be smaller than the actual buffer size B max , such an overflow condition can be tolerated. fn this case, CR is set to 1/4 and the lossless compression mode yielding the fewest number of bits should be chosen for the BAB 972. 
     Appendix III contains exemplary psudo-code for implementing the marginal shape encoding process described with reference to FIG. 9. Experimental results using this algorithm are illustrated in FIGS. 10-17. FIG. 10 shows decoded frames (a)-(f) from an MPEG-4 shape decoder having a B max , of 1000 bits and a B visual , of 960 bits, where the outgoing channel rate is 6 bits/BAB --  block. FIG. 11 shows decoded frames (a)-(f) from an MPEG-4 shape decoder having a B max , of 500 bits and a B visual  of 460 bits, where the outgoing channel rate is 6 bits/BAB --  block. FIG. 12 shows decoded frames (a)-(f) from an MPEG-4 shape decoder having a B max , of 1000 bits and a B visual  of 980 bits, where the outgoing channel rate is 7 bits/BAB --  block. FIG. 13 shows decoded frames (a)-(f) from an MPEG-4 shape decoder having a B max , of 500 bits and a B visual  of 480 bits, where the outgoing channel rate is 7 bits/BAB --  block. FIG. 14 shows decoded frames (a)-(f) from an MPEG-4 shape decoder having a B max , of 1000 bits and a B visual  of 990 bits, where the outgoing channel rate is 8 bits/BAB --  block. FIG. 15 shows decoded frames (a)-(f) from an MPEG-4 shape decoder having a B max , of 500 bits and a B visual  of 490 bits, where the outgoing channel rate is 8 bits/BAB --  block. 
     FIGS. 16(a)-(c) show 3 graphs plotting buffer occupancy vs. macroblock number for the three experiments described above that use B max , of 1000 bits. FIG. 16a applies to the case where B visual  is 960 bits and the outgoing channel rate is 6 bits/BAB --  block, FIG. 16b applies to the case where B visual  is 980 bits and the outgoing channel rate is 7 bits/BAB --  block, and FIG. 16c applies to the case where B visual  is 990 bits and the outgoing channel rate is 8 bits/BAB --  block. FIGS. 17 (a)-(c) show 3 graphs plotting buffer occupancy vs. macroblock number for the three experiments using B max , of 500 bits. FIG. 17a applies to the case where B visual  is 460 bits and the outgoing channel rate is 6 bits/BAB --  block, FIG. 17b applies to the case where B visual  is 480 bits and the outgoing channel rate is 7 bits/BAB --  block, and FIG. 17c applies to the case where B visual  is 490 bits and the outgoing channel rate is 8 bits/BAB --  block. 
     The foregoing merely illustrates the principles of the invention. Various modifications and alterations to the described embodiments will be apparent to those skilled in the art in view of the teachings herein. For example, although the disclosure herein is directed to the compression of binary shape information for an MPEG-4 compliant bitstream, the invention has general applicability to any video compression process requiring the minimization of distortion under buffer constraints. It will thus be appreciated that those skilled in the art will be able to devise numerous systems and methods which, although not explicitly shown or described herein, embody the principles of the invention and are thus within the spirit and scope of the invention. ##EQU4##