IDR (instantaneous decoding refresh)-instant decoding and refreshing.
I frame: Intra-frame Encoding FrameIt is an independent frame that comes with all information. It can be decoded independently without reference to other images. The first frame in the video sequence is always an I frame.
Both I and IDR frames use intra-frame prediction.They are all the same thing.,For convenience in encoding and decoding, We need to separate the first I frame from other I frames,So the first I frame is called IDR.To control the encoding and decoding processes. IDR frames are refreshed immediately so that errors are not transmitted. The encoding starts from the IDR frame and recalculates a new sequence. I frame does not have the random access capability. This function is undertaken by IDR. IDR will result in DPB (decodedpicturebuffer reference frame list-this is the key) to be cleared, and I will not. IDR images must be I images, but I images may not be IDR images. There can be many I images in a sequence, and the images after I images can reference the images between I images for motion reference. There can be many I images in a sequence, and the images after I images can reference the images between I images for motion reference.
For an IDR frame, all frames after an IDR frame cannot reference the content of any frame before an IDR frame. In contrast, for an ordinary I-frame, b-and p-frames after a normal I-frame can be referenced. From a random video stream, the player can always play from an IDR frame, because no frame references the previous frame after it. However, you cannot start playing from any point in a video without an IDR frame, because the subsequent frame always references the previous frame.
When an IDR frame is received, the decoder also needs to update all PPs and SPS parameters.
Processing IDR frames (the same as processing I frames): (1) Intra-Frame Prediction determines the intra-frame prediction mode. (2) subtract the predicted value from the pixel value to obtain the residual value. (3) transform and quantify the residual. (4) variable-length coding and arithmetic coding. (5) reconstruct the image and filter the image to serve as a reference frame for other frames.
In the case of multiple reference frames, an example is as follows: ippppIPPPP ....... Encode the three reference frames.
Because three reference frames are encoded, the length of the reference frame queue is 3.
When a green I is encountered, the reference frame queue is not cleared, and this I frame is added to the reference frame queue (of course, the reference frame is not required for I encoding .). When a red P frame is detected, three PPI frames are used for reference.
P frame: Forward prediction Encoding Frame
For continuous dynamic image encoding, several consecutive images are divided into three types: P, B, And I. P frames are predicted by P frames or I frames before them, it compares the same information or data with the previous p-frame or I-frame, that is, compression between frames considering the moving feature. The P-frame method compresses the data of the current frame based on the differences between the current frame and the adjacent previous frame (I frame or P frame. The method of p-frame and I-Frame Joint compression can achieve higher compression without obvious compression marks.
P-Frame Prediction and reconstruction frame are based on I-frame as the reference frame. in I-frame, the prediction value and Motion Vector of p-frame are found, and the Prediction difference value and Motion Vector are transmitted together. The receiver finds the predicted value of a certain point of the P frame from the I frame based on the Motion Vector and obtains the sample value of a certain point of the P frame with the difference value, thus obtaining the complete P frame.
Some video sequences are relatively simple, so there is no B frame,
B frame: bidirectional prediction interpolation Encoding Frame
B Frame Prediction and Reconstruction
The B-frame method is a bidirectional prediction inter-frame compression algorithm. When a frame is compressed into B frame, it compresses the frame based on the data difference between the adjacent previous frame, the current frame, and the next frame, that is, only the difference between the current frame and the front frame is recorded. Only B-frame compression can achieve a high compression rate of to 1.
Frame B is the reference frame of the previous I or P frame and the next P frame to find out the predicted values and two motion vectors of frame B's "a point, and transmits the prediction difference value and the motion vector. The receiving end is included in two reference frames based on the motion vector.