The difference between the H264 and the I, P, b frame encoding in MPEG

Source: Internet
Author: User

(There is no time to study whether I, P, b frame is really in H. C and MPEG, first turn around) 1, the basic flow of I, P, B frame coding in H264

The basic process for I-frame encoding is:
(1) The intra-frame prediction model is used to determine the intra-frame prediction mode.
(2) The pixel value minus the predicted value, resulting in a residual error.
(3) to transform and quantify the residual error.
(4) Variable length coding and arithmetic coding.
(5) Reconstruct the image and filter the resulting image as a reference frame for other frames.


The basic flow of P-frame and B-frame encoding is:
(1) For motion estimation, the rate-distortion function (section) value is calculated using the encoding mode of the inter-frame coding process. P-Frame
Refer to the previous frame only, and frame B can refer to the following frame.
* (2) in-frame prediction, the selection of the minimum rate distortion function value of the intra-frame mode and the comparison between the frame, determine
Which encoding mode to use.
(3) Calculate the difference between the actual value and the predicted value.
(4) to transform and quantify the residual error.
(5) Entropy Coding, if the inter-frame encoding mode, coded motion vector

2. I, B, p frames in MPEG compression

First, the basic idea of MPEG-1 compression: Intra-frame compression and inter-frame compression.
Second, statistical analysis of time correlation: statistical results show that in the image of the interval of one or two frames, each pixel is only 10% points below, the luminance difference value changes more than 2%, and the chroma difference value changes only 1% or less.

The compression method adopted: grouping: A few frames of images into a group (GOP), in order to prevent motion changes, the number of frames should not be taken more.
1. Define frames: Define each frame image as three types, i.e. I, B, and P frames;
2. Prediction frame: I frame as the base frame, I-frame prediction P-frame, and then by I-frame and P-Frame prediction B-frame;
3. Data transfer: Finally, I-frame data and prediction of the difference between the information storage and transmission.

I frame: intra-frame encoded frame
I-Frame features:
1. It is a full frame compression encoded frame. It will encode and transmit the full frame image information in JPEG compression.
2. Decoding the full image can be reconstructed with the data of I-frame only;
3.I frame describes the image background and the details of the moving body;
4.I frames do not need to refer to other images to generate;
The 5.I frame is a reference frame of P-frame and B-frame (its mass directly affects the quality of subsequent frames in the same group);
The 6.I frame is the base frame of the frame group GOP (first frame), with only one I frame in a group;
7.I frames do not need to consider motion vectors;
The amount of data that the 8.I frame occupies is relatively large.

P Frame: forward prediction encoded frame.
P-Frame Prediction and reconstruction: P-Frame is based on I-frame as reference frame, in I-frame to find the P-frame "a point" of the predicted value and motion vector, take the predicted difference and the motion vector transmission together. A complete P-frame can be obtained by finding the predicted value of the P-frame "point" from the I-frame at the receiving end and adding it to the difference to get the P-frame "some" sample value.
P-Frame Features:
The 1.P frame is an encoded frame that is separated by one or more frames after the I frame;
The 2.P frame uses the motion compensation method to transmit its difference and motion vectors (prediction error) with the previous I or P frames.
3. Decoding must sum the predicted value in I frame with the prediction error to reconstruct the complete P-frame image;
4.P frames belong to the inter-frame encoding of the forward prediction. It refers only to the I-frame or P-frame closest to it;
A 5.P frame can be a reference frame of the P-frame behind it, or a reference frame of a B-frame before and after it.
6. Since P-frame is a reference frame, it may cause the spread of decoding errors;
7. Due to the difference in transmission, p-frame compression is relatively high.

B-Frame: bidirectional prediction interpolation encoded frames.
Prediction and reconstruction of B-frame
The B-frame is the reference frame of the front I or P frame and the following P-frame, "finds" the predicted value of "a point" of B-frame and two motion vectors, and takes the predicted difference and motion vector transmission. The receiving end "finds out" the predicted value according to the motion vector in two reference frames and sums it with the difference, obtains the B-frame "Some point" sample value, thus obtains the complete B-frame.
B-Frame Features
1.B frames are predicted by the front I or P frames and the following p-frames;
The 2.B frame transmits the prediction error and the motion vector between it and the front I or p frame and the back p frame;
3.B frames are bidirectional predictive coded frames;
The 4.B frame compression ratio is the highest, because it only reflects the change of the moving body between the reference frames, the prediction is more accurate;
5.B frames are not reference frames and do not cause a spread of decoding errors.

Note: I, B, p frames are based on the needs of the compression algorithm, are human-defined, they are real physical frames, as to which frame in the image is the I-frame, is random, one but to determine the I-frame, the subsequent frames are strictly in accordance with the specified order.


http://blog.csdn.net/sunnymov/article/details/4620199


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.