3.5 Entropy Entropy Entropy Code Transforms a series of elements symbols to indicate video sequences into a compressed code stream for transmitting or stored. The input symbol may include quantized transform coefficients (like the running order or zero tree mentioned above. ), Motion vector (for each motion compensation block of the vector value X and Y), the mark (in the sequence is used to indicate the point of the hidden step), the head (macroblock head, the head, the first, etc.) and additional information (For information on correct decoding). In this section, we will introduce some predicted precoding methods (used to represent regional relationships in encoding frames), then introduce two widely used Entropy coding technology ---- Modified Havman coding and arithmetic coding.
3.5.1 Predicting Coding In some areas of the image, some symbols are highly related. For example, the average value or DC value of adjacent intra codes is very similar, and adjacent motion vectors may have Similar X and Y values,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, The amount of the predictive reference value of the previously encoded frame. The vector of the adjacent block or macroblock is often associated with the motion of the object may pass through a large area of the frame. This is a small block or a large amount This is especially true for moving objects. The compression of the motion vector can be improved by predicting each motion vector from the previous encoding vector. A simple prediction of a vector for the current macroblock X is horizontal adjacent macroblock A, three or more encoded vectors can be used to predict the vector (such as A, B and C) of the macroblock X. The difference between the predicted and the actual motion vector is encoded and transmitted.
Quantization parameters or quantizer steps control the equilibrium of compression efficiency and image quality. In real-time video codec, modification quantization in one encoded frame is necessary (for example, changing compression ratios to make coding rate and transmission channel) Code rate adaptation). Smaller change parameter values in adjacent macroblocks are sufficient. Modified quantization parameters must tell the decoder, and we do not transfer new quantization parameter values, but transfer one Difference values (such as 1, -1 or 2) to indicate how much this parameter value is changed. Because of the use of fewer bits to encode the difference value than encoding the entire quantization parameter.
3.5.2 Growling a long encoder to map the input symbol to a series of codewords (VLC). Each symbol is mapped to a codeword, and the code word has changed, but must include an integer bit. The symbols appear for short VLCs, and the uncommon symbols are expressed with long VLCs. For a large number of compressed symbols, such operations will increase the compression ratio.
3.5.2.1 How to assign a value to each VLC to each VLC is based on the difference between the emergence of different symbols. According to Huffman in 1952, the appearance of each symbol is calculated. The probability is necessary, and this result is used to construct a series of bell codewords.
If the distributed machine value is accurate, the Hafman code provides a compression method for raw data. However, in order to achieve optimal compression, different code tables for different sequences are required.
3.5.2.2 Pre-estimated Hafman Encoding Hafman Encoding Process There are two unfavorable places for video codes. First, the decoder must decode the same codewords set by the encoder. Transfer this information The decoding terminal will increase the transmission content, and reduce the compression efficiency, especially for short video sequences. Second, the possibility value for large video sequences can not be obtained before the video data encoding, this will result The delay in the encoding process. Due to these reasons, the recent graphics and video coding standards are encoded based on the statistical model of the usual video sequence to solve this problem.
The transform coefficient (TCOEF) MPEG-4 video section uses 3D coding of the quantization coefficient, which uses each codeword to represent a combination of Run, Level, Last. A total of 102 specific (Run, Level, Last) combination VLC value. The Last bit of each codeword is 's', used to indicate the decoding coefficient symbol of the symbol (0 indicates positive, 1 means negative).
A codeword that contains more than eight 0 Run values is invalid, so that any code words starting with 000000,000 indicate an error in the code stream. All other sequences can be decoded with a valid coding value. Note the minimum The code is assigned to a small RUN and a small Level value because the probability they happen is relatively large.
The motion vector difference (MVD) difference encoding is encoded as a pair of VLCs, one is for the X value, one is for the y value. Note the shortest code indicates a small motion vector difference (such as MVD = 0 Simple code value 1). These code tables are very similar to the Hafman value, because each symbol is assigned to the only codeword. Usually used symbols are assigned shortcodes, one table alone In, there is no prefix of the code word is the same as other codewords.