Abstract:
Method and apparatus for generating variable length coded for video encoding. A plurality of memory tables contain variable length codes tailored to patterns of input video information that is likely to be input to the variable length encoder. The patterns are determined in large part by a value of a quantizer used in video encoding. A separate memory table containing separate variable length codes is established for each of a plurality of quantization parameter values. The quantization parameter is input to the encoder to enable one of the memory tables and the video information is input to the enabled table to generate the variable length code.

Description:
RELATED APPLICATION 
     This is a continuation in part application that benefits from priority of provisional patent application Ser. No. 60/038,018, filed Feb. 14, 1997. 
    
    
     BACKGROUND OF THE INVENTION 
     The present invention relates to video coders and, specifically, to variable length coders utilized in the coding of video images. 
     Currently, several standards for video coding have been defined or are under consideration. The proposed standard for video coding of motion pictures, MPEG-4, provides for coding according to a discrete cosine transform, quantization, run length coding and additionally variable length coding (VLC). VLC tables are preferred due to their low complexity. They permit bit savings by allocating shorter codes to video signals that occur with high frequency and longer codes are allocated to video signals that occur with lower frequency. However, VLCs are narrowly tailored for specific applications; they do not adapt to dynamic conditions. For example, for intra coding in the verification model no. 6 of the proposed MPEG-4 coding standard, a first VLC table is used to code DC coefficients of luminance, a second VLC table codes AC coefficients of luminance, a third VLC table codes DC coefficients of chrominance and a fourth VLC table codes AC coefficients of chrominance. For inter coding, additional VLC tables may be required. However, the addition of VLC tables increases system complexity and requires additional signaling to identify when specific VLC tables are in use. Such overhead consumes bandwidth and contributes to coding inefficiencies. 
     Video coders now may advantageously employ variable quantizers. Quantizers divide down a video signal by a quantization parameter to reduce bandwidth occupied by the coded signal. A variable quantizer divides down by a variable quantization parameter but it changes the statistics of the video signal coded by the VLC tables. Thus, changes in the quantization parameter affects the coding efficiencies of the VLC tables. Coding savings obtained at the quantizer may result in costs at the VLC table. 
     Accordingly, there is a need in the art for a coding scheme that integrates a variable quantizer with a variable length encoder. Further, there is a need in the art for such a coding scheme that switches among VLC tables without additional overhead signaling. 
     SUMMARY OF THE INVENTION 
     The present invention alleviates the disadvantages in the art by adopting a coding scheme based on the value of the quantization parameter used. The variable length encoder applies a VLC table that is determined by the value of variable quantization parameter, Q p . Because the decoder knows the value of Q p , no overhead signal need be transmitted to the decoder to synchronize the value of Q p  between the encoder and the decoder. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1(a) illustrates an encoder in accordance with an embodiment of the present invention. 
     FIG. 1(b) illustrates a decoder in accordance with an embodiment of the present invention. 
     FIG. 2 is a diagram of portions of the quantizer and the variable length coder of FIG. 1(a). 
    
    
     DETAILED DESCRIPTION 
     The present invention integrates a quantizer characterized by a variable quantization parameter (Q p ) with a variable length encoder. The variable length coder stores VLC tables in memory. The VLC tables are selected based on the value of the variable quantization parameter applied at the quantizer. The quantization parameter is updated traditionally on a macro block by macro block basis. Accordingly, the variable length encoder may switch automatically among VLC tables at each macro block depending on whether the quantization parameter has been updated. 
     Updates to the quantization parameter are reported in the bitstream output from the encoder. When a macro block is decoded, the decoder calculates a quantization parameter for the macro block based on the quantizer update information and the quantization parameter of the previous macro block. Based on the calculated quantization parameter, the decoder switches among a plurality of tables to decode the variable length tables. By switching among VLC tables according to the value of the quantization parameter, three or four VLC tables may be used generically for all signal types. 
     The new VLC tables are designed to be interchangeable not only between luminance and chrominance but also in coding of inter and intra coefficients. The statistics of such video information correlate strongly with the value of the quantizer parameter. 
     In a first preferred embodiment, the number and value of breakpoints between VLC tables are predetermined at both the encoder and decoder. The breakpoints are static; they do not change. No initialization is required to synchronize breakpoints used by a decoder with breakpoints used at the encoder. 
     In a second preferred embodiment, breakpoints between VLC tables are defined at the encoder. The encoder includes an table initialization signal in a bitstream output from the encoder that identifies breakpoints. Because the breakpoints generally occur for intermediate values of the quantization parameter, the length of the breakpoint initialization signal may be shortened by coding only an offset from a base breakpoint. 
     For example, in an MPEG-4 embodiment, Q p  takes a value between 1-31. The breakpoint initialization signal may be a 3 bit signal identifying an offset from Q p  =8. Depending upon the breakpoint initialization signal, a breakpoint may be established between Q p  =9 and Q p  =16. Alternatively, the encoder may include a 4 bit signal identifying an offset from Q p  =5. Depending upon the breakpoint initialization signal, a breakpoint may be established between Q p  =6 and Q p  =21. 
     Selection of the quantization parameter value Q p  is made based upon the bandwidth or bit rate available to the channel, the resolution of the encoded image and other considerations known to those of skill in the art. Typically, at lower values of Q p , a higher bandwidth is available to the channel, more detailed image information is encoded and, consequently, higher image quality is obtained. In a preferred embodiment, the VLC table is optimized for video information at very low Q p  values (Q p  &lt;6 in the MPEG-4 scheme). 
     DC luminance and DC chrominance information carries the most perceptually significant video information in the block. Accordingly, in a preferred embodiment, the VLC tables are optimized for DC luminance and chrominance information, particularly at very low values of the quantization parameter (Q p  &lt;6 in the MPEG-4 scheme). 
     Appreciable differences in image quality are rarely obtained among quantizer values in the middle to high ranges (31&gt;Q p  &gt;18 in the MPEG-4 scheme). Accordingly, in another preferred embodiment, separate VLC tables are allocated to quantizer parameter values for very low Q p  values, for low Q p  values and for high Q p  values. For instance, in the MPEG-4 scheme, separate VLC tables are provided for Q p  =1 to 6, Q p  =7 to 17 and Q p  =18 to 31. 
     At middle to high quantization parameter values, statistics of inter coded coefficients often possess similarities to intra coded coefficients. Accordingly, in a further preferred embodiment, the VLC tables at the middle to high quantization parameter values may be optimized for use with inter coded coefficients. 
     The present invention is not limited to coding of video information. In addition, the advantages of the present invention also may encode overhead information that indicates which of the blocks in the macro block contain coded information. For example, verification model no. 6 of the proposed MPEG-4 standard provides for encoding of an MBtype field to indicate the type of coding (intra, intra+quantizer update, inter, inter+quantizer update, etc.). Further, because some blocks may be eliminated entirely by quantization, the standard provides for encoding of a CBPC field to indicate which of the chrominance blocks contain coded information and a CBPY field to indicate which of the luminance blocks contain encoded information. Because the frequency at which blocks are eliminated depends on the value of the quantization parameter, the techniques of the present invention may be used to code MBtype, CBPC and CBPY. 
     In one preferred embodiment, three VLC tables have been developed for encoding MBtype and CBPC in the proposed MPEG-4 coding standard. The quantization parameter based switching is applied to both a macro block type and coded block pattern field for coding of chrominance information as follows: 
     
                       TABLE 1______________________________________     VLC&#39;s for CBPC with Quantizer, Q.sub.p in rangeMBtype CBPC     1 through 6                      7 through 14                               15 through 31______________________________________3      00       01         1        13      01       0011       0011     0013      10       0010       0010     0103      11       1          01       0114      00       0001       0001     00014      01       0000011    0000011  0000014      10       0000010    0000010  0000104      11       001        0001     000011______________________________________ 
    
     According to the MPEG-4 standard, MBtype=3 when the macro block contains intra coded information and no quantizer update is included in the bitstream; MBtype=4 when the macro block contains intra coded information and a quantizer update is included in the bitstream. CPBC indicates whether the first or second chrominance blocks in the macro block contains video information. A `1` in either bit position indicates that video information for a corresponding chrominance block is encoded. 
     At higher values of Q p , one expects that it is more likely that the two chrominance blocks are eliminated completely. Thus, for CPBC=00, the VLC code is shortest when Q p  falls between 15 and 31. At low Q p  &#39;s, one expects that it is more likely that the bitstream will contain encoded signals for both chrominance blocks. Thus, the VLC is shortest at. CBPC=11 when Q p  is between 1 and 6. 
     In the example of Table 1, three VLC tables are defined for image data having breakpoints at Q p  =7 and Q p  =15. In this example, when the scalar falls between 1 and 6, the first VLC table is used. When the scalar falls between 7 and 14, the second VLC table is used. The third VLC table is used when the scalar exceeds 15. 
     Similarly, in the preferred embodiment, three VLC tables have been obtained for CBPY based on values of the quantization parameter. 
     
                       TABLE 2______________________________________VLC&#39;S for CBPY with Quantizer, Q.sub.p, in rangeCBPY    1 through 14 15 through 22                           23 through 31______________________________________00      001          01         010000      00001        00001      000010100      000001       11000      110101000      00010        0001       00011101      011100       11001      110110001      00011        11010      10000101      011101       000001     0000011001      01000        11011      10011110      011110       111110     10100010      011111       111111     1111100110      01001        11100      1111111010      01010        11101      111101111      01011        0010       10110011      01100        0011       11000111      01101        11110      11101011      1            10         00111______________________________________ 
    
     At low values of Q p , where one would expect the fewest coefficients divided down to zero, the shortest code indicates that all four luminance blocks in the macro block contain data (CBPY=1111). 
     FIG. 1 shows an encoder 100 constructed in accordance with a first embodiment of the present invention. An analog image signal is presented to the encoder 100. The image signal is sampled and converted to a digital signal by an analog to digital (&#34;A/D&#34;) converter 110 using techniques known in the art. The A/D converter 110 generates a digital image signal for a plurality of pixels of the image. Alternatively, the image signal may be presented to the encoder as a digital image signal; in this case, the A/D converter 110 is omitted. 
     The digital image signal is input to a processing circuit 120. The processing circuit 120 may perform a host of functions. Typically, the processing circuit 120 filters the image data and breaks the image data into a luminance signal component and two chrominance signal components. Additionally, the processing circuit 120 groups image data into blocks of data. Where the digital input signal represents information for a plurality of pixels in a scanning direction, the digital output of the processing circuit 120 represents blocks of pixels, for example, data may be blocked into 8 pixel by 8 pixel arrays of image data. The processing circuit 120 outputs image data on a macro block basis. A macro block typically consists of four blocks of luminance data and two blocks of chrominance data. The processing circuit 120 may also perform additional functions, such as filtering, to suit individual design criteria. 
     The output of the processing circuit 120 is input to a transform circuit 130. The transform circuit 130 performs a transformation of the image data, such as discrete cosine transform (&#34;DCT&#34;) coding or sub-band coding, from the pixel domain to a domain of coefficients. A block of 64 pixels is transformed to a block of 64 coefficients. Coefficients output by DCT coding generally include a single DC coefficient and 63 AC coefficients, some of which are non-zero. Similarly, coefficients output by sub-band coding represent image characteristics at a variety of frequencies; typically, many coefficients from sub-band coding are very small. The transform circuit 130 outputs blocks of coefficients. 
     A quantizer 140 scales the signals generated by the transform circuit 130 according to a constant or variable scalar value (Q p ). The quantizer 140 reduces bandwidth of the image signal by reducing a number of quantization levels available for encoding the signal. The quantization process is lossy. Many small coefficients input to the quantizer 140 are divided down and truncated to zero. The scaled signal is output from the quantizer 140. 
     The prediction circuit 150 performs gradient prediction analysis to predict scaled DC coefficients of each block. The prediction circuit 150 may pass scaled AC coefficients or, alternatively, may predict AC coefficients of the block. In a preferred mode of operation, the prediction circuit 150 selects between modes of predicting or passing AC coefficients; in this case, the prediction circuit 150 generates an AC prediction flag to identify a mode of operation. The prediction circuit 150 outputs a DC residual signal, AC signals (representing either AC coefficients or AC residuals) and, optionally, an AC prediction flag. 
     A variable length coder 160 encodes the output of the prediction circuit 150. The variable length coder 160 typically is a Huffman encoder that performs run length coding on scaled video signals but is triggered by the values of Q p . A bitstream output from the variable length coder 160 may be transmitted, stored, or put to other uses as are known in the art. 
     In the encoder 100, the prediction circuit 150 and the quantizer 140 perform functions which are mutually transparent. Accordingly, their order of operation is largely immaterial. Although FIG. 1 illustrates output of the quantizer 140 as an input to the prediction circuit 150, the circuits may be reversed in order. The output of the prediction circuit 150 may be input to the quantizer 140. 
     A decoder 200 performs operations that undo the encoding operation described above. A variable length decoder 260 analyzes the bitstream using a complementary process to recover a scaled signal. If a Huffman encoder were used by the encoder 160, a Huffman decoder 260 is used. 
     A reconstruction circuit 250 performs the identical gradient analysis performed in the prediction circuit 150. The DC residual signal is identified and added to a predicted coefficient to obtain a DC coefficient. Optionally, the reconstruction circuit 250 may identify the AC prediction flag and, on the status of that flag, interprets the AC information as either AC coefficient information or AC residual information. In the event that AC residual information is present, the reconstruction circuit 250 adds the residual signals to corresponding predicted signals to obtain AC coefficients. The reconstruction circuit 250 outputs coefficient signals. 
     A scalar circuit 240 multiplies the recovered signal by the same scalar used as a basis for division in the quantizer 140. Of course, those coefficients divided down to zero are not recovered. 
     An inverse transformation circuit 230 performs the inverse transformation applied by the transform circuit 130 of encoder 100. If a DCT transformation were performed, an inverse DCT transformation is applied. So, too, with sub-band coding. The inverse transformation circuit 230 transforms the coefficient information back to the pixel domain. 
     A processing circuit 220 combines luminance and chrominance signals and may perform such optional features as are desired in particular application. The processing circuit 220 outputs digital signals of pixels ready to be displayed. At this point the signals are fit for display on a digital monitor. If necessary to fit a particular application, the signals may be converted by a digital to analog converter 210 for display on an analog display. 
     FIG. 2 illustrates the structure of one embodiment of a variable length encoder 160 and its interaction with a quantizer 140 of FIG. 1. Video information input to the variable length encoder 160 consisted of coded video information such as MBtype, CBPC, CBPY and scaled coefficient information. 
     The variable length encoder 160 includes several VLC tables in memory, illustrated as 310, 320 and 330 respectively. In practice, a single memory 340 may house all VLC tables. The variable length encoder 160 receives the quantization parameter Q p  from the quantizer 140. Based on the value of the quantization parameter Q p , a processor 350 of the variable length encoder 160 enables one of the VLC tables, say 330 in the illustrated embodiment. The video information addresses the VLC table 330 which, in turn, generates a variable length code representative of the video information. 
     In a preferred embodiment where all VLC tables are stored in a single memory, both the Q p  signal and the video information are applied as an address for a memory location in which the associated variable length code is stored. 
     The processor 350 may establish breakpoints between the tables. The processor reports the breakpoints in the breakpoint initialization signal over line 360. 
     The processor 350 may be replaced by an address logic circuit (not shown) that enables a table based on the magnitude of Q p . The address logic circuit would not permit an adaptive breakpoint in the manner shown above with respect to the processor 350 above. 
     The present invention provides advantages in variable length coding of video signals by developing unique variable length code tables based upon values taken by a variable quantization parameter. The statistics of video information depends heavily upon the quantization parameter used. The present invention capitalizes on this relationship by using the quantization parameter as a basis for selecting among the memory tables and using the video information to select and entry from the selected table.