1. Video Encoder Work Flow chart
A. Why does the video compress?
Because there is time and space redundancy ...
B. For the existence of encoders?
With the market demand, in the lowest possible storage situation, to obtain good image quality and low-bandwidth image fast transmission ... Compress the video ...
C. What is the input and output of the encoder?
Input: A frame of the image (including various formats), the configuration of the encoder register; output: bitstream, data, SPS ...??
D. Intra-frame prediction: In-frame prediction mode, the prediction block is based on the encoded reconstruction block and the current block formed ...
The current coded macro block is predicted by the adjacent reconstructed macro block (left, upper left, top) in the frame, which can effectively suppress the error spread caused by motion compensation and improve the frame
Prediction accuracy of the internal prediction.
E. Inter-frame prediction: The predictive mode using encoded video frames and block-based motion compensation. Motion compensation: According to the calculated motion vector, find the current frame of the block is where the previous frame moved over, so as to get the current frame pixel block prediction value.
F.DCT (Discrete cosine transform): The low frequency signal of the image is concentrated on the DC coefficients of the upper left corner after the DCT transform, and the high frequency signal of the image is distributed to other AC coefficients, and most of the signals in the video image are concentrated in the low frequency region.
G. Quantization: Most of the DCT is floating-point data, without reducing the reconstructed video quality, minimizing the length of the video image, and discarding some unnecessary data that does not affect the reconstruction of the video.
FQ: Bit quantization value, QP: Quantization width, Y:DCT transformed raw data, round: rounding function
QP: When taking a larger value, the FQ has a smaller dynamic range, after entropy coding, the code word is small, but the reference frame reconstructed by FQ will lose more reference details and affect the video quality. Conversely, a clearer video image can be obtained.
So the value of QP needs to find a balance between the encoded output length and the image quality based on the specific bandwidth and the fill of the buffer.
The portion that is quantified to 0 cannot be restored.
H. Entropy coding: Improve video compression ratio, belongs to lossless compression, so the video information compressed by entropy coding can be reconstructed without distortion at the decoding end of the original video image. (Huffman, arithmetic code, run-length encoding)
I. Dividing the maximum macro block of slice,h.265 64x64 by LCU line the largest macro block of the 16x16, and a step between the slice slice and the piece according to the number of bytes encoded.
J. Coding Flowchart:
Video Encoder Workflow