The basic method of entropy coding in the first and H:
- Entropy coding has the function of eliminating statistical redundancy between data, and the syntax element is written to the output code stream as the last operation in the coded end.
- Entropy decoding, as the first step in decoding process, parses the code stream into grammatical elements for subsequent steps to reconstruct the image using
In the standard protocol, different syntax elements specify different entropy coding methods. A descriptor for 10 syntax elements is specified in the Protocol document, which expresses the method by which the stream is parsed into the value of the grammatical element, which contains all the entropy coding methods supported by the H + + standard:
Syntax Element descriptor |
Encoding Method |
B (8) |
8-bit binary bit string for describing Rbsp_byte () |
F (N) |
N-bit fixed-mode bit string, starting from the leftmost bit |
U (n) |
Using an n-bit unsigned integer representation, the n-bit conversion is obtained |
I (N) |
represented by n-bit signed integers, with n-bit conversion obtained |
UE (v) |
Use unsigned exponential Columbus code |
Se (v) |
Using the signed exponential Columbus code |
Te (v) |
Use truncated exponential Columbus code |
Me (v) |
Using the map exponent Columbus Code |
CE (v) |
Context-Adaptive variable-length encoding (CAVLC) |
AE (v) |
Context-Adaptive binary Arithmetic encoding (CABAC) |
II. Index Columbus Code Classification & CODEC process:
Like the Huffman code introduced earlier, the exponential Columbus code is also a variable length coding (VLC)
Significant differences between the two:
- SOURCE correlation: Huffman coding relies on the probability distribution of desire; Exponential Columbus coding is independent of the source
- Additional information: Havermann encoded data must carry an additional code table that matches the source; the exponential Columbus Code does not require additional information
1. Classification of the exponential Columbus Code
Commonly used index Columbus codes can be divided into four categories:
Syntax Element descriptor |
Encoding Method |
UE (v) |
Use unsigned exponential Columbus code |
Se (v) |
Using the signed exponential Columbus code |
Te (v) |
Use truncated exponential Columbus code |
Me (v) |
Using the map exponent Columbus Code |
Where the unsigned exponent of the Columbus Code UE (v) is the basis for other encoding methods, the other methods can be derived from the UE (v).
2.0 Order (0 order) unsigned index COLUMBUS encoded UE (v)
The code word for UE (v) can be divided into three parts:
[prefix] 1 [surfix]
Where the prefix code is n bit length of 0, suffix code is the actual value of the information bit, the length of the information bit is equal to the number of 0 in the prefix code.
The length of the prefix and suffix part of the exponential Columbus code is determined by the value of the code element:
0 Order index Columbus Code template |
applicable code element value |
1 |
0 |
0 1 x |
1, 2 |
0 0 1 x x |
3~6 |
0 0 0 1 x x x |
7~14 |
0 0 0 0 1 x x x x |
15~30 |
0 0 0 0 0 1 x x x x x |
31~62 |
|
|
The suffix part of the encoding template, XX, in binary form, to represent the decoded value
The length of the prefix 0 is expressed in leadingzerobits, then the decoded value is:\ (codenum = 2^{leadingzerobits}-1 + (XXX) \). (XXX) is a 10 binary representation of binary numeric xxx. Examples are as follows:
exponential Columbus code word |
code element Value |
1 |
0 |
0 1 0 |
1 |
0 0 1) 0 1 |
4 |
0 0 0 1 0 0 0 |
7 |
Encoding and decoding process:
- Coding:
Codenum = 13,
Number of prefix 0:\ (Prefixlen = Floor[log_2 (codenum+1)] = 3\);
The binary of the suffix part:\ (Codenum+1-2^{prefixlen} = 14-8 = 6 = B (1 1 0) \)
So the 13 index of the Columbus code word is 0 0 0 1 1 1 0.
- Decoding:
Index Columbus Code 0 0 0 0 1 0 1 0 1
The decoded value is \ (2^4-1+5 = 20\)
3. Signed Index Columbus Code SE (v)
The "signed exponential Columbus encoded value" is obtained through the conversion of the "unsigned exponential Columbus encoded value"
The conversion relationship is:\ (n = ( -1) ^{(k+1)} \times ceil (K/2) \)
is to say: first by unsigned decoding, get the decimal number two a group, the absolute value is the same, the first is positive, the second is negative.
The following table is a conversion relationship between the signed and unsigned exponential Columbus code:
exponential Columbus code word |
unsigned decoding result |
signed decoding results |
1 |
0 |
0 |
0 1 0 |
1 |
1 |
0 1 1 |
2 |
-1 |
0 0 1 0 0 |
3 |
2 |
0 0 1 0 1 |
4 |
-2 |
|
k |
\ (( -1) ^{(k+1)} \times ceil (K/2) \) |
4. Truncated index Columbus Code te (v)
When decoding, the first thing to judge is the range of values of the syntax element, which is assumed to be \ ([0, X], x≥1\). Based on the value of x, the syntax elements are parsed according to the following different conditions:
- If x>1, the parsing method is the same as UE (V)
- If x=1, the syntax element value is equal to the inverse of the next bit value
5. Map Index Columbus Code Me (v)
Coded_block_pattern encoding for macro blocks of intra_4x4, intra_8x8, or Inter for predictive mode. The I (V) Mapping method does not have a specified conversion formula, which is usually done by a table-checking method.
The comparison between the index Columbus Code and Huffman Code:
- Huffman coding takes into account the probability distribution characteristics of each symbol in the coding process, encodes the probability distribution of the symbols, and the results of Huffman coding of different sources are different; exponential Columbus code for all sources unified
- Huffman code before decoding must obtain an additional copy of the current source of the Code table; Exponential Columbus code does not need
- Index Columbus Coding Compression ratio is usually low, for some information or even no compression effect, without regard to the Code table, Huffman coding compression rate is higher
However, in fact, for video compression, the advantages of similar to the compression ratios provided by Huffman coding are far from sufficient, and additional code tables are required. Therefore, in the actual video coding method is used in the exponential Columbus code, but because of low compression rate, only as a small number of auxiliary grammatical elements of the encoding and most grammatical elements of the two-valued method.
The real contribution of the high compression ratio for CAVLC and CABAC encoding, etc., will be introduced in the follow-up study notes.
"Video codec • Learning note" 8. Entropy Coding algorithm: Basic algorithm Enumeration & index Columbus Code