H.264 Study Notes 6-exponential Columbus code

Source: Internet
Author: User

In H.264, the use of cabac requires binarization, and the exponential Columbus encoding is a binary processing method of cabac. The specific process of the K-order index Columbus codec is as follows:

A. Encoding Process:Assume that the number to be encoded is codenum (must be a non-negative integer)

[Mzeors] [1] [info] is taken as the index after Columbus encoding, and mzero indicates M 0.

1. Describe codenum in binary format (if less than K bits, add 0 to the Front) and remove the next K bits (if it is exactly K bits, remove K bits and get 0 ), add 1 to the result (value) to obtain the binary number T1;

2. m is the binary digit T1 minus one;

3. Then, connect the rounded K-bit in step 1 to the end of step T1, and get [1] [info].

Set the binary number of [info] to I. The encoding process can also be described as follows:

[1 info] is the binary representation of codenum + 2 ^ K. M = I-k is the number of 0 in mzeros.

The total encoding length is codelen = m + 1 + I = 2 m + k + 1.

B. decoding process:

1. Read 0 consecutive times, and the number of 0 consecutive times is M;

2. Calculate codelen = 2 m + k + 1. The number of digits in [1 info] is I = codelen-M = m + k + 1;

3. Read the I-bit binary code word and convert it into a 10-digit system, which is assumed to be w. From W = codenum + 2 ^ K, codenum = W-2 ^ K.

C. Example:

For k = 0: codenum = 3. The encoding is as follows:

The binary value is 11. If K = 0 is removed, 100 is obtained after 1 is added;

So m = 2;

The encoded result is [mzeros] [1] [info] = [mzeros] [1 info] = 00100.

Decoding is as follows:

Read 2 consecutive 0 s, so m = 2; codelen = 2 m + 1 + k = 5; so you need to read 3 more code streams 100, [1 info] is 100, convert to decimal result W is 4, so codenum = W-2 ^ K = 4-1 = 3;

For k = 0 and codenum = 6, the encoding is 00111;

For k = 3 and codenum = 3, the encoding is 1011;

For k = 3 and codenum = 6, the encoding is 1110;

For k = 3 and codenum = 10, the encoding is 010010;

H.264 Study Notes 6-exponential Columbus code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.