Differences and features of video compression I, B, and P frames

Source: Internet
Author: User
The basic idea of MPEG-1 compression: Intra-frame compression and inter-frame compression. Second, statistical analysis of time correlation: the statistical results show that the interval is 1 ~ In a two-frame image, each pixel has only less than 10% points, and its brightness difference changes more than 2%, while the color difference changes only less than 1%.
Compression Method: Grouping: divides several frames into one group (GOP). To prevent motion changes, the number of frames should not be too large.
1. frame definition: three types of images are defined for each frame in each group, namely, I frame, B frame, and P frame;
2. Prediction frame: I frame is used as the base frame, I frame is used to predict P frame, and then I frame and P frame are used to predict B frame;
3. Data Transmission: At last, the difference information between the I-frame data and the prediction is stored and transmitted.
I frame: Intra-frame Encoding Frame
I frame features:
1. It is a fully-compressed encoded frame. It compresses and transmits the full frame image information in JPEG format;
2. The complete image can be reconstructed with only the data of the I frame during decoding;
3. Frame I describes the details of the image background and motion subject;
4. I frames are generated without reference to other images;
5. I frame is a reference frame of P frame and B frame (its quality directly affects the quality of each frame in the same group and later );
6. I frame is the basic frame (the first frame) of the frame group GOP, and there is only one I frame in a group;
7. motion vectors are not required for I frames;
8. I frame occupies a large amount of data information.
P frame: Forward prediction Encoding Frame.
P Frame Prediction and Reconstruction: P frame uses I frame as the reference frame to find the predicted value and Motion Vector of P frame "a certain point" in I frame, transmits the prediction difference value along with the motion vector. The receiver finds the predicted value of "A point" of the P frame from the I frame based on the Motion Vector and obtains the "A Point" value of the P frame with the difference value, the complete P frame can be obtained.
P frame features:
1. P frames are separated by 1 ~ after I frames ~ Two encoding frames;
2. P frames use motion compensation to transmit the difference between P frames and I or P frames and motion vectors (prediction error );
3. During decoding, the prediction value and prediction error in frame I must be summed before the complete P-frame image can be reconstructed;
4. P frames are pre-predicted inter-frame encoding. It only refers to the I frame or P frame closest to it;
5. P frame can be the reference frame of P frame after it, or the reference frame of B frame before and after it;
6. Because p frame is a reference frame, it may cause the spread of decoding errors;
7. Because the difference value is transmitted, the compression of P frames is relatively high.
B frame: bidirectional prediction interpolation Encoding Frame.
B Frame Prediction and Reconstruction
Frame I or frame P before frame B and frame P after frame P are the reference frames, and the predicted values and two motion vectors of frame B are "a point, and transmits the prediction difference value and the motion vector. Based on the motion vector, the acceptor "finds (computes)" the predicted value in the two reference frames and sums the difference value to obtain the "A Point" sample value of the B frame, so as to obtain the complete B frame.
B frame features
1. B frame is predicted by I or P frame and P frame;
2. Frame B transmits the prediction error and motion vector between it and the previous I or P frame and the next P frame;
3. Frame B is a bidirectional prediction Encoding Frame;
4. Frame B has the highest compression ratio, because it only reflects the changes of the motion subject between frames of reference C, and the prediction is more accurate;
5. Frame B is not a reference frame and will not cause the spread of decoding errors.
Note: I, B, and P frames are compressed based on Algorithm The need is defined by humans. They are all real physical frames. As for which frame in the image is an I frame, it is random, but I frame is determined, subsequent frames will be arranged strictly in the specified order.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.