Z-coder: a fast adaptive binary arithmetic coder
Abstract
A binary arithmetic coder and decoder providesimproved coding accuracy due to improved probabilityestimation and adaptation. They also provide improveddecoding speed through a "fast path" design whereindecoding of a most probable symbol requires fewcomputational steps. Coded data represents data that ispopulated by more probable symbols ("MPS") and lessprobable symbols ("LPS"). In an embodiment, a decoderreceives a segment of the coded data as a binaryfraction C. It defines a coding interval of possiblevalues of C, the interval extending from a variablelower bound A to a constant upper bound 1. For eachposition in the decoded symbol string, the decodercomputes a test value Z that subdivides the codinginterval into sub-intervals according to the relativeprobabilities that an MPS or an LPS occurs in theposition. A first sub-interval extends from the lowerbound A to the test value Z; the second sub-intervalextending from the test value Z to 1. If C is greaterthan Z, the decoder emits an MPS for the currentposition in the decoded symbol string and sets the lowerbound A to the test variable Z for use during decodingof the next position in the decoded symbol string. If Cis less than Z, the decoder emits an LPS and computes anew lower bound A and a new binary fraction C for useduring decoding of the next position in the decodedsymbol string. The encoder operates according toanalogous techniques to compose coded data from originaldata.

Term
Term ended
Expired 27 July 2018, 8.2 years ago.
- Priority
- Filed
- Granted
- Expired
- Today
94 claims: 30 independent, 64 dependent
- 1CA 02244380 2001-07-11 CLAIMS :1. A method for encoding data, the data represented by a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS), the method comprising the steps of : initializing a code accumulator S;defining a coding interval extending from a variable lower bound A to a constant upper bound 1;for each position in the symbol string: computing a test value Z subdividing the coding interval into sub - intervals in accordance with the relative probabilities of an MPS and an LPS occurrence in the position, a first sub-interval extending from the lower bound A to the test value Z, the second subinterval extending from the test value Z to 1;if the symbol located at the current position in the symbol string is an MPS, setting the lower bound A to the test variable Z for use in encoding of a next position in the decoded symbol string;if the symbol located at the current position in the symbol string is an LPS, adding the length of the second sub-interval to the accumulator S, and computing a new lower bound A for use in encoding of a next position in the decoded symbol string;and when a predefined criterion is met, outputting a segment of coded data and computing new values for both the accumulator S and the lower bound A. CA 02244380 2001-07-11
- 4The method of claim 3, wherein k is 1/2.
- 5The method of claim 3, wherein k is 1/4.
- 6The method of claim 1, wherein the computation of the test value Z depends on the value of a parameter P approximating a probability of the occurrence of LPS symbols in the decoded symbol string, said method comprising the additional steps of :if the decoded symbol is an LPS, setting the parameter P to a value representing an increased estimated probability for the LPS symbol;and if the decoded symbol is an MPS;comparing the lower bound A with a threshold value M depending on P, and CA 02244380 2001-07-11 if the lower bound A is greater than the threshold value M, setting the parameter P to a value representing a decreased estimated probability for the LPS symbol.
- 10A method for decoding coded data into a decoded symbol string populated by more probable symbols (MPS) and less probable symbols (LPS), the method comprising the steps of :receiving a segment of coded data interpreted as a binary fraction C;defining a coding interval of possible values of C, the interval extending from a variable lower bound A to a constant upper bound 1;for each position in the decoded symbol string: computing a test value Z subdividing the coding interval in sub-intervals in accordance with the relative probabilities that an MPS and an LPS occurrence in the position, a first sub-interval extending from the lower bound A to the test value Z, the second sub-interval extending from the test value Z to 1, the computing step comprising : computing a first test value Z1 derived from the lower bound A and from a current estimate P of the probability of the LPS symbol, computing a second test value Z2 derived from the lower bound A and from the current estimate P of the probability of the LPS symbol, and CA 02244380 2001-07-11 setting the test value Z to the lesser of Z1 and Z2;if C is greater than Z: placing an MPS at the current position in the decoded symbol string, and setting the lower bound A to the test variable Z for use in decoding of a next position in the symbol string;and if C is less than Z: placing an LPS at the current position in the decoded symbol string, and computing a new lower bound A and a new binary fraction C for use in decoding of the next position in the decoded symbol string.
- 26A method of decoding coded data into a decoded symbol string, the decoded data represented by a symbol string of more probable symbols (MPS”) and less probable symbols (LPS), the method comprising:receiving a segment of coded data interpreted as a binary fraction, for a position in the decoded symbol string: defining an interval of possible values of the coded data, the interval bounded by 1 and a lower bound, computing a test variable that divides the interval into two sub-intervals according to relative probabilities that the symbol should be occupied by the MPS or the LPS, a first sub-interval extending from 1 to the test variable and associated with the MPS, a second sub-interval extending from the test variable to the lower bound and associated with the LPS, the computing step comprising: computing a first test value Z1 derived from the lower bound A and from a current estimate P of the probability of the LPS symbol, computing a second test value Z2 derived from the lower bound A and from the current estimate P of the probability of the LPS symbol, and setting the test value Z to the lesser of Z1 and Z2;when the coded data segment occupies the first subinterval, placing an MPS in the position, and CA 02244380 2001-07-11 when the coded data segment occupies the second subinterval, placing an LPS in the position.
- 27A method of decoding coded data into decoded data, the decoded data represented by a symbol string of more probable symbols (MPS) and less probable symbols (LPS), the method comprising:receiving a segment of coded data interpreted as a binary fraction, for a position in the decoded symbol string, defining an interval of possible values of the coded data, the interval bounded by 1 and a lower bound, computing a test variable that divides the interval into two sub-intervals according to relative probabilities that the symbol should be occupied by the MPS or the LPS, a first sub-interval extending from 1 to the test variable and associated with the MPS, a second sub-interval extending from the test variable to the lower bound and associated with the LPS, computing a fence variable to be the lesser of the coded data segment and 1/2, and when the test variable is less than the fence variable, placing an MPS in the position.
- 32A method of decoding coded data into decoded data, comprising the steps of:receiving a segment of coded data interpreted as a binary fraction, for a position in the decoded symbol string, defining an interval of possible values of the coded data, the interval bounded by 1 and a lower bound, computing a test variable that divides the interval into two sub-intervals according to relative probabilities that the symbol should be occupied by the MPS or the LPS, a first sub-interval extending from 1 to the test variable and associated with the MPS, a second CA 02244380 2001-07-11 3 5 sub-interval extending from the test variable to the lower bound and associated with the LPS, computing a fence variable to be the lesser of the coded data segment and 1/2, decoding an MPS for the position when either of the following conditions occur: the test variable is less than the fence variable, and when the test variable is less than the segment of coded data, and decoding an LPS for the position and performing LPS adaptation when neither of the conditions occur.
- 34A method of decoding coded data, the coded data representing a sequence of symbols including a most probable symbol (MPS) and a least probable symbol (LPS), the method comprising:receiving a segment of the coded data as a fractional value;initializing a variable representing a lower limit on possible values of the segment of coded data to equal zero;and iteratively, calculating a test variable that divides an interval from the lower limit to one according to relative probabilities that a next symbol to be decoded is an LPS or an MPS, CA 02244380 2001-07-11 calculâting a fence variable representing the lesser of one half and the value of segment of coded data, decoding the next symbol to be an MPS when the test variable is less than the fence variable, otherwise, decoding the next symbol to be an MPS when the test variable is less than the value of segment of coded data, otherwise, decoding the next symbol to be an LPS, when an MPS is decoded, setting the lower limit for a next iteration equal to the test variable, and when an LPS is decoded, setting the lower limit and the segment of coded data equal to their respective values for the instant iteration added by an amount equal to the difference between the test variable and 1.
- 37A decoder adapted to perform the following functions :receive a segment of the coded data as a fractional value ;initialize a variable representing a lower limit on possible values of the segment of coded data to equal zero;and iteratively, CA 02244380 2001-07-11 calculate a test variable that divides an interval from the lower limit to one according to relative probabilities that a next symbol to be decoded is an LPS or an MPS, calculate a fence variable representing the lesser of one half and the value of segment of coded data, decode the next symbol to be an MPS when the test variable is less than the fence variable, otherwise, decode the next symbol to be an MPS when the test variable is less than the value of segment of coded data, otherwise, decode the next symbol to be an LPS, when an MPS is decoded, set the lower limit for a next iteration equal to the test variable, and when an LPS is decoded, set the lower limit and the segment of coded data equal to their respective values for the instant iteration added by an amount equal to the difference between the test variable and 1.
- 40A method for simultaneously decoding coded data into a decoded symbol string populated with symbols of a CA 02244380 2001-07-11 first and second kind, and for adapting a plurality of integer states whose values are representative of a probability distribution of the symbols , comprising the steps of :receiving a segment of coded data interpreted as a binary fraction C;for each position in the decoded symbol string: determining which integer state is representative of the probability distribution of the symbol located at said position in the decoded symbol string;defining a coding interval of possible values of C, the interval extending from a variable lower bound A to a constant upper bound 1 ;retrieving a parameter P L ps from a table indexed by the integer state, said parameter P L ps approximating a probability of occurrence of the LPS at the position in the decoded symbol string;computing a test value Z subdividing the coding interval in sub-intervals in accordance with the value of Plps, a first sub-interval extending from the lower bound A to the test value Z, the second sub-interval extending from the test value Z to 1;if C is less than Z: placing the LPS at the current position in the decoded symbol string, computing a new lower bound A and a new binary fraction C for use in decoding of the next position in the decoded symbol string, and CA 02244380 2001-07-11 modifying the value of said integer state to a new integer representing an increased estimated probability of the LPS;if C is greater than Z: placing the MPS at the current position in the decoded symbol string, setting the lower bound A to the test variable Z for use in decoding of the next position in the symbol string, retrieving a threshold parameter M from a table indexed by the integer state, said table containing different threshold values for different integer states, if A is greater than M, modifying the value of said integer state to a new integer representing a decreased estimated probability of the LPS.
- 41A method for simultaneously decoding coded data into a decoded symbol string populated with symbols of a first and second kind, and for adapting a plurality of integer states whose values are representative of the probability distribution of the symbols, comprising the steps of :receiving a segment of coded data interpreted as a binary fraction C;for each position in the decoded symbol string: determining which integer state is representative of the probability distribution of the symbol located at said position in the decoded symbol string;CA 02244380 2001-07-11 determining one of the symbol kinds to be a most probable symbol (MPS), the other to be a least probable symbol (LPS), defining a coding interval of possible values of C, the interval extending from a variable lower bound A to a constant upper bound 1 ;retrieving a parameter P IjPS from a table indexed by the integer state, said parameter P LPS approximating the estimated probability of occurrence of the LPS at said position in the decoded symbol string;computing a test value Z subdividing the coding interval in sub-intervals in accordance with the value of parameter P LPS , a first sub-interval extending from the lower bound A to the test value Z, the second sub- interval extending from the test value Z to 1, if C is less than Z : placing the LPS at the current position in the decoded symbol string, and computing a new lower bound A and a new binary fraction C for use in decoding of the next position in the decoded symbol string, and modifying the value of said integer state to a new integer representing an increased estimated probability of the LPS;and if C is greater than Z: placing the MPS at the current position in the decoded symbol string, setting the lower bound A to the test variable Z for use in decoding of the next position in the symbol string, and CA 02244380 2001-07-11 retrieving a threshold parameter M from a table indexed by the integer state, said table containing different threshold values for integer state, and if Z is greater than M, modifying the value of said integer state to a new integer representing a decreased estimated probability of the LPS.
- 42A method for decoding coded data into a decoded symbol string populated by more probable symbols (MPS) and less probable symbols (LPS), the method comprising the steps of :receiving a segment of coded data interpreted as a binary fraction C;defining a coding interval of possible values of C, the interval extending from a variable lower bound A to a constant upper bound 1;retrieving, from an index table, a parameter (Plps) approximating a probability of an LPS occurrence in the decoded symbol string and an increment parameter p representing an optimal increment of P LPS when an LPS symbol occurs in the symbol stream, for each position in the decoded symbol string: computing a test value Z subdividing the coding interval in sub-intervals in accordance with relative probabilities of an MPS and an LPS occurrence in the position, a first sub-interval extending from the lower bound A to the test value Z, the second sub-interval extending from the test value Z to 1, if C is less than Z: CA 02244380 2001-07-11 placing an LPS at the current position in the decoded symbol string, and computing a new lower bound A and a new binary fraction C for use in decoding of the next position in the decoded symbol string, and incrementing P LPS by p for a subsequent iteration;and if C is greater than Z: placing an MPS at the current position in the decoded symbol string, and setting the lower bound A to the test variable Z for use in decoding of a next position in the symbol string, and comparing the lower bound A with a threshold value m in [1/2-p, 1/2] and, if A m, reducing p for a subsequent iteration to a value representing a decreased estimated probability of an LPS occurrence.
- 43A method for decoding coded data into a decoded symbol string populated by more probable symbols (MPS) and less probable symbols (LPS), the method comprising the steps of :receiving a segment of coded data interpreted as a binary fraction C;defining a coding interval of possible values of C, the interval extending from a variable lower bound A to a constant upper bound 1;retrieving, from an index table, a parameter (Plps) approximating a probability of an LPS occurrence in the decoded symbol string and an increment parameter p CA 02244380 2001-07-11 representing an optimal increment of P LPS when an LPS symbol occurs in the symbol stream, for each position in the decoded symbol string: computing a test value Z subdividing the coding interval in sub-intervals in accordance with relative probabilities of an MPS and an LPS occurrence in the position, a first sub-interval extending from the lower bound A to the test value Z, the second sub-interval extending from the test value Z to 1, if C is less than Z: placing an LPS at the current position in the decoded symbol string, and computing a new lower bound A and a new binary fraction C for use in decoding of the next position in the decoded symbol string, and incrementing P ]jPS by p for a subsequent iteration;and if C is greater than Z: placing an MPS at the current position in the decoded symbol string, and setting the lower bound A to the test variable Z for use in decoding of a next position in the symbol string, and comparing the test value Z with a threshold value m in [1/2-p, 1/2] and, if Z m, reducing p for a subsequent iteration to a value representing a decreased estimated probability of an LPS occurrence.
- 44A method for decoding a coded string into a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS), comprising:CA 02244380 2001-07-11 interpreting the;coded string as a binaryfraction;creating a coding interval defined by a variable lower bound value and 1 ;calculating a test value;dividing the coding interval into lower subinterval and an upper subinterval, the lower subinterval extending from the lower bound value to the test value and the upper subinterval extending from the test value to 1;placing an LPS into the symbol string and incrementing the lower bound value and coded string by a lies within predetermined amount when the coded string the lower subinterval, the predetermined amount being equal to the quantity 1 minus the test value;and placing an MPS into the symbol string and setting the lower bound value equal to the test value when the coded string lies within the upper subinterval.
- 50The method of claim 49, wherein k = 1/4.
- 52The method of claim 49, further comprising :of calculating a fence value to be the lesser the code string or 1/2;and CA 02244380 2001-07-11 placing an MPS into the symbol string and setting the lower bound value equal to the test value if the first intermediate test value is less than the fence value .
- 56A method for encoding a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS) into a coded string, comprising:calculating a test value ;incrementing a variable lower bound value and an accumulator value by a predetermined amount when the symbol to be coded is an LPS, the predetermined amount being equal to the quantity 1 minus the test value;setting the lower bound value equal to the test value when the symbol to be coded is an MPS;calculating an accumulator difference value as the quantity 1 minus the accumulator value;and placing the most significant bit of the accumulator difference value into the coded string and shifting the CA 02244380 2001-07-11 bits of the lower bound value and the accumulator value one bit position to the left when the lower bound value is less than 1/2.
- 60The method of claim 59, wherein k = 1/4.
- 62An apparatus for decoding a coded string into a symbol string populated by more probable symbols (MPS) CA 02244380 2001-07-11 and less probable symbols (LPS), comprising a processor adapted to:interpret a coded string as a binary fraction;create a coding interval defined by a variable lower bound value and 1;calculate a test value;divide the coding interval into a lower subinterval and an upper subinterval, the lower subinterval extending from the lower bound value to the test value and the upper subinterval extending from the test value to 1 ;place an LPS into the symbol string and increment the lower bound value and coded string by a predetermined amount when the coded string lies within the lower subinterval, the predetermined amount being equal to the quantity 1 minus the test value;and place an MPS into the symbol string and set the lower bound value equal to the test value when the coded string lies within the upper subinterval.
- 63The apparatus of claim 62, wherein said processor is further adapted to :re-normalize the lower bound value and the coded string when the most significant bit positions of the lower bound value and the coded string are equal to 1;and consume the most significant bit positions of the lower bound value and the coded string. CA 02244380 2001-07-11
- 72An apparatus for encoding a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS) into a coded string, comprising a processor adapted to:calculate a test value;increment the lower bound value and the accumulator value by a predetermined amount when the symbol to be coded is an LPS, the predetermined amount being equal to the quantity 1 minus the test value;set the lower bound value equal to the test value when the symbol to be coded is an MPS ;calculate an accumulator difference value as the quantity 1 minus the accumulator value;and place the most significant bit of the accumulator difference value into the coded string and shift the bits of the lower bound value and the accumulator value one CA 02244380 2001-07-11 bit position to the left when the lower bound value is less than 1/2.
- 77An encoded data signal representing a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS) generated according to the process of :calculating a test value;incrementing a variable lower bound value and an accumulator value by a predetermined amount when the CA 02244380 2001-07-11 symbol to be coded is an LPS, the predetermined amount being equal to the quantity 1 minus the test value;setting the lower bound value equal to the test value when the symbol to be coded is an MPS ;calculating an accumulator difference value as the quantity 1 minus the accumulator value;and placing the most significant bit of the accumulator difference value into the coded string and shifting the bits of the lower bound value and the accumulator value one bit position to the left when the lower bound value is less than 1/2.
- 80The data signal of claim 79, wherein k = 1/4. CA 02244380 2001-07-11
- 82A computer-readable medium having stored thereon a plurality of instructions for decoding a coded string into a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS), which, when executed by a processor, cause the processor to:interpret a coded string as a binary fraction;create a coding interval defined by a variable lower bound value and 1;calculate a test value;divide the coding interval into a lower subinterval upper subinterval, the lower subinterval extending from the lower bound value to the test value and the upper subinterval extending from the test value to 1;place an LPS into the symbol string and increment the lower bound value and coded string by a predetermined amount when the coded string lies within the lower subinterval, the predetermined amount being equal to the quantity 1 minus the test value;and place an MPS into the symbol string and set the lower bound value equal to the test value when the coded string lies within the upper subinterval.
- 84The computer readable medium of claim 83, wherein the decoding is completed when all the bits in the coded string are consumed.
- 85The computer readable medium of claim 83, further comprising instructions that cause the processor to :shift the bits of the coded string one position to the left;and add a new coded bit to the least significant bit position of the coded string.
- 88The computer readable medium of claim 87, wherein k = 1/4
- 898 9. The computer readable medium of claim 82, further comprising instructions that cause the processor to :calculate a fence value to be the lesser of the code string or 1/2;and place an MPS into the symbol string and set the lower bound value equal to the test value if the first intermediate test value is less than the fence value.
- 92A computer-readable medium having stored thereon a plurality of instructions for encoding a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS) into a coded string, which, when executed by a processor, cause the processor to:CA 02244380 2001-07-11 calculate a test value;increment the lower bound value and the accumulator value by a predetermined amount when the symbol to be coded is an LPS, the predetermined amount being equal to the quantity 1 minus the test value;set the lower bound value equal to the test value when the symbol to be coded is an MPS;calculate an accumulator difference value as the quantity 1 minus the accumulator value;and place the most significant bit of the accumulator difference value into the coded string and shift the bits of the lower bound value and the accumulator value one bit position to the left when the lower bound value is less than 1/2.
Independent claims30
166 paragraphs in 27 sections, as filed
CA 02244380 1998-07-27
Z-CODER: A FAST ADAPTIVE BINARY ARITHMETIC CODER
BACKGROUND OF THE INVENTION
Fiald of th· Invention
The present invention relates to an improved adaptive binary arithmetic coder that provides improved processing speed and accuracy over conventional arithmetic coders.
Related Art
Arithmetic coders provide well-known algorithms for encoding data. Compression ratios of the arithmetic coders can reach the information theory limit. The arithmetic coder and decoder must possess good estimates of the probability distribution of each symbol to code. For each symbol to be coded in a string element, the encoder and decoder must possess a table containing estimated probabilities for the occurrence of each possible symbol at each point in the symbol string. The coders themselves must perform a table search and at least one multiplication. For this reason, arithmetic coders incur high computational expense. Binary adaptive arithmetic coders, such as the Q-Coder, by Pennebaker, et al. (1998) and the QM-Coder, by Ono (1993), have been developed to overcome this drawback.
CA 02244380 1998-07-27
A high-level system diagram of a prior art binary arithmetic coder is shown in FIG. 1. Data to be coded is input to an encoder 100. The encoder 100 encodes the data and outputs a string of coded data to a channel 200. A decoder 300 retrieves the code string from the channel 200 and replicates the original data by decoding the coded data.
The coding process often is described by the operation of the decoder 300. In the decoder, the code string is interpreted as a binary representation of a real number contained in the unit interval [0,1 [. The binary arithmetic coder divides the unit interval into two sub-intervals having lengths that are proportional to the estimated probabilities of each value of the first bit in the symbol string. Any code string located in a first, lower sub-interval represents a symbol string starting with a zero (0) . Conversely, any code string located in the upper sub-interval represents a symbol string starting with a one (1).
Each of the sub-intervals can be divided into two smaller sub-intervals having lengths that are proportional to the estimated conditional probabilities of the second symbol bit given the previously encoded symbol bit. Any code string located in one of these sub-intervals represents a symbol string starting with the corresponding two bit prefix.
The decoding process is repeated. Sub-intervals are themselves divided into smaller sub-intervals
CA 02244380 1998-07-27 representing probabilities of the value of the next bit in the symbol string. The process produces a partition of the unit interval having sub-intervals that correspond to each possible value of the symbol string. Any code string in the interval can be chosen corresponding to the encoded symbol string.
According to theory, when an interval is divided into sub-intervals, the length of each sub-interval should be proportional to the probability of the value of the next data symbol to be decoded given the previous symbol bits. The probability distribution of the code string therefore would be uniform in the interval. Since each code bit is equally likely to be a 0 or a 1, it would carry as much information as information theory allows. In other words, the coder would achieve entropie compression.
The known Q-Coder and QM-Coder, while they represent advances over traditional arithmetic coders, do not provide performance that approaches entropie compression. Thus, there is a need in the art for a binary arithmetic coder that provides improved compression ratios than the Q-Code and the QM-Coder.
Decoding speed is an important performance characteristic of data coding systems. Decoding latency, the time that is required to generate decoded data once the coded data is received should be minimized wherever possible. Thus, decoders that introduce lengthy or complex computational processes to the
CA 02244380 1998-07-27 decoding operation are disfavored. Accordingly, there is a need in the art for a data decoding scheme that is computationally simple and provides improved throughput of decoded data.
SUMMARY OF THE INVENTION
The present invention provides a binary arithmetic coder and decoder having important advantages over the prior art. The coding scheme provides improved coding accuracy over the prior art due to improved probability estimation and adaptation. It provides improved decoding speed through a fast path design wherein decoding of a most probable symbol requires few computational steps.
According to the present invention, coded data represents data that is populated by more probable symbols (MPS”) and less probable symbols (LPS). In an embodiment, the decoder receives a segment of the coded data as a binary fraction C. It defines a coding interval of possible values of C, the interval extending from a variable lower bound A to a constant upper bound 1. For each position in the decoded symbol string, the decoder computes a test value Z that subdivides the coding interval into sub-intervals according to the relative probabilities that an MPS or an LPS occurs in the position. A first sub-interval extends from the lower bound A to the test value Z; the second subinterval extending from the test value Z to 1. If C is greater than Z, the decoder emits an MPS for the current
CA 02244380 2001-07-11 position in the decoded symbol string and sets the lower bound A to the test variable Z for use during decoding of the next position in the decoded symbol string. If C is less than Z, the decoder emits an LPS and computes a new lower bound A and a new binary fraction C for use during decoding of the next position in the decoded symbol string. The encoder operates according to analogous techniques to compose coded data from original data.
In accordance with one aspect of the present invention, there is provided a method for encoding data, the data represented by a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS), the method comprising the steps of: initializing a code accumulator S; defining a coding interval extending from a variable lower bound A to a constant upper bound 1; for each position in the symbol string: computing a test value Z subdividing the coding interval into sub-intervals in accordance with the relative probabilities of an MPS and an LPS occurrence in the position, a first sub-interval extending from the lower bound A to the test value Z, the second sub-interval extending from the test value Z to 1; if the symbol located at the current position in the symbol string is an MPS, setting the lower bound A to the test variable Z for use in encoding of a next position in the decoded symbol string; if the symbol located at the current position in the symbol string is an LPS, adding the length of the second sub-interval to the accumulator S, and computing a new lower bound A for use in encoding of
CA 02244380 2001-07-11
5a a next position in the decoded symbol string; and when a predefined criterion is met, outputting a segment of coded data and computing new values for both the accumulator S and the lower bound A.
In accordance with another aspect of the present invention, there is provided a method of decoding coded data into a decoded symbol string, the decoded data represented by a symbol string of more probable symbols (MPS) and less probable symbols (LPS), the method comprising: receiving a segment of coded data interpreted as a binary fraction, for a position in the decoded symbol string: defining an interval of possible values of the codeci data, the interval bounded by 1 and a lower bound, computing a test variable that divides the interval into two sub-intervals according to relative probabilities that the symbol should be occupied by the MPS or the LPS, a first sub-interval extending from 1 to the test variable and associated with the MPS, a second sub-interval extending from the test variable to the lower bound and associated with the LPS, the computing step comprising: computing a first test value Z1 derived from the lower bound A and from a current estimate P of the probability of the LPS symbol, computing a second test value Z2 derived from the lower bound A and from the current estimate P of the probability of the LPS symbol, and setting the test value Z to the lesser of Z1 and Z2 ; when the coded data segment occupies the first subinterval, placing an MPS in the position, and when the coded data segment occupies the second sub-interval, placing an LPS in the position.
CA 02244380 2001-07-11
5b
In accordance with yet another aspect of the present invention, there is provided a method of decoding coded data into decoded data, the decoded data represented by a symbol string of more probable symbols (MPS) and less probable symbols (LPS), the method comprising: receiving a segment of coded data interpreted as a binary fraction, for a position in the decoded symbol string, defining an interval of possible values of the coded data, the interval bounded by 1 and a lower bound, computing a test variable that divides the interval into two sub-intervals according to relative probabilities that the symbol should be occupied by the MPS or the LPS, a first sub-interval extending from 1 to the test variable and associated with the MPS, a second subinterval extending from the test variable to the lower bound and associated with the LPS, computing a fence variable to be the lesser of the coded data segment and 1/2, and when the test variable is less than the fence variable, placing an MPS in the position.
In accordance with still yet another aspect of the present invention, there is provided a method for decoding a coded string into a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS) , comprising: interpreting the coded string as a binary fraction; creating a coding interval defined by a variable lower bound value and 1; calculating a test value; dividing the coding interval into a lower subinterval and an upper subinterval, the lower subinterval extending from the lower bound value to the test value and the upper subinterval extending from the
CA 02244380 2001-07-11
5c test value to 1; placing an LPS into the symbol string and incrementing the lower bound value and coded string by a predetermined amount when the coded string lies within the lower subinterval, the predetermined amount being equal to the quantity 1 minus the test value; and placing an MPS into the symbol string and setting the lower bound value equal to the test value when the coded string lies within the upper subinterval.
In accordance with stillyet another aspect of the present invention, there is provided a method for encoding a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS) into a coded string, comprising: calculating a test value; incrementing a variable lower bound value and an accumulator value by a predetermined amount when the symbol to be coded is an LPS, the predetermined amount being equal to the quantity 1 minus the test value; setting the lower bound value equal to the test value when the symbol to be coded is an MPS; calculating an accumulator difference value as the quantity 1 minus the accumulator value; and placing the most significant bit of the accumulator difference value into the coded string and shifting the bits of the lower bound value and the accumulator value one bit position to the left when the lower bound value is less than 1/2.
In accordance with still yet another aspect of the present invention, there is provided an apparatus for decoding a coded string into a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS), comprising a processor adapted to: interpret a
CA 02244380 2001-07-11
5d coded string as a binary fraction; create a coding interval defined by a variable lower bound value and 1; calculate a test value; divide the coding interval into a lower subinterval and an upper subinterval, the lower subinterval extending from the lower bound value to the test value and the upper subinterval extending from the test value to 1; place an LPS into the symbol string and increment the lower bound value and coded string by a predetermined amount when the coded string lies within the lower subinterval, the predetermined amount being equal to the quantity 1 minus the test value; and place an MPS into the symbol string and set the lower bound value equal to the test value when the coded string lies within the upper subinterval.
In accordance with still yet another aspect of the present invention, there is provided an apparatus for encoding a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS) into a coded string, comprising a processor adapted to: calculate a test value; increment the lower bound value and the accumulator value by a predetermined amount when the symbol to be coded is an LPS, the predetermined amount being equal to the quantity 1 minus the test value; set the lower bound value equal to the test value when the symbol to be coded is an MPS; calculate an accumulator difference value as the quantity 1 minus the accumulator value; and place the most significant bit of the accumulator difference value into the coded string and shift the bits of the lower bound value and the
CA 02244380 2001-07-11
5e accumulator value one bit position to the left when the lower bound value is less than 1/2.
In accordance with still yet another aspect of the present invention, there is provided an encoded data signal representing a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS) generated according to the process of: calculating a test value; incrementing a variable lower bound value and an accumulator value by a predetermined amount when the symbol to be coded is an LPS, the predetermined amount being equal to the quantity 1 minus the test value; setting the lower bound value equal to the test value when the symbol to be coded is an MPS; calculating an accumulator difference value as the quantity 1 minus the accumulator value; and placing the most significant bit of the accumulator difference value into the coded string and shifting the bits of the lower bound value and the accumulator value one bit position to the left when the lower bound value is less than 1/2.
In accordance with still yet another aspect of the present invention, there is provided a computer-readable medium having stored thereon a plurality of instructions for encoding a symbol string populated by more probable symbols (MPS) and less probable symbols (LPS) into a coded string, which, when executed by a processor, cause the processor to: calculate a lower bound value and the predetermined amount when the test value; increment the accumulator value by a symbol to be coded is an
LPS, the predetermined amount being equal to the quantity minus the test value; set the lower bound value equal
CA 02244380 2001-07-11
5f to the test value when the symbol to be coded is an MPS; calculate an accumulator difference value as the quantity 1 minus the accumulator value; and place the most significant bit of the accumulator difference value into the coded string and shift the bits of the lower bound value and the accumulator value one bit position to the left when the lower bound value is less than 1/2.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a high-level system block diagram of a known binary arithmetic coder.
FIG. 2 illustrates a method of operation of a decoder according to a first embodiment of the present invention .
FIGS. 3 and 4 respectively illustrate interval parameters as a function of interval splitting variables in an entropie coding application and a QM Coder of the prior art.
FIG. 5 illustrates interval parameters as a function of an interval splitting variable in the present invention.
FIG. 6 illustrates a method of operation of a decoder according to a second embodiment of the present invention.
CA 02244380 1998-07-27
FIG. 7 illustrates a method of operation of an encoder according to an embodiment of the present invention.
FIG. 8 is a graph illustrating a comparison between an optimal increment parameter and an increment parameter in use in an embodiment of the present invention.
FIG. 9 illustrates a method of operation of a decoder according to a third embodiment of the present invention.
DETAILED DESCRIPTION
The present invention provides a data coding system, labeled the Z-Coder, that provides improved compression ratios over traditional binary arithmetic coders. The decoder of the Z-Coder system may be optimized to provide very fast decoding of coded data.
To facilitate an understanding of the invention, the decoding scheme of the present invention is described first. A method of operation 1000 of a decoder according to a first embodiment of the present invention is shown in FIG. 2. The decoder decodes a coded data string, labeled C(t), into decoded data. The decoded data is a string of symbols that may be either a most probable symbol (MPS) or a least probable symbol (LPS). C(t) is treated by the decoder as a binary fraction. For example, a coded data string 1010101011111111 is treated as 0.1010101011111111.
CA 02244380 1998-07-27
When C(t) is received and before the decoder tests its value, C(t) may take any value between 0 and 1 (C(t)e [0,l[) . The decoder maintains a second variable, labeled A(t), that represents a lower bound of possible values of C(t). Thus, the decoder sets A(l)=0 as an initial step (Step 1010) and further sets C(l) to a code string received from the channel (Step 1020).
Decoding of the t<sup>th</sup> code symbol operates according to steps 1030-1080. At step 1030, the decoder computes a test variable, labeled Z(t), that divides the interval [A(t),l[ in proportion to the relative probabilities of MPS and LPS (Step 1030) . The decoder compares the actual value of C(t) against the test variable Z(t) to determine which is greater (Step 1040). If C(t) is greater than Z(t), the decoder determines that the next symbol to be decoded is a MPS (Step 1050). The decoder sets A (t+1)=Z(t) , because Z(t) is established as the lower bound of C(t) (Step 1060).
However, if C(t) is less than Z(t), the next bit to be decoded is the LPS (Step 1070) . When a least probable symbol occurs, C(t) falls between A(t) and Z(t) . To prepare for the next decoding iteration, C(t+1) should be bounded by A(t+1) and 1. Accordingly, the decoder shifts the values of A(t) and C(t) in an amount sufficient to shift Z(t) to 1, the higher bound of C(t) (Step 1080). A(t+1)=A(t)+1-Z(t) and
C(t+l)=C(t)+l-Z(t).
CA 02244380 1998-07-27
After step 1060 or step 1080, the decoder may renormalize the variables A(t) and C(t) (Step 1070). Renormalization occurs when the most significant bit positions of C(t) and of A(t) are equal to one. When this occurs, the most significant bit position provides no more useful information to the decoding of data.
The most significant bit position is consumed by the decoding process.
The decoder of the present invention may be implemented in a microprocessor or digital signal processor. In such an implementation, and C(t) are stored in data registers having a fixed length, such as 16 bit registers.
Renormalization causes shift of data in each register one bit position to the left. It shifts the most significant bit out of
The storing C(t) permits a shift of data in the register new bit to be retrieved from the channel and stored in the least significant position in the register.
Because A(t) is always less than or equal to C(t), it is necessary to test only the first bit position of A(t) . If that bit position is a one (1), then the decoder determines that renormalization shift should be performed.
The method of FIG. 2 works so long as both the encoder and the decoder use the same test values Z(t} for testing and adjusting the lower bound of register A(t) .
CA 02244380 1998-07-27
The Z-Coder provides compression ratios that approach entropie compression ratios. It provides a closer approximation of entropie compression than prior art coders. Entropie compression is achieved when Z(t) splits the interval [A(t),l[ precisely in proportion with the probabilities P<sub>LP</sub>s and P<sub>MPS</sub>. For entropie compression :
Ze(t)= 1-(1-P<sub>LPS</sub>) (l-A(t) ) =A(t)+P<sub>LPS</sub> (l-A(t) )
Unfortunately, calculation of a test value that achieves entropie compression would require a multiplication to be performed, a computationally slow operation. FIG. 3 illustrates lines representing the test value Z(t) as a function of P<sub>LPS</sub> for several values of A(t) under entropie conditions. The multiplication arises because each line has a different slope. FIG. 4 illustrates an approximation used by the QM-Coder implemented to avoid the slow multiplications. The QM-Coder deviates significantly from entropie compression.
The Z-Coder avoids slow multiplications. The ZCoder computes an approximation of the entropie test value using two line segments having constant slopes. Shown in FIG. 5, the first line segment has slope 1. It is used for small values of P<sub>LPS</sub>. The second line segment has slope k and is used for large values of P<sub>LPS</sub>.
This solution is implemented by computing Z(t) as the minimum of the two following quantities:
(first line segment)
Zl(t) = A(t)+p
CA 02244380 1998-07-27
Z2(t) = 1/2 + A(t)/2 + k(p-l/2) (second line segment) where p is approximately equal to but slightly lower than P<sub>L</sub>ps · The computation of Zl(t) involves only an addition, a computationally efficient operation. The computation of Z2(t) requires a multiplication but is subject to significant simplifications when k is a power of two:
• when k=l/2, for instance, Z2(t) may be computed as 1/4 + Z1(t)/2 .
· when k=l/4, for instance, Z2(t) may be computed as 3/8 + (A(t) + Z1(t)]/4
Multiplication of binary numbers by values which are a power of two (^, 2, 4, 8, ...) requires only a data shift to be performed rather than a true multiplication.
Thus, the simplified expressions can be computed quickly.
The decoding algorithm of FIG. 2 may be implemented in software code by the following subroutine:
boolean decoder (int p, boolean mps) {
z = a + p; // compute Zl(t) d = 0x6000 + (z+a)»2; // compute Z2(t) (here with k=l/4) if (d < z) // compute Z(t) = min [Z1(t), Z2(t)] z = d;
if (z > c) { a += 0xl0000-z; c += 0xl0000-z; bit = 1-mps; } else { a = z; bit = mps} while (a >= 0x8000) { a = ((a - 0x8000)<<1);
c = ((c - 0x8000)<<1) + next_code_bit() ; } return bit;
}
CA 02244380 1998-07-27
The decoding method of FIG. 2 provides adaptive binary arithmetic decoding that achieves compression ratios that are much closer to entropie compression ratios than are achieved by arithmetic decoders of the prior art. The Z-Coder provides much better data compression than the prior art adaptive binary arithmetic decoders.
FIG. 6 illustrates a method of operation of a decoder according to a second embodiment of the present invention. The decoding method 2000 provides a fast decoding path for encoded MPS bits. Because the MPS is, by definition, the most probable symbol, the fast decoding path is traversed more often than other decoding paths. Fast decoding of the MPS, therefore, provides for improved performance.
The design of the fast decoder capitalizes upon the fact that an MPS may be returned as soon it is
<td> determined t</td><td> ihat Z1 (t )</td><td> is smaller than C(t)</td><td> and</td><td> also</td>
<td> smaller than</td><td></td><td></td><td></td><td></td>
<td> • Z(t)</td><td> is rarely</td><td> greater than because p</td><td> is</td><td> often</td>
<td> very</td><td> small;</td><td></td><td></td><td></td>
<td> • Z(t)</td><td> is rarely</td><td> less than C(t) because</td><td colspan="2"> PLPS is</td>
usually very small; and • Re-normalization rarely occurs because the compression ratio of the Z-Coder is very good (The decoding algorithm produces many more bits than it consumes).
The fast decoding method is initialized in the same manner as the traditional method of FIG. 2. A(l) is set
CA 02244380 1998-07-27 to 0 (Step 2010). The decoder receives C(t) from the channel (Step 2020). The decoder computes a new fence variable, labeled F(t), to be the lesser of either C(t) or k (Step 2030). Further, the decoder computes Zl(t) as above (Step 2040).
The decoder compares Zl(t) against F(t) (Step 2050). If Zl(t) is less than F(t), the next bit to be decoded is an MPS. The decoder outputs the MPS as the next bit in the decoded data and sets A (t+1) =Z1 (t) (Steps 2060-2070). Next, the decoder loops back to Step 2040.
If, at step 2050, Zl(t) is greater than F(t), the decoder computes Z2 (t) and finally determines Z(t) to be the minimum of Zl(t) and Z2(t) (Steps 2080-2110).
The decoder determines whether Z(t) is greater than C(t) (Step 2120). If so, it decodes the next bit as an MPS and sets A(t+l)=Z(t) in a manner similar to steps 2060-2070 (Step 2130-2140). If, at step 2120, Z(t) is not greater than C(t), the decoder determines the next bit to be an LPS (Step 2150). It sets A(t+1) =A(t)+1Z(t) and sets C(t)=C(t)+1-Z (t) (Step 2160).
Thereafter, the decoder may perform renormalization in a manner similar to the decoding method of FIG. 2 (Step 2170). After renormalization, the decoder loops back to step 2030 to compute a fence variable for the next decoded bit position (t=t+l).
CA 02244380 1998-07-27
The optimized decoder may be implemented in software using the following code:
boolean decoder_fast(int p, boolean mps) {
z=a + p; // Compute Zl(t) if (z<=fence) { a=z; return mps} //Fast path returns MPS immediately d = 0x6000 + (z+a)>>2; // Compute Z2(t) (here with k=l/4) if (d < z) // compute Z(t) = min[Z1(t),Z2(t) ] z = d;
if (z > c) { a += 0xl0000-z; c += 0xl0000-z; bit = 1-mps; } else { a = z; bit = mps; } while ( a >= 0x8000) { a = ((a - 0x8000)<<l);
c = ( (c - 0x8000) «1) + next_code_bit ( ) ; } fence = c;
if (fence >= 0x8000) { fence = 0x7FFF; } return bit;
}
As is shown, if Zl(t) is less than or equal to
F(t), labeled fence in the software description, the decoder performs only a single step and then returns.
The remainder of the decoding sub-routine is not performed. The fast decoder therefore provides improved decoding performance by minimizing decoding latency.
The encoder performs data encoding using the same principles as the decoding methods described above. A method of operation of an encoder constructed in accordance with an embodiment of the present invention is illustrated in FIG. 7. The encoder maintains a code string interval of the form [A (t)-S (t) , 1-S (t) [. The interval can be interpreted as a lower bound A(t) on a
CA 02244380 1998-07-27 number that plays the same role that C(t) does in the decoder. The code string is obtained by subtracting S(t) from the number. The quantity S(t) accumulates all the terms that are added to C(t) in the LPS branch of the decoder described above with regard to either FIGS. 2 or 6.
To encode a MPS, a new interval [Z (t)-S (t) , 1-S (t) ] must be set. This is achieved by setting A(t)+l=Z(t). To encode an LPS, a new interval must be set to [A(t)S(t), Z(t)—S(t) [ which is readily achieved by setting
A(t+1)=A(t)+1-Z(t) and S(t+1)=S(t)+1-Z (t) .
The encoding method is and S(1) to 0 (Step 3010). to the encoder (Step 3020).
initialized by setting A(l)
Data to be encoded is input
Encoding of a symbol begins with the computation of test value Z(t) just as in the decoding methods (Steps 3030-3070) .
The encoder examines a bit in the data stream to be coded (Step 3080) . If the bit is an MPS, the encoder sets A(t+l)=Z(t) (Step 3090). If the bit is an LPS, the encoder sets A(t+1)=A(t)+1-Z(t) and S(t+1)=S(t)+1-Z(t) (Step 3100). These steps ensure that operation of the encoder and decoder track each other.
Coded data bits are emitted from the encoder only if A(t)>^. While A(t)>^, the decoder iteratively emits a bit of the code string (as the most significant bit of 1—S(t)) and shifts A(t) and S(t) a bit position to the left (Steps 3110-3130) .
CA 02244380 1998-07-27
Thereafter, the encoder returns to step 3030 to decode another bit in the data string.
In a microprocessor or digital signal processor implementation, the encoder again stores values of A(t) and S(t) in data registers having fixed lengths. However, it should be appreciated that when an LPS is encoded, the shift S (t+1)=S(t)+1-Z(t) may cause a carry in the register storing the S value. The carry must be preserved. Accordingly, if a 16-bit register is used for example to store values of A(t), then S(t) must be stored in a 17-bit register.
Because the result of register S can overflow to a 17<sup>th</sup> bit, the subtraction in step 3120 can result in a negative number. S(t) can be greater than 1. The borrow must be propagated through previously emitted bits in C(t). The Z-Coder borrow propagation is similar to the carry propagation problem attendant in known binary arithmetic coders. The solutions obtained in the prior art apply equally well to the Z-Coder:
• Bit counting consists of delaying issuance of the coded data string until a one is emitted or until a borrow propagation turns all the zeros into ones. This method may be implemented by keeping count of the number of zeros recently emitted.
• Bit stuffing consists of inserting a dummy one when no lengths of sequence of zeros exceed the predefined limit. Bit stuffing may reduce the compression ratio but it sets an upper limit on the delay between encoding of a symbol and the emission of the corresponding code bits.
CA 02244380 1998-07-27
The encoding method of FIG. 6 may be implemented in software, employing the follow code:
void encoder(boolean bit, int p, boolean mps) {
z = a + p ;
d = 0x6000 + (z+a)»2; // compute Z2(t) (here with k=l/4) if (d < z) // compute Z(t) = min[Z1(t),Z2(t)] z = d;
if (bit == mps) {a = z; } else { s += 0xl00000-z; a += 0xl00000-z; } while (a >= 0x8000) { emit (1- (s»15) ) ;
s = (s&0x7fff)«l; a + (a&0x7ff f ) «1; } }
The encoders and decoders of the Z-Coding system use an increment parameter p that represents the estimated probabilities of the LPS and MPS symbols. This section presents an analytic derivation of the relation between the symbol probability distribution P<sub>L</sub>ps and the optimal increment parameter p. This derivation relies on the analysis of a theoretical experiment that included a decoding a random string of independent equiprobable bits with a particular value of the increment p. The probability P<sub>L</sub>ps in the decoded symbol string can be calculated with the following simplifying assumptions:
• A(t) contains a uniform random number in internal [0,M. This uniform distribution hypothesis is reasonably supported by empirical evidence, as long as the greatest common divisor of the increment p and the interval size b is small.
• C(t) contains a uniform random number in interval [A(t),l[. This assumption is implied
CA 02244380 1998-07-27 by the definition of the lower bound A(t) and by the random nature of the code string.
The assumptions also eliminate dependencies between consecutive decoded symbols. It is assumes that each bit is decoded with random values A(t) and C(t), regardless of previous decoding actions. Eliminating dependencies between consecutive symbols is surprisingly realistic. Real life applications tend to mix many streams of symbols with different probabilities into a single arithmetic coder. The interleaved mixture randomizes A(t) and C(t) quite efficiently.
Under these assumptions, the decoded symbols are independent identically distributed random variables. The probability of LPS can be derived using the following decomposition:
P*(LPS) = P{Z1(t)<Z2(t)} P{Zl(t)>C(t) |
Z1 (t)<Z2 (t) }
4- P(Zl(t)>Z2(t) } P{Z2(t)>C(t) I
Z1(t)>Z2(t)}
Using this decomposition and the simplifying assumptions described above, a simple exercise in integral calculus provides analytical formulas relating P*(LPS) and p for each chosen value of the slope k (see, FIG. 8).
The case k=l/2, for instance, resolves to the following formula:
P*(LPS) = p-(pt^) log(p+h) - (p-b) log b
CA 02244380 1998-07-27
Decoding a random sequence of independent equiprobable bits produces a random sequence of independent symbols distributed as derived above. Conversely, encoding such a random sequence of symbols, under the same assumptions, produces a random sequence of equiprobable bits. That means that the increment p is the optimal increment for symbol string distribution P*(LPS) .
This formula has been confirmed by empirical experiments seeking the optimum increment for chosen symbol probability distributions. Encoding a random symbol string with this optimal increment produces about 0.5% more code bits than predicted by the information theoretical limit. This is probably the price of the additive approximation to the computation of the zvalue.
This following discussion presents a stochastic algorithm that automatically adapts the Z-Coder parameters (p and MPS) while encoding or decoding symbol strings.
The adaptation algorithm must remember some information about the observed symbol frequencies in the symbol string. It is convenient in practice to represent this information as a single integer state. Typical data compression applications maintain an array of state variables (also called coding contexts<sup>7</sup>') . Each symbol is encoded with a coding context chosen
CA 02244380 1998-07-27 according to application specific prior information about its probability distribution.
The integer state is used as an index into a table defining the actual coder parameters, i.e., the identity of the MPS (zero or one) and the probability P<sub>LPS</sub> (a number in [0,½]). The Z-Coder adaptation algorithm modifies the value of the state variable when certain conditions are verified:
• Encoding or decoding an LPS always triggers an LPS adaptation. The state variable is then changed to point a table entry with a larger value of the increment p, or, if the increment is already large, to point a table entry with swapped definition of the MPS and LPS symbols.
• Encoding or decoding an MPS triggers an MPS adaptation if and only if A(t) is greater than a threshold m in [ h-p, M tabulated as a function of the current state. The state variable is changed to point a table entry with a smaller value of the increment encoding or decoding adaptation if and only to A(t) in a known threshold tabulated as state.
p. In another embodiment a MPS triggers a MPS if Z(t), which is related way, is greater than a a function of the current
FIG. 9 illustrates a method of operation 3000 of a decoder that integrates adaptation with the fast decoding of FIG. 6. Like steps from FIG. 6 are indicated with like reference numerals. After step 2130, when the decoder determines that a next bit to be decoded is an MPS, the decoder tests for MPS adaptation. Specifically, the decoder determines whether A(t)>m, the threshold test variable for MPS adaptation (Step 3010).
CA 02244380 1998-07-27
If so, the decoder performs the MPS adaptation (Step 3020). Thereafter, or if Z(t) fails the threshold of step 3010 (Z(t)ftm), the decoder resets A(t) for the next iteration (Step 2070) . Equivalently, the decoder may test Z(t) against m.
At step 2150, when the decoder determines that the next bit to be decoded is an LPS, the decoder always performs LPS adaptation (Step 3030).
The remaining discussion pertains to symmetrical linear transition tables. These tables are organized like a ladder. The first rung represents the symbol distribution with the highest probability of zeroes. The last rung represents a symbol distribution with the highest distribution of ones. Each LPS transition moves the state variable on step towards the center of the ladder. Each MPS transition moves the state variable one step towards the closest tip of the ladder.
The limiting distribution of the state variable depends on the respective probabilities of the adaptation events.
case of a symmetrical transition table, these probabilities must fulfill the following conditions:
<td> P (MPS</td><td> adaptation)</td><td> < P(LPS</td><td> adaptation)</td><td> if P</td><td> is</td><td> too</td>
<td> small</td><td></td><td></td><td></td><td></td><td></td><td></td>
<td> P (MPS</td><td> adaptation)</td><td> > P(LPS</td><td> adaptation)</td><td> if P</td><td> is</td><td> too</td>
<td> large</td><td></td><td></td><td></td><td></td><td></td><td></td>
<td> P (MPS</td><td> adaptation)</td><td> = P(LPS</td><td> adaptation )</td><td> if p is</td><td colspan="2"> optimal</td>
These conditions imply that the probability of both adaptation events must have the same order of magnitude.
CA 02244380 1998-07-27
The Z-Coder adaptation algorithm uses Z(t) as a pseudorandom number generator to tune the probability of the MPS adaptation events.
Analytical expressions for the probabilities of the adaptation event are derived by assuming again that the lower bound register a contains a uniform random number in [ 0, Fl [. The following formulae are easily obtained by analyzing the encoding algorithm:
P(LPS adaptation) = P(LPS) = P<sub>LPS</sub>
P (MPS adaptation) = P (A ( t ) >m | MPS ) P(MPS) = (l-2m) (1Plps)
FIG. 8 compares the adaptation event probabilities as a function of the optimal increment p when the threshold m is equal to F. These curves show that this value of the threshold makes the probability of the MPS adaptation event too high. A larger threshold is needed to reduce the probability of MPS adaptation event until it becomes equal to the probability of LPS adaptation event.
For each value of the state variable, a threshold m is chosen in order to ensure that both adaptation events occur with the same probability when the increment p is optimal for the current value of P<sub>LPS</sub>. The following expression gives the correct value of the threshold m as a function of the optimal increment p:
m = Ml-P* (LPS) / (1-P* (LPS) ) ) where P*(LPS) is the expression derived above.
CA 02244380 1998-07-27
The Z-Coder adaptation algorithm differs significantly from the adaptation scheme introduced by the Q-Coder and used by the QM-Coder. These coders perform a MPS adaptation whenever encoding or decoding a MPS produces or consumes a code bit. This is similar to using a constant threshold m = with the Z-Coder adaptation algorithm. An optimally tuned Q-Coder or QMCoder therefore produces more MPS adaptation events than LPS adaptation events. This is compensated by a careful design of asymmetrical state transition tables.
The Z-Coder state transition tables however are free of these constraints. This can be a significant advantage for creating efficient state transition tables in an analytically principled way.
The encoder or decoder of the present invention may be provided on a processor or digital signal processor with appropriate program instructions.
As shown herein, the Z-Coder is an adaptive binary arithmetic coder having the following characteristics:
• A new multiplication-free approximation of the interval splitting point provides an improved coding accuracy.
• The decoder only keeps a lower bound on the code number, a simplification that leads to very fast implementation of the decoding algorithm.
• The two registers used by both the encoding and the decoding algorithm require only sixteen bits and a carry bit, an implementation benefit that reduces the cost of implementation of the ZCoder.
CA 02244380 1998-07-27
A new probability adaptation scheme reduces the constraints on state transition tables.
Contents27
6 sheets
Sheet 1 Sheet 2 Sheet 3 Sheet 4 Sheet 5 Sheet 6
12 members in 3 offices
Priority claims4
| Document | Office | Kind | Date |
|---|---|---|---|
| 5449597 | United States of America | P | |
| 60054495 | United States of America | – | |
| 60054495 | – | – | – |
| US19970054495P | – | – | – |
Members12
| Document | Office | Kind | |
|---|---|---|---|
| CA2244380A1 | Canada | A1 | |
| EP0895361A2 | European Patent Office (EPO) | A2 | |
| EP0895361A3 | European Patent Office (EPO) | A3 | |
| US6188334B1 | United States of America | B1 | |
| US6225925B1 | United States of America | B1 | |
| US2001006370A1 | United States of America | A1 | |
| US6281817B2 | United States of America | B2 | |
| US2002014981A1 | United States of America | A1 | |
| US6476740B1 | United States of America | B1 | |
| CA2244380CThis record | Canada | C | |
| EP1798860A2 | European Patent Office (EPO) | A2 | |
| EP1798860A3 | European Patent Office (EPO) | A3 |
2 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| LapsedLapsedMKLA | MKLA | |
| Examination requestEEER | EEER |
Numbers
- Publication
- 2244380
- Publication, DOCDB
- 2244380
- Publication, EPODOC
- CA2244380
- Application
- 2244380
- Application, DOCDB
- 2244380
- Application, EPODOC
- CA19982244380
Titles2
- English
- Z-CODER: A FAST ADAPTIVE BINARY ARITHMETIC CODER
- French
- LE CODEUR Z : UN CODEUR ARITHMETIQUE BINAIRE ADAPTATIF RAPIDE
Classification
- CPC, 1
- H03M7/30
- IPC, 2
- H03M7 30
- H04B1 66