[Codecs] In-depth analysis and understanding of CABAC

### Date:2018.4.9

=======================================================

The essence of arithmetic coding is to assign a codeword to the entire input sequence.

1. Floating-point arithmetic coding:

Steps: 1. The encoder sets the "current interval" to [0,1] at the beginning;

           2. For each event, process according to a, b:

               a) The encoder divides the current interval into sub-intervals, one for each event;

               b) The size of a subinterval is proportional to the probability that the next event will occur, the encoder selects the subinterval corresponding to the next exact event to occur, and makes it the new current interval.

               c) The lower boundary of the final output current interval is the arithmetic code of the given event sequence.

2. Fixed-point arithmetic coding:

     In floating-point arithmetic, the range is [0,1), and in fixed-point arithmetic, the range is determined by the number of bits in the register. Taking a 32-bit register as an example, in fixed-point arithmetic low=0x00000000, high=0x11111111. Due to the limitation of the number of registers, it can be assumed that there are countless suffixes after the limited number of digits, there are countless 0s after low, and countless 1s after high.

      The rules can be obtained from floating point arithmetic:

1.low gradually increases;

2.high gradually decreases

3. high > low

    Therefore, in the process of fixed-point algorithm, when the highest bit of low is 1 or the highest bit of high is 0, the highest bit will not change in future encoding. When the highest bits of low and high are the same, the precision will not be affected, and the register can be directly shifted out, and 0 (low) or 1 (high) is added to the low bit at the same time. Note: Since high>low, when the highest bit of low is 1, the highest bit of high must be 1; when the highest bit of high is 0, the highest bit of low must be 0.

3. In-depth analysis and understanding

I will not repeat the wheel construction here. For detailed analysis, please refer to: https://blog.csdn.net/shakingwaves/article/details/52426244




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325991541&siteId=291194637