Basic principles to reduce Redundant video data in the MPEG encoding process.


Free Download Mp4Gain
picture

Basic principles to reduce
Redundant video data in the MPEG encoding process.

MPEG video

Evolution of digital video compression standards

Mpeg video format

The MPEG encoding process removes redundant video data in a series of adjacent frames.

Two adjacent frames often contain many of the same picture elements. The information in them differs in a small part from all the information contained in the frame. The video is compressed, in which not all the data from each video frame is used, but the frame dynamics changes, since in most consecutive frames of a video clip the background hardly changes, and clearly noticeable changes occur in the foreground. .

For example, there is a smooth movement of a small object against the background of an unchanging background. In this case, the complete information about the image is stored for the reference images only. For the rest of the frames, only the difference information is digitized: on the position of the object, the direction and magnitude of its displacement, on new background elements that open behind the object as it moves. In addition, this difference information is calculated not only in comparison with the previous images, but also with the later ones (since it is in them, as the object moves, that the previously hidden part of the background is revealed).

The data reduction process is as follows. First, a keyframe (I, Intra frame) is created.

The reference I-frames are used to restore the remaining frames and are placed sequentially every 10-15 frames. Only a few fragments of frames that are between I-frames have time to change, and it is these changes that are recorded during the compression process.

In addition to I-frames, two other types of frames are distinguished in MPEG:

predictable frames (P, Predicted) containing the difference between the current image and the previous I-frame or taking into account the displacements of individual fragments;
Bidirectional predictive frames (B, bidirectionally predictive), containing only references to before or after frames of type I or P, taking into account the offsets of the individual fragments.
I-frames form the basis of an MPEG stream and, through them, random access to a piece of video is performed. The I-frames are slightly compressed to ensure high visual quality.

The P-frames are encoded relative to the previous frames (I or P) and are used as a comparison pattern for an additional sequence of P-frames. In this case, a high level of compression is achieved.

B-frames are highly compressed. To link B-frames to a video sequence, it is necessary to use not only the previous image, but also the next one. B-frames are never used for comparison.

The I, P, B frames are combined into groups (GOP-Group Of Pictures), which represent the minimum repeated set of consecutive frames, for example:

(I0 B1 B2 P3 B4 B5 P6 B7 B8 P9 B10 B11) (I12 B13 B14 P15 B16 B17 P18 …)

Frames are made up of macroblocks, which are small fragments of an image 16 × 16 pixels in size. The MPEG encoder processor analyzes the frames and looks for identical or very close macroblocks by comparing the base and subsequent frames. As a result, only the difference data between frames, called vector motion code, is saved. Macroblocks that do not contain changes are ignored and therefore the amount of data to be transferred is significantly reduced. To reduce the impact of errors during data transmission, sequential macroblocks are combined into independent sections (slices). In turn, each macroblock consists of six blocks, four of which carry information on luminance (Y) and the remaining 2 blocks carry information on color difference signals (U / V). Blocks are basic units

Block diagrams are used 4: 2: 0 or for studio quality (broadcast) 4: 2: 2.

This is an important point that requires a more detailed explanation:

It is useful to know that RGB color data received from a video camera can be represented equivalently as the sum of the luminance signal (Y) and two color difference signals (U and V), called chromatic. The luminance signal Y determines the luminance of the point. The U and V color difference signals, together with the Y signal, can fully restore the original RGB data.

And it is calculated from RGB data using the formula: Y = 0.299R + 0.587G + 0.114B

The U and V signals are calculated as follows: U = R – Y and V = B – Y


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

What determines the quality of MPEG-4 movies?

What determines the quality of MPEG-4 movies?

mpeg 4

The quality of MPEG-4 movies depends on many factors; they can be roughly divided into three groups.

mpeg 4

The quality of the source material. For example, if a two VideoCD (MPEG-1) CD movie with a resolution of 352 * 288 is compressed onto a disc in MPEG-4 or worse, from a pirated videotape, then there can be no doubt of acceptable quality. …

Source video compression parameters: bit rate (data flow that goes through the decoder), image size and others, less significant. The value of these parameters determines, in the first place, the duration of the movie. So on a CD, you can put a movie that is one and a half hours long, or you can come up with a three-hour movie. It is clear that in the first case the data flow turns out to be wider and the required compression ratio is lower. Consequently, the movie will be compressed and burned to CD with less loss of image quality. The optimal choice of encoding parameters in MPEG-4 is strictly individual and depends on a particular movie. Therefore, without sufficient experience in this matter, it is difficult to achieve a good result. It is no secret that all MPEG-4 movies are made by hand. Image quality is often very poor, and the impression of watching a movie can be completely ruined by artifacts and constant image shake. In contrast, in the DVD format, virtually all discs have excellent studio quality picture and sound.

Compressed video decompression settings, video card settings, monitor / TV settings and the speed of the computer used for display. The lower the speed, the more choppy images and frame drops are noticeable (especially in dynamic scenes).
For obvious reasons, the viewer cannot have any influence on the factors of the first two groups, so we will not consider them. The only thing left to do here is to advise you to choose your discs carefully. The factors of the third group depend entirely on the user and his computer, we will consider them in more detail below.

Overlay – what is it?
A video stream in Windows can be played through a special DirectDraw mode called Overlay, while the video information is not sent to the video buffer, but to a separate area of ​​the video card’s local memory, where it is further processed by the hardware. from the video card itself (YUV to RGB color space conversion, hardware scaling and filtering). The size of the overlay frame and the depth of the color are independent of the desktop. After processing, the overlay buffer can be displayed on the desktop or through a separate channel, for example, through the video output to the TV, and many video cards allow you to perform gamma correction on the content of this buffer, adjust the brightness, contrast etc. regardless of the desktop. The overlay is displayed on the desktop using “chromakey” technology. Windows draws the window where the overlay should be displayed, and fills it with “key color”; When a video controller encounters this color, by sending it to a DAC (digital-to-analog converter), it replaces it with data from the overlay buffer, having previously scaled the image to window size or full screen. It is very simple to check if the overlay mode works or not when playing a video: just try to take a screenshot of the screen; if a black rectangle appears in place of the video image, then the video is displayed through the overlay.

What is DivX and what is it for?
DivX (divx.ctw.cc) is a codec that performs compression / decompression of compressed images in the MPEG-4 standard. In an effort to drive competitors out of the video streaming market (eg Apple with QuickTime), Microsoft has developed a codec that allows a video stream to be compressed in MPEG-4 format. In one of the debugging stages of the new product, a beta version of this codec was released to the masses, which, after minor modifications by a group of hackers, was renamed the DivX codec. For “political” reasons, Microsoft then slowed development in this direction, releasing only a module to play already encoded video.

Questions and answers about MPEG4

Questions and answers about MPEG4

mpeg 4

Movies recorded in the MPEG-4 format have already gained deserved popularity among a wide audience of PC users.

mpeg 4

These films will generally fit on a CD, and in terms of image quality they can compete successfully with video tapes. Not the last factor that determines the popularity of MPEG-4 discs is their price. Therefore, MPEG-4 could well become a middle ground on the path of the massive transition of home users from analog VHS video recorders to the digital DVD standard.

In the Russian-language part of the Internet, you can find a large number of materials about the MPEG-4 standard, but most of them contain a description of the complexities of the process of compressing video in this format. This is, of course, a specific question that requires detailed research, but for users acting only as viewers, these articles often cannot answer the questions that arise when they want to watch movies. Another important source of information is conferences. In the “Processors”, “Video”, “Multimedia” sections, issues related to speed, quality, optimal settings and everything related to MPEG-4 are constantly raised, but the answers received often contradict each other. Someone claims that all his life he watched MPEG-4 without brakes on Pentium 200, others complain about the slideshow,

This article attempts to clarify frequently asked questions from people who have recently encountered this format, as well as to draw the attention of those who have never encountered MPEG-4 before. Hopefully, after reading this material, the reader who is not involved in video editing and compression can confidently say, “Now I know enough about this.”

What is MPEG?
MPEG is an abbreviation that stands for Moving Picture Experts Group (before writing a letter the first letter is not deciphered, so go to www.mpeg.org).

It is a fairly large organization, consisting of developers of audio, video and computer equipment, as well as programmers and specialists involved in the development and implementation of standards for algorithms for compression, transmission, storage and reproduction of audio and video data. .

Among the developments of this group in the field of digital video recording, the most famous are:

MPEG-1 standard. It was released in 1992. Users most often associate it with movies on VideoCD. The typical consumer video format for MPEG-1 in the PAL standard is 352 * 288 pixels, 25 frames per second. The audio part is stereo audio with a sampling frequency of 44.1 kHz, compressed in MPEG-1 Layer II. A feature film recorded in this format occupies two CDs in the VideoCD standard. The picture quality of VideoCDs is on par with a consumer VHS videotape.

MPEG-2 standard. Released in 1995. Users come across this video compression format primarily when purchasing DVD with movies. The typical frame size for a DVD movie in the PAL / SECAM video standard is 720 * 576 at 25 frames per second, or 640 * 480 at 30 frames per second in the NTSC standard. Compared to MPEG-1, support for multi-channel audio (Dolby Digital 5.1, DTS, etc.) has been added to the audio part. Increasing the bit rate and using an improved video compression algorithm have provided DVD movies with much better image quality than VideoCD. MPEG-2 is also used today in digital satellite television. Home DVD players in our country are gaining popularity. The relatively high price of DVD movies plays a big role in this.

MPEG-4 standard. It began to develop in the first half of the 90s of the last century. In December 1999, a launch of this format was presented, which received the official status of ISO / IEC standard. MPEG-4 was conceived as a way to transfer data from transmission media, mainly video, over low-bandwidth channels. The standard unexpectedly gained popularity among low-budget users: the use of more complex compression algorithms made it possible to put one-and-a-half-hour to two-hour feature films in acceptable quality on a single CD. With the same bit rate and certain encoding conditions, the image quality of a movie in MPEG-4 can be comparable or even better than when using MPEG-1 or MPEG-2. However, the use of new compression algorithms also led to a significant increase in the computing resources required for decompressing high-quality images from this format.