Mpeg CompressionI, B, PFrame and compression:Intra-frame CompressionAndInter-frame Compression.
Second, through statistical analysis of time correlation, at the interval of 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
1% or less, the compression method is grouping:
Divide several frames into a 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:
1. It isFull-frame compression encoding Frame. It compresses and transmits the full frame image information in JPEG format;
2. Only data of I frame is used for decoding.Reconfigurable complete image;
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 frameThe amount of data occupied is large..
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. Root at the receiving end
Based on the Motion Vector, we can find the predicted value of the P frame "A Point" from the I frame and get the "A Point" sample value of the P frame with the difference value, so as to obtain the complete P frame.
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 frame belongsForward prediction 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 it is a difference value transfer,P-frame compression is relatively high.
B frame: bidirectional prediction interpolation Encoding Frame.
B Frame Prediction and reconstruction of B frame I or P frame before B and P frame after B as the reference frame, "find" B frame "A Point" predicted value and two motion vectors, and get the prediction difference value and the motion vector.
Send. 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 isBidirectional prediction Encoding Frame;
4.Maximum B-frame compression ratioBecause it only reflects and references the changes of the motion subject between frames, and the prediction is more accurate;
5. Frame B is not a reference frame and will not cause the spread of decoding errors.
The following is an example of a GOP of 15. The decoded frame and its decoding sequence are all in it:
For example, the decoding of I frame does not depend on any other frame, while the decoding of P frame depends on the decoding of I frame or P frame. B frame prior to it.
The nearest I frame or P frame and the nearest P frame.
Reference: http://www.cnblogs.com/qingquan/archive/2011/07/27/2118967.html
Mpeg I B P Frame