RELATED PATENT APPLICATIONS

[0001]
This invention is related to concurrently filed U.S. patent application Ser. No. 10/______ to inventors Chen, et al. titled VIDEO CODING USING MULTIDIMENSIONAL AMPLITUDE CODING AND 2D NONZERO/ZERO CLUSTER POSITION CODING, Attorney/Agent Ref. No. CISCO9180. U.S. patent application Ser. No. 10/______ is incorporated herein by reference.
BACKGROUND

[0002]
The present invention relates to image coding, and in particular to variable length coding of an ordered series of quantized transform coefficients of a transform of a block of image data.

[0003]
Twodimensional variable length coding, referred to as 2DVLC, has been widely used to code quantized transform coefficients. In traditional 2DVLC, statistics are collected or assumed of events that include a run of consecutive zerovalued coefficients followed by a single nonzero amplitude coefficient that follows the run length. The ordering of the series of quantized transform coefficients is along a preselected path, e.g., a zigzag path, in the twodimensional path of the transform. Thus, in a typical implementation, a twodimensional table consisting of the ending amplitude and the runlength of the preceding consecutive zerovalued coefficients is constructed and variable length codes, such as optimal Huffman codes or arithmetic codes, are assigned according to the assumed or measured statistics to form the 2DVLC table for the subsequent encoding process. Shorter code lengths are used for the more likelytooccur, e.g., more frequently occurring events.

[0004]
2DVLC is used in common transform coding methods, such as JPEG, MPEG1, MPEG2, ITUT261, etc., as follows. For motion video, an image is divided into blocks, e.g., 8 by 8 or 16 by 16 blocks. Each image is classified as interframe or intraframe. Interframe images are typically post motion compensation. The blocks of the image are transformed and the transform coefficients are quantized. The quantized transform coefficients are then coded along a specified path according to a 2DVLC table. Interframe and intraframe images typically have different 2DVLC tables. The DC component is typically separately encoded. Furthermore, the 2DVLC table may be truncated so that the least frequently occurring events use an escape code followed by a fixed length code. A special “EOB” code is used to indicate the end of the block when all remaining coefficients are zero.

[0005]
FIG. 1 shows how a table lookup may be used to implement a 2DVLC scheme. Prior to the table look up, the runlength of zero amplitudes preceding any nonzero amplitude and the nonzero amplitude are determined. The table look up uses a 2D table for those likelytooccur events encoded using variable length encoding. An escape code together with a fixed length code is used for relatively less likelytooccur combinations.

[0006]
One advantage of traditional 2DVLC is that the position of each nonzerovalued quantized coefficient and its amplitude are coded simultaneously, which generally results in shorter code lengths than using a separate code, e.g., a VLC code for each nonzerovalued coefficient and coefficient amplitude.

[0007]
Because of the widespread use of image coding, many patents have been issued on different forms of VLC. U.S. Pat. No. 4,698,672 issued Oct. 6, 1987 to Wenhsiung Chen, one of the inventors of the present invention, for example, described one form of a twodimensional variable length coding method.

[0008]
Extensions and variations to the common 2DVLC method are known. For example, the ITU H.263 compression standard defines one such variation sometimes called threedimensional VLC (3DVLC). See PCT patent publication WO 9318616 published Sep. 16, 1993 titled PICTURE DATA ENCODING METHOD and also the ITUT H.263 standard. In 3DVLC, each symbol (“event”) is a triplet (LAST, RUN, LEVEL) that includes: LAST, a binary flag that indicates whether or not the current nonzero amplitudevalue is the last nonzerovalued coefficient in the block, RUN, the runlength of zerovalue coefficients that precede the current nonzero amplitude, i.e., the number of zeroes since the last nonzero coefficient amplitude, and LEVEL, the current nonzero coefficient amplitude value. Thus, there is no need for a separate EOB codeword; whether or not the nonzerovalued coefficient is the last one is incorporated into the event.

[0009]
FIG. 2 shows how a table lookup may be used to implement 3DVLC.

[0010]
One deficiency of 2DVLC is that every nonzerovalued coefficient needs to be accompanied by a runlength code to identify its position, in the form of the number of preceding zerovalued coefficients.

[0011]
In block based transform coding, there often is a region, e.g., a lowfrequency region along the ordering in which nonzerovalued coefficients tend to cluster, i.e., there are often a number of consecutive nonzerovalued coefficients along the low frequency region of the predetermined path. Each one of a number of such consecutive nonzerovalued coefficients would require the same number of codewords representing the position and amplitude.

[0012]
U.S. patent application Ser. No. 10/342,537 to inventors Chen et al., filed Jan. 15, 2003 and titled AN EXTENSION OF TWODIMENSIONAL VARIABLE LENGTH CODING FOR IMAGE COMPRESSION describes a method called the “Extended 2DVLC Method” herein that includes encoding repetitions of some nonzero coefficient values. One variant of the Extended 2DVLC method provides codes for all the possible amplitude variations of consecutive coefficients that follow a set of zerovalued coefficients. This effectively reduces the runlength to 1 for all cases. The difficulty of this approach is that there are enormous numbers of patterns that can be generated from the amplitudes of consecutive coefficients. For example, with 32 quantization levels as defined in many common video coding standards, there are in the order of 32^{n }patterns that can be generated from n consecutive coefficients. As such, in a practical implementation, only a limited number of the most likelytooccur nonzero amplitude values, such as 1 and 2, and a limited number of lengths of consecutive nonzerovalues, such as 3 or 4 consecutive values, are regrouped for pattern matching.

[0013]
Furthermore, in coding, while there may be a region where there are clusters of nonzerovalued coefficients, there is also likely to be a high frequency region where any nonzerovalued coefficients are likely to be scattered.

[0014]
With these observation in mind, U.S. patent application Ser. No. 10/869,229 to inventors Chen et al., filed Jun. 15, 2004 and titled A HYBRID VARIABLE LENGTH CODING METHOD FOR LOW BIT RATE VIDEO CODING, Attorney/Agent Ref. No. CISCO8783 was developed to encode the position and amplitude of quantized transform coefficients separately and to take advantage of the nature of the distribution of the transform coefficients in the low frequency and high frequency regions. U.S. patent application Ser. No. 10/869,229 is incorporated herein by reference, and the methods described therein are each and collectively called the “Basic Hybrid VLC Method” herein.

[0015]
U.S. patent application Ser. No. 10/898,654 to inventors Chen et al., filed Jul. 22, 2004 and titled AN EXTENDED HYBRID VARIABLE LENGTH CODING METHOD FOR LOW BIT RATE VIDEO CODING, Attorney/Agent Ref. No. CISCO8795 was invented, and provides an alternative coding method for the high frequency region by taking advantage of the very few amplitude values in the high frequency region, especially, for example, for low bit rate and interframe applications. U.S. patent application Ser. No. 10/898,654 is incorporated herein by reference, and the methods described therein are each and collectively called the “Extended Hybrid VLC Method” herein.

[0016]
In one embodiment of the abovementioned Basic Hybrid VLC Method, two independent types of coding schemes are introduced to code the quantized coefficients along the path. A boundary is established along the path to define two regions, e.g., a low frequency region and a high frequency region. The boundary can be made adaptive to the video depending on a number of factors such as intraframe coding or interframe coding, standard definition television (SDTV) or high definition television (HDTV), complex scene or simple scene, high bit rate coding or low bit rate coding, and so forth. In one embodiment, the encoding of the quantized coefficients in the lowfrequency region includes coding the positions of consecutive nonzerovalued coefficients and the positions of consecutive zerovalued coefficients using a runlength coding method of a first type and a runlength coding method of a second type. The encoding further includes coding the amplitude values and sign of the nonzerovalued coefficients. In the highfrequency region, in one embodiment, the encoding of coefficients in the high frequency region includes encoding the positions of runs of none or more consecutive zerovalued coefficients using a runlength coding method of a third type. The encoding further includes coding the amplitude values and sign of the nonzerovalued coefficients.

[0017]
In one embodiment of the abovementioned Extended Hybrid VLC Method, a coding method is used in the second region that takes into account that almost all nonzerovalued coefficients in the high frequency region are ±1. No amplitude coding is needed to encode runs of consecutive zeroes that end in a coefficient of amplitude 1. An exception (escape) code is included to encode those rare nonzerovalued coefficients that have values other than ±1.

[0018]
Although the Basic Hybrid VLC Method and the Extended Hybrid VLC Method provide potential improvement beyond using a single 2DVLC technique for all quantized coefficients in a block, these methods may not be optimal for various reasons, including that the dynamic nature of the quantized block coefficients may not exactly match the model assumed in a predetermined coding technique. By the dynamic nature, we mean changed in blocktoblock, and image to image in one or more of the cluster or scatter of the coefficients in a region, in whether a region has significant consecutive runs of nonzerovalued coefficients or mostly isolated nonzerovalued coefficients, in whether a region has coefficients with amplitudes dominated by a few values or even a single value, and so forth.

[0019]
U.S. patent application Ser. No. 10/910,712 to inventors Chen et al., filed Aug. 3, 2004 and titled VIDEO COMPRESSION USING MULTIPLE VARIABLE LENGTH CODING PROCESSES FOR MULTIPLE CLASSES OF TRANSFORM COEFFICIENT BLOCKS, Attorney/Agent Ref. No. CISCO8819 describes a method that includes classifying each block of quantized coefficients to one of a plurality of classes. Each class has a corresponding method (a coding strategy) applicable to that type of data, e.g., to the types of statistical distributions of zero and nonzerovalued coefficients, including whether the nonzero coefficients are clustered or scattered, whether the nonzerovalued coefficients, other than the DC value, are dominated with amplitide1coefficients, and whether or not a breakpoint can be established that defines a first region wherein the nonzerocoefficients are clustered, and a second region wherein the nonzero valued coefficients are scattered. Thus, one of a plurality of coding strategies is applied according to the nature of the coefficients. In one embodiment, the classifying compares the results of applying the corresponding strategies, and selects the class and thus the strategy according to which corresponding strategy provides the best compression. U.S. patent application Ser. No. 10/910,712 is incorporated herein by reference, and the methods described therein are each and collectively called the “MultiClass VLC Method” herein.

[0020]
In the Basic Hybrid VLC Method and the Extended Hybrid VLC Method, the consecutive nonzerovalued coefficients and the consecutive zerovalued coefficients in the low frequency region are coded alternatively using two independent onedimensional variable length coding methods. It would be desirable to pair the consecutive nonzerovalued coefficients and zerovalued coefficients as a single event and apply a single variable length to the pair.

[0021]
Thus there is still room for improvement in how to encode a series of quantized coefficients, in particular for a series in which there are clusters of nonzerovalued coefficients.

[0022]
Thus, there is still a need in the art for variable length coding methods applicable to quantized coefficients for transform image coding. Such methods can be added to the corresponding methods in the abovedescribed MultiClass VLC Method.

[0023]
Furthermore, one or more patents describing some existing 2DVLC coding methods have recently been the subject of patent litigation. Thus, there is a need in the art for alternate methods that can replace commonly used 2DVLC methods that have been the subject of such litigation.
SUMMARY

[0024]
Described herein are a method, an apparatus, and carrier medium to encode a series of signals having the most likelytooccur value and at least one other value. The application is for encoding a series of quantized transform coefficients of a block of image data. One method embodiment includes, in a first region, identifying events that each includes a run of zerovalued coefficients preceding a run of one or more nonzerovalued coefficients, and for each such event, jointly encoding the run lengths of the preceding run of zerovalued coefficients and the following run of nonzerovalued coefficients with a codeword, such that for at least some events, relatively more likelytooccur pairs of runlengths are encoded by a shorter codeword than relatively less likelytooccur runlengths. The method further includes encoding each amplitude in the run of consecutive nonzerovalued coefficients, and encoding the signs of such coefficients. The method is applicable to encoding a region in the series where there is likely to be a cluster of nonzerovalued coefficients. Other features, advantages, and aspects will be apparent from the description and claims herein.
BRIEF DESCRIPTION OF THE DRAWINGS

[0025]
FIG. 1 shows how a prior art 2D VLC method may be implemented by a table lookup.

[0026]
FIG. 2 shows how a common prior art variation of 2D VLC called 3DVLC may be implemented by a table lookup.

[0027]
FIG. 3 shows a table of statistics of events according to a prior art 2D VLC method.

[0028]
FIG. 4 shows a code table for coding events according to a prior art 2D VLC method.

[0029]
FIGS. 5A5D show tables that each show examples of events according to an embodiment of the invention. In the patterns, an “x” indicates a nonzero value.

[0030]
FIG. 6 shows a table of statistics collected for events of runs of none or more zerovaluedcoefficients followed by a run of nonzerovalued coefficients according to an embodiment of the invention.

[0031]
FIG. 7 shows a table of variable length codes for events of runs of none or more zerovaluedcoefficients followed by a run of nonzerovalued coefficients according to an embodiment of the invention.

[0032]
FIGS. 8A8F show tables that each show examples of events according to an improved embodiment of the invention in which events of runs of zerovalued coefficients followed by runs of nonzerovalued coefficients include a following zerovalued coefficient. The events are truncated to cover no more than 12 consecutive coefficients.

[0033]
FIG. 9 shows a table of statistics collected or assumed for events of runs of none or more zerovaluedcoefficients followed by a run of nonzerovalued coefficients followed by a single zerovaluedcoefficient according to an embodiment of the invention.

[0034]
FIG. 10 shows a table of variable length codes for events of runs of none or more zerovaluedcoefficients followed by a run of nonzerovalued coefficients followed by a single zerovaluedcoefficient according to an embodiment of the invention.

[0035]
FIG. 11 shows a table of actual statistics for a sample image for a first region with a breakpoint of 12 that forms a soft boundary. Note that the event skip is the same as the event R(12,0).

[0036]
FIG. 12 shows an apparatus embodiment that includes a processing system with a processor and a memory implementing the coding methods described herein.
DETAILED DESCRIPTION

[0037]
An aspect of the present invention encodes, using a variable length code, events of a run of consecutive zerovalued coefficients that are followed by a run of consecutivenonzerovalued coefficients followed by single zerovalue. The inventors believe this provides an efficient code for a series of coefficients, or a region of such a series wherein the nonzerovalued coefficients may cluster.

[0038]
Consider first traditional 2DVLC. FIG. 3 shows Table 1 that presents, as an example, the statistics of events for traditional 2DVLC tabulated as a two dimensional table. In the table, S_{2D}(z,m) is the likelihood expressed, for example, as a relative number of occurrences of a run of i consecutive zerovaluedcoefficients, z=0, 1, 2, . . . followed by an amplitude of m, m=1, 2, . . .

[0039]
In 2DVLC, a variable length code such as an optimal code is assigned to each, or least some of the events that have an S_{2D}(z,m) above, with the most likelytooccur element having the shortest number of bits, and the least occurring event coded using the longest number of bits. FIG. 4 shows Table 2 that presents, as an example, a 2DVLC table where C_{2D}(z,m) is the codeword used to encode the event of the combination of z consecutive 0valued coefficients followed by a single nonzero coefficient of magnitude or amplitude m, i=0, 1, . . . and m=1, 2, . . . .

[0040]
Suppose the series of quantized transform coefficients is:

[0041]
5100342000201030000000000000000000001000000000000010000000000000.

[0042]
Such a series would be encoded in conventional 2DVLC as:

 C_{2D}(0,5)+C_{2D}(0, 1)+C_{2D}(2,3)+C_{2D}(0,4)+C_{2D}(0,2)+C_{2D}(3,2)+C_{2D}(1,1)+C_{2D}(1,3)+C_{2D}(21,1)+C_{2D}(13,1)+EOB
 where + represents concatenation, and where C_{2D}(z,m) denotes the 2DVLC code, z denotes the number of zerovalue coefficients preceding a nonzeroamplitude value, and m represents the amplitude—also called magnitude ignoring the sign—value to be encoded, and where EOB represents a code that indicates the end of the block, i.e., all remaining coefficients are zerovalued. Note that the above does not include encoding the sign of the coefficients. Those in the art will understand that coefficients may be positive or negative, and that each nonzero coefficient value is therefore further encoded by a sign bit to indicate the sign, or, in an alternate embodiment, each nonzero coefficient is encoded in its entirety including the sign. Signs are not included in the discussion in order not to obscure the inventive aspect.

[0045]
It is common to separately encode the DC term—the first transform coefficient—using a separate amplitude code. Let DC(m) indicate the codeword for the DC amplitude. In such a method, the above set of coefficients would be encoded using conventional 2DVLC as:

 DC(5)+C_{2D}(0, 1)+C_{2D}(2,3)+C_{2D}(0,4)+C_{2D}(0,2)+C_{2D}(3,2)+C_{2D}(1,1)+C_{2D}(1,3)+C_{2D}(21,1)+C_{2D}(13,1)+EOB
 wherein EOB is the code indicating that the remainder of the series is a run of zerovalued coefficients and +represents concatenation. In practice, some of the less likelytooccur events are coded with an escape code followed by a fixed length codeword.

[0048]
The Basic Hybrid and Extended Hybrid VLC Methods use the observation that for many series of quantized transform coefficients, there is a breakpoint that defines a first region in which there are nonzerovalued coefficients that are clustered, and a second, e.g., highfrequency region in which most nonzerovalued coefficients are scattered. In the first region, runs of zerovalued coefficients and runs of nonzerovalued coefficients are identified. A first variable length code is used for the runs of zerovalued coefficients, and a second runlength code is used for the runs of nonzerovalued coefficients. Thus, two onedimensional runlength codes are alternately applied. The DC is separately encoded. It is assumed that the series starts with a run of nonzerovalued coefficients, and a particular codeword indicates that this is a null run, i.e., that the series starts with a zerovalued coefficient.

[0049]
Consider the series above (excluding the DC term):

[0050]
100342000201030000000000000000000001000000000000010000000000000.

[0051]
Consider first the Basic Hybrid Method. Assume for simplicity that no sign bits are included in the coding. Suppose that a breakpoint is established at 15 that defines a first region up to 15 wherein the nonzerocoefficients tend to cluster, and a second region wherein the nonzerovalued coefficients tend to scatter. In such a case, denoting by x a nonzerovalued coefficient, the first region of the series (without a DC term) may be written as:

 x00xxx000x0x0x
 and the second region as:
 00000000000000000000x0000000000000x0000000000000.

[0055]
Denote by rn the run of n consecutive nonzero coefficients, and r′z the run of z consecutive zerovalued coefficients in the first region, n,z=1,2, . . . . The ordered sequence of the example then starts with:

 r1 r′2 r3 r′3 r1 r′1 r1 r′1 r1 SKIP

[0057]
For the second region, denote by r″z, z=0,1, . . . , runs of consecutive zerovalued coefficients. Then, according to the Basic Hybrid method, the second region has the events:

 r″20 r″13 End
 where SKIP denotes that the remainder of the coefficients to the breakpoint are zero and End denotes that the remainder of the coefficients are zero.

[0060]
Denote by cn the variable length code according to a first variable length coding method for encoding the runlengths of the nonzerovalued coefficients. Similarly denote by c′z the variable length code according to a second variable length coding method for encoding the runlengths of the zerovalued coefficients in the first region. Further denote by Am the codeword used to encode the amplitude m, m=1, 2, . . . of nonzerovalued coefficients in the first region according to a first amplitude coding method, and denote by A″m the codeword used to encode the amplitude m, m=1, 2, . . . of nonzerovalued coefficients in the second region according to a second amplitude coding method.

[0061]
Leaving out sign bits, the first region would then be encoded as:

 c1+A1+c′2+c3+A3+A4+A2+c′3+c1+A2+c′1+c1+A1+c′1+c1+A3+Skip
 and the second region would be encoded as:
 c″20+A″1+r″13+A″1+EOB
 where Skip and EOB represent codewords indicating that the remainder of the series has only zerovalued coefficients, and +represents concatenation. Note that according to the Extended Hybrid Coding Method, coefficient amplitudes are assumed to be 1, such that runs of zerovaluedcoefficients ending in a single amplitude1coefficient require no further amplitude encoding. Amplitudes greater than 1 are encoded by an exception code followed by an amplitude code for amplitudes greater than 1. Thus, the second region would not include the amplitude codes, since they are for amplitude 1.

[0066]
In practical implementations of conventional 2DVLC, in order to reduce the size of the coding tables, some of the less likelytooccur events are encoded with fixed length codewords that are preceded with what are called escape codes.

[0067]
One aspect of the present invention is avoiding using escape codes.

[0068]
Another aspect of the present invention is a method that includes, for a first region of the series, identifying one or more events, each including a run of zerovalued coefficients followed by a run of nonzerovalued coefficients. The method further includes encoding each such identified event by a single variable length code, e.g., from a single table. With the Basic and Extended Hybrid Methods, such pair of events would be encoded by two codewords according to the first and the second onedimensional runlength coding methods.

[0069]
In one embodiment, the first region is the whole series of the quantized transform coefficients. For simplicity, this case will be the first considered.

[0070]
Each identified event may be defined by the runlengths of the zerovalued and nonzerovalued coefficients. Denote by R′(z,n) a run of z consecutive zerovalues coefficients followed by n nonzerovalued coefficients, with z=0,1, 2, . . . , and n=1, 2, 3 . . . , such that a “run” of no preceding zerovalued coefficients is included.

[0071]
FIGS. 5A5D show Tables 3A3D that each show examples of events. In the patterns, an “x” indicates a nonzero value.

[0072]
Consider again the series:

 5100342000201030000000000000000000001000000000000010000000000000.

[0074]
The events of the such a series, excluding the DC term (the amplitude 5) and not including any sign data, are:

 R′(0, 1),R′(2,3),R′(3, 1),R′(1, 1),R′(1, 1),R′(21,1),R′(13, 1),End
 where End indicates the remainder of the series consists of zerovaluedcoefficients.

[0077]
In one implementation, statistics are collected or assumed for each event, e.g., in a table such as Table 4 shown in FIG. 6, in which S′(z,n) denotes the assumed or measured relative likelihood for the event R′(z,n), z=0, 1, 2, . . . and n=1, 2, . . . Table 5 shown in FIG. 7 is a variable length code table formed based on the assumed or collected statistics of Table 4. In Table 5, C′(z,n) denotes the variable length code for the event R′(z,n), z=0, 1, 2, . . . and n=1, 2, . . . . Note that in one implementation, such a table is used to encode only a region, e.g., the first low frequency region of a series of coefficients. For such a situation, a code is also needed to indicate that all coefficients are zero, in order to skip to the next region.

[0078]
Further, any nonzerovalued coefficients are encoded by an amplitude code, which in one embodiment is implemented by using variable length code presented as a coding table according to the assumed or collected statistics. Let Am, m=1, 2, . . . , denote the code for the quantized value m according to the amplitude coding table.

[0079]
Thus, for the above series, excluding the DC term and the sign of the coefficients, the series would be coded as follows:

 C′(0, 1)+A1+C′(2,3)+A3+A4+A2+C′(3, 1)+A2+C′(1,1)+A1+C′(1, 1)+A3+C′(21,1)+A1+C′(13,1)+A1+EOB
 where EOB is the codeword for End that indicates all the remaining codewords are 0, and where + indicated concatenation.

[0082]
Since a run of nonzerovalued coefficients is followed by at least one zerovalued coefficient, or ends the series, in an improved implementation, events identified and encoded by the method include a run of zerovalued coefficients followed by a run of nonzerovaluedcoefficients, followed by a single zerovalued coefficient. With such events, more coefficients are encoded by each event. The coding is expected to provide more compression.

[0083]
The possible number of such events is rather large, so that the code table that results may be rather large. In conventional prior art 2DVLC, the size of the table is restricted by adding Escape codes followed by fixed length codes for events that are less likelytooccur. In one embodiment of the present invention, the size of the code table is also limited such that events up to a maximum total number of coefficients only are encoded, with an additional code provided for an event of all zeroes of the maximum length, and for maximal length events that end in a nonzerocoefficient. These special maximallength events provide for avoiding using escape codes.

[0084]
Thus denote by R(z,n) a run of z consecutive zerovalues coefficients followed by n nonzerovalued coefficients followed by a single zerovalued coefficient, with z=0, 1, 2, . . . , and n=1, 2, 3, . . . . Suppose the events are truncated to no more than 12 coefficients. Then for those events of length less than 12, z+n=11. Some of the events of 12 coefficients for which z+n=12 are events that end in a nonzerovalued coefficient and can be considered “truncated” in that, if followed by an event that starts with a nonzerovalued coefficient, such events avoid using Escape codes. One event, R(12,0) of all zeroes is also a truncated event.

[0085]
As an example, FIGS. 8A8F show Tables 6A6F, respectively, that each show examples of events. In the patterns, an “x” indicates a nonzero value. The events are truncated to cover no more than 12 consecutive coefficients. Events of length 12 for which z+n=12 are indicated by “No zero at end; avoids escape” in FIG. 8F. Also, the event R(12,0) is shown and marked “All zeroes.”

[0086]
FIG. 9 shows Table 7 of collected or assumed relative likelihoods for events of runs of none or more zerovaluedcoefficients followed by a run of a number of nonzerovalued coefficients followed by a single zerovaluedcoefficient, except that some length 12 events according to an embodiment of the invention, do not so end. Those length12 events distinguished by having z+n=12 are shown in boldface, and may be used to avoid end or Escape codes.

[0087]
FIG. 10 shows Table 8 of variable length codes for the events shown in FIG. 9 according to the statistics of FIG. 9. The codes are for runs of none or more zerovaluedcoefficients followed by a run of nonzerovalued coefficients followed by a single zerovaluedcoefficient according to an embodiment of the invention.

[0088]
The amplitudes are encoded according an amplitude code, which in one embodiment is a variable length code described by a one dimensional amplitude table. Denote by Am the code for the amplitude m, m=1,2, . . .

[0089]
Consider again the series:

 5 10 03420 0020 10 30 000000000000 0000000010 000000000000 10 000000000000
 where the first value is the DC value. The events of the such a series, excluding the DC term and not including any sign data, are:
 R(0,1),R(1,3),R(2,1),R(0,1),R(0,1),R(12,0),R(8,1),R(12,0),R(0,1),End,
 where End indicates the remaining coefficients are all zerovalued. The series is encoded using Table 8 of FIG. 10 as:
 C(0,1)+A1+C(1,3)+A3+A4+A2+C(2,1)+A2+C(0,1)+A1+C(0,1)+A3+C(12,0)+C(8,1)+A1+C(12,0)+C(0,1)+A1+EOB,
 where EOB indicates the end of block, i.e., that the remainder of the series is zerovalued coefficients. Recall, again, that the above assumes no sign information and excludes the DC term.
Multiple Regions

[0096]
The inventors observed that in actual series of quantized transform coefficients of image blocks, there is typically at least one breakpoint that defines at least two regions such that nonzero coefficients cluster in one region, and tend to be scattered in the second region. This is the basis of the Basic and Extended Hybrid Coding Methods.

[0000]
Two regions

[0097]
The variable length coding method described herein is suitable for coding the whole region or any region. For example, the variable length coding method described is applicable to any region where nonzerovalued coefficients are clustered. According to the abovedescribed Basic Hybrid and Extended Hybrid VLC Methods, an event R′(z,n) would be encoded by two runlength coding tables and a single amplitude coding table. Using aspects of the present invention, such an event may be encoded by a single runlength coding table and a single amplitude coding table. Furthermore, there may be regions where the statistics for such events are significantly different. For example, the inventors observed that at the start of a block, the first cluster of quantized coefficients has larger amplitudes than the later clusters.

[0098]
In a first embodiment, the coding method includes establishing a breakpoint along the path of the ordering of the coefficients to identify a first, e.g., lowfrequency region and a second, e.g., high frequency region. The encoding of the coefficients in the first region includes identifying a joint event that includes a first run of one or more consecutive zerovalued coefficients followed by a second run of consecutive none or more nonvalued coefficients followed by a single zerovalued coefficient. Each such event is identified by the number of zerovalued coefficients in the first run and the number of zerovalued coefficients in the second run.

[0099]
In one version, each identified event only includes up to a predetermined number of coefficients, called the maximal length herein. In such a situation, there may be a need for encoding a sequence of consecutive zerovalued coefficients followed by a run of nonzero coefficients, with the two runlengths being greater than the maximal length. For example, if the maximal length is 12, there would be a need to encode the following:

[0101]
If any length events would be allowed, this would correspond to R(3,13). However, if the maximal length is 12, one embodiment splits this up into a first event:

 000xxxxxxxxxx
 and a second event:
 xxxx0.

[0105]
Thus, in one embodiment in which a maximal length is defined, possible events include sequences that have the maximal length, and that end in a sequence of one or more nonzerovalued coefficients without the ending zerovalued coefficient. Such events would typically be followed in a region. This provides for encoding an event with more than the predetermined number of coefficients as a plurality of events of at most the maximal length without using escape codes. Two or more events that together define a run of less than the maximal length zerovalued coefficients followed by a run of any length of nonzerovalued coefficients is called a “generalized event” herein in that it is treated as a single event for some purposes, including, for example, establishing the first and second region using what is called a soft boundary. See below for more details.

[0106]
Furthermore, when a maximal length id is defined for an event, an event of all zerovalued coefficients is also defined to provide for coding of a “generalized event” that includes more than the maximal length of zerovalued coefficients followed by one or more nonzero valued coefficients followed by a single zerovalued coefficient.

[0107]
How to establish the breakpoint is described in the Basic Hybrid Coding Method. One version uses a fixed breakpoint between the first, e.g., low frequency region, and the second, e.g., high frequency region. In one embodiment, the fixed breakpoint is predetermined for each type of image and for each type of compression method by running experiments collecting statistics on a set of typical samples such images. Typically, different breakpoints are determined for:

 intraframe and still image coding vs. interframe coding;
 standard definition television images (SDTV) vs. HDTV images;
 high bit rate coding methods vs. low bit rate coding methods;
 DCT vs. nonDCT transforms;
and so forth.

[0112]
When fixed breakpoints are used, there is already an indication passed on to the decoder to indicate the type of image, e.g., whether interframe or intraframe. Thus, there is typically no need to send a further indication to the decoder of the breakpoint.

[0113]
The inventors performed experiments on typical still images—applicable also to intraframe images in motion coding—by performing variable length coding according to embodiments of the present invention, and plotting the size of the compressed image for different breakpoint values for the case of 8 by 8 blocks quantized to 127 nonzero amplitudes using the DCT, and observed that a breakpoint of 22 worked for most images, although some images worked well with a breakpoint of about 12. Therefore, in one embodiment for intraframe and still images for DCT transform coding, a preselected fixed breakpoint of 22 was used.

[0114]
In a first variation, the breakpoint is image dependent and selected from a finite set according to a breakpoint selection criterion. For example, from the abovedescribed experiments, the compression using a first breakpoint of 22 was compared to the compression using a second breakpoint of 10, and the breakpoint that gave the higher compression was used. Other breakpoint selection criteria also are possible, e.g., by looking at the statistics of runs of zerovalued coefficients and nonzerovalued coefficients.

[0115]
When such an imagedependent breakpoint is used, an indication of the breakpoint is also sent with each set of coefficients. In one embodiment, a 2bit indication is sent. This provides for each block to be encoded using one of 4 predefined breakpoints. In an alternate embodiment, the indication of which predefined breakpoint is sent as a variable length code such that more common breakpoints are encoded by a shorter code.

[0116]
While typically, the set of possible breakpoints is a small subset of the possible positions in the series, in yet another variation, the image dependent breakpoint is selected from anywhere in the series, or, in an alternate variation, from anywhere along a subrange.

[0117]
In an improved embodiment, instead of the breakpoint defining a fixed boundary between the first and second region, called a “hard” boundary herein, or a set of breakpoints defining a set of hard breakpoints, such that an event or generalized event that includes a sequence of up to the maximal length of consecutive zerovalued coefficients followed by a run of nonzero values that crossed the breakpoint would be regarded as a generalized event in the first region up to the breakpoint. In such a case, the breakpoint defines what is called herein a “soft” boundary in that any event that started in the first region would be encoded in the first region even if it crossed the breakpoint. Thus, the actual boundary for a particular block of coefficients might extend beyond the breakpoint.

[0118]
FIG. 11 shows a table of actual statistics for events in a first region for a sample image with a breakpoint of 12 that forms a soft boundary. Note that this table includes a “skip” code to indicate to skip to the breakpoint, and corresponds to the event R(12,0) with the breakpoint at 12. In one alternate embodiment, any event R(12,0) within less that 12 coefficients from the boundary is also a skip event to skip to the start of the second regionapplicable to a hard boundary, while in a second alternate embodiment applicable to a soft boundary, such an event would be included in the next region, with the boundary moved to the start of such an event.

[0119]
In the above description, it is assumed that the signs of the nonzerovalued coefficients in each event are encoded using individual sign bits.

[0120]
The coefficients in the second, e.g., high frequency region also may be coded by a similar method, but using a different second coding table for the events matched to assumed or measured likelihoods of the events in the second region. Such a second coding table, for example, would take into account the more scattered nature of nonzero coefficients in the second region. For relatively lowbit rate interframe coded images, such a code table would also take into account that the nonzerovalued coefficients would likely be dominated by amplitude 1.

[0121]
In one alternate embodiment, traditional 2DVLC is used for the second region.

[0122]
In yet another alternate embodiment, the coefficients in the second region are encoded by a secondregion method described in the Basic Hybrid Method. That is, each run of none or more zerovalued coefficients in the second region followed by a single nonzerovalued coefficient is identified and encoded by a runlength code using a variable length coding table, and the amplitude of the nonzerovalued coefficient is encoded by an amplitude coding method typically different than the amplitude coding method used for coefficients in the first region. An EOB code is used to indicate all remaining coefficients are zerovalued. A sign bit is used to encode the sign of the nonzerovalued coefficient.

[0123]
In yet another alternate embodiment, the coefficients in the second region are encoded by a secondregion method described in the Extended Hybrid Method that assumed nonzerovalued coefficients are dominated by amplitide1 coefficients, such that no amplitude coding is used to encode an amplitude1 coefficient, and an exception code followed by a codeword is used to encode any nonamplitude1 coefficient. That is, each run of none or more zerovalued coefficients in the second region followed by a single nonzerovalued coefficient is identified and encoded by a runlength code using a variable length coding table. Any nonamplitide1, nonzero coefficient is identified by an exception code and, for example, encoded by an Escape code, and the amplitude of such nonzerovalued, nonamplitide1 coefficient is encoded by an amplitude coding method typically different than the amplitude coding method used for coefficients in the first region. An EOB code is used to indicate all remaining coefficients are zerovalued. A sign bit is used to encode the sign of the nonzerovalued coefficient.

[0000]
More than Two Regions

[0124]
An alternate embodiment includes more than two regions, i.e., more than one breakpoint defining the more than two regions. The inventors, for example, have observed that the first cluster of nonzerovalued coefficients often have larger amplitude values than later clusters of nonzerovalued coefficients. Therefore, in one embodiment, a first region is defined by the first event of a run of none or more zerovalued coefficients followed by a run of consecutive nonzerovalued coefficients followed by a single zerovalued coefficient. Such an event is coded using a first variable length code, e.g., a first variable length coding table. The amplitudes of the nonzerovalued coefficients are coded using a first amplitude coding method, e.g., a first variable length amplitude code. The signs of each nonzero coefficient also are encoded using a sign bit. The first variable length event code and the first amplitude coding method are constructed based on actual or assumed statistics for the first event in the series, ignoring the DC term.

[0125]
A breakpoint is selected to define a second and a third region. The coding of the coefficients of the second region includes identifying events that include a first run of one or more consecutive nonzerovalued coefficients followed by a single zerovalued coefficient, followed by a second run of consecutive none or more zerovalued coefficients. Each such event is identified by the number of nonzerovalued coefficients in the first run and the number of zerovalued coefficients in the second run. Each identified event only includes up to the maximal length of coefficients. Each identified event is encoded by a second variable length code, e.g., using a second variable length coding table. Furthermore, the amplitudes of the nonzerovalued coefficients are coded using a second amplitude coding method, e.g., a second variable length amplitude code. The signs of the nonzerovalued coefficients are encoded by corresponding sign bits. The third region is encoded by the method described for the high frequency region in the Extended Hybrid Method that assumed nonzerovalued coefficients are dominated by amplitide1 coefficients, such that no amplitude coding is used to encode an amplitude1 coefficient, and an exception code followed by a codeword is used to encode any nonamplitude1 coefficient.

[0126]
Other alternate methods that include more than two regions are also included in the scope of the invention. One coding method includes using two breakpoints to define a first, second, and third region. In the first region, runs of nonzerovalued coefficients and runs of zerovalued coefficients are identified, and the runlengths of the nonzeroamplitude and zeroamplitude coefficients are encoded using a first runlength coding: method and a second runlength coding method. In the second region, runs of coefficients of amplitudeone, and runs of zerovalued coefficients are identified, and the runlengths of the amplitudeone and zeroamplitude coefficients are encoded using a third runlength coding method and a fourth runlength coding method, respectively. In the third region, runs of zerovalued coefficients are identified, and the runlengths of such zerovaluedruns are encoded using a fifth runlength coding method.

[0127]
Alternate coding methods may be used for the third, e.g., highfrequency region, as described above for the tworegion methods. For example, the third region may use conventional 2DVLC, or in another embodiment, the third region can use the high frequency coding method of the Basic Hybrid Method, or in yet another embodiment in which it may be assumed that any nonzerovalued coefficients in the third region are dominated by amplitide1 coefficients, the third region can use the high frequency coding method of the Extended

[0000]
Hybrid Method.

[0128]
As an example, consider the series of quantized coefficients:

 5 00003420 00000030 000000 1000000000000 0010 000000000000 10 000000000000.

[0130]
Suppose the encoding is such that the first event defines the first region, and a breakpoint along the ordering defines the second and third regions. Suppose further that the first coefficient is the DC value, and let DC(a) be the codeword for a DC amplitude of quantized value a. Suppose further that the above described variable length coding of zerovalued runs followed by nonzerovalued runs is used, with a maximal length defined for any event. Denote by C0(z,n), C1(z,n), and C2(z,n), z=0,1, . . . , n=1, 2, . . . the variable length codewords for the first region event, events in the second region, and events in the third region respectively, each event being of z zerovalued coefficients followed by n nonzerovalued coefficients followed by a single zerovalued coefficient, unless z+n=the maximal length. For this example, suppose the breakpoint to define the second and third region is at 22 and defines a soft boundary. Let A0(a), A1(a) and A2(a) denote the codewords of an amplitude in the first, the second, and the third regions, respectively, as determined by a first, second, and third amplitude coding method. In one embodiment, these amplitude coding methods are variable length coding methods that differ. For example, in the first region, a large amplitude is more likelytooccur than in the second region. Such a relatively high amplitude is even less likelytooccur in the third region.

[0131]
Ignoring the signs of the amplitudes, the above series would be encoded as:

 DC(5)+C0(4,3)+A0(3)+A0(4)+A0(2)+C1 (6,1)+A1 (3)+C1 (12,0)+C2(8,1)+A2(1)+C2 (12,0)+C2(0,1)+A2(1)+EOB
 where EOB is a codeword indicating the end of table, and +denotes concatenation. Note that the run of six zerovalued coefficients before the breakpoint moves to the next region because the soft boundary moves to before the six zerovalued coefficients.

[0134]
Note that in this implementation, C0(12,0), C1(12,0) and C2(12,0) are the codewords for events of 12 zerovalued coefficients, or, if within 12 coefficients of a breakpoint, the codewords to indicate skiptobreakpoint in the case of a hard boundary, or the soft boundary moves to the start of the zerovalued coefficients of the event in the case of a soft boundary.

[0135]
In an actual implementation, each amplitude would also have a sign, and the encoding would also include a sign bit. Let S
_{+} and S
_{−} denote the code bits for a positive and negative amplitude, respectively. Suppose the series of quantized coefficients to encode is:

 5 0000+3−4−2+10 000000+30 000000 1000000 000000 00−10 000000000000+10 000000000000.

[0137]
The, with sign bits, according to the same embodiment, the series would be encoded as:

 DC(5)+C0(4,4)+A0(3)+S_{+}+A0(4)+S_{−}+A0(2)+S_{−}+A0(1)+S_{+}+C_{1}(6,1)+A1 (3)+S_{+}+C1 (12,0)++C2(8,1)+A2(1)+S_{−}+C2(12,0)+C2(0,1)+A2(1)+S_{+}+EOB.

[0139]
In another version the encoding of the nonzerovalues includes the sign.

[0000]
Apparatus

[0140]
Another aspect of the invention is an apparatus for coding a series of digital signals, e.g., an ordered series of quantized coefficients of a transformed block of image data. FIG. 12 shows an apparatus 1200 that includes a processing system 1202 that includes one or more processors 1204 and a memory 1206. A single processor is shown in FIG. 12 and those in the art will appreciate that this may represent several processors. Similarly, a single memory subsystem 1206 is shown, and those in the art will appreciate that the memory subsystem may include different elements such as RAM, ROM, and so forth. In addition, the memory subsystem is meant to include any nonvolatile memory storage such as a magnetic or optical storage component. A computer program 1208 is included and is loaded into the memory 1206. Note that at any time, some of the program may be in the different parts of the memory subsystem, as will be understood by those in the art. The program 1208 includes instructions to instruct the processor to implement, in different versions, the different coding methods described above. The processor thus accepts as data the ordered coefficients and generates the codewords. The apparatus 1200 further includes in the memory subsystem 1206 a coding data structure 1210 that provides the codewords for sets of one or more coefficients as described in any one of the novel coding methods described herein. In one embodiment, the data structure is in the form of one or more tables.

[0141]
Note that FIG. 12 does not show details such as bus structures, I/O structures, etc., that may be included since the need for such structures would be known to those in the art and their inclusion would only obscure the inventive aspects of the apparatus. Furthermore, the processing system may be implemented using one or more general purpose microprocessors, one or more microcontrollers that include several memory and other elements, one or more DSP devices, or any other programmable processors. Furthermore, the processors may be standalone devices, or may be implemented as “cores” to be included in an ASIC, gate array, or other device.

[0142]
Another aspect of the invention is a memory (such as memory 1206 in FIG. 12) that stores a coding data structure that provides the codewords for sets of one or more coefficients as described in any one of the novel coding methods described herein. In one embodiment, the data structure is in the form of one or more tables.

[0143]
Thus, a variable length coding method and apparatus has been described suitable for encoding the quantized transform coefficients of blocks of images as occur in common image compression methods.

[0144]
One embodiment of each of the methods described herein is in the form of a computer program that executes on a processing system, e.g., one or more processors that are part of an image coder. Thus, as will be appreciated by those skilled in the art, embodiments of the present invention may be embodied as a method, an apparatus such as a special purpose apparatus, an apparatus such as a data processing system, or a carrier medium carrying computer readable code, e.g., a computer program product or a carrier wave. The carrier medium carries one or more computer readable code segments for instructing a processing system to implement a method. Accordingly, aspects of the present invention may take the form of a method, an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of carrier medium (e.g., a computer program product on a computerreadable storage medium or a carrier wave) carrying computerreadable program code segments embodied in or carried by the medium.

[0145]
While the carrier medium is shown in an exemplary embodiment to be a single medium, the term “carrier medium” should be taken to include a single medium or multiple media (e.g., a centralized or distributed database, and/or associated caches and servers) that store the one or more sets of instructions. The term “carrier medium” shall also be taken to include any medium that is capable of storing, encoding or carrying a set of instructions for execution by the machine and that cause the machine to perform any one or more of the methodologies of the present invention. A carrier medium may take many forms, including but not limited to, nonvolatile media, volatile media, and transmission media. Nonvolatile media includes, for example, optical, magnetic disks, and magnetooptical disks. Volatile media includes dynamic memory, such as main memory. Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise a bus subsystem. Transmission media also may also take the form of acoustic or light waves, such as those generated during radio wave and infrared data communications. For example, the term “carrier medium” shall accordingly be taken to include, but not be limited to, solidstate memories, optical and magnetic media, and carrier wave signals.

[0146]
It will be understood that the methods discussed are performed in one embodiment by an appropriate processor (or processors) of a processing (i.e., computer) system executing instructions (code segments) stored in storage. It will also be understood that the invention is not limited to any particular implementation or programming technique and that the invention may be implemented using any appropriate techniques for implementing the functionality described herein. The invention is not limited to any particular programming language or operating system.

[0147]
Reference throughout this specification to “one embodiment” or “an embodiment” means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner, as would be apparent to one of ordinary skill in the art from this disclosure, in one or more embodiments.

[0148]
Similarly, it should be appreciated that in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

[0149]
It should further be appreciated that although the invention has been described in the context of transform encoding of images, the invention is not limited to such contexts and may be utilized in various other compression applications and systems. Furthermore, the invention is not limited to any one type of architecture or type of transform encoding. For example, the DCT is mentioned above as one transform. Other transforms may be used, e.g., the new H.264/MEG4 AVC video coding standard/draft standard defines 4×4 blocks and a DCTlike 4×4 integer transform. The invention does not depend on any particular type of interframe coding if used, or of motion compensation if used for interframe coding, or any intraestimation if used for estimating the pixels of a block using information from neighboring blocks.

[0150]
Note that variable length coding is sometimes referred to as entropy coding or statistical coding.

[0151]
Note that in some of the above examples for amplitude encoding, 127 possible nonzero values are assumed for the coefficients, the invention is not restricted to any number of possible quantization values.

[0152]
Note also that the term amplitude is irrespective of sign. Therefore, for example, coefficient of values +1 and −1 both have amplitude 1.

[0153]
In some of the embodiments described above, no sign data was included. Most transforms produce positive and negative coefficients, and the forming of the codeword includes an indication of the sign of any nonzerovalued coefficients. In one version, the sign information for any runs of nonzero amplitudes in any region is added together with the information of each amplitude. In an alternate embodiment, the sign information for any runs of nonzero amplitudes in any region may be included in a different manner, e.g., as a code for the series of signs. Other alternate embodiments are also possible for encoding the sign.

[0154]
Note that the terms coding and encoding are used interchangeably herein.

[0155]
Note also that the present invention does not depend on the particular type of VLC used for any of the coding methods, e.g., the coding tables, and can work, for example, with Huffman coding and with arithmetic coding methods. Furthermore, while embodiments have been described that used fixed encoding for the events based on assumed or a priori likelihoods of occurrence of the events (also called the symbols), i.e., the likelihoods of occurrence of the events do not change, other embodiments use adaptive encoding, i.e., the encoding is changeable according to statistical data such as histograms collected from the actual coefficients.

[0156]
All publications, patents, and patent applications cited herein are hereby incorporated by reference.

[0157]
Thus, while there has been described what is believed to be the preferred embodiments of the invention, those skilled in the art will recognize that other and further modifications may be made thereto without departing from the spirit of the invention, and it is intended to claim all such changes and modifications as fall within the scope of the invention. For example, any formulas given above are merely representative of procedures that may be used. Functionality may be added or deleted from the block diagrams and operations may be interchanged among functional blocks. Steps may be added or deleted to methods described within the scope of the present invention.