[Audio and video processing] Audio coding AAC detailed explanation, low bit rate to improve sound quality?

Hi everyone, and welcome to the Stop Refactoring channel.

In this issue we introduce the audio coding format AAC .

AAC is one of the most commonly used encoding formats for audio , and almost all players support this encoding format.

Other audio encoding formats are similar, but there are differences in some details, such as compression algorithms, restrictions on certain audio parameters, and so on.

We discuss in this order:

1. The role of packaging format 

2. Some special restrictions of AAC

3. Selection of AAC and other encoding formats 

The role of packaging format

As introduced in the previous "Working Principles of Audio and Video Transcoding", a video or audio file is actually divided into three layers: encapsulation, encoding, and basic data. For the function of encapsulation, please refer to the previous "Encapsulation Format".

The role of encoding , also mentioned in the previous "H264 Encoding Format", is to compress data and limit the size of the final file.

Let's take an example. Audio is composed of samples. If the bit depth of the sample is 16bit, the size of a sample is 16bit.

If the audio length is 1 minute, the sampling rate is 48KHz, and two channels, the theoretical audio file size is about 10MB.

Generally, except for lossless audio files, it is not so large, because the audio encoding stage will compress the data .

By the way, even if it is a lossless audio file, the data will be compressed during the encoding stage , but the compression algorithm is lossless, which guarantees that it can be restored to the original data.

In addition, generally only the basic parameters that affect the size of the audio file will act on the encoding stage , such as bit rate, maximum bit rate, etc.

In addition to lossless audio encoding formats, the encoding stage will limit the file size according to these parameters, but at the same time, lossy compression may also occur, affecting the sound quality.

Other parameters, such as sampling rate, bit depth, etc., are not processed in the encoding stage, and require a transcoding program to process the original audio data .

For the explanation of audio-related parameters and recommended settings , such as audio frame, sampling, bit depth, sampling rate, channel, etc., please refer to the previous issue of "Audio Parameters" , which will not be expanded here.

Some Special Limitations of AAC

The difference in audio encoding format means the difference in compression algorithm. The specific compression algorithm does not need to be clarified, but some special restrictions of the specific encoding format need to be clarified .

For AAC encoding, the audio sampling rate is limited between 8KHz-96KHz.

In addition, AAC encoding generally uses 1024 samples as an audio frame . If it is dual-channel and the sampling rate is 48KHz, the length of an audio frame is about 0.01 second.

If the number of samples per audio frame is wrong, it may cause playback too fast or too slow.

It should be noted here that AAC actually has multiple specifications , and different specifications can be understood as different behaviors of AAC encoding. Some special restrictions introduced above are based on the most commonly used AAC-LC specification .

Under different specifications , the supported sampling rate, maximum bit rate, and number of samples per frame are different . In addition, at low bit rates below 128Kbps, the subjective sound quality of different modes will be different, and AAC-HE will be better than the commonly used AAC-LC .

However, the general audio bit rate will be above 128Kbps, so the conventional AAC-LC can be used.

Selection of AAC and other encoding formats

AAC is a very commonly used encoding format. Whether it is a video file or a simple audio file, the AAC encoding format has high compatibility .

If lossless sound quality is required, choose a coding format such as PCM.

Of course, the choice of audio encoding format is on the actual situation . On the premise of clarifying the sound quality requirements, cost issues such as data volume/traffic need to be considered.

But more importantly , it is compatible with the playback equipment/software of the target user group . After all, no matter how good the encoding format is, it is useless if users cannot broadcast it.

Summarize

As of this issue, we have introduced the basics of audio and video, including video playback, transcoding, live broadcast working principles, audio and video parameter packaging, live broadcast protocols, encoding formats, and more.

In the future, we will enter the formal audio and video processing stage, so stay tuned.

 

Guess you like

Origin blog.csdn.net/Daniel_Leung/article/details/131167069