MPEG-2 Video Encoding

Source: Internet
Author: User

Http://www.360doc.com/content/06/0718/15/9571_158909.shtml

In order to improve the compression ratio and image quality, MPEG-2 video encoding uses Motion Compensation prediction (Time Prediction + interpolation) to eliminate time redundancy and image details that do not change with time; two-dimensional DCT (image pixels + quantitative transmission coefficient) is used to decompose adjacent pixels to eliminate invisible and unimportant image details; use entropy encoding (entropy of quantified parameters + encoded parameters) to reduce the number of bits to the theoretical minimum. The preceding three compression technologies are described as follows:

1) Motion Compensation Prediction



This is the motion compensation process. In order to compress the time redundancy (temporal redundancy) of the video signal, MPEG adopts motion compensated prediction. Figure 17 shows the motion processing process. Motion Compensation prediction assumes that the current image can be partially predicted by moving the image at a certain time in advance. The local part means that the amplitude and direction of the displacement in each part of the screen can be different. Motion Compensation is made based on the results of motion valuation to minimize the prediction error. Motion Estimation includes a set of techniques for extracting motion information from video sequences. The features of this technique and the processed image sequences determine the performance of motion compensation. Motion vectors related to the 16x16 pixel macro block support Motion Compensation Prediction in the receiver decoder. The so-called prediction is actually the prediction of the pixels taken into account by the current (n) image frame from the previous N-1) image frame, then, the difference between the actual pixel value of N frames and its predicted value is transmitted by motion vector encoding. For example, if the Macro Block is a rectangle block of m × N, the macro block of N-1 frame in Figure 17 is compared with the macro block of N frame. This is actually a motion compensation process shown in 18 for macro block matching, that is, the 16x16 pixel Macro Block in N frames and the limited search area (SR) in n-1 frames) compare all 16x16 pixels of macro blocks. If the Brightness Signal of an n-1 frame is F
N-1 (I, j): The Brightness Signal of N frames is f N (I, j), where (I, j) it is the random position of the m x n macro block of N frames, and an m x n Macro Block in N frames is considered to be translated from n-1 frames, it is also required that all pixels in the same macro block have the same displacement value (K, L ). In this way, you can search for a macro block in the SR of N-1 frames, the absolute value of the difference value between the macro block and the macro block to be matched in N frames is minimized, and the motion data of the motion vector is obtained. Under the Control of N-1 frames and motion data, obtain a predicted value of N frames. Proceed with this process until the pixels of any position (I, j) of the m x n macro blocks of N frames are all predicted by the pixels of N-1 frames. That is, the correlation function f (k) between N frames and n-1 Frames
, L) the absolute value is:

Formula (1) indicates that the macro block to be matched has been matched and the motion data of the horizontal and vertical displacement vectors (K, L) is obtained. Matching not only minimizes the transmitted difference value, but also compensates for the displacement of the matching object in the image, which is motion compensation. To improve the prediction effect, field prediction can be used. Because of the large degree of commonality between consecutive TV images, that is, time redundancy, the difference between most images is extremely small, especially when values are transmitted within a small range during most time, motion Compensation prediction can significantly reduce the bit rate. The decoder at the receiving end uses the same motion compensation to predict and reproduce the predicted value. The original pixel amplitude is obtained by adding the predicted value and the difference value. Figure
19 is the block diagram of the basic MPEG Video Encoder. The left side of the dotted line in the figure shows the basic functional devices required for Motion Compensation prediction encoding. The fixed memory stores the restoration data of N-1 frames and sends them together with N frames to the Motion Compensation parameter estimator. After the estimation, the motion vector data can be obtained. Use the motion vector data and the restoration data of N-1 frames to control the variable memory used for block matching and predict the current pixel value of N frames. Here, the prediction is only one frame by frame difference, in fact, the MPEG-1 and MPEG-2 can be a reference to a frame of several frames before the current frame for prediction. Value to obtain the original pixel amplitude. Figure 19 is the block diagram of the basic MPEG Video Encoder. The left side of the dotted line in the figure shows the basic functional devices required for Motion Compensation prediction encoding. The fixed memory stores the restoration data of N-1 frames and sends them together with N frames to the Motion Compensation parameter estimator. After the estimation, the motion vector data can be obtained. Use the motion vector data and the restoration data of N-1 frames to control the variable memory used for block matching and predict the current pixel value of N frames. Here, the prediction is only one frame by frame difference, in fact, the MPEG-1 and MPEG-2 can be a reference to a frame of several frames before the current frame for prediction.

It must be noted that MPEG defines frame-based, field-based, and dual-Field Image Prediction, as well as 16 × 8 motion compensation.

MPEG-2: there is a line-by-line scanning method, can use frame-based image prediction; there is a line-by-line scanning method, can also use the field-based image prediction. Therefore, the MPEG-2 encoder should first determine the frame mode compression or field mode compression for each image. Frame-based image prediction is used in scenarios with less motion. Because frame-based images have almost no displacement between adjacent lines, the inter-adjacent line correlation within the frame is stronger than intra-field correlation, the space redundancy removed from the entire frame is much higher than that removed from individual fields. In scenarios with violent motion, the field-based image prediction is used, because there is a delay time between two adjacent lines based on frames, the pixel displacement between adjacent lines is large, and the correlation between adjacent lines in the frames is greatly reduced, the field-based image is more correlated between two adjacent lines than that between adjacent lines within a frame. In one frame, the inter-field motion has many high-frequency components, the high-frequency components removed from the field are more than those removed from the entire frame. As shown above, the key to frame-based image prediction or field-based image prediction is interline correlation. Therefore, before DCT, You need to select the frame DCT encoding or field DCT encoding, for 16x16
The difference obtained after Motion Compensation of the original image or brightness is calculated as the correlation coefficient between the adjacent lines in the frame and the adjacent lines in the field. If the inter-line correlation coefficient within a frame is greater than the intra-field inter-line correlation coefficient, select the frame DCT encoding, and vice versa. Frame DCT encoding and field DCT encoding 20 are shown.

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.