<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Context-adaptive_binary_arithmetic_coding</id>
	<title>Context-adaptive binary arithmetic coding - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Context-adaptive_binary_arithmetic_coding"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Context-adaptive_binary_arithmetic_coding&amp;action=history"/>
	<updated>2026-04-21T02:07:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Context-adaptive_binary_arithmetic_coding&amp;diff=4827606&amp;oldid=prev</id>
		<title>80.221.244.224: /* History */ typo. Middle name is Johannes</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Context-adaptive_binary_arithmetic_coding&amp;diff=4827606&amp;oldid=prev"/>
		<updated>2024-12-21T00:03:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;History: &lt;/span&gt; typo. Middle name is Johannes&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Entropy coding method}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Context-adaptive binary arithmetic coding&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;CABAC&amp;#039;&amp;#039;&amp;#039;) is a form of [[entropy encoding]] used in the [[H.264/MPEG-4 AVC]]&amp;lt;ref name=&amp;quot;H.264_overview&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;H.264_book&amp;quot; /&amp;gt; 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 [[data compression|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.&amp;lt;ref name=&amp;quot;LiDrew2014&amp;quot;&amp;gt;{{cite book|author1=Ze-Nian Li|author2=Mark S. Drew|author3=Jiangchuan Liu|title=Fundamentals of Multimedia|url=https://books.google.com/books?id=R6vBBAAAQBAJ|date=9 April 2014|publisher=Springer Science &amp;amp; Business Media|isbn=978-3-319-05290-8}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In [[H.264/MPEG-4 AVC]], CABAC is only supported in the Main and higher [[H.264/MPEG-4 AVC#Profiles|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&amp;#039;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.&lt;br /&gt;
&lt;br /&gt;
==Algorithm==&lt;br /&gt;
&lt;br /&gt;
CABAC is based on [[arithmetic coding]], with a few innovations and changes to adapt it to the needs of video encoding standards:&amp;lt;ref name=&amp;quot;CABAC_paper&amp;quot; /&amp;gt;&lt;br /&gt;
* It encodes binary symbols, which keeps the complexity low and allows probability modelling for more frequently used bits of any symbol.&lt;br /&gt;
* The probability models are selected adaptively based on local context, allowing better modelling of probabilities, because coding modes are usually locally well correlated.&lt;br /&gt;
* It uses a multiplication-free range division by the use of [[Quantization (signal processing)|quantized]] probability ranges and probability states.&lt;br /&gt;
&lt;br /&gt;
CABAC has multiple [[probability]] modes for different contexts.  It first converts all non-[[binary numeral system|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.&lt;br /&gt;
[[File:CABAC Encoder Workflow Diagram.png|alt=|center|thumb|800x800px|CABAC method of entropy encoding used within H264 video compression standard in English]]&lt;br /&gt;
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&amp;#039;s roughly 10% savings in [[bit rate]] over the [[CAVLC]] entropy coding method.&lt;br /&gt;
&lt;br /&gt;
Coding a data symbol involves the following stages.&lt;br /&gt;
* Binarization: CABAC uses Binary Arithmetic Coding which means that only binary  decisions (1 or 0) are encoded. A non-binary-valued symbol (e.g. a transform  coefficient or motion vector) is &amp;quot;binarized&amp;quot; or converted into a binary code prior to arithmetic coding. This process is similar to the process of converting a data symbol into a variable length code but the binary code is further encoded (by the arithmetic coder) prior to transmission.&lt;br /&gt;
* Stages are repeated for each bit (or &amp;quot;bin&amp;quot;) of the binarized symbol.&lt;br /&gt;
* Context model selection: A &amp;quot;context model&amp;quot; is a probability model for one or more bins of the binarized symbol. This model may be chosen from a selection of available models depending on the statistics of recently coded data symbols. The context model stores the probability of each bin being &amp;quot;1&amp;quot; or &amp;quot;0&amp;quot;.&lt;br /&gt;
* Arithmetic encoding: An arithmetic coder encodes each bin according to the selected probability model. Note that there are just two sub-ranges for each bin (corresponding to &amp;quot;0&amp;quot; and &amp;quot;1&amp;quot;).&lt;br /&gt;
* Probability update: The selected context model is updated based on the actual coded value (e.g. if the bin value was &amp;quot;1&amp;quot;, the frequency count of &amp;quot;1&amp;quot;s is increased).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
! MVD&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;&lt;br /&gt;
! Binarization&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 110&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 1110&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 11110&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 111110&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 1111110&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 11111110&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 111111110&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
1. Binarize the value MVDx, the motion vector difference in the {{var|x}} direction.&lt;br /&gt;
&lt;br /&gt;
The first bit of the binarized codeword is bin 1; the second bit is bin 2; and so on.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
! e&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt;&lt;br /&gt;
! Context model for bin 1&lt;br /&gt;
|-&lt;br /&gt;
| 0 ≤ e&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt; &amp;lt; 3&lt;br /&gt;
| Model 0&lt;br /&gt;
|-&lt;br /&gt;
| 3 ≤ e&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt; &amp;lt; 33&lt;br /&gt;
| Model 1&lt;br /&gt;
|-&lt;br /&gt;
| 33 ≤ e&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt;&lt;br /&gt;
| Model 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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, e&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt;, is calculated:&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
! Bin&lt;br /&gt;
! Context model&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0, 1 or 2 depending on e&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 5 and higher&lt;br /&gt;
| 6&lt;br /&gt;
|}&lt;br /&gt;
If e&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt; is small, then there is a high probability that the current MVD will have a small magnitude; conversely, if e&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
3. Encode each bin. The selected context model supplies two probability estimates: the probability that the bin contains &amp;quot;1&amp;quot; and the probability that the bin contains &amp;quot;0&amp;quot;. These estimates determine the two sub-ranges that the arithmetic coder uses to encode the bin.&lt;br /&gt;
&lt;br /&gt;
4. Update the context models. For example, if context model 2 was selected for bin 1 and the value of bin 1 was &amp;quot;0&amp;quot;, the frequency count of &amp;quot;0&amp;quot;s is incremented. This means that the next time this model is selected, the probability of a &amp;quot;0&amp;quot; will be slightly higher. When the total number of occurrences of a model exceeds a threshold value, the frequency counts for &amp;quot;0&amp;quot; and &amp;quot;1&amp;quot; will be scaled down, which in effect gives higher priority to recent observations.&lt;br /&gt;
&lt;br /&gt;
==The arithmetic decoding engine==&lt;br /&gt;
&lt;br /&gt;
The arithmetic decoder is described in some detail in the Standard. It has three distinct properties:&lt;br /&gt;
#Probability estimation is performed by a transition process between 64 separate probability states for &amp;quot;Least Probable Symbol&amp;quot; (LPS, the least probable of the two binary decisions &amp;quot;0&amp;quot; or &amp;quot;1&amp;quot;).&lt;br /&gt;
#The range {{var|R}} 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).&lt;br /&gt;
#A simplified encoding and decoding process is defined for data symbols with a near uniform probability distribution.&lt;br /&gt;
The definition of the decoding process is designed to facilitate low-complexity &lt;br /&gt;
implementations of arithmetic encoding and decoding. Overall, CABAC provides &lt;br /&gt;
improved coding efficiency compared with CAVLC-based coding, at the expense of greater &lt;br /&gt;
computational complexity.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
In 1986, [[IBM]] researchers Kottappuram M. A. Mohiuddin and Jorma Johannes Rissanen filed a [[patent]] for a multiplication-free binary arithmetic coding algorithm.&amp;lt;ref name=&amp;quot;t81&amp;quot;&amp;gt;{{cite web |title=T.81 – DIGITAL COMPRESSION AND CODING OF CONTINUOUS-TONE STILL IMAGES – REQUIREMENTS AND GUIDELINES |url=https://www.w3.org/Graphics/JPEG/itu-t81.pdf |publisher=[[CCITT]] |date=September 1992 |accessdate=12 July 2019}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{US patent|4652856}}&amp;lt;/ref&amp;gt; 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.&amp;lt;ref&amp;gt;{{cite journal |last1=Arps |first1=R. B. |last2=Truong |first2=T. K. |last3=Lu |first3=D. J. |last4=Pasco |first4=R. C. |last5=Friedman |first5=T. D. |title=A multi-purpose VLSI chip for adaptive data compression of bilevel images |journal=IBM Journal of Research and Development |date=November 1988 |volume=32 |issue=6 |pages=775–795 |doi=10.1147/rd.326.0775 |issn=0018-8646}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite journal |last1=Pennebaker |first1=W. B. |last2=Mitchell |first2=J. L. |last3=Langdon |first3=G. G. |last4=Arps |first4=R. B. |title=An overview of the basic principles of the Q-Coder adaptive binary arithmetic coder |journal=IBM Journal of Research and Development |date=November 1988 |volume=32 |issue=6 |pages=717–726 |doi=10.1147/rd.326.0717 |issn=0018-8646}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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&amp;#039;s adaptive binary arithmetic coding algorithm in 1992.&amp;lt;ref name=&amp;quot;t81&amp;quot;/&amp;gt; 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&amp;#039;s arithmetic coding patents&amp;lt;ref&amp;gt;{{cite web |url=http://www.itu.int/rec/T-REC-T.81-200401-I!Cor1/dologin.asp?lang=e&amp;amp;id=T-REC-T.81-200401-I!Cor1!PDF-E&amp;amp;type=items |title=Recommendation T.81 (1992) Corrigendum 1 (01/04) |author= |date=9 November 2004 |work=Recommendation T.81 (1992) |publisher=International Telecommunication Union |accessdate=3 February 2011}}&amp;lt;/ref&amp;gt; have since expired due to the age of the JPEG standard.&amp;lt;ref&amp;gt;&amp;#039;&amp;#039;JPEG Still Image Data Compression Standard&amp;#039;&amp;#039;, W. B. Pennebaker and [[Joan L. Mitchell|J. L. Mitchell]], Kluwer Academic Press, 1992. {{ISBN|0-442-01272-1}}&amp;lt;/ref&amp;gt; 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.&amp;lt;ref&amp;gt;&amp;#039;&amp;#039;DCT Coding for Motion Video Storage using Adaptive Arithmetic Coding&amp;#039;&amp;#039;, C. A. Gonzales. L. Allman, T. McCarthy, P. Wendt and A. N. Akansu, Signal Processing: Image Communication, 2, 145, 1990.&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;&amp;#039;&amp;#039;Encoding of motion video sequences for the MPEG environment using arithmetic coding&amp;#039;&amp;#039;, E. Viscito and C. Gonzales, SPIE Visual Communications and Image Processing &amp;#039;90, October 2–4, 1990.&amp;lt;/ref&amp;gt; This proposal extended the use of arithmetic coding from intraframe JPEG to interframe video coding.&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;{{cite book |last1=Ortega |first1=A. |title=Proceedings 1999 International Conference on Image Processing (Cat. 99CH36348) |chapter=Embedded image-domain compression using context models |date=October 1999 |volume=1 |pages=477–481 vol.1 |doi=10.1109/ICIP.1999.821655|isbn=0-7803-5467-2 |s2cid=27303716 }}&amp;lt;/ref&amp;gt; The modern context-adaptive binary arithmetic coding (CABAC) algorithm was commercially introduced with the [[H.264/MPEG-4 AVC]] format in 2003.&amp;lt;ref&amp;gt;{{cite web |title=Context-Based Adaptive Binary Arithmetic Coding (CABAC) |url=https://www.hhi.fraunhofer.de/en/departments/vca/research-groups/image-video-coding/research-topics/context-based-adaptive-binary-arithmetic-coding-cabac.html |website=Fraunhofer Heinrich Hertz Institute |accessdate=13 July 2019 |language=en}}&amp;lt;/ref&amp;gt; The majority of patents for the AVC format are held by [[Panasonic]], [[Godo kaisha|Godo Kaisha IP Bridge]] and [[LG Electronics]].&amp;lt;ref name=&amp;quot;patents&amp;quot;&amp;gt;{{cite web |title=AVC/H.264 {{ndash}} Patent List |url=https://www.mpegla.com/wp-content/uploads/avc-att1.pdf |website=MPEG LA |accessdate=6 July 2019}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Arithmetic coding]]&lt;br /&gt;
*[[Data compression]]&lt;br /&gt;
*[[Lossless compression]]&lt;br /&gt;
*[[Context-adaptive variable-length coding|Context-adaptive variable-length coding (CAVLC)]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist|&lt;br /&gt;
refs=&lt;br /&gt;
&amp;lt;ref name=&amp;quot;H.264_overview&amp;quot;&amp;gt;Richardson, Iain E. G., [https://web.archive.org/web/20051104184031/http://www.rgu.ac.uk/files/h264_cabac.pdf H.264 / MPEG-4 Part 10 White Paper], 17 October 2002.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;H.264_book&amp;quot;&amp;gt;{{cite book | last = Richardson | first = Iain E. G.  | title = H.264 and MPEG-4 Video Compression: Video Coding for Next-generation Multimedia | publisher = John Wiley &amp;amp; Sons Ltd. | year = 2003 | location = Chichester}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;CABAC_paper&amp;quot;&amp;gt;Marpe, D., Schwarz, H., and Wiegand, T., [http://iphome.hhi.de/marpe/download/cabac_ieee03.pdf Context-Based Adaptive Binary Arithmetic Coding in the H.264/AVC Video Compression Standard], &amp;#039;&amp;#039;IEEE Trans. Circuits and Systems for Video Technology&amp;#039;&amp;#039;, Vol. 13, No. 7, pp. 620–636, July, 2003.&amp;lt;/ref&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Compression methods}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Audiovisual introductions in 2003]]&lt;br /&gt;
[[Category:Entropy coding]]&lt;br /&gt;
[[Category:MPEG]]&lt;br /&gt;
[[Category:Video compression]]&lt;br /&gt;
[[Category:Data compression]]&lt;/div&gt;</summary>
		<author><name>80.221.244.224</name></author>
	</entry>
</feed>