MPEG-1 How it works


Free Download Mp4Gain
picture

MPEG-1 How it works

mpeg-1

Mpeg-1 video

MPEG

After the division of frames into different types is completed, the process of preparing for encoding begins.

With I-frames, the process of preparing for encoding is quite simple: the frame is divided into blocks. In MPEG-1, the blocks are 8×8 pixels.

But for type P and B personnel, the preparation is much more complicated. To compress frames of the indicated types more strongly, a motion prediction algorithm is used.

As input, the motion prediction algorithm receives an 8×8 pixel block from the current frame and similar blocks from previous frames (type I or P). In the output of this algorithm, we have the following information about the previous block:

The motion vector of the current block relative to previous ones
The difference between the current and previous blocks, which will, in fact, be further encoded.
All redundant information must be removed, which is why such a high compression ratio is achieved that it is impossible with lossless compression.

But the motion prediction algorithm has limitations. Often in movies, there are still scenes where there is little or no movement and full blocks or frames appear where it is impossible to use the motion prediction algorithm. I think you have noticed that MPEG-1 compressed videos have noticeably better quality in scenes with few moving objects than in high traffic scenes. This is due to the fact that in still scenes the P and B-frames are in fact copies of the I-frames, there is practically no loss, but the compression of the information is negligible.

In the case of the correct operation of the motion prediction algorithm, the frame volumes of different types in bytes are related to each other roughly as follows: I: P: B as 15: 5: 2. As you can see from this relationship , the reduction in the amount of video information is already evident in the preparation stage for encoding.

At the end of this stage, the encoding itself begins. The encoding process includes 3 stages:

Discrete Cosine Transformation: DTC, Discrete Cosine Transform, Fourier Transform.
Quantization – quantification. Conversion of data from continuous to discontinuous, discrete.
Convert the received data blocks into a sequence, that is, convert from a matrix to a linear form.
When encoding, the pixel blocks or the calculated difference between blocks are processed by the first of the transformation algorithms: DTC (Discrete Cosine Transform). Usually the pixels in a block and the image blocks themselves are related to each other in some way, for example a solid background, a uniform lighting gradient, a repeating pattern, and so on. This relationship is called correlation. The DTC algorithm uses correlated effects to transform the blocks into frequency Fourier components.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Author: R. Arias

R. Arias is the author of this article and has extensive experience for more than 30 years as a recording engineer and audio specialist, as well as more than 20 years of experience creating algorithms related to audio and video. Linkedin