Bitrate: Difference between revisions

From Hydrogenaudio Knowledgebase
(→‎MP3 bitrates: wikilink move)
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A data rate expressed in bits per second. This is a similar to baud but the latter is more applicable to channels with more than two states.
'''Bitrate''' means the data rate (i.e. how many bits get transferred in a certain amount of time), usually expressed in bits per second.


The common units of bit rate are kilobits per second (Kbps) and megabits per second (Mbps). In data rates, the multipliers "k", "M", etc. stand for powers of 1000, not powers of 1024.
The common units of bit rate are kilobits per second (Kbps) and megabits per second (Mbps). In data rates, the multipliers "k", "M", etc. stand for powers of 1000, not powers of 1024.
Line 9: Line 9:
==MP3 bitrates==
==MP3 bitrates==


MP3 bitrates can be deceptive. For example, a 128 kbps "constant bitrate" ([[CBR]]) MP3 will use ''about'' 128 kilobits for each second of audio that is encoded (so the file size, in bits, divided by the audio's duration, comes out to about 128,000), and its [[frame]] headers will occur at regular intervals, but internally, from frame to frame it may encode audio at a bitrate higher or lower than 128 kbps through the use of the [[bit reservoir]] (the ability of a frame to use spare bits from the preceding frame). However, the size of this reservoir, and thus the amount of variability, is limited, so 128 kbps will be very close to the effective bitrate across the whole file.
MP3 bitrates can be deceptive. For example, a 128 kbps "constant bitrate" ([[CBR]]) MP3 will use ''about'' 128 kilobits for each second of audio that is encoded (so the file size, in bits, divided by the audio's duration, comes out to about 128,000), and its frame headers will occur at regular intervals, but internally, from frame to frame it may encode audio at a bitrate higher or lower than 128 kbps through the use of the [[bit reservoir]] (the ability of a frame to use spare bits from the preceding frame). However, the size of this reservoir, and thus the amount of variability, is limited, so 128 kbps will be very close to the effective bitrate across the whole file.


As another example, a "128 kbps VBR MP3" is usually a misnomer, since the point of [[VBR]] is to allow each of the MP3's internal frames to have its own bitrate. When people refer to the bitrate of a VBR MP3, they are usually referring to the actual average of bitrate of its frames. If the duration of the encoded audio is known, then "bitrate" might be the size of the file divided by its duration, which will be pretty close to the same number. However, the duration of a VBR MP3 cannot be accurately determined without scanning all the frames.
As another example, a "128 kbps VBR MP3" is usually a misnomer, since the point of [[VBR]] is to allow each of the MP3's internal frames to have its own bitrate. When people refer to the bitrate of a VBR MP3, they are usually referring to the actual average of bitrate of its frames. If the duration of the encoded audio is known, then "bitrate" might be the size of the file data divided by its duration, which will be pretty close to the same number. However, the duration of a VBR MP3 cannot be accurately determined without scanning all the frames.
 
== Equivalent bitrate estimates for multichannel audio==
 
C.R.Helmrich [https://hydrogenaud.io/index.php/topic,120007.msg997612.html#msg997612 writes]:
<blockquote>
The following function gives you a weight w for each ''cc'', where cc is the channel configuration written as a decimal number (1.0 for mono, 2.0 for stereo, 5.1 for surround, etc.):
 
w(''cc'') = ''cc''<sup>0.75</sup>
 
If you want to know the quality equivalent mono bit-rate of, e.g., 128 kbps stereo, you simply calculate 128 * w(1.0)/w(2.0) = 128 * (1.0/2.0)^0.75 = 76 kbps. That function also tells you that, with 5.1 surround, you need roughly twice the stereo bit-rate for the same level of audio quality. Based on my experience that's quite reasonable, at least with modern codecs like Opus, (x)HE-AAC, and MPEG-H Audio.
</blockquote>
 
This very simple definition does two things:
* Surround channels are treated as one-tenth of a "real" channel. This is reasonable, because low-frequency effects (LFE) channel do carry little information.
* The power function makes it such that each additional channel adds less bitrate than a previous channel. This is also reasonable, considering [[joint stereo]] and analogous methods used to extract redundancy from multichannel audio.
 
[[Category:Technical]]

Latest revision as of 05:10, 12 August 2023

Bitrate means the data rate (i.e. how many bits get transferred in a certain amount of time), usually expressed in bits per second.

The common units of bit rate are kilobits per second (Kbps) and megabits per second (Mbps). In data rates, the multipliers "k", "M", etc. stand for powers of 1000, not powers of 1024.

The term is also commonly used when discussing digital sampling and sample rates. For example, the MP3 audio compression algorithm is often set to ouput files with a bitrate of 128 kbps. This means that the file contains an average of 128 kilobits for each second of audio (960KB per minute). This contrasts with CD audio, which is encoded as 44100 16-bit stereo samples per second: 1411.2 kbps (16bit x 44100Hz x 2 channels).

Often, upper-case units and multipliers are used for bytes (like "KB" for kilobytes) and lowercase multipliers are bits (like "kb" for kilobits). All modern computers use 8-bit bytes.

MP3 bitrates

MP3 bitrates can be deceptive. For example, a 128 kbps "constant bitrate" (CBR) MP3 will use about 128 kilobits for each second of audio that is encoded (so the file size, in bits, divided by the audio's duration, comes out to about 128,000), and its frame headers will occur at regular intervals, but internally, from frame to frame it may encode audio at a bitrate higher or lower than 128 kbps through the use of the bit reservoir (the ability of a frame to use spare bits from the preceding frame). However, the size of this reservoir, and thus the amount of variability, is limited, so 128 kbps will be very close to the effective bitrate across the whole file.

As another example, a "128 kbps VBR MP3" is usually a misnomer, since the point of VBR is to allow each of the MP3's internal frames to have its own bitrate. When people refer to the bitrate of a VBR MP3, they are usually referring to the actual average of bitrate of its frames. If the duration of the encoded audio is known, then "bitrate" might be the size of the file data divided by its duration, which will be pretty close to the same number. However, the duration of a VBR MP3 cannot be accurately determined without scanning all the frames.

Equivalent bitrate estimates for multichannel audio

C.R.Helmrich writes:

The following function gives you a weight w for each cc, where cc is the channel configuration written as a decimal number (1.0 for mono, 2.0 for stereo, 5.1 for surround, etc.):

w(cc) = cc0.75

If you want to know the quality equivalent mono bit-rate of, e.g., 128 kbps stereo, you simply calculate 128 * w(1.0)/w(2.0) = 128 * (1.0/2.0)^0.75 = 76 kbps. That function also tells you that, with 5.1 surround, you need roughly twice the stereo bit-rate for the same level of audio quality. Based on my experience that's quite reasonable, at least with modern codecs like Opus, (x)HE-AAC, and MPEG-H Audio.

This very simple definition does two things:

  • Surround channels are treated as one-tenth of a "real" channel. This is reasonable, because low-frequency effects (LFE) channel do carry little information.
  • The power function makes it such that each additional channel adds less bitrate than a previous channel. This is also reasonable, considering joint stereo and analogous methods used to extract redundancy from multichannel audio.