Traditional Culture Encyclopedia - Photography major - Estimation and Compensation of H.263 Video Coding

Estimation and Compensation of H.263 Video Coding

Motion estimation and compensation of H.263 encoder The first step to reduce bandwidth is to subtract the previously transmitted frame from the current frame, so that only the difference or residual is encoded and transmitted. This means that the unchanged content in the frame will not be encoded. We try to estimate the motion of the current frame content and compensate the motion value to achieve a higher compression ratio. The motion estimation module compares each pixel block (macro block) of 16* 16 in the current frame and the previous frame in an attempt to find a matching frame. The motion compensation module deletes the matching area from the current macroblock position. If the motion estimation and compensation process is effective, the remaining macroblocks should only contain a small amount of information.

Discrete Cosine Transform (DCT) DCT transforms a pixel value (or residual frame value) into a series of "frequency domain coefficients". It's like transforming a signal from time domain to frequency domain by fast Fourier transform (FFT). DCT operates on two-dimensional pixel blocks (instead of one-dimensional signals), and is particularly good at compressing the energy in the blocks into a series of coefficients. This means that with several DCT coefficients, we can reconstruct a copy of the original pixel block.

Quantization For a typical pixel block, the coefficients obtained by DCT are mostly close to 0. The quantizer module reduces the precision of each coefficient, so that the value close to 0 is set to 0, and only some non-zero values are kept. In practice, we divide the coefficient value by the integer factor and truncate the result. It is very important that we "throw away" some information in the process of quantification.

Entropy coding Entropy encoders (such as Huffman encoders) use short binary codes to represent frequently occurring values and long binary codes to represent infrequently occurring values. Entropy coding in H.263 is based on this technology and is used to compress quantized DCT coefficients. The result is a variable-length binary sequence. These codes are combined to synchronize and control information (such as motion vectors needed to reconstruct motion compensated reference frames) and enter the coded H.263 code stream. Frame storage must store the current frame in order to use it as a reference frame when encoding the next frame. Instead of simply storing the current memory, we store the inverse quantized quantization factor, the inverse transform after the inverse DCT operation and the reference block information added to the motion compensation in the memory area for reconstructing the frame. This ensures that the contents in the frame storage area at the encoder end are the same as those in the decoder storage area. When the next frame is encoded, motion estimation uses the contents in the frame storage area to determine the best matching area for motion compensation.