H.266/VVC code learning 43: VLC encoding and decoding

I have struggled with the coefficients of ALF for two weeks. I don’t know why it can be obtained directly from the decoder without transmitting the flag. I finally VLCReader.cppcaught it in it. Maybe this is also of great benefit to the understanding of RBSP. The world of variable length coding.

1 Introduction

VLC stands for variable length coding. The principle is to use short codes to encode high-frequency information to achieve the goal of fewer bits.
We know that most content in video coding is coded and decoded through CABAC, and most flags and transform coefficient entropy coding are used, and have high coding efficiency. However, the coding efficiency of VLC headed by zero-order exponential Golomb code is also very high for generalized Gaussian sources, and the coding and decoding are simple, soCan be used on most of the syntax elements of VPS, SPS, PPS parameters and Slice header information

2 Zero-order exponential Columbus code

The code length after encoding can be calculated based on the code word information, and the code word can be decoded by simple calculation without looking up the table.
Decoding method:
1. Read the number of 0 in front of the first 1, and add the number of times of 2 to the number of 0s, which is recorded as C1;
2. Read the binary number after the first 1, and record as C2;
3. The decoded value C1+C2-1is as shown in the following table if it needs to express a signed number:

Codeword Decoded value Signed number
1 0 0
010 1 1
011 2 -1
00100 3 2
00101 4 -2
00110 5 3
00111 6 -3

Guess you like

Origin blog.csdn.net/weixin_42979679/article/details/102923305