Lossy compression: Compress audio and video


Free Download Mp4Gain
picture

Lossy compression: Compress audio and video

Lossy cmpression

High-quality digitized audio requires a large amount of disk space. Attempts to reduce file size using standard file cabinets do not yield significant gains due to the specificity of the audio data. However, it is possible to achieve a fairly significant level of compression of the audio information using special methods based on the analysis of the data structure and subsequent compression with some loss.

Lossy Compression

The real possibility of sound processing comparable in quality to existing analog examples did not appear until the late 1980s. In 1988, the International Organization for Standardization (ISO) formed the MPEG (Moving Image Experts Group) committee. , whose main task is to develop standards for the encoding of moving images, sound and their combination. During the ten years of its existence, the committee has developed a series of norms on this subject. As a result, summarizing the extensive research in this area, several specific formats were recommended for storing data, which are excellent in quality of results and data flow.

Currently, the three most common video storage standards are MPEG-1, MPEG-2, and MPEG-4. Within the first two formats, there are also formats for storing audio information: Layer-1, Layer-2 and Layer-3. These three audio formats are defined for MPEG-1 and minor extensions are used in MPEG-2. The three formats are similar to each other, but use different levels of compromise between compression and complexity. Layer-1 is the simplest level, it does not require significant compression costs, but it also provides a negligible compression ratio. Layer-3 level: the most time consuming and provides the best compression. Recently, this format has gained immense popularity. It is often called MP3. This name is associated with the extension of the audio files stored in this format.

Founded idea, in which all audio signal loss compression methods – ignore the subtle details of the original sound, which are outside of what the human ear perceives. Here several points can be highlighted.

Noise level. Sound compression is based on a simple fact: if a person is near a loud siren, they are unlikely to hear the conversation of the people who are nearby. Also, this happens not because a person pays close attention to a loud sound, but to a greater extent because the human ear actually misses out sounds that are in the same frequency range as a louder sound. This effect is called masking, it changes with the difference in volume and frequency of the sound.

The second point is the division of the audio frequency band into subbands, each of which is further processed separately. The encoding program extracts the loudest sounds in each band and uses this information to determine an acceptable noise level for that band. The best encoding programs also take into account the influence of adjacent bands. A very loud sound in one band can affect the masking effect and nearby bands.

Another point of the codification is the use of a psychoacoustic model based on the peculiarities of the human perception of sound. Compression The use of this model is based on removing obviously inaudible frequencies with more careful preservation of sounds that are clearly distinguishable by the human ear. Unfortunately, there can be no exact mathematical formulas here. The human perception of sound is a complex process, not fully understood, so the choice of compression methods is based on analyzing listening and comparing compressed sounds differently by teams of experts. But here there are practically limitless possibilities in the field of improving psychoacoustic models. Most of the existing algorithms to encode the human voice are based on the high predictability of said signal; Universal MPEG compression algorithms have tried to apply this technique with variable success.

Another compression technique is the use of so-called joint stereo. It is known that the human hearing aid can only determine the direction of the mid frequencies, the high and low sound, so to speak, separately from the source. This means that these background frequencies can be encoded into a mono signal. In addition to all this, compression uses the difference in the complexity of the flows in the channels. For example, if there is total silence on the right channel for some time, this “reserved” place is used to improve the quality of the left channel.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Data compression: lossless and lossy

Data compression: lossless and lossy

In computer science and telecommunications, the term data compression (data compression) will indicate the data processing techniques that allow the reduction of the quantity of bits necessary for the representation of the information in digital form. In practice, for example, data compression makes it possible to reduce the number of bits required for the transmission of a video transmission, allowing it to be viewed on the Internet even in the presence of a connection that is not fast enough.

losseless compression

For files, data compression allows you to reduce the size (number of bits) of the file – this is advantageous because it reduces the space occupied by the file on disk and allows you to transfer the file more quickly (for example, by email).

Compression techniques fall into two main categories:

lossless compression (lossless):

in this case it is possible to rebuild the file from the compressed without loss of information;

lossy compression (loss)

compression occurs to the detriment of information quality, for example, through loss of image definition or sound quality of an audio file; in this case it is not possible to rebuild the file from the compressed file before compression.

how mp3 workslosseless compression

The two techniques are used in different areas. As already mentioned, lossy compression is often applied to images, sounds and videos as it enables significant reductions to be made from the original data, at the price of an often negligible loss in quality. In addition, lossy techniques can be applied during data transmission (runtime), that is, it is not necessary to know all the data to be compressed to apply them: this is obviously an advantage in the transmission of transmissions over the Internet . Among the best known lossless algorithms, we mention jpeg for images and mp3 for audio and mpeg for videos.

In contrast, lossless compression is used when you want to compress text documents, programs, databases, circuit diagrams, etc. and in any case where the loss of the original data is not accepted. The lossless compression category includes .zip and .rar formats, often used to compress files and file folders.

Later we will discuss lossy compression techniques, talking about multimedia formats. Here, instead, we want to deepen the understanding of lossless compression.

Lossless compression algorithms

Lossless compression techniques (algorithms) can be divided into two main categories:

statistical compression;

replacement compression

.
Statistical compression is based on the input study to be compressed. Statistical studies are carried out on the input format to obtain a good compression. For example, in a text file to compress, the relative frequency of each character is studied and then the shortest code is associated with the character present several times in the text; vice versa, characters present with low frequency are associated with a longer code. Codes like Huffman’s are part of this class, which we will discuss in the next lesson.

As for substitution compression, this is based on the idea of ​​replacing, in a file, all occurrences of repeated strings with pointers to previous copies of the same string. Compression is due to the fact that the length of a pointer is usually less than the length of the string being replaced. As a result, the higher the repetitions of string occurrences in the file to be compressed, the greater the degree of compression achieved.