Video compression: Relationship to codec


Free Download Mp4Gain
picture

Video compression: Relationship to codec

Video Bitrate

I mentioned earlier that “the higher the bit rate, the better the image quality and sound quality”, but the image quality and sound quality are closely related to the “codec”.

A “codec” is something like a “compression algorithm” for compressing “video” and “audio”.

Reference: What is video format? Codec difference

For example, the video codec “H.264” It is a very famous codec that is also used on Youtube and Nico Nico Douga,

(Addendum: Not used now …)

There is a codec called “H.265” that improves the “image quality per file size” of “H.264”.

“H.265” is “H.264 at about half the bit rate of”, “H.264 will get the equivalent of image quality and”. (The compression rate is double)

For example

Using “2Mbps” video bit rate with “H.264 codec”
Video with a bit rate of “2 Mbps” with the codec “H.265”
If there are two videos, the image quality of “H.265” is twice as beautiful even though the bit rate (file size) is the same.

s-25-11-2015_14h09_08
▲ Image comparing H.264 and H.265
(the character part etc. is quite different)
In addition, there is an almost four times difference in picture quality between videos using the “MPEG-2” codec used in DVDs and videos using “H.265”.

Also, the image quality is almost eight times different from that of “MPEG-1”, which is the predecessor of “MPEG-2”.

In other words, if you want to achieve the same image quality as “H.265” video with “MPEG-1”, you need 8 times the bit rate of “H.265”.

By the way, the video in unzipped state without using the codec
Uncompressed video
Uncompressed video
Is named. (Also called “raw video”)

The intro has gotten long, but what I mean after all is

“If you use a codec with a good compression rate, you can maintain reasonable picture and sound quality even at low bit rates.”

That’s why

In other words, the picture and sound quality are good.

Image quality (sound quality) = high bit rate x codec type
It is decided by the formula.

Reference: Different from the type of video codec (H.264, VP9, ​​MPEG, Xvid, DivX, WMV, etc.)

Reference: Different from the type of voice codec (MP3, AAC, WMA, WAV, Vorbis, FLAC, etc.)

Reference: Difference Between Lossy Compression and Lossless Compression [codec]


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

What is a bit rate?

What is a bit rate?

Video Bitrate

The bit rate in a video is “how much information is packed in one second”.

What if the bit rate is high?
Basically, the higher the bit rate, the better the picture and sound quality.

* Although it is closely related to the “codec” described later, it will basically improve.

There are two types of bit rates
Bit rates are assigned separately for “video” and “audio”.

The higher the bitrate assigned to “video”, the better the “image quality”.
The higher the bit rate assigned to “voice”, the better the “sound quality”.
Also, the sum of the two bit rates is called the “oval bit rate (total bit rate)”. (This oval bit rate is called “video bit rate”)

screenshot_2952
▲ If you open the video file properties and open the “Details” tab, you can see “What is the bit rate?”

(However, this Windows function is unreliable, so it is better to use video analysis software like MediaInfo)

In other words

Oval bit rate = video bit rate + audio bit rate
It becomes the calculation formula.

So even if it says “bit rate is high!”, It may mean “bit rate of video is high” and “bit rate of audio is not high”.

In other words, in such a case, the video will be “Image quality is good, but sound quality is not good …”.

Basically, the file size of “audio” is much smaller than that of “video”, so even if you increase the bit rate of “audio” significantly, the overall size of the file will not change as much.

Therefore, “speech” is often encoded uncompressed (linear PCM).

Relationship to image quality
The higher the “video” bit rate, the more accurate the color information that can be assigned to all pixels.

as a result

High bit rates improve image quality and
If the bit rate is low, the image quality will deteriorate.
koubittore-to
teibittore-to-to
▲ High bit rate (12 Mbps, 2.57 MB) ▲ Low bit rate (90 kbps, 20 KB)
* Actually, it is a gif video, so the bit rate is not accurate.

Bit rate difference

Also, in the case of a low bitrate, if you allocate bits evenly to all pixels, you will run out of bits, so in scenes where similar colors are continuous (such as a scene where the blue sky stretches without end), etc. Try to reduce the bits preferably.

As a result, “block noise” ↓ is likely to occur in such scenes.

Block noise
▲ Example of block noise (block noise)

Relationship to sound quality
The audio bit rate is

Sampling rate (Hz) x bit depth (bit) = bit rate (bps)
It can be expressed by the formula.

For example, when recording sound as digital data

How often do you record (= sample rate)
How much data is stored per interval (= bit depth)
Decide and register.

For example

Sampling rate: 44000Hz
Bit depth: 24 bit
If so, the sound is divided and recorded 44,000 times per second, and the sound is recorded using 24 bits for every 44,000 times.

In other words, if you want to improve the sound quality, you can increase the “sample rate” or the “bit depth”.

Increase the sample rate → Soft sound
Increase the bit depth → Increase the expressiveness of the sound, such as finesse and volume
Reference: Meaning and Relationship of Sample Rate, Bit Depth, and Bit Rate

The Truth About High Bitrate Lossy Compression Part 3

The Truth About High Bitrate Lossy Compression Part 3

BITRATE

For most users of the MP3 format, the problem of high quality sound is usually phrased as follows: “256 or 320? Or maybe try VBR?”

Bitrate

 

And this question haunts them day after day. Not all recordings sound good at 256; there is a strong audible and visible (measured) loss in the high frequency range. When using VBR mode (the so-called variable bit rate stream), it often happens that music sounds better by ear than 256, but this should not be taken as a general rule of thumb. Encode low-value or poor-quality records – you can’t go wrong. I have selected the VBR parameters to get the highest quality for VBR.

For the commercial LQT format, there is only one encoder proprietary to the authors: Liquifier Pro. We push them. Note that the LQT format is originally based on VBR encoding, so there are simply multiple modes for it, such as “bad”, “good”, and “excellent”. Naturally, for our tests we took the “excellent” (audiophile) mode, which results in a stream of 192 to 256, most of the time 200-220 kbps. Let me remind you that the LQT format is based on the MPEG-2 AAC family of algorithms. Also, this is the highest quality AAC implementation to date (tested on analogs).

The OGG format is a relative of the MP3 format, but it contains a different psychoacoustic model and some technical innovations that MP3 does not have. For starters, OGG initially only supports VBR mode. The user sets the approximate bit rate and the encoder tries to compress as closely as possible. The range of variation is extremely wide: 8 to 512 kbps, and it is much more discreet than MP3. The top bar is up to 512 kbit / s, whereas nowadays MP3 encoders really only “pull” up to 320. You may ask “is it possible that even 320 is not enough?” Yes, it happens, but rarely.

Roxette samples
Well, we come to the most interesting part. Let’s start with my auditory sensations.

For MP3 in a 256 kbps stream, noise disturbances at high frequencies are clearly audible. Not only is a considerable part of them absent from the sound, but strong distortion, wheezing, clanging and other “charms” are also mixed in. This is a sign that 256 is clearly not enough, therefore you need to test higher. Let’s take a 320 compressed sample. The sound has changed significantly, this is a completely different matter: the upper part is in place, no differences by ear were found. For the purity of the experiment, let’s see what happens in floating flow mode. We obtain an average bit rate of 290 kbit / s, of which the conclusion suggests that 256 for the sample under study will not be enough. In fact, a sample encoded in VBR mode sounds a little better than 256, but it clearly falls short of 320. In the case of MP3, for high-quality compression, only encoding in 320 kbps mode is adequate, ie , to the maximum of opportunities.

Let’s take OGG as “modified MP3”. There are five approximate bit rates for the encoder: 128, 160, 192, 256 and 350. Well, let’s try 192 and 256. We will not take 350 bit rates, because we already know that MP3 at 320 kbps clearly transmits excellent quality, it seems that better not necessary. For 192 mode, we get an average stream of 226, and for 256 mode, up to 315 kbps. So far the precision. Such a large deviation from the reference point is a signal for sound material that is very difficult to encode; with a sample with a simpler density, the precision will be higher. To be honest, I tried to evaluate 320 MP3 and 315 OGG for a long time and came to the conclusion that they both sound almost identical to the original sound. But they are based on different psychoacoustic models and their sound coloration is different. Personally, I liked the MP3 a bit more. But, this is really a controversial issue; after all, the OGG encoder is just a beta version. When there is a release, I think it should surpass MP3 in quality. Comparing them separately to the original, I was inclined to believe that the OGG has an even closer sound to the original, but there is something wrong with the high frequencies of this encoder. Because of this, MP3 sounds a bit better. I don’t think it is necessary to say that in 350 mode (average bitrate was 365) OGG “perfectly” repeats the original.

Now we are talking about the little-known but widely advertised format as the “highest quality”: the LQT format. And most importantly, it sounds great overall, however after listening to it, I realized that I didn’t like its sound. It doesn’t distort high frequencies, like MP3 256 kbps, but it smears the sound and smears a lot. Loud sounds fade over time.

The Truth About High Bitrate Lossy Compression Part 2

The Truth About High Bitrate Lossy Compression Part 2

Bitrate

I decided to “drop” the three specified formats to get the highest quality sound with the minimum file size.

audio bitrate

For the test, we selected several samples (here a sample is a small fragment cut from a PCM file) from two types of compositions. The first is a very dense and loud sound with amplitude normalization (compacting the sound “vertically” to fit 16-bit from a 24-bit master) and compression of the dynamic range (so that the sound of all instruments is always strong). As the first type (as in my previous tests), the composition Crush On You from the album Have A Nice Day by Roxette was chosen, three samples of 15-20 seconds each of different parts of the composition were examined. The second sample is clean and transparent (acoustic or light orchestral arrangement).

Why these particular records? Roxette samples have very strong dynamic compression (the amplitude value is very often equal to the maximum (which is bad) and leads to overload of the playback equipment and strong distortions).

Roxette sample
In such samples, the encoders have to work in extreme mode, so any distortion becomes easily audible. encoding distortions add to the existing intrinsic distortions of the original. You ask “why then take a sample as a test?” It is necessary and how. The vast majority of albums released today are recorded this way. Therefore, the encoder must adequately accept clipping sound.

With Klaiderman’s samples, the situation is diametrically opposite. The original analog recording after a very high quality digital remastering was recorded to CD and without dynamic compression.

Clayderman sample
Great sound, very nice and smooth highs. We will pay special attention to them during the analysis, we will try to preserve them. But it is these frequencies that will be the most difficult for encoders to transmit.

the truth about high bitrate lossy compression

the truth about high bitrate lossy compression

bitrate lossy

Preface

bitrate lossy

In the understanding of most people, the word music lover is most often associated with a person who not only loves and collects music, but also appreciates high-quality music, and not only in artistic and aesthetic terms. but also the quality of the recording. of the phonogram itself. Think, a few years ago, an audio CD was considered the standard of music quality, but a computer, even in dreams, could not compete with the quality of a CD. However, time is a great joker and he often likes to turn things upside down. It would seem that quite a long time passed, one or two years and … that’s it, the CD on the PC went into the background. Don’t ask “why?”, You know the answer to this question yourself. Everything is to blame for the revolution in the world of sound on a computer: audio compression (hereinafter referred to as audiolo compression which means lossy compression to reduce the size of the audio file), which made it possible to store music on the hard drive, lots of music! In addition, it was possible to exchange it over the Internet. New sound cards have been released, capable of squeezing almost studio quality out of a piece of hardware that seems useless in terms of music. Today, even having a computer that is not very smart in performance, having bought a Creative SoundBlaster Live! And remembering that since the Soviet times there is a good amplifier and good acoustics, you will get nothing but a high-quality music center, the sound of which is inferior only to very expensive audio equipment (mid-range or even high-fidelity hi-fi). ). Add to this the general availability of music files and you know you have the power at your fingertips. And then there is a revolution, and you understand that a compact disc is no longer so convenient, you are fascinated by something completely different: the magic signs of the “MP3”. He cannot eat or sleep; faces the seemingly insoluble question of the “chicken and egg”: how to “squeeze” and, more importantly, how to “squeeze” …

This is where I will help you. This article is the beginning of my new series of informational materials on music on the computer. For over a year maintaining an extensive database of MP3 files, I have accumulated a great deal of research on audio compression. It is these studies that I will try to share with you. Several respected authors have written many articles on audio compression, so I will try not to write what I can easily find in other sources of information. I would like to express my position on the subject under discussion simply and clearly. We will not consider audio compression to be as compact a tool as possible put audio information on your hard drive (so that you can record so many hours of music there). Yes, compression allows you to record music more compactly, but my goal is to minimize quality loss by converting “pure” audio to compressed. That is why only high bitrates and encoders that compress qualitatively are considered in these modes. So it is much more convenient to work with compressed audio – instant access to any track from any album, convenient software for playback. And, of course, the financial issue has not been forgotten either.

Of the audio compression formats that exist today, three deserve attention, in my opinion: MP3 (or MPEG-1 Audio Layer III), LQT (as representative of the MPEG-2 AAC / MPEG-4 family) and the completely new OGG format (Ogg Vorbis) developed by a group of enthusiasts:

MP3 is by far the most widely used of these (mainly because it is free). Let me remind you that it was thanks to the MP3 format that the victorious procession of compressed audio took place. However, as is often the case with pioneers, little by little it is losing ground and giving way to new and better formats.
The second format, LQT, is a representative of a new direction of audio coding algorithms, a representative of the AAC family. This is a fairly high quality, but commercial and highly classified format.
OGG became widely known to the public this summer and is currently developing rapidly, soon (with the release of the Encoder and Decoder) it should beat MP3 with better sound quality with smaller file size.
I will not give a detailed description of technologies and formats here, you can easily find them yourself. There will only be facts, conclusions and recommendations. I plan to present my research separately for each format in separate articles.

MP3 bitrate types

MP3 bitrate types

Mp3 Bitrate

Bit rate

bitrate

CBR stands for constant bit rate, that is, a constant bit rate that is set by the user and does not change when the part is encoded. Therefore, every second of the part corresponds to the same number of bits of encoded data (even when encoding silence).

VBR stands for variable bit rate, that is, a variable bit rate or variable bit rate that the encoder program dynamically changes during encoding based on the saturation of the audio material being encoded and the encoding quality set by the user (for example, silence is encoded with the minimum bit rate). The downside to this encoding method is that VBR considers the quietest snippets to be “negligible” audio information, so it turns out that if you listen too loud, these snippets will be of poor quality, while CBR makes quiet and loud snippets with the same bit rate …

ABR stands for Average Bit Rate, that is, Average Bit Rate, which is a hybrid of VBR and CBR: the user sets the bit rate in kbit / s and the program varies it, constantly adjusting it to the specified bit. Velocity. Therefore, the codec will be careful to use the maximum and minimum possible bitrate values, as it runs the risk of not conforming to the bitrate specified by the user. This is a clear disadvantage of this method, as it affects the quality of the output file, which will be slightly better than using CBR, but worse than using VBR (with the same file size).

MP3 codecs

The type of programs required to convert file formats. The most common MP3 codecs are:

mp3PRO-codec (uses SBR frequency transform).
LAME codec
fraunhofer-codec