Context-adaptive binary arithmetic coding explained

Context-adaptive binary arithmetic coding (CABAC) is a form of entropy encoding used in the H.264/MPEG-4 AVC and High Efficiency Video Coding (HEVC) standards. It is a lossless compression technique, although the video coding standards in which it is used are typically for lossy compression applications. CABAC is notable for providing much better compression than most other entropy encoding algorithms used in video encoding, and it is one of the key elements that provides the H.264/AVC encoding scheme with better compression capability than its predecessors.[1]

In H.264/MPEG-4 AVC, CABAC is only supported in the Main and higher profiles (but not the extended profile) of the standard, as it requires a larger amount of processing to decode than the simpler scheme known as context-adaptive variable-length coding (CAVLC) that is used in the standard's Baseline profile. CABAC is also difficult to parallelize and vectorize, so other forms of parallelism (such as spatial region parallelism) may be coupled with its use. In HEVC, CABAC is used in all profiles of the standard.

Algorithm

CABAC is based on arithmetic coding, with a few innovations and changes to adapt it to the needs of video encoding standards:

CABAC has multiple probability modes for different contexts. It first converts all non-binary symbols to binary. Then, for each bit, the coder selects which probability model to use, then uses information from nearby elements to optimize the probability estimate. Arithmetic coding is finally applied to compress the data.The context modeling provides estimates of conditional probabilities of the coding symbols. Utilizing suitable context models, a given inter-symbol redundancy can be exploited by switching between different probability models according to already-coded symbols in the neighborhood of the current symbol to encode. The context modeling is responsible for most of CABAC's roughly 10% savings in bit rate over the CAVLC entropy coding method.

Coding a data symbol involves the following stages.

Example

MVDxBinarization
00
110
2110
31110
411110
5111110
61111110
711111110
8111111110

1. Binarize the value MVDx, the motion vector difference in the direction.

The first bit of the binarized codeword is bin 1; the second bit is bin 2; and so on.

ekContext model for bin 1
0 ≤ ek < 3Model 0
3 ≤ ek < 33Model 1
33 ≤ ekModel 2

2. Choose a context model for each bin. One of 3 models is selected for bin 1, based on previous coded MVD values. The L1 norm of two previously-coded values, ek, is calculated:

BinContext model
10, 1 or 2 depending on ek
23
34
45
5 and higher6
If ek is small, then there is a high probability that the current MVD will have a small magnitude; conversely, if ek is large then it is more likely that the current MVD will have a large magnitude. We select a probability table (context model) accordingly. The remaining bins are coded using one of 4 further context models:
3. Encode each bin. The selected context model supplies two probability estimates: the probability that the bin contains “1” and the probability that the bin contains “0”. These estimates determine the two sub-ranges that the arithmetic coder uses to encode the bin.

4. Update the context models. For example, if context model 2 was selected for bin 1 and the value of bin 1 was “0”, the frequency count of “0”s is incremented. This means that the next time this model is selected, the probability of a “0” will be slightly higher. When the total number of occurrences of a model exceeds a threshold value, the frequency counts for “0” and “1” will be scaled down, which in effect gives higher priority to recent observations.

The arithmetic decoding engine

The arithmetic decoder is described in some detail in the Standard. It has three distinct properties:

  1. Probability estimation is performed by a transition process between 64 separate probability states for "Least Probable Symbol" (LPS, the least probable of the two binary decisions "0" or "1").
  2. The range representing the current state of the arithmetic coder is quantized to a small range of pre-set values before calculating the new range at each step, making it possible to calculate the new range using a look-up table (i.e. multiplication-free).
  3. A simplified encoding and decoding process is defined for data symbols with a near uniform probability distribution.

The definition of the decoding process is designed to facilitate low-complexity implementations of arithmetic encoding and decoding. Overall, CABAC provides improved coding efficiency compared with CAVLC-based coding, at the expense of greater computational complexity.

History

In 1986, IBM researchers Kottappuram M. A. Mohiuddin and Jorma Johannen Rissanen filed a patent for a multiplication-free binary arithmetic coding algorithm.[2] In 1988, an IBM research team including R.B. Arps, T.K. Truong, D.J. Lu, W. B. Pennebaker, L. Mitchell and G. G. Langdon presented an adaptive binary arithmetic coding (ABAC) algorithm called Q-Coder.[3] [4]

The above patents and research papers, along several others from IBM and Mitsubishi Electric, were later cited by the CCITT and Joint Photographic Experts Group as the basis for the JPEG image compression format's adaptive binary arithmetic coding algorithm in 1992.[2] However, encoders and decoders of the JPEG file format, which has options for both Huffman encoding and arithmetic coding, typically only support the Huffman encoding option, which was originally because of patent concerns, although JPEG's arithmetic coding patents[5] have since expired due to the age of the JPEG standard.[6] The first reported use of adaptive binary arithmetic coding in motion video compression was in a proposal by IBM researchers to the MPEG group in 1989.[7] [8] This proposal extended the use of arithmetic coding from intraframe JPEG to interframe video coding.

In 1999, Youngjun Yoo (Texas Instruments), Young Gap Kwon and Antonio Ortega (University of Southern California) presented a context-adaptive form of binary arithmetic coding.[9] The modern context-adaptive binary arithmetic coding (CABAC) algorithm was commercially introduced with the H.264/MPEG-4 AVC format in 2003.[10] The majority of patents for the AVC format are held by Panasonic, Godo Kaisha IP Bridge and LG Electronics.[11]

See also

Notes and References

  1. Book: Ze-Nian Li. Mark S. Drew. Jiangchuan Liu. Fundamentals of Multimedia. 9 April 2014. Springer Science & Business Media. 978-3-319-05290-8.
  2. Web site: T.81 – DIGITAL COMPRESSION AND CODING OF CONTINUOUS-TONE STILL IMAGES – REQUIREMENTS AND GUIDELINES . . September 1992 . 12 July 2019.
  3. Arps . R. B. . Truong . T. K. . Lu . D. J. . Pasco . R. C. . Friedman . T. D. . A multi-purpose VLSI chip for adaptive data compression of bilevel images . IBM Journal of Research and Development . November 1988 . 32 . 6 . 775–795 . 10.1147/rd.326.0775 . 0018-8646.
  4. Pennebaker . W. B. . Mitchell . J. L. . Langdon . G. G. . Arps . R. B. . An overview of the basic principles of the Q-Coder adaptive binary arithmetic coder . IBM Journal of Research and Development . November 1988 . 32 . 6 . 717–726 . 10.1147/rd.326.0717 . 0018-8646.
  5. Web site: Recommendation T.81 (1992) Corrigendum 1 (01/04) . 9 November 2004 . Recommendation T.81 (1992) . International Telecommunication Union . 3 February 2011.
  6. JPEG Still Image Data Compression Standard, W. B. Pennebaker and J. L. Mitchell, Kluwer Academic Press, 1992.
  7. DCT Coding for Motion Video Storage using Adaptive Arithmetic Coding, C. A. Gonzales. L. Allman, T. McCarthy, P. Wendt and A. N. Akansu, Signal Processing: Image Communication, 2, 145, 1990.
  8. Encoding of motion video sequences for the MPEG environment using arithmetic coding, E. Viscito and C. Gonzales, SPIE Visual Communications and Image Processing '90, October 2–4, 1990.
  9. Book: Ortega . A. . Proceedings 1999 International Conference on Image Processing (Cat. 99CH36348) . Embedded image-domain compression using context models . October 1999 . 1 . 477–481 vol.1 . 10.1109/ICIP.1999.821655. 0-7803-5467-2 . 27303716 .
  10. Web site: Context-Based Adaptive Binary Arithmetic Coding (CABAC) . Fraunhofer Heinrich Hertz Institute . 13 July 2019 . en.
  11. Web site: AVC/H.264 Patent List . MPEG LA . 6 July 2019.