<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.hydrogenaudio.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Maikmerten</id>
	<title>Hydrogenaudio Knowledgebase - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.hydrogenaudio.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Maikmerten"/>
	<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Special:Contributions/Maikmerten"/>
	<updated>2026-05-07T02:42:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=38047</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=38047"/>
		<updated>2024-06-11T17:24:32Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ Document -L switch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
A value of &amp;quot;1&amp;quot; means that only frames with M/S stereo can include high frequency content. A value of &amp;quot;2&amp;quot; allows high-frequency content in all frame-types.&lt;br /&gt;
&lt;br /&gt;
Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -L || Set &#039;&#039;per-channel&#039;&#039; bitrate limit (upper cap) in VBR mode. Defaults to no limit. || -L80 to limit maximum VBR bitrate to 160 kbps for stereo files&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -T || Bias for VBR quality scale. Ranges from -40 to 50, defaults to 0. In conjunction with the base VBR quality scale (-V, see below) this determines the bitrate and quality of VBR encodings. Can be used to reach bitrates usually not achievable with the base VBR quality setting alone. || -V0 -T-40 for a lower than usually possible VBR bitrate&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: Only generic optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== -HF switch ===&lt;br /&gt;
&lt;br /&gt;
Due to a design decision in the MP3 format, encoding high-frequency content (frequencies beyond 16 kHz) can be comparatively costly in terms of bits, while these frequencies often do not contribute much to the perceived audio quality. For this reason, the Helix MP3 Encoder will not encode high-frequency content by default. This, however, can be controlled by the -HF switch.&lt;br /&gt;
&lt;br /&gt;
With -HF1, only Mid-Side stereo (M/S-stereo) frames will contain high-frequency content, while other frame-types will not encode any high-frequency content. The encoder will automatically choose the most efficient stereo mode for each frame. Usually, around 80% of frames will be coded as M/S-stereo (&amp;quot;joint&amp;quot; stereo encoding), with 20% of frames being coded as simple-stereo (separate encoding of channels). With -HF1, the ~20% of frames not being encoded in M/S-stereo will not encode high-frequency content, which might be perceivable as &amp;quot;dropouts&amp;quot; in the high frequency bands in unfavorable conditions.&lt;br /&gt;
&lt;br /&gt;
With -HF2, all frame types can encode high-frequency content, so no &amp;quot;dropouts&amp;quot; should occur.&lt;br /&gt;
&lt;br /&gt;
The behavior of -HF1 and -HF2 can be observed in the following spectrographs:&lt;br /&gt;
&lt;br /&gt;
-HF1: [[File:Helix-pink-noise-v110-hf1.png|384px]]&lt;br /&gt;
-HF2: [[File:Helix-pink-noise-v110-hf2.png|384px]]&lt;br /&gt;
&lt;br /&gt;
The rationale for having the -HF1 option in the first place may be that if M/S-stereo is not applicable for a given frame, many bits are already spent on encoding the stereo image with separate stereo encoding. If the bitrate cannot be increased (for instance, when doing CBR encoding), it might be preferable to spend the remaining bits on the usually more perceivable lower frequencies, omitting high-frequency content. This rationale appears less applicable to VBR encoding (as the encoder can choose a more fitting bit allocation) and thus using -HF1 in VBR encoding might not be recommendable.&lt;br /&gt;
&lt;br /&gt;
=== Magical Mystery Switch -TX ===&lt;br /&gt;
&lt;br /&gt;
During encoder-development, apparently different experimental settings were exposed for easy tweaking during testing. The [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/pub/bitallo.h#L65 BA_CONTROL data structure] includes the wonderfully named int variables &amp;quot;test1&amp;quot;, &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot;. While &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot; are unused, &amp;quot;test1&amp;quot; is used in in the function [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1069 startup_adjustNT1B of bitallo3.cpp]. The value of &amp;quot;test1&amp;quot; can be set via the -TX command line parameter. The default value is 6.&lt;br /&gt;
&lt;br /&gt;
The function startup_adjustNT1B adjusts (increases) the per-band &amp;quot;Noise Target&amp;quot; (NT). The value of &amp;quot;test1&amp;quot; provides a multiplier &amp;quot;f&amp;quot;, which factors in how much the noise target is adjusted. A [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1075 per-band threshold table] decides which bands receive adjustment.&lt;br /&gt;
&lt;br /&gt;
From code comments, it appears that the default value of 6 was determined to generally work best. It&#039;s unclear in what situations modifying this value is beneficial.&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37857</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37857"/>
		<updated>2024-04-20T12:45:18Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ Document -T switch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
A value of &amp;quot;1&amp;quot; means that only frames with M/S stereo can include high frequency content. A value of &amp;quot;2&amp;quot; allows high-frequency content in all frame-types.&lt;br /&gt;
&lt;br /&gt;
Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -T || Bias for VBR quality scale. Ranges from -40 to 50, defaults to 0. In conjunction with the base VBR quality scale (-V, see below) this determines the bitrate and quality of VBR encodings. Can be used to reach bitrates usually not achievable with the base VBR quality setting alone. || -V0 -T-40 for a lower than usually possible VBR bitrate&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: Only generic optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== -HF switch ===&lt;br /&gt;
&lt;br /&gt;
Due to a design decision in the MP3 format, encoding high-frequency content (frequencies beyond 16 kHz) can be comparatively costly in terms of bits, while these frequencies often do not contribute much to the perceived audio quality. For this reason, the Helix MP3 Encoder will not encode high-frequency content by default. This, however, can be controlled by the -HF switch.&lt;br /&gt;
&lt;br /&gt;
With -HF1, only Mid-Side stereo (M/S-stereo) frames will contain high-frequency content, while other frame-types will not encode any high-frequency content. The encoder will automatically choose the most efficient stereo mode for each frame. Usually, around 80% of frames will be coded as M/S-stereo (&amp;quot;joint&amp;quot; stereo encoding), with 20% of frames being coded as simple-stereo (separate encoding of channels). With -HF1, the ~20% of frames not being encoded in M/S-stereo will not encode high-frequency content, which might be perceivable as &amp;quot;dropouts&amp;quot; in the high frequency bands in unfavorable conditions.&lt;br /&gt;
&lt;br /&gt;
With -HF2, all frame types can encode high-frequency content, so no &amp;quot;dropouts&amp;quot; should occur.&lt;br /&gt;
&lt;br /&gt;
The behavior of -HF1 and -HF2 can be observed in the following spectrographs:&lt;br /&gt;
&lt;br /&gt;
-HF1: [[File:Helix-pink-noise-v110-hf1.png|384px]]&lt;br /&gt;
-HF2: [[File:Helix-pink-noise-v110-hf2.png|384px]]&lt;br /&gt;
&lt;br /&gt;
The rationale for having the -HF1 option in the first place may be that if M/S-stereo is not applicable for a given frame, many bits are already spent on encoding the stereo image with separate stereo encoding. If the bitrate cannot be increased (for instance, when doing CBR encoding), it might be preferable to spend the remaining bits on the usually more perceivable lower frequencies, omitting high-frequency content. This rationale appears less applicable to VBR encoding (as the encoder can choose a more fitting bit allocation) and thus using -HF1 in VBR encoding might not be recommendable.&lt;br /&gt;
&lt;br /&gt;
=== Magical Mystery Switch -TX ===&lt;br /&gt;
&lt;br /&gt;
During encoder-development, apparently different experimental settings were exposed for easy tweaking during testing. The [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/pub/bitallo.h#L65 BA_CONTROL data structure] includes the wonderfully named int variables &amp;quot;test1&amp;quot;, &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot;. While &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot; are unused, &amp;quot;test1&amp;quot; is used in in the function [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1069 startup_adjustNT1B of bitallo3.cpp]. The value of &amp;quot;test1&amp;quot; can be set via the -TX command line parameter. The default value is 6.&lt;br /&gt;
&lt;br /&gt;
The function startup_adjustNT1B adjusts (increases) the per-band &amp;quot;Noise Target&amp;quot; (NT). The value of &amp;quot;test1&amp;quot; provides a multiplier &amp;quot;f&amp;quot;, which factors in how much the noise target is adjusted. A [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1075 per-band threshold table] decides which bands receive adjustment.&lt;br /&gt;
&lt;br /&gt;
From code comments, it appears that the default value of 6 was determined to generally work best. It&#039;s unclear in what situations modifying this value is beneficial.&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37856</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37856"/>
		<updated>2024-04-20T08:35:32Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* -HF switch */ spectographs of HF1 and HF2 and description of encoding behavior&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
A value of &amp;quot;1&amp;quot; means that only frames with M/S stereo can include high frequency content. A value of &amp;quot;2&amp;quot; allows high-frequency content in all frame-types.&lt;br /&gt;
&lt;br /&gt;
Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: Only generic optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== -HF switch ===&lt;br /&gt;
&lt;br /&gt;
Due to a design decision in the MP3 format, encoding high-frequency content (frequencies beyond 16 kHz) can be comparatively costly in terms of bits, while these frequencies often do not contribute much to the perceived audio quality. For this reason, the Helix MP3 Encoder will not encode high-frequency content by default. This, however, can be controlled by the -HF switch.&lt;br /&gt;
&lt;br /&gt;
With -HF1, only Mid-Side stereo (M/S-stereo) frames will contain high-frequency content, while other frame-types will not encode any high-frequency content. The encoder will automatically choose the most efficient stereo mode for each frame. Usually, around 80% of frames will be coded as M/S-stereo (&amp;quot;joint&amp;quot; stereo encoding), with 20% of frames being coded as simple-stereo (separate encoding of channels). With -HF1, the ~20% of frames not being encoded in M/S-stereo will not encode high-frequency content, which might be perceivable as &amp;quot;dropouts&amp;quot; in the high frequency bands in unfavorable conditions.&lt;br /&gt;
&lt;br /&gt;
With -HF2, all frame types can encode high-frequency content, so no &amp;quot;dropouts&amp;quot; should occur.&lt;br /&gt;
&lt;br /&gt;
The behavior of -HF1 and -HF2 can be observed in the following spectrographs:&lt;br /&gt;
&lt;br /&gt;
-HF1: [[File:Helix-pink-noise-v110-hf1.png|384px]]&lt;br /&gt;
-HF2: [[File:Helix-pink-noise-v110-hf2.png|384px]]&lt;br /&gt;
&lt;br /&gt;
The rationale for having the -HF1 option in the first place may be that if M/S-stereo is not applicable for a given frame, many bits are already spent on encoding the stereo image with separate stereo encoding. If the bitrate cannot be increased (for instance, when doing CBR encoding), it might be preferable to spend the remaining bits on the usually more perceivable lower frequencies, omitting high-frequency content. This rationale appears less applicable to VBR encoding (as the encoder can choose a more fitting bit allocation) and thus using -HF1 in VBR encoding might not be recommendable.&lt;br /&gt;
&lt;br /&gt;
=== Magical Mystery Switch -TX ===&lt;br /&gt;
&lt;br /&gt;
During encoder-development, apparently different experimental settings were exposed for easy tweaking during testing. The [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/pub/bitallo.h#L65 BA_CONTROL data structure] includes the wonderfully named int variables &amp;quot;test1&amp;quot;, &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot;. While &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot; are unused, &amp;quot;test1&amp;quot; is used in in the function [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1069 startup_adjustNT1B of bitallo3.cpp]. The value of &amp;quot;test1&amp;quot; can be set via the -TX command line parameter. The default value is 6.&lt;br /&gt;
&lt;br /&gt;
The function startup_adjustNT1B adjusts (increases) the per-band &amp;quot;Noise Target&amp;quot; (NT). The value of &amp;quot;test1&amp;quot; provides a multiplier &amp;quot;f&amp;quot;, which factors in how much the noise target is adjusted. A [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1075 per-band threshold table] decides which bands receive adjustment.&lt;br /&gt;
&lt;br /&gt;
From code comments, it appears that the default value of 6 was determined to generally work best. It&#039;s unclear in what situations modifying this value is beneficial.&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=File:Helix-pink-noise-v110-hf1.png&amp;diff=37855</id>
		<title>File:Helix-pink-noise-v110-hf1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=File:Helix-pink-noise-v110-hf1.png&amp;diff=37855"/>
		<updated>2024-04-20T07:59:02Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: Typo in &amp;quot;Spectrograph&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Spectrograph of pink noise (stereo, 16 bits, 44.1 kHz, -10 dB, uniform distribution) encoded encoded by the Helix MP3 Encoder (hmp3), visualized with Spek.&lt;br /&gt;
&lt;br /&gt;
hmp3 settings: -V110 -HF1&lt;br /&gt;
&lt;br /&gt;
The encoder chose 18.0 % Simple stereo frames and 82.0 % Mid-side stereo frames. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Image provided by HydrogenAudio member 145dBSPL.&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=File:Helix-pink-noise-v110-hf2.png&amp;diff=37854</id>
		<title>File:Helix-pink-noise-v110-hf2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=File:Helix-pink-noise-v110-hf2.png&amp;diff=37854"/>
		<updated>2024-04-20T07:58:35Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: Spectrograph of pink noise (stereo, 16 bits, 44.1 kHz, -10 dB, uniform distribution) encoded encoded by the Helix MP3 Encoder (hmp3), visualized with Spek.

hmp3 settings: -V110 -HF2

The encoder chose 18.0 % Simple stereo frames and 82.0 % Mid-side st...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Spectrograph of pink noise (stereo, 16 bits, 44.1 kHz, -10 dB, uniform distribution) encoded encoded by the Helix MP3 Encoder (hmp3), visualized with Spek.&lt;br /&gt;
&lt;br /&gt;
hmp3 settings: -V110 -HF2&lt;br /&gt;
&lt;br /&gt;
The encoder chose 18.0 % Simple stereo frames and 82.0 % Mid-side stereo frames. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Image provided by HydrogenAudio member 145dBSPL.&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=File:Helix-pink-noise-v110-hf1.png&amp;diff=37853</id>
		<title>File:Helix-pink-noise-v110-hf1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=File:Helix-pink-noise-v110-hf1.png&amp;diff=37853"/>
		<updated>2024-04-20T07:57:53Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: Spectograph of pink noise (stereo, 16 bits, 44.1 kHz, -10 dB, uniform distribution) encoded encoded by the Helix MP3 Encoder (hmp3), visualized with Spek.

hmp3 settings: -V110 -HF1

The encoder chose 18.0 % Simple stereo frames and 82.0 % Mid-side ste...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Spectograph of pink noise (stereo, 16 bits, 44.1 kHz, -10 dB, uniform distribution) encoded encoded by the Helix MP3 Encoder (hmp3), visualized with Spek.&lt;br /&gt;
&lt;br /&gt;
hmp3 settings: -V110 -HF1&lt;br /&gt;
&lt;br /&gt;
The encoder chose 18.0 % Simple stereo frames and 82.0 % Mid-side stereo frames. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Image provided by HydrogenAudio member 145dBSPL.&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37852</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37852"/>
		<updated>2024-04-20T07:50:54Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ new section regarding the -HF switch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
A value of &amp;quot;1&amp;quot; means that only frames with M/S stereo can include high frequency content. A value of &amp;quot;2&amp;quot; allows high-frequency content in all frame-types.&lt;br /&gt;
&lt;br /&gt;
Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: Only generic optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== -HF switch ===&lt;br /&gt;
&lt;br /&gt;
Due to ta design decision in the MP3 bitstream format, encoding high-frequency content (frequencies beyond 16 kHz) can be comparatively costly in terms of bits, while these frequencies often do not contribute much to the perceived audio quality. For this reason, the Helix MP3 Encoder will not encode high-frequency content by default. This, however, can be controlled by the -HF switch.&lt;br /&gt;
&lt;br /&gt;
=== Magical Mystery Switch -TX ===&lt;br /&gt;
&lt;br /&gt;
During encoder-development, apparently different experimental settings were exposed for easy tweaking during testing. The [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/pub/bitallo.h#L65 BA_CONTROL data structure] includes the wonderfully named int variables &amp;quot;test1&amp;quot;, &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot;. While &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot; are unused, &amp;quot;test1&amp;quot; is used in in the function [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1069 startup_adjustNT1B of bitallo3.cpp]. The value of &amp;quot;test1&amp;quot; can be set via the -TX command line parameter. The default value is 6.&lt;br /&gt;
&lt;br /&gt;
The function startup_adjustNT1B adjusts (increases) the per-band &amp;quot;Noise Target&amp;quot; (NT). The value of &amp;quot;test1&amp;quot; provides a multiplier &amp;quot;f&amp;quot;, which factors in how much the noise target is adjusted. A [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1075 per-band threshold table] decides which bands receive adjustment.&lt;br /&gt;
&lt;br /&gt;
From code comments, it appears that the default value of 6 was determined to generally work best. It&#039;s unclear in what situations modifying this value is beneficial.&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37797</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37797"/>
		<updated>2024-04-08T12:49:52Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ Extend description for -HF&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
A value of &amp;quot;1&amp;quot; means that only frames with M/S stereo can include high frequency content. A value of &amp;quot;2&amp;quot; allows high-frequency content in all frame-types.&lt;br /&gt;
&lt;br /&gt;
Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: Only generic optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Magical Mystery Switch -TX ===&lt;br /&gt;
&lt;br /&gt;
During encoder-development, apparently different experimental settings were exposed for easy tweaking during testing. The [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/pub/bitallo.h#L65 BA_CONTROL data structure] includes the wonderfully named int variables &amp;quot;test1&amp;quot;, &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot;. While &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot; are unused, &amp;quot;test1&amp;quot; is used in in the function [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1069 startup_adjustNT1B of bitallo3.cpp]. The value of &amp;quot;test1&amp;quot; can be set via the -TX command line parameter. The default value is 6.&lt;br /&gt;
&lt;br /&gt;
The function startup_adjustNT1B adjusts (increases) the per-band &amp;quot;Noise Target&amp;quot; (NT). The value of &amp;quot;test1&amp;quot; provides a multiplier &amp;quot;f&amp;quot;, which factors in how much the noise target is adjusted. A [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1075 per-band threshold table] decides which bands receive adjustment.&lt;br /&gt;
&lt;br /&gt;
From code comments, it appears that the default value of 6 was determined to generally work best. It&#039;s unclear in what situations modifying this value is beneficial.&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37784</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37784"/>
		<updated>2024-03-29T12:21:31Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Magical Mystery Switch -TX */ typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: Only generic optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Magical Mystery Switch -TX ===&lt;br /&gt;
&lt;br /&gt;
During encoder-development, apparently different experimental settings were exposed for easy tweaking during testing. The [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/pub/bitallo.h#L65 BA_CONTROL data structure] includes the wonderfully named int variables &amp;quot;test1&amp;quot;, &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot;. While &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot; are unused, &amp;quot;test1&amp;quot; is used in in the function [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1069 startup_adjustNT1B of bitallo3.cpp]. The value of &amp;quot;test1&amp;quot; can be set via the -TX command line parameter. The default value is 6.&lt;br /&gt;
&lt;br /&gt;
The function startup_adjustNT1B adjusts (increases) the per-band &amp;quot;Noise Target&amp;quot; (NT). The value of &amp;quot;test1&amp;quot; provides a multiplier &amp;quot;f&amp;quot;, which factors in how much the noise target is adjusted. A [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1075 per-band threshold table] decides which bands receive adjustment.&lt;br /&gt;
&lt;br /&gt;
From code comments, it appears that the default value of 6 was determined to generally work best. It&#039;s unclear in what situations modifying this value is beneficial.&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37783</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37783"/>
		<updated>2024-03-29T12:18:12Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ Some words on -TX&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: Only generic optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Magical Mystery Switch -TX ===&lt;br /&gt;
&lt;br /&gt;
During encoder-development, apparently different experimental settings were exposed for easy tweaking during testing. The [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/pub/bitallo.h#L65 BA_CONTROL data structure] includes the wonderfully named int variables &amp;quot;test1&amp;quot;, &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot;. While &amp;quot;test2&amp;quot; and &amp;quot;test3&amp;quot; and unused, &amp;quot;test1&amp;quot; is used in in the function [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1069 startup_adjustNT1B of bitallo3.cpp]. The value of &amp;quot;test1&amp;quot; can be set via the -TX command line parameter. The default value is 6.&lt;br /&gt;
&lt;br /&gt;
The function startup_adjustNT1B adjusts (increases) the per-band &amp;quot;Noise Target&amp;quot; (NT). The value of &amp;quot;test1&amp;quot; provides a multiplier &amp;quot;f&amp;quot;, which factors in how much the noise target is adjusted. A [https://github.com/maikmerten/hmp3/blob/0e895bf47fdb0de3093622465031c8dbc4acc0b6/hmp3/src/bitallo3.cpp#L1075 per-band threshold table] decides which bands receive adjustment.&lt;br /&gt;
&lt;br /&gt;
From code comments, it appears that the default value of 6 was determined to generally work best. It&#039;s unclear in what situations modifying this value is beneficial.&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37781</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37781"/>
		<updated>2024-03-26T06:46:56Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Reasonable Settings */ remove superfluous low-pass parameters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: Only generic optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Xing&amp;diff=37780</id>
		<title>Xing</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Xing&amp;diff=37780"/>
		<updated>2024-03-25T20:10:12Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: Link to Helix MP3 Encoder page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Xing&#039;&#039;&#039; (pronounced &amp;quot;zing&amp;quot;) [[MP3]] encoder was one of the fastest MP3 encoders. Of course that comes with a price, and quality wasn&#039;t on par with encoders tuned for quality instead of speed, like FhG Slowenc ([[Audioactive]]) and [[LAME]]. Yet despite its reputation for poor quality, Xing&#039;s ~128 kbps VBR mode compared favorably in [http://web.archive.org/web/20071005104610/http://www.rjamorim.com/test/ an early 2004 listening test].&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
* Encodes .wav to MPEG-1 and MPEG-2 layer 3 audio&lt;br /&gt;
* Encodes bitrates ranging from 28 to 320 kbps&lt;br /&gt;
* Variable Bitrate (VBR) encoding support&lt;br /&gt;
* High Frequency Encoding support (up to 20 kHz)&lt;br /&gt;
* Low data rate support&lt;br /&gt;
* Several times faster than most popular encoders&lt;br /&gt;
* Automated batch processing&lt;br /&gt;
* MP3 playback capabilities&lt;br /&gt;
* GUI based and command-line encoder front ends&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
===XingMP3 standalone encoder===&lt;br /&gt;
[[Image:xingmp3encoder.png|frame|right|Xing Mp3 Encoder (v1.5 GUI, main window)]]&lt;br /&gt;
&lt;br /&gt;
The last standalone version of the Xing encoder was XingMP3 1.5, released in March 1999. It included a command-line interface (x3enc.exe), and a GUI (mp3enc.exe). The GUI was restricted to using a limited set of encoding profiles, whereas the command-line encoder had more options.&lt;br /&gt;
&lt;br /&gt;
After that release, the encoder continued to be improved, but it was only distributed as part of the [[wikipedia:RealPlayer|RealPlayer]] bundle.&amp;lt;!--details, anyone? I&#039;m not putting RealPlayer 10 on my system just to find out what interface they gave the MP3 encoder--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Helix MP3 Encoder===&lt;br /&gt;
In 2005, RealNetworks - owners of the Xing assets after acquiring [[wikipedia:Xing Technology|Xing Technology]], a.k.a. XingTech - decided to release the encoder under an [[open source]] license, with the new name &#039;&#039;&#039;Helix mp3enc&#039;&#039;&#039;. The new version of the encoder is a code library which also has a command-line interface, but there is no GUI.&lt;br /&gt;
&lt;br /&gt;
The [[Helix MP3 Encoder]] is part of the Helix datatype project, a collection of code libraries intended to support the [[wikipedia:Helix (multimedia project)|Helix multimedia project]].&lt;br /&gt;
&lt;br /&gt;
In November 2022 HydrogenAudio user [https://hydrogenaud.io/index.php?action=profile;u=1312 maikmerten] updated the encoder to include a [[LAME#VBR_header_and_LAME_tag|lametag]] to provide sample accurate encoding/decoding for VBR and CBR, plus a bug fix to the original code.&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder command-line executable for Windows, at RareWares]&lt;br /&gt;
* [https://web.archive.org/web/20160105123337/https://datatype.helixcommunity.org/files/2005/mp3enc.doc Helix MP3 encoder API docs (via archive.org)]&lt;br /&gt;
* &amp;lt;s&amp;gt;[https://helixcommunity.org/viewcvs/datatype/mp3/codec/encoder/ Helix MP3 encoder source code (CVS)]&amp;lt;/s&amp;gt;&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,35531.0.html|Related discussion (2005-2016)}}&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder (Nov 2022+)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37779</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37779"/>
		<updated>2024-03-25T17:47:00Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ update to -U switch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: Only generic optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37778</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37778"/>
		<updated>2024-03-25T17:43:04Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Assembly optimization */ minor typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: No assembly optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimizations ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37777</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37777"/>
		<updated>2024-03-25T17:35:19Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Technical details */ some words on the assembly optimizations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: No assembly optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Assembly optimization ===&lt;br /&gt;
&lt;br /&gt;
In platform/win/i386, there are optimized assembly versions of speed-critical routines. These target 32-bit x86-CPUs in general (but usually optimized for the Pentium 2), with some routines also being available for SSE, targeting the Pentium 3 (assembly files starting with &amp;quot;x&amp;quot;). These SSE optimizations can be selected via the -U parameter.&lt;br /&gt;
&lt;br /&gt;
These routines are somewhat outdated. They only work in Visual Studio up to version 2015, only for the Windows platform - and only for 32-bit targets. It has been demonstrated that modern compilers generate faster code from the pure C source code. As such, these assembly optimizations appear to be superfluous.&lt;br /&gt;
&lt;br /&gt;
That modern compilers can generate faster code might (but this is speculation) have something to do with the hand-written assembly version mixing x87 FPU instructions (in the routines for general i386 CPUs) with SSE instructions (which have their own register set). Modern CPUs appear to prefer doing all (even scalar) floating point operations in SSE or AVX registers.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37776</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37776"/>
		<updated>2024-03-25T17:17:52Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ document -U switch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -U&lt;br /&gt;
|&lt;br /&gt;
Select assembly optimizations. 0: No assembly optimizations, 1: unused (was supposed to be AMD&#039;s 3Dnow!) 2: use SSE assembly optimizations (Intel Pentium 3).&lt;br /&gt;
&lt;br /&gt;
This only has an effect if the encoder is compiled with Visual Studio (up to version 2015) for 32-bit Windows. No effect if the encoder is compiled for Linux, 64-bit Windows or, e.g., ARM processors.&lt;br /&gt;
| -U2 to use SSE assembly (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37775</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37775"/>
		<updated>2024-03-25T17:05:08Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Technical details */ describe transient detection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Detection of transients ===&lt;br /&gt;
&lt;br /&gt;
To detect transients that warrant a switch to short blocks, the Helix MP3 Encoder uses output from the 32-band polyphase filterbank. The encoder computes &amp;quot;energy&amp;quot; values from the filterbank output and compares current energy values with values for the previous granule (detect.c). This is accomplished by an &amp;quot;energy history&amp;quot; (defined as &amp;quot;attack_buf&amp;quot; in mp3enc.h).&lt;br /&gt;
&lt;br /&gt;
If the energy values differ enough (above the threshold for short block detection), short blocks will be used. The encoder will use short blocks for both channels, even if only the signal of one channel triggered the transients detection.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37774</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37774"/>
		<updated>2024-03-25T16:45:05Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Bit allocators */ details on stereo modes for BA1 and BA3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| M/S-Stereo || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Dual Channel Stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37773</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37773"/>
		<updated>2024-03-25T16:42:49Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: Structure technical details into its own section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
The following bits might not be relevant for daily-use of the Helix MP3 Encoder, but might be interesting to developers.&lt;br /&gt;
&lt;br /&gt;
=== Bit allocators ===&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37772</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37772"/>
		<updated>2024-03-25T14:38:53Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Bit allocators */ Consistency with bold-ening &amp;quot;not&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Bit allocators ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not&#039;&#039;&#039; supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37771</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37771"/>
		<updated>2024-03-25T14:35:02Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Features */ link to related Wiki pages (MP3, CBR, VBR)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Encodes [[MP3]] in MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* [[CBR]] and [[VBR]] encoding&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Bit allocators ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not supported&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37770</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37770"/>
		<updated>2024-03-25T14:23:43Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Reasonable Settings */ document some &amp;quot;reasonable&amp;quot; settings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a short list of settings for different encoding needs. Note that while comparisons to LAME&#039;s VBR settings are provided, these are only &#039;&#039;very rough estimates&#039;&#039; to provide guidance regarding potential use cases. LAME and Helix are very different encoders and are expected to perform better and worse in comparison, depending on audio material.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Overview of reasonable hmp3 settings&lt;br /&gt;
|-&lt;br /&gt;
! Setting !! Approx. Bitrate !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
  -F24000 -HF2 -V150&lt;br /&gt;
| ~ 256 kbps&lt;br /&gt;
| Maximum quality VBR encoding, with full audio spectrum. (ca. LAME -V 0)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F19000 -HF2 -V110&lt;br /&gt;
| ~ 195 kbps&lt;br /&gt;
|&lt;br /&gt;
High-quality VBR encoding, audio spectrum up to 19 kHz. (ca. LAME -V 2)&lt;br /&gt;
&lt;br /&gt;
This should be close to transparent to most people in most situations.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F18000 -HF2 -V80&lt;br /&gt;
| ~ 160 kbps&lt;br /&gt;
| Medium-quality VBR encoding, audio spectrum up to 18 kHz. (ca. LAME -V 4)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  -F16000 -V50&lt;br /&gt;
| ~ 128 kbps&lt;br /&gt;
| &lt;br /&gt;
Low-medium-quality VBR encoding, audio spectrum up to 16 kHz. (ca. LAME -V 5-6)&lt;br /&gt;
&lt;br /&gt;
Default setting of the Helix MP3 Encoder. Should be sufficient for casual listening on space-constrained devices, but is not expected to be universally transparent.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Bit allocators ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not supported&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37769</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37769"/>
		<updated>2024-03-25T13:55:32Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: prepare new section &amp;quot;Reasonable Settings&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reasonable Settings ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Bit allocators ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not supported&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37768</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37768"/>
		<updated>2024-03-25T13:30:37Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */  document -N switch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -N || Enable use of Intensity Stereo. Only works with CBR and makes the encoder use &amp;quot;Bit Allocator 1&amp;quot; (see section &amp;quot;Bit Allocators&amp;quot;) || -N8 to enable Intensity Stereo with 8 bands of M/S stereo&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Bit allocators ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not supported&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable)] at RareWares&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37766</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37766"/>
		<updated>2024-03-25T13:00:43Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ Formatting for -HF switch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF&lt;br /&gt;
| Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings.&lt;br /&gt;
&lt;br /&gt;
High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96.&lt;br /&gt;
| HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Bit allocators ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not supported&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable), at RareWares]&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37765</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37765"/>
		<updated>2024-03-25T12:44:51Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Bit allocators */ Feature-comparison of bit allocators&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = RealNetworks,&lt;br /&gt;
{{ha user|1312|maikmerten}} maintains GitHub repo&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 GitHub repo]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF || Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings. High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96. || -HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Bit allocators ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Bit allocators&lt;br /&gt;
|-&lt;br /&gt;
! Feature || Bit Allocator 1 !! Bit Allocator 3&lt;br /&gt;
|-&lt;br /&gt;
| CBR || supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| VBR || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;16 kHz encoding || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Long/Short block switching || &#039;&#039;&#039;not&#039;&#039;&#039; supported || supported&lt;br /&gt;
|-&lt;br /&gt;
| Intensity stereo || supported || &#039;&#039;&#039;not supported&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit Allocator 1 thus is mostly interesting for very low-bitrate CBR encodings, where intensity stereo can lead to bitrate savings to spend somewhere else. Example:&lt;br /&gt;
 &lt;br /&gt;
  hmp3 input.wav output.mp3 -F16000 -B48 -N8&lt;br /&gt;
&lt;br /&gt;
for somewhat bearable low-bitrate stereo-ish MP3 encoding (the -N parameter enables intensity stereo).&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable), at RareWares]&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37763</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37763"/>
		<updated>2024-03-25T12:29:39Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: Start a section on the available bit allocators, will add a comparison later&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = {{ha user|1312|maikmerten}} (maintainer of GitHub repo, not original creator)&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 github]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF || Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings. High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96. || -HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Bit allocators ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 Encoder, apparently for historical reasons, has two distinct bit allocators, which are selected depending on operating modes. &#039;&#039;&#039;Bit Allocator 1&#039;&#039;&#039; (bitallo1.cpp) appears to be the older one, most likely inherited from early Xing days, while &#039;&#039;&#039;Bit Allocator 3&#039;&#039;&#039; (bitallo3.cpp) is a newer, overall more-capable mechanism that is utilized by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable), at RareWares]&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37762</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37762"/>
		<updated>2024-03-25T12:17:38Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ Document bitrate/quality range for -HF switch.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = {{ha user|1312|maikmerten}} (maintainer of GitHub repo, not original creator)&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 github]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF || Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings. High frequencies will only be encoded if -V &amp;gt;= 80 or -B &amp;gt;= 96. || -HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable), at RareWares]&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37761</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37761"/>
		<updated>2024-03-25T12:06:11Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ specify default for -X&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = {{ha user|1312|maikmerten}} (maintainer of GitHub repo, not original creator)&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 github]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF || Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings. || -HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless information) (default)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rarewares.org/mp3-others.php#helix_enc Helix MP3 encoder (Windows command-line executable), at RareWares]&lt;br /&gt;
* {{ha|https://hydrogenaud.io/index.php/topic,123331.0.html|Resurrecting/Preserving the Helix MP3 encoder}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37759</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37759"/>
		<updated>2024-03-25T12:04:50Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ document -X switch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = {{ha user|1312|maikmerten}} (maintainer of GitHub repo, not original creator)&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 github]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF || Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings. || -HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|-&lt;br /&gt;
| -X || Control writing of Xing/LAME header information. 0: No headers, 1: only basic Xing information header, 2: Xing header with VBR-TOC and LAME header (gapless)  || -X0 to disable headers (in very rare cases of incompatibility)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37758</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37758"/>
		<updated>2024-03-25T12:00:08Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = {{ha user|1312|maikmerten}} (maintainer of GitHub repo, not original creator)&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 github]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF || Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings. || -HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37757</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37757"/>
		<updated>2024-03-25T11:51:23Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoder switches */ Stereo/Mono control&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software Infobox&lt;br /&gt;
| name                 = Helix MP3 Encoder&lt;br /&gt;
| logo                 =&lt;br /&gt;
| screenshot           = &lt;br /&gt;
| caption              = &lt;br /&gt;
| developer            = {{ha user|1312|maikmerten}}&lt;br /&gt;
| released             = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| stable_release       = &lt;br /&gt;
| stable_release_date  = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release      = &lt;br /&gt;
| preview_release_date = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
| preview_release_ref  =&lt;br /&gt;
| operating_system     = Linux, Windows&lt;br /&gt;
| use                  = Encoder&lt;br /&gt;
| license              = [https://github.com/maikmerten/hmp3/blob/main/hmp3/LICENSE.txt RPSL]&lt;br /&gt;
| website              = [https://github.com/maikmerten/hmp3 github]&lt;br /&gt;
}}&lt;br /&gt;
The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF || Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings. || -HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -M || Stereo-mode/Mono selection. 0: stereo, 1: M/S stereo (default), 2: dual channel, 3: mono || -M3 to downmix to mono&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Encoder/Decoder]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37755</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37755"/>
		<updated>2024-03-25T11:22:27Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: add some MP3 listening tests with Helix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Listening tests ==&lt;br /&gt;
&lt;br /&gt;
The Helix MP3 encoder participated in several listening tests and demonstrated to be amongst the highest-quality encoders for MP3 available.&lt;br /&gt;
&lt;br /&gt;
* [https://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Public MP3 listening test, October 2008]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,100896.0.html Personal listening test by Kamedo2, ~224 kbps, May 2013]&lt;br /&gt;
* [https://hydrogenaud.io/index.php/topic,113324.0.html Personal listening test by Kamedo2, ~192 kbps, December 2016]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF || Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings. || -HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37754</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37754"/>
		<updated>2024-03-25T10:24:29Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: some initial encoder switch documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version (&amp;quot;hmp3&amp;quot;), with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encoder switches ==&lt;br /&gt;
&lt;br /&gt;
hmp3 is a command-line operated application. The most basic invocation to generate a MP3 file from WAV:&lt;br /&gt;
&lt;br /&gt;
  hmp3 input.wav output.mp3&lt;br /&gt;
&lt;br /&gt;
This creates a ~128 kbps VBR file for 44.1 kHz stereo input.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Encoder switches&lt;br /&gt;
|-&lt;br /&gt;
! Switch !! Function || Example&lt;br /&gt;
|-&lt;br /&gt;
| -B || Set &#039;&#039;per-channel&#039;&#039; bitrate. Selects &#039;&#039;&#039;CBR&#039;&#039;&#039; encoding. || -B64 for a 128 kbps stereo CBR file  &lt;br /&gt;
|-&lt;br /&gt;
| -F || Frequency cutoff for the encoder lowpass filter. To actually encode anything beyond 16 kHz, also specify the -HF switch. || -F19000 for a 19 kHz lowpass&lt;br /&gt;
|-&lt;br /&gt;
| -HF || Controls encoding of high frequency content (&amp;gt; 16 kHz). Disabled by default. Valid values are 0 (disabled), 1 (partial, only &amp;quot;mode-1 granules&amp;quot;), 2 (full, &amp;quot;all granules&amp;quot;). Note that high-frequency content will only be encoded if the psychoacoustic model deems encoding high frequencies as beneficial for the given bitrate/quality settings. || -HF2 for unrestricted high-frequency encoding&lt;br /&gt;
|-&lt;br /&gt;
| -SBT || Threshold for short-block decisions. &#039;&#039;Lower&#039;&#039; values mean &#039;&#039;more&#039;&#039; short-block usage. Default is 700. ||  -SBT500 for more short-blocks (more responsive to transients, might increase bitrate in VBR)&lt;br /&gt;
|-&lt;br /&gt;
| -V || Quality setting for &#039;&#039;&#039;VBR&#039;&#039;&#039; encoding. Ranges from 0 to 150. Default is 50. || -V115 for a ~180-200 kbps stereo VBR file&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37753</id>
		<title>Helix MP3 Encoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Helix_MP3_Encoder&amp;diff=37753"/>
		<updated>2024-03-25T09:58:52Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: initial page for the Helix MP3 Encoder&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Helix MP3 Encoder was open-sourced by RealNetworks ca. 2005 via the (long-defunct) Helix community project. It originated from the [[Xing]] MP3 encoder, which was purchased by RealNetworks.&lt;br /&gt;
&lt;br /&gt;
A current version, with contributions from HydrogenAudio members, is available as source code over at [https://github.com/maikmerten/hmp3 https://github.com/maikmerten/hmp3]. This Wiki page discusses that version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Supports MPEG-1 and MPEG-2 modes&lt;br /&gt;
** 48 kHz, 44.1 kHz, 32 kHz (MPEG-1)&lt;br /&gt;
** 24 kHz, 22.05 kHz, 16 kHz (MPEG-2)&lt;br /&gt;
* LAME headers for gapless playback&lt;br /&gt;
* CBR and VBR encoding&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=MP3&amp;diff=37752</id>
		<title>MP3</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=MP3&amp;diff=37752"/>
		<updated>2024-03-25T09:42:57Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoders/decoders (supported platforms) */ &amp;quot;Helix MP3&amp;quot; to &amp;quot;Helix MP3 Encoder&amp;quot; to differentiate from the Helix MP3 Decoder (which also exists)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;MPEG-1 Audio Layer 3&#039;&#039;&#039;, more commonly referred to as MP3, is a popular digital audio encoding and lossy compression format, designed to greatly reduce the amount of data required to represent audio, yet still sound like a faithful reproduction of the original uncompressed audio to most listeners. It was invented by a team of European engineers who worked in the framework of the EUREKA 147 DAB digital radio research program, and it became an ISO/IEC standard in 1991.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
The MP3 algorithm development started in 1987, with a joint cooperation of [http://www.iis.fraunhofer.de/ Fraunhofer IIS-A] and the University of Erlangen. It is standardized as ISO-MPEG Audio Layer-3 (IS 11172-3 and IS 13818-3).&lt;br /&gt;
&lt;br /&gt;
It soon became the de facto standard for lossy audio encoding, due to the high [[compression rates]] (1/11 of the original size, still retaining considerable quality), the high availability of decoders and the low CPU requirements for playback. (486 DX2-100 is enough for real-time decoding)&lt;br /&gt;
&lt;br /&gt;
It supports [[multichannel]] files (see [http://www.mp3surround-format.com/ page]), [[sampling rate]]s from 16 kHz to 24 kHz (MPEG2 Layer 3) and 32 kHz to 48 kHz (MPEG1 Layer 3)&lt;br /&gt;
&lt;br /&gt;
Formal and informal listening tests have shown that MP3 at the 160-224 kbps range provide encoded results indistinguishable from the original materials in most of the cases.&lt;br /&gt;
&lt;br /&gt;
== Encoding and decoding ==&lt;br /&gt;
=== Encoding of MP3 audio ===&lt;br /&gt;
The MPEG-1 standard does not include a precise specification for an MP3 encoder. The decoding algorithm and file format, as a contrast, are well defined. Implementers of the standard were supposed to devise their own algorithms suitable for removing parts of the information in the raw audio (or rather its MDCT representation in the frequency domain). During encoding 576 time domain samples are taken and are transformed to 576 frequency domain samples. If there is a transient 192 samples are taken instead of 576. This is done to limit the temporal spread of quantization noise accompanying the transient.&lt;br /&gt;
&lt;br /&gt;
This is the domain of psychoacoustics: the study of subjective human perception of sounds.&lt;br /&gt;
&lt;br /&gt;
As a result, there are many different MP3 encoders available, each producing files of differing quality. Comparisons are widely available, so it is easy for a prospective user of an encoder to research the best choice. It must be kept in mind that an encoder that is proficient at encoding at higher bitrates (such as LAME, which is in widespread use for encoding at higher bitrates) is not necessarily as good at other, lower bitrates.&lt;br /&gt;
&lt;br /&gt;
=== Decoding of MP3 audio ===&lt;br /&gt;
Decoding, on the other hand, is carefully defined in the standard. Most decoders are &amp;quot;bitstream compliant&amp;quot;, meaning that the decompressed output they produce from a given MP3 file will be the same (within a specified degree of rounding tolerance) as the output specified mathematically in the ISO/IEC standard document. The MP3 file has a standard format which is a frame consisting of 384, 576, or 1152 samples (depends on MPEG version and layer) and all the frames have associated header information (32 bits) and side information (9, 17, or 32 bytes, depending on MPEG version and stereo/mono). The header and side information help the decoder to decode the associated Huffman encoded data correctly.&lt;br /&gt;
&lt;br /&gt;
Therefore, for the most part, comparison of decoders is almost exclusively based on how computationally efficient they are (i.e., how much memory or CPU time they use in the decoding process).&lt;br /&gt;
&lt;br /&gt;
== MP3 file structure ==&lt;br /&gt;
[[Image:MP3 file structure.png|thumb|right|500px|Breakdown of an MP3 File&#039;s Structure]]&lt;br /&gt;
An MP3 file is made up of multiple MP3 frames which consist of the MP3 header and the MP3 data. This sequence of frames is called an Elementary stream. Frames are independent items: one can cut the frames from a file and an MP3 player would be able to play it. The MP3 data is the actual audio payload. The diagram shows that the MP3 header consists of a sync word which is used to identify the beginning of a valid frame. This is followed by a bit indicating that this is the MPEG standard and two bits that indicate that layer 3 is being used, hence MPEG-1 Audio Layer 3 or MP3. After this, the values will differ depending on the MP3 file. The range of values for each section of the header along with the specification of the header is defined by ISO/IEC 11172-3.&lt;br /&gt;
&lt;br /&gt;
Most MP3 files today contain ID3 metadata which precedes or follows the MP3 frames; this is also shown in the diagram.&lt;br /&gt;
&lt;br /&gt;
===VBRI, XING, and LAME headers===&lt;br /&gt;
MP3 files often begin with a single frame of silence which contains an extra header that, when supported by decoders, results in the entire frame being treated as informational instead of being played (although some are known to do both). The extra header is in the frame&#039;s data section, before the actual silent audio data, and was originally intended to help with the playback of VBR files.&lt;br /&gt;
&lt;br /&gt;
Xing and Fraunhofer each developed their own formats for this header. The Xing-format header is just called the &#039;&#039;Xing header&#039;&#039; or &#039;&#039;XING header&#039;&#039;. The Fraunhofer-format header is called the &#039;&#039;VBRI header&#039;&#039; or &#039;&#039;VBR Info header&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
====Seek table====&lt;br /&gt;
Both formats specify a table of seek points, which help players correlate playback position (e.g., in seconds, or as a percentage) with byte offsets in the file.&lt;br /&gt;
&lt;br /&gt;
====Gapless playback info====&lt;br /&gt;
In addition to the seek-point table, the Fraunhofer format contains a combined encoder delay &amp;amp; padding value (measured in samples), which can assist [[gapless playback]]. The encoder delay value is the number of samples added to the beginning of the audio data, and the encoder padding value is the number of samples added to the end. There&#039;s also a decoder delay, usually 529 samples of junk samples added to the beginning by the decoder. To determine the starting and ending samples of the non-delay, non-padding portion of the decoder output, MP3 players can perform the following calculation:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
gapless_range_start = encoder_delay + decoder_delay&lt;br /&gt;
if encoder_padding &amp;lt; decoder_delay:&lt;br /&gt;
    gapless_range_end = total_samples&lt;br /&gt;
else:&lt;br /&gt;
    gapless_range_end = total_samples - encoder_padding + decoder_delay&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, when &amp;lt;code&amp;gt;encoder_padding&amp;lt;/code&amp;gt; &amp;amp;lt; &amp;lt;code&amp;gt;decoder_delay&amp;lt;/code&amp;gt;, a player could feed an extra MP3 frame to the decoder (e.g. a silent frame, or the first frame of the next MP3 in a sequence), and then use the second &amp;lt;code&amp;gt;gapless_range_end&amp;lt;/code&amp;gt; calculation. At least one player (Rockbox) does the latter to handle an uncommon type of MP3 encoded specially for gapless playback, where one long stream is split up and written into separate files.&lt;br /&gt;
&lt;br /&gt;
====LAME tag====&lt;br /&gt;
The [[LAME]] encoder extends the Xing header format. This modified header is sometimes called a &#039;&#039;LAME header&#039;&#039; or &#039;&#039;LAME tag&#039;&#039;, although the actual LAME tag is only the LAME-specific data embedded in unused space in the header.&lt;br /&gt;
&lt;br /&gt;
When the header was first added in LAME 3.12, the LAME tag contained only a 20-byte LAME version string. In LAME 3.90, this region was expanded to hold additional data, such as:&lt;br /&gt;
* audio and info tag CRCs&lt;br /&gt;
* separate delay &amp;amp; padding values for gapless playback&lt;br /&gt;
* various encoder settings (expanded in LAME 3.94 to include presets)&lt;br /&gt;
The modified header is also included in CBR files (effective LAME 3.94), with &amp;quot;Info&amp;quot; instead of &amp;quot;Xing&amp;quot; near the beginning.&lt;br /&gt;
&lt;br /&gt;
====Specs====&lt;br /&gt;
The Fraunhofer VBRI header and the LAME tag have explicit specifications. The Xing format can only be inferred from the C code the company provided to read the headers. Here are links to the code and specs:&lt;br /&gt;
* [http://gabriel.mp3-tech.org/mp3infotag.html LAME MP3 Info Tag spec]&lt;br /&gt;
* [http://www.all4mp3.com/tools/tech-and-tools.php All4mp3 mp3 Tech &amp;amp; Tools downloads] - official distribution site for Fraunhofer&#039;s &#039;&#039;Source code to add VBRi header to mp3 file&#039;&#039; (contains header spec) and &#039;&#039;MP3 VBR-Header SDK&#039;&#039; (header-reading C code sample)&lt;br /&gt;
* [http://www.mp3-tech.org/programmer/sources/vbrheadersdk.zip Xing Variable Bitrate MP3 Playback SDK]&lt;br /&gt;
* [http://mp3decoders.mp3-tech.org/decoders_lame.html#delays Information about common encoder and decoder delays]&lt;br /&gt;
&lt;br /&gt;
== Technical information ==&lt;br /&gt;
=== Codec block diagram ===&lt;br /&gt;
A basic functional block diagram of the MPEG1 layer 3 audio codec is as shown below.&lt;br /&gt;
[[Image:Layer3_block.png|frame|center|Block diagram of the MPEG1 layer 3 audio]]&lt;br /&gt;
&lt;br /&gt;
=== The hybrid polyphase filterbank ===&lt;br /&gt;
&lt;br /&gt;
The polyphase [[filterbank]] is the key component common to all layers of MPEG1 audio compression. The purpose of the polyphase filterbank is to divide the audio signal into 32 equal-width [[frequency]] [[subband]]s, by using a set of [[bandpass filters]] covering the entire audio frequency range (a set of 512 tap FIR Filters).&lt;br /&gt;
&lt;br /&gt;
====Polyphase Filterbank Formula====&lt;br /&gt;
[[Image:Poly_samples.png|frame|center|Polyphase filterbank]]&lt;br /&gt;
&lt;br /&gt;
Audio is processed by frames of 1152 samples per audio channel. The polyphase filter groups 3 groups of 12 samples (3x12=36) samples per subband as seen from the picture above (3x12x32 subbands=1152 samples).&lt;br /&gt;
&lt;br /&gt;
The polyphase filter bank and its inverse are not [[lossless]] transformations. Even without [[quantize|quantization]], the inverse transformation cannot perfectly recover the original signal. However by design the error introduced by the filter bank is small and inaudible.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;[[Image:Mdct.png|frame|center|MDCT]]&amp;lt;br /&amp;gt;MDCT formula: &amp;lt;math&amp;gt; X(m)= \sum_{k=0}^{n-1}f(k)x(k)\cos [{ {\pi \over {2n}} ({2k+1+{n \over 2}})({2m+1})}],~m=0 ... {n \over 2}-1&amp;lt;/math&amp;gt;&amp;lt;!-- [[Image:Mdct_formula.png|none|frame|MDCT formula]] --&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Layer 3 compensates for some of the filter bank deficiencies by processing the filter bank output with a Modified Discrete Cosine Transform ([[MDCT]]). The polyphase [[filterbank]] and the MDCT are together called as the hybrid filterbank. The hybrid filterbank adapts to the signal characteristics (block switching depending on the signal etc.).&lt;br /&gt;
&lt;br /&gt;
The 32 [[subband]] signals are subdivided further in frequency content by applying a 18-spectral point or 6-spectral point MDCT. Layer 3 specifies two different MDCT block lengths: a long block (18 spectral points) or a short block (6 spectral points).&lt;br /&gt;
&lt;br /&gt;
Long blocks have a higher frequency resolution. Each subband is transformed into 18 spectral coefficients by MDCT, yielding a maximum of 576 spectral coefficients (32x18=576 spectral lines) each representing a bandwidth of 41.67Hz at 48kHz sampling rate. At 48kHz sampling rate a long block has a time resolution of about x ms. There is a 50% overlap between successive transform windows, so the window size is 36 for long blocks.&lt;br /&gt;
&lt;br /&gt;
Short blocks have a higher time resolution. Short block length is one third of a long block and used for transients to provide better time (temporal) resolution. Each subband is transformed into 6 spectral coefficients by MDCT, yielding a maximum of 192 spectral coefficients (32x6=192 spectral lines) each representing a bandwidth of 125Hz at 48kHz [[sampling rate]]. At 48kHz sampling rate a short block has impulse response of 18.6ms. There is a 50% overlap between successive transform windows, so the window size is 12 for short blocks.&lt;br /&gt;
&lt;br /&gt;
Time resolution of long blocks and time resolution of short blocks are not constants, but jitter depending on the position of the sample in the transformed block. See [http://hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/timeres.html here] for diagrams showing the average time resolutions of different codecs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Freqlines.png|center|frame|Psychoacoustic-MDCT]]&lt;br /&gt;
&lt;br /&gt;
Block switching ([[MDCT]] window switching) is triggered by [[Psychoacoustic|psycho acoustics]].&lt;br /&gt;
&lt;br /&gt;
For a given frame of 1152 samples, the MDCT&#039;s can all have the same block length (long or short) or have a mixed-block mode (mixed-block mode for Lame is in development).&lt;br /&gt;
&lt;br /&gt;
Unlike only the polyphase [[filterbank]], without quantization the MDCT transformation is [[lossless]].&lt;br /&gt;
&lt;br /&gt;
Once the MDCT converts the audio signal into the [[frequency domain]], the [[aliasing]] introduced by the subsampling in the filterbank can be partially cancelled. The decoder has to undo this so that the inverse MDCT can reconstruct the [[subband]] samples in their original aliased form for reconstruction by the synthesis filterbank.&lt;br /&gt;
&lt;br /&gt;
=== The psychoacoustic model ===&lt;br /&gt;
&lt;br /&gt;
This section is a work in progress. It is incomplete and data is still being gathered.&lt;br /&gt;
&lt;br /&gt;
==== Concepts ====&lt;br /&gt;
;[[Critical band]]s&lt;br /&gt;
: Much of what is done in simultaneous [[masking]] is based on the existence of critical bands. The hearing works much like a non-uniform filterbank, and the critical bands can be said to approximate the characteristics of those filters. Critical bands does not really have specific &amp;quot;on&amp;quot; and &amp;quot;off&amp;quot; frequencies, but rather width as a function of [[frequency]] - critical [[bandwidth]]s.&lt;br /&gt;
&lt;br /&gt;
;Tonality estimation&lt;br /&gt;
&lt;br /&gt;
;Spreading function&lt;br /&gt;
: Masking does not only occur within the [[critical band]], but also spreads to neighboring bands. A spreading function SF(z,a) can be defined, where z is the frequency and a the amplitude of a masker. This function would give a masking threshold produced by a single masker for neighboring frequencies. The simplest function would be a triangular function with slopes of +25 and -10 dB / [[Bark]], but a more sophisticated one is highly nonlinear and depends on both frequency and amplitude of masker.&lt;br /&gt;
&lt;br /&gt;
;Simultaneous masking&lt;br /&gt;
: Simultaneous [[masking]] is a frequency domain phenomenon where a low level signal, e.g, a smallband&amp;lt;!--a what?--&amp;gt; noise (the maskee) can be made inaudible by simultaneously occurring stronger signal (the masker), e.g, a pure tone, if masker and maskee are close enough to each other in frequency. A masking threshold can be measured below which any signal will not be audible. The masking threshold depends on the sound pressure level (SPL) and the frequency of the masker, and on the characteristics of the masker and maskee. The slope of the masking threshold is steeper towards lower frequencies,i.e., higher frequencies are more easily masked.&lt;br /&gt;
&lt;br /&gt;
: Without a masker, a signal is inaudible if its SPL is below the threshold of quiet, which depends on frequency and covers a dynamic range of more than 60 dB. We have just described masking by only one masker. If the source signal consists of many simultaneous maskers, a global masking threshold can be computed that describes the threshold of just noticeable distortions as a function of frequency. The calculation of the global masking threshold is based on the high resolution short term [[frequency|amplitude]] spectrum of the audio or speech signal, sufficient for critical band based analysis, and is determined in audio coding via 512 or 1024 point FFT. In a first step all individual masking thresholds are calculated, depending on signal level, type of masker(noise or tone), and frequency range. Next the global masking threshold is determined by adding all individual thresholds and the threshold in quiet (adding this later threshold ensures that the computed global masking threshold is not below the threshold in quiet). The effects of masking reaching over [[critical band]] bounds must be included in the calculation. Finally the global signal-to-mask ratio (SMR) is determined as the ratio of the maximum of signal power and global masking threshold.&lt;br /&gt;
&lt;br /&gt;
;Temporal masking&lt;br /&gt;
: In addition to simultaneous [[masking]] two [[time domain]] phenomena also play an important role in human auditory perception, pre-masking and post-masking. The temporal masking effects occur before and after a masking signal has been switched on and off, respectively. The duration when pre-masking applies is less than -or as newer results indicate, significantly less than-one tenth that of the post-masking, which is in the order of 50 to 200 msec. Both pre and post-masking are being exploited in the ISO/MPEG audio coding algorithm.&lt;br /&gt;
&lt;br /&gt;
: It uses either a separate [[filterbank]] or combines the calculation of energy values (for the masking calculations) and the main filter bank. The output of the perceptual model consists of values for the masking threshold or the allowed noise for each coder partition. If the quantization noise can be kept below the masking threshold, then the compression results should be indistinguishable from the original signal.&lt;br /&gt;
&lt;br /&gt;
;[[ATH]]&lt;br /&gt;
&lt;br /&gt;
;[[Masking]] threshold&lt;br /&gt;
: Masking raises the threshold of hearing, and compressors take advantage of this effect by raising the noise floor, which allows the audio waveform to be expressed with fewer bits. The noise floor can only be raised at [[frequency|frequencies]] at which there is effective masking.&lt;br /&gt;
&lt;br /&gt;
: The equal widths of the [[subband]]s do not accurately reflect the human auditory system&#039;s frequency dependent behavior. The width of a &amp;quot;[[critical band]]&amp;quot; as a function of frequency is a good indicator of this behavior. Many psychoacoustic effects are consistent with a critical band frequency scaling. For example, both the perceived loudness of a signal and its audibility in the presence of a masking signal is different for signals within one critical band than for signals that extend over more than one critical band. Figure 2 compares the polyphase filter [[bandwidth]]s with the width of these critical bands. At lower frequencies a single subband covers several critical bands.&lt;br /&gt;
&lt;br /&gt;
==== Simplified overview of the psychoacoustic model ====&lt;br /&gt;
* Perform a 1024-sample [[FFT]]s on each half of a frame (1152 samples) of the input signal, selecting the lower of the two masking thresholds to use for that subband.&lt;br /&gt;
* Each frequency bin is mapped to its corresponding critical band.&lt;br /&gt;
* Calculate a tonality index, a measure of whether a signal is more tone-like or noise-like.&lt;br /&gt;
* Use a defined spreading function to calculate the masking effect of the signal on neighbouring [[critical band]]s.&lt;br /&gt;
* Calculate the final masking threshold for each subband, using the tonality index, the output of the spreading function, and the [[ATH]].&lt;br /&gt;
* Calculate the signal-to-mask ratio for each [[subband]], and passes information on to the [[quantize|quantizer]].&lt;br /&gt;
&lt;br /&gt;
==== More detailed overview the psychoacoustic model====&lt;br /&gt;
The MPEG/audio algorithm compresses the audio data in large part by removing the acoustically irrelevant parts of the audio signal. That is, it takes advantage of the human auditory system&#039;s inability to hear quantization noise under conditions of auditory masking. This masking is a perceptual property of the human auditory system that occurs whenever the presence of a strong audio signal makes a temporal or spectral neighborhood of weaker audio signals imperceptible. A variety of psychoacoustic experiments corroborate this masking phenomenon.&lt;br /&gt;
&lt;br /&gt;
Empirical results also show that the human auditory system has a limited, [[frequency]] dependent, resolution. This frequency dependency can be expressed in terms of critical band widths which are less than 100Hz for the lowest audible frequencies and more than 4kHz at the highest. The human auditory system blurs the various signal components within a critical band although this system&#039;s frequency selectivity is much finer than a critical band.&lt;br /&gt;
&lt;br /&gt;
The psychoacoustic model analyzes the audio signal and computes the amount of noise [[masking]] available as a function of frequency. The masking ability of a given signal component depends on its frequency position and its loudness. The encoder uses this information to decide how best to represent the input audio signal with its limited number of code bits. The MPEG/audio standard provides two example implementations of the psychoacoustic model.&lt;br /&gt;
&lt;br /&gt;
Below is a general outline of the basic steps involved in the psychoacoustic calculations for either model. Differences between the two models will be highlighted.&lt;br /&gt;
&lt;br /&gt;
* Time align audio data. There is one psychoacoustic evaluation per frame. The audio data sent to the psychoacoustic model must be concurrent with the audio data to be coded. The psychoacoustic model must account for both the delay of the audio data through the [[filterbank]] and a data offset so that the relevant data is centered within the psychoacoustic analysis window.&lt;br /&gt;
* Convert audio to a [[frequency]] domain representation. The psychoacoustic model should use a separate, independent, time-to-frequency mapping instead of the polyphase filter bank because it needs finer frequency resolution for an accurate calculation of the masking thresholds.&lt;br /&gt;
&lt;br /&gt;
Layer II and III use a 1,152 sample frame size so the 1,024 sample window does not provide complete coverage. While ideally the analysis window should completely cover the samples to be coded, a 1,024 sample window is a reasonable compromise. Samples falling outside the analysis window generally will not have a major impact on the psychoacoustic evaluation.&lt;br /&gt;
&lt;br /&gt;
For Layers II and III, the model computes two 1,024 point psychoacoustic calculations for each frame. The first calculation centers the first half of the 1,152 samples in the analysis window and the second calculation centers the second half. The model combines the results of the two calculations by using the higher of the two signal-to-mask ratios for each [[subband]]. This in effect selects the lower of the two noise masking thresholds for each subband.&lt;br /&gt;
&lt;br /&gt;
* Process spectral values in groupings related to critical band widths. To simplify the psychoacoustic calculations, both models process the frequency values in perceptual quanta.&lt;br /&gt;
&lt;br /&gt;
Psychoacoustic model 2 never actually separates tonal and non-tonal components. Instead, it computes a tonality index as a function of frequency. This index gives a measure of whether the component is more tone-like or noise-like. Model 2 uses this index to interpolate between pure tone-masking-noise and noise-masking-tone values. The tonality index is based on a measure of predictability. Model 2 uses data from the previous two analysis windows to predict, via linear extrapolation, the component values for the current window. Tonal components are more predictable and thus will have higher tonality indices. Because this process relies on more data, it is more likely to better discriminate between tonal and non-tonal components than the model 1 method.&lt;br /&gt;
&lt;br /&gt;
* Apply a spreading function. The [[masking]] ability of a given signal spreads across its surrounding [[critical band]]. The model determines the noise masking thresholds by first applying an empirically determined masking (model 1) or spreading function (model 2) to the signal components.&lt;br /&gt;
&lt;br /&gt;
* Set a lower bound for the threshold values. Both models include an empirically determined absolute masking threshold, the threshold in quiet. This threshold is the lower bound on the audibility of sound.&lt;br /&gt;
&lt;br /&gt;
* Find the masking threshold for each [[subband]]. Model 2 selects the minimum of the masking thresholds covered by the subband only where the band is wide relative to the critical band in that [[frequency]] region. It uses the average of the masking thresholds covered by the subband where the band is narrow relative to the critical band. Model 2 is not less accurate for the higher frequency subbands because it does not concentrate the non-tonal components.&lt;br /&gt;
&lt;br /&gt;
* Calculate the signal-to-mask ratio. The psychoacoustic model computes the signal-to-mask ratio as the ratio of the signal energy within the subband (or, for Layer III , a group of bands) to the minimum masking threshold for that subband. The model passes this value to the bit (or noise) allocation section of the encoder.&lt;br /&gt;
&lt;br /&gt;
==== Model 2 technical details ====&lt;br /&gt;
&amp;lt;!--commented out because it relies on missing diagrams:&lt;br /&gt;
2.1.1.1 Example for Psychoacoustic Model 2 The processes used by psychoacoustic model 2 are somewhat easier to visualize, so this model will be covered first. Figure 12a shows the result, according to psychoacoustic model 2, of transforming the audio signal to the perceptual domain (63, one-third critical band, partitions) and then applying the spreading function. Note the shift of the sinusoid peak and the expansion of the lowpass noise distribution. The perceptual transformation expands the low frequency region and compresses the higher frequency region. Because the spreading function is applied in a perceptual domain, the shape of the spreading function is relatively uniform as a function of partition. Figure 13 shows a plot of the spreading functions. Figure 12b shows the tonality index for the audio signal as computed by psychoacoustic model 2. Figure 14a shows a plot of the masking threshold as computed by the model based on the spread energy and the tonality index. This figure has plots of the masking threshold both before and after the incorporation of the threshold in quiet to illustrate its impact. Note the threshold in quiet significantly increases the noise masking threshold for the higher frequencies. The human auditory system is much less sensitive in this region. Also note how the sinusoid signal increases the masking threshold for the neighboring frequencies. The masking threshold is computed in the uniform frequency domain instead of the perceptual domain in preparation for the final step of the psychoacoustic model, the calculation of the signal-to-mask ratios (SMR) for each [[subband]]. Figure 14b is a plot of these results and figure 14c is a [[frequency]] plot of a processed audio signal using these SMR’s. In this example the audio compression was severe (768 to 64 kbits/sec) so the coder may not necessarily be able to mask all the [[quantize|quantization]] noise.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The psychoacoustic model calculates just-noticeable distortion (JND) profiles for each band in the [[filterbank]]. This noise level is used to determine the actual quantizers and quantizer levels. There are two psychoacoustic models defined by the standard. They can be applied to any layer of the MPEG/Audio algorithm. In practice however, Model 1 has been used for Layers I and II and Model 2 for Layer III. Both models compute a signal-to-mask ratio (SMR) for each band (Layers I and II) or group of bands (Layer III).&lt;br /&gt;
&lt;br /&gt;
The more sophisticated of the two, Model 2, will be discussed. The steps leading to the computation of the JND profiles is outlined below.&lt;br /&gt;
&lt;br /&gt;
;1. Time-align audio data&lt;br /&gt;
&lt;br /&gt;
The psychoacoustic model must estimate the [[masking]] thresholds for the audio data that are to be [[quantize|quantized]]. So, it must account for both the delay through the filterbank and a data offset so that the relevant data is centered within the psychoacoustic analysis window. For the Layer III algorithm, time-aligning the psychoacoustic model with the filterbank demands that the data fed to the model be delayed by 768 samples.&lt;br /&gt;
&lt;br /&gt;
;2. Spectral analysis and normalization.&lt;br /&gt;
&lt;br /&gt;
A high-resolution spectral estimate of the time-aligned data is essential for an accurate estimation of the masking thresholds in the [[critical band]]s. The low frequency resolution of the filterbank leaves no option but to compute an independent time-to-frequency mapping via a fast Fourier Transform ([[FFT]]). A Hanning window is applied to the data to reduce the edge effects of the transform window.&lt;br /&gt;
&lt;br /&gt;
Layer III operates on 1152-sample data frames. Model 2 uses a 1024- point window for spectral estimation. Ideally, the analysis window should completely cover the samples to be coded. The model computes two 1024-point psychoacoustic calculations. On the first pass, the first 576 samples are centered in the analysis window. The second pass centers the remaining samples. The model combines the results of the two calculations by using the more stringent of the two JND estimates for bit or noise allocation in each [[subband]].&lt;br /&gt;
&lt;br /&gt;
Since playback levels are unknown3, the sound-pressure level (SPL) needs to be normalized. This implies clamping the lowest point in the absolute threshold of hearing curves to +/- 1-bit [[frequency|amplitude]]. &lt;br /&gt;
&lt;br /&gt;
;3. Grouping of spectral values into threshold calculation partitions.&lt;br /&gt;
&lt;br /&gt;
The uniform [[frequency]] decomposition and poor selectivity of the filterbank do not reflect the response of the ear&#039;s Basilar Membrane. To accurately model the masking phenomenon characteristic of the Basilar Membrane, the spectral values are grouped into a large number of partitions. The exact number of threshold partitions depends on the choice of sampling rate. This transformation provides a resolution of approximately either 1 FFT line or 1/3 critical band, whichever is smaller. At low frequencies, a single line of the FFT will constitute a partition, while at high frequency|frequencies many lines are grouped into one.&lt;br /&gt;
&lt;br /&gt;
;4. Estimation of tonality indices.&lt;br /&gt;
&lt;br /&gt;
It is necessary to identify tonal and non-tonal (noise-like) components because the masking abilities of the two types of signals differ. Model 2 does not explicitly separate tonal and non-tonal components. Instead, it computes a tonality index as a function of frequency. This is an indicator of the tone-like or noise-like nature of the spectral component. The tonality index is based on a measure of predictability. Linear extrapolation is used to predict the component values of the current window from the previous two analysis windows. Model 2 uses this index to interpolate between pure tone-masking-noise and noise-masking-tone values. Tonal components are more predictable and thus have a higher tonality index. As this process has memory, it is more likely to discriminate better between tonal and non-tonal components, unlike psychoacoustic Model 116.&lt;br /&gt;
&lt;br /&gt;
;5. Simulation of the spread of masking on the Basilar Membrane.&lt;br /&gt;
&lt;br /&gt;
A strong signal component affects the audibility of weaker components in the same critical band and the adjacent bands. Model 2 simulates this phenomenon by applying a Spreading function to spread the energy of any critical band into its surrounding bands. On the [[Bark]] scale, the spreading function has a constant shape as a function of partition number, with slopes of +25 and –10 dB per Bark.&lt;br /&gt;
&lt;br /&gt;
;6. Set a lower bound for the threshold values.&lt;br /&gt;
&lt;br /&gt;
An empirically determined absolute [[masking]] threshold, the threshold in quiet, is used as a lower bound on the audibility of sound.&lt;br /&gt;
&lt;br /&gt;
;7. Determination of masking threshold per [[subband]].&lt;br /&gt;
&lt;br /&gt;
At low [[frequency|frequencies]], the minimum of the masking thresholds within a subband is chosen as the threshold value. At higher frequencies, the average of the thresholds within the subband is selected as the masking threshold. Model 2 has the same accuracy for the higher subbands as for low frequency ones because it does not concentrate non-tonal components16.&lt;br /&gt;
&lt;br /&gt;
;8. [[Pre echo]] detection and window switching decision.&lt;br /&gt;
&lt;br /&gt;
;9. Calculation of the signal-to-mask ratio (SMR).&lt;br /&gt;
&lt;br /&gt;
SMR is calculated as a ratio of signal energy within the subband (for Layers I and II) or a group of subbands (Layer III) to the minimum threshold for that subband. This is the final output of the psychoacoustic model.&lt;br /&gt;
&lt;br /&gt;
The masking threshold computed from the spread energy and the tonality index.&lt;br /&gt;
&lt;br /&gt;
== Pros and cons ==&lt;br /&gt;
=== Pros ===&lt;br /&gt;
* Widespread acceptance, support in nearly all hardware audio players and devices&lt;br /&gt;
* An [[ISO]] standard, part of MPEG specs&lt;br /&gt;
* Fast decoding, lower complexity than [[Advanced Audio Coding|AAC]] or [[Vorbis]]&lt;br /&gt;
* Anyone can create their own implementation (Specs and demo sources available)&lt;br /&gt;
* Since the patents have expired, MP3 is in the public domain.&lt;br /&gt;
&lt;br /&gt;
=== Cons ===&lt;br /&gt;
* Lower performance/efficiency than modern codecs.&lt;br /&gt;
* Problem cases that trip out all transform codecs.&lt;br /&gt;
* Sometimes, maximum bitrate (320kbps) isn&#039;t enough.&lt;br /&gt;
* Unusable for high definition audio (sampling rates higher than 48kHz).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
=== Techniques used in compression ===&lt;br /&gt;
* [[Huffman coding]]&lt;br /&gt;
* [[Quantization]]&lt;br /&gt;
* [[Joint stereo|M/S matrixing]]&lt;br /&gt;
* [[Intensity stereo]]&lt;br /&gt;
* [[Channel coupling]]&lt;br /&gt;
* Modified discrete cosine transform ([[MDCT]])&lt;br /&gt;
* Polyphase filter bank&lt;br /&gt;
&lt;br /&gt;
There is a non-standardized form of MP3 called [[MP3Pro]], which takes advantage of [[SBR]] encoding to provide better quality at low bitrates.&lt;br /&gt;
&lt;br /&gt;
=== Encoders/decoders (supported platforms) ===&lt;br /&gt;
* [[LAME]] (Win32/Posix)&lt;br /&gt;
* [[Helix MP3 Encoder]] (Win32/Posix)&lt;br /&gt;
* [[Audioactive]] (Win32)&lt;br /&gt;
* [[Blade]] (Win32/Posix)&lt;br /&gt;
* [[Xing]] (Win32)&lt;br /&gt;
* [[Gogo]] (Win32/Posix)&lt;br /&gt;
&lt;br /&gt;
=== Metadata (tags) ===&lt;br /&gt;
* [[ID3v1]]&lt;br /&gt;
* [[ID3v1.1]]&lt;br /&gt;
* [[ID3v2]]&lt;br /&gt;
&lt;br /&gt;
== Further reading and bibliography ==&lt;br /&gt;
* [[Best MP3 Decoder]]&lt;br /&gt;
* [[High-frequency content in MP3s]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* &amp;lt;s&amp;gt;Roberto&#039;s listening test&amp;lt;/s&amp;gt; featuring MP3 encoders&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mp3 MP3 at Wikipedia]&lt;br /&gt;
&lt;br /&gt;
[[Category:Codecs]]&lt;br /&gt;
[[Category:Lossy]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=MP3&amp;diff=37751</id>
		<title>MP3</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=MP3&amp;diff=37751"/>
		<updated>2024-03-25T09:41:45Z</updated>

		<summary type="html">&lt;p&gt;Maikmerten: /* Encoders/decoders (supported platforms) */ add Helix MP3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;MPEG-1 Audio Layer 3&#039;&#039;&#039;, more commonly referred to as MP3, is a popular digital audio encoding and lossy compression format, designed to greatly reduce the amount of data required to represent audio, yet still sound like a faithful reproduction of the original uncompressed audio to most listeners. It was invented by a team of European engineers who worked in the framework of the EUREKA 147 DAB digital radio research program, and it became an ISO/IEC standard in 1991.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
The MP3 algorithm development started in 1987, with a joint cooperation of [http://www.iis.fraunhofer.de/ Fraunhofer IIS-A] and the University of Erlangen. It is standardized as ISO-MPEG Audio Layer-3 (IS 11172-3 and IS 13818-3).&lt;br /&gt;
&lt;br /&gt;
It soon became the de facto standard for lossy audio encoding, due to the high [[compression rates]] (1/11 of the original size, still retaining considerable quality), the high availability of decoders and the low CPU requirements for playback. (486 DX2-100 is enough for real-time decoding)&lt;br /&gt;
&lt;br /&gt;
It supports [[multichannel]] files (see [http://www.mp3surround-format.com/ page]), [[sampling rate]]s from 16 kHz to 24 kHz (MPEG2 Layer 3) and 32 kHz to 48 kHz (MPEG1 Layer 3)&lt;br /&gt;
&lt;br /&gt;
Formal and informal listening tests have shown that MP3 at the 160-224 kbps range provide encoded results indistinguishable from the original materials in most of the cases.&lt;br /&gt;
&lt;br /&gt;
== Encoding and decoding ==&lt;br /&gt;
=== Encoding of MP3 audio ===&lt;br /&gt;
The MPEG-1 standard does not include a precise specification for an MP3 encoder. The decoding algorithm and file format, as a contrast, are well defined. Implementers of the standard were supposed to devise their own algorithms suitable for removing parts of the information in the raw audio (or rather its MDCT representation in the frequency domain). During encoding 576 time domain samples are taken and are transformed to 576 frequency domain samples. If there is a transient 192 samples are taken instead of 576. This is done to limit the temporal spread of quantization noise accompanying the transient.&lt;br /&gt;
&lt;br /&gt;
This is the domain of psychoacoustics: the study of subjective human perception of sounds.&lt;br /&gt;
&lt;br /&gt;
As a result, there are many different MP3 encoders available, each producing files of differing quality. Comparisons are widely available, so it is easy for a prospective user of an encoder to research the best choice. It must be kept in mind that an encoder that is proficient at encoding at higher bitrates (such as LAME, which is in widespread use for encoding at higher bitrates) is not necessarily as good at other, lower bitrates.&lt;br /&gt;
&lt;br /&gt;
=== Decoding of MP3 audio ===&lt;br /&gt;
Decoding, on the other hand, is carefully defined in the standard. Most decoders are &amp;quot;bitstream compliant&amp;quot;, meaning that the decompressed output they produce from a given MP3 file will be the same (within a specified degree of rounding tolerance) as the output specified mathematically in the ISO/IEC standard document. The MP3 file has a standard format which is a frame consisting of 384, 576, or 1152 samples (depends on MPEG version and layer) and all the frames have associated header information (32 bits) and side information (9, 17, or 32 bytes, depending on MPEG version and stereo/mono). The header and side information help the decoder to decode the associated Huffman encoded data correctly.&lt;br /&gt;
&lt;br /&gt;
Therefore, for the most part, comparison of decoders is almost exclusively based on how computationally efficient they are (i.e., how much memory or CPU time they use in the decoding process).&lt;br /&gt;
&lt;br /&gt;
== MP3 file structure ==&lt;br /&gt;
[[Image:MP3 file structure.png|thumb|right|500px|Breakdown of an MP3 File&#039;s Structure]]&lt;br /&gt;
An MP3 file is made up of multiple MP3 frames which consist of the MP3 header and the MP3 data. This sequence of frames is called an Elementary stream. Frames are independent items: one can cut the frames from a file and an MP3 player would be able to play it. The MP3 data is the actual audio payload. The diagram shows that the MP3 header consists of a sync word which is used to identify the beginning of a valid frame. This is followed by a bit indicating that this is the MPEG standard and two bits that indicate that layer 3 is being used, hence MPEG-1 Audio Layer 3 or MP3. After this, the values will differ depending on the MP3 file. The range of values for each section of the header along with the specification of the header is defined by ISO/IEC 11172-3.&lt;br /&gt;
&lt;br /&gt;
Most MP3 files today contain ID3 metadata which precedes or follows the MP3 frames; this is also shown in the diagram.&lt;br /&gt;
&lt;br /&gt;
===VBRI, XING, and LAME headers===&lt;br /&gt;
MP3 files often begin with a single frame of silence which contains an extra header that, when supported by decoders, results in the entire frame being treated as informational instead of being played (although some are known to do both). The extra header is in the frame&#039;s data section, before the actual silent audio data, and was originally intended to help with the playback of VBR files.&lt;br /&gt;
&lt;br /&gt;
Xing and Fraunhofer each developed their own formats for this header. The Xing-format header is just called the &#039;&#039;Xing header&#039;&#039; or &#039;&#039;XING header&#039;&#039;. The Fraunhofer-format header is called the &#039;&#039;VBRI header&#039;&#039; or &#039;&#039;VBR Info header&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
====Seek table====&lt;br /&gt;
Both formats specify a table of seek points, which help players correlate playback position (e.g., in seconds, or as a percentage) with byte offsets in the file.&lt;br /&gt;
&lt;br /&gt;
====Gapless playback info====&lt;br /&gt;
In addition to the seek-point table, the Fraunhofer format contains a combined encoder delay &amp;amp; padding value (measured in samples), which can assist [[gapless playback]]. The encoder delay value is the number of samples added to the beginning of the audio data, and the encoder padding value is the number of samples added to the end. There&#039;s also a decoder delay, usually 529 samples of junk samples added to the beginning by the decoder. To determine the starting and ending samples of the non-delay, non-padding portion of the decoder output, MP3 players can perform the following calculation:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
gapless_range_start = encoder_delay + decoder_delay&lt;br /&gt;
if encoder_padding &amp;lt; decoder_delay:&lt;br /&gt;
    gapless_range_end = total_samples&lt;br /&gt;
else:&lt;br /&gt;
    gapless_range_end = total_samples - encoder_padding + decoder_delay&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, when &amp;lt;code&amp;gt;encoder_padding&amp;lt;/code&amp;gt; &amp;amp;lt; &amp;lt;code&amp;gt;decoder_delay&amp;lt;/code&amp;gt;, a player could feed an extra MP3 frame to the decoder (e.g. a silent frame, or the first frame of the next MP3 in a sequence), and then use the second &amp;lt;code&amp;gt;gapless_range_end&amp;lt;/code&amp;gt; calculation. At least one player (Rockbox) does the latter to handle an uncommon type of MP3 encoded specially for gapless playback, where one long stream is split up and written into separate files.&lt;br /&gt;
&lt;br /&gt;
====LAME tag====&lt;br /&gt;
The [[LAME]] encoder extends the Xing header format. This modified header is sometimes called a &#039;&#039;LAME header&#039;&#039; or &#039;&#039;LAME tag&#039;&#039;, although the actual LAME tag is only the LAME-specific data embedded in unused space in the header.&lt;br /&gt;
&lt;br /&gt;
When the header was first added in LAME 3.12, the LAME tag contained only a 20-byte LAME version string. In LAME 3.90, this region was expanded to hold additional data, such as:&lt;br /&gt;
* audio and info tag CRCs&lt;br /&gt;
* separate delay &amp;amp; padding values for gapless playback&lt;br /&gt;
* various encoder settings (expanded in LAME 3.94 to include presets)&lt;br /&gt;
The modified header is also included in CBR files (effective LAME 3.94), with &amp;quot;Info&amp;quot; instead of &amp;quot;Xing&amp;quot; near the beginning.&lt;br /&gt;
&lt;br /&gt;
====Specs====&lt;br /&gt;
The Fraunhofer VBRI header and the LAME tag have explicit specifications. The Xing format can only be inferred from the C code the company provided to read the headers. Here are links to the code and specs:&lt;br /&gt;
* [http://gabriel.mp3-tech.org/mp3infotag.html LAME MP3 Info Tag spec]&lt;br /&gt;
* [http://www.all4mp3.com/tools/tech-and-tools.php All4mp3 mp3 Tech &amp;amp; Tools downloads] - official distribution site for Fraunhofer&#039;s &#039;&#039;Source code to add VBRi header to mp3 file&#039;&#039; (contains header spec) and &#039;&#039;MP3 VBR-Header SDK&#039;&#039; (header-reading C code sample)&lt;br /&gt;
* [http://www.mp3-tech.org/programmer/sources/vbrheadersdk.zip Xing Variable Bitrate MP3 Playback SDK]&lt;br /&gt;
* [http://mp3decoders.mp3-tech.org/decoders_lame.html#delays Information about common encoder and decoder delays]&lt;br /&gt;
&lt;br /&gt;
== Technical information ==&lt;br /&gt;
=== Codec block diagram ===&lt;br /&gt;
A basic functional block diagram of the MPEG1 layer 3 audio codec is as shown below.&lt;br /&gt;
[[Image:Layer3_block.png|frame|center|Block diagram of the MPEG1 layer 3 audio]]&lt;br /&gt;
&lt;br /&gt;
=== The hybrid polyphase filterbank ===&lt;br /&gt;
&lt;br /&gt;
The polyphase [[filterbank]] is the key component common to all layers of MPEG1 audio compression. The purpose of the polyphase filterbank is to divide the audio signal into 32 equal-width [[frequency]] [[subband]]s, by using a set of [[bandpass filters]] covering the entire audio frequency range (a set of 512 tap FIR Filters).&lt;br /&gt;
&lt;br /&gt;
====Polyphase Filterbank Formula====&lt;br /&gt;
[[Image:Poly_samples.png|frame|center|Polyphase filterbank]]&lt;br /&gt;
&lt;br /&gt;
Audio is processed by frames of 1152 samples per audio channel. The polyphase filter groups 3 groups of 12 samples (3x12=36) samples per subband as seen from the picture above (3x12x32 subbands=1152 samples).&lt;br /&gt;
&lt;br /&gt;
The polyphase filter bank and its inverse are not [[lossless]] transformations. Even without [[quantize|quantization]], the inverse transformation cannot perfectly recover the original signal. However by design the error introduced by the filter bank is small and inaudible.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;[[Image:Mdct.png|frame|center|MDCT]]&amp;lt;br /&amp;gt;MDCT formula: &amp;lt;math&amp;gt; X(m)= \sum_{k=0}^{n-1}f(k)x(k)\cos [{ {\pi \over {2n}} ({2k+1+{n \over 2}})({2m+1})}],~m=0 ... {n \over 2}-1&amp;lt;/math&amp;gt;&amp;lt;!-- [[Image:Mdct_formula.png|none|frame|MDCT formula]] --&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Layer 3 compensates for some of the filter bank deficiencies by processing the filter bank output with a Modified Discrete Cosine Transform ([[MDCT]]). The polyphase [[filterbank]] and the MDCT are together called as the hybrid filterbank. The hybrid filterbank adapts to the signal characteristics (block switching depending on the signal etc.).&lt;br /&gt;
&lt;br /&gt;
The 32 [[subband]] signals are subdivided further in frequency content by applying a 18-spectral point or 6-spectral point MDCT. Layer 3 specifies two different MDCT block lengths: a long block (18 spectral points) or a short block (6 spectral points).&lt;br /&gt;
&lt;br /&gt;
Long blocks have a higher frequency resolution. Each subband is transformed into 18 spectral coefficients by MDCT, yielding a maximum of 576 spectral coefficients (32x18=576 spectral lines) each representing a bandwidth of 41.67Hz at 48kHz sampling rate. At 48kHz sampling rate a long block has a time resolution of about x ms. There is a 50% overlap between successive transform windows, so the window size is 36 for long blocks.&lt;br /&gt;
&lt;br /&gt;
Short blocks have a higher time resolution. Short block length is one third of a long block and used for transients to provide better time (temporal) resolution. Each subband is transformed into 6 spectral coefficients by MDCT, yielding a maximum of 192 spectral coefficients (32x6=192 spectral lines) each representing a bandwidth of 125Hz at 48kHz [[sampling rate]]. At 48kHz sampling rate a short block has impulse response of 18.6ms. There is a 50% overlap between successive transform windows, so the window size is 12 for short blocks.&lt;br /&gt;
&lt;br /&gt;
Time resolution of long blocks and time resolution of short blocks are not constants, but jitter depending on the position of the sample in the transformed block. See [http://hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/timeres.html here] for diagrams showing the average time resolutions of different codecs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Freqlines.png|center|frame|Psychoacoustic-MDCT]]&lt;br /&gt;
&lt;br /&gt;
Block switching ([[MDCT]] window switching) is triggered by [[Psychoacoustic|psycho acoustics]].&lt;br /&gt;
&lt;br /&gt;
For a given frame of 1152 samples, the MDCT&#039;s can all have the same block length (long or short) or have a mixed-block mode (mixed-block mode for Lame is in development).&lt;br /&gt;
&lt;br /&gt;
Unlike only the polyphase [[filterbank]], without quantization the MDCT transformation is [[lossless]].&lt;br /&gt;
&lt;br /&gt;
Once the MDCT converts the audio signal into the [[frequency domain]], the [[aliasing]] introduced by the subsampling in the filterbank can be partially cancelled. The decoder has to undo this so that the inverse MDCT can reconstruct the [[subband]] samples in their original aliased form for reconstruction by the synthesis filterbank.&lt;br /&gt;
&lt;br /&gt;
=== The psychoacoustic model ===&lt;br /&gt;
&lt;br /&gt;
This section is a work in progress. It is incomplete and data is still being gathered.&lt;br /&gt;
&lt;br /&gt;
==== Concepts ====&lt;br /&gt;
;[[Critical band]]s&lt;br /&gt;
: Much of what is done in simultaneous [[masking]] is based on the existence of critical bands. The hearing works much like a non-uniform filterbank, and the critical bands can be said to approximate the characteristics of those filters. Critical bands does not really have specific &amp;quot;on&amp;quot; and &amp;quot;off&amp;quot; frequencies, but rather width as a function of [[frequency]] - critical [[bandwidth]]s.&lt;br /&gt;
&lt;br /&gt;
;Tonality estimation&lt;br /&gt;
&lt;br /&gt;
;Spreading function&lt;br /&gt;
: Masking does not only occur within the [[critical band]], but also spreads to neighboring bands. A spreading function SF(z,a) can be defined, where z is the frequency and a the amplitude of a masker. This function would give a masking threshold produced by a single masker for neighboring frequencies. The simplest function would be a triangular function with slopes of +25 and -10 dB / [[Bark]], but a more sophisticated one is highly nonlinear and depends on both frequency and amplitude of masker.&lt;br /&gt;
&lt;br /&gt;
;Simultaneous masking&lt;br /&gt;
: Simultaneous [[masking]] is a frequency domain phenomenon where a low level signal, e.g, a smallband&amp;lt;!--a what?--&amp;gt; noise (the maskee) can be made inaudible by simultaneously occurring stronger signal (the masker), e.g, a pure tone, if masker and maskee are close enough to each other in frequency. A masking threshold can be measured below which any signal will not be audible. The masking threshold depends on the sound pressure level (SPL) and the frequency of the masker, and on the characteristics of the masker and maskee. The slope of the masking threshold is steeper towards lower frequencies,i.e., higher frequencies are more easily masked.&lt;br /&gt;
&lt;br /&gt;
: Without a masker, a signal is inaudible if its SPL is below the threshold of quiet, which depends on frequency and covers a dynamic range of more than 60 dB. We have just described masking by only one masker. If the source signal consists of many simultaneous maskers, a global masking threshold can be computed that describes the threshold of just noticeable distortions as a function of frequency. The calculation of the global masking threshold is based on the high resolution short term [[frequency|amplitude]] spectrum of the audio or speech signal, sufficient for critical band based analysis, and is determined in audio coding via 512 or 1024 point FFT. In a first step all individual masking thresholds are calculated, depending on signal level, type of masker(noise or tone), and frequency range. Next the global masking threshold is determined by adding all individual thresholds and the threshold in quiet (adding this later threshold ensures that the computed global masking threshold is not below the threshold in quiet). The effects of masking reaching over [[critical band]] bounds must be included in the calculation. Finally the global signal-to-mask ratio (SMR) is determined as the ratio of the maximum of signal power and global masking threshold.&lt;br /&gt;
&lt;br /&gt;
;Temporal masking&lt;br /&gt;
: In addition to simultaneous [[masking]] two [[time domain]] phenomena also play an important role in human auditory perception, pre-masking and post-masking. The temporal masking effects occur before and after a masking signal has been switched on and off, respectively. The duration when pre-masking applies is less than -or as newer results indicate, significantly less than-one tenth that of the post-masking, which is in the order of 50 to 200 msec. Both pre and post-masking are being exploited in the ISO/MPEG audio coding algorithm.&lt;br /&gt;
&lt;br /&gt;
: It uses either a separate [[filterbank]] or combines the calculation of energy values (for the masking calculations) and the main filter bank. The output of the perceptual model consists of values for the masking threshold or the allowed noise for each coder partition. If the quantization noise can be kept below the masking threshold, then the compression results should be indistinguishable from the original signal.&lt;br /&gt;
&lt;br /&gt;
;[[ATH]]&lt;br /&gt;
&lt;br /&gt;
;[[Masking]] threshold&lt;br /&gt;
: Masking raises the threshold of hearing, and compressors take advantage of this effect by raising the noise floor, which allows the audio waveform to be expressed with fewer bits. The noise floor can only be raised at [[frequency|frequencies]] at which there is effective masking.&lt;br /&gt;
&lt;br /&gt;
: The equal widths of the [[subband]]s do not accurately reflect the human auditory system&#039;s frequency dependent behavior. The width of a &amp;quot;[[critical band]]&amp;quot; as a function of frequency is a good indicator of this behavior. Many psychoacoustic effects are consistent with a critical band frequency scaling. For example, both the perceived loudness of a signal and its audibility in the presence of a masking signal is different for signals within one critical band than for signals that extend over more than one critical band. Figure 2 compares the polyphase filter [[bandwidth]]s with the width of these critical bands. At lower frequencies a single subband covers several critical bands.&lt;br /&gt;
&lt;br /&gt;
==== Simplified overview of the psychoacoustic model ====&lt;br /&gt;
* Perform a 1024-sample [[FFT]]s on each half of a frame (1152 samples) of the input signal, selecting the lower of the two masking thresholds to use for that subband.&lt;br /&gt;
* Each frequency bin is mapped to its corresponding critical band.&lt;br /&gt;
* Calculate a tonality index, a measure of whether a signal is more tone-like or noise-like.&lt;br /&gt;
* Use a defined spreading function to calculate the masking effect of the signal on neighbouring [[critical band]]s.&lt;br /&gt;
* Calculate the final masking threshold for each subband, using the tonality index, the output of the spreading function, and the [[ATH]].&lt;br /&gt;
* Calculate the signal-to-mask ratio for each [[subband]], and passes information on to the [[quantize|quantizer]].&lt;br /&gt;
&lt;br /&gt;
==== More detailed overview the psychoacoustic model====&lt;br /&gt;
The MPEG/audio algorithm compresses the audio data in large part by removing the acoustically irrelevant parts of the audio signal. That is, it takes advantage of the human auditory system&#039;s inability to hear quantization noise under conditions of auditory masking. This masking is a perceptual property of the human auditory system that occurs whenever the presence of a strong audio signal makes a temporal or spectral neighborhood of weaker audio signals imperceptible. A variety of psychoacoustic experiments corroborate this masking phenomenon.&lt;br /&gt;
&lt;br /&gt;
Empirical results also show that the human auditory system has a limited, [[frequency]] dependent, resolution. This frequency dependency can be expressed in terms of critical band widths which are less than 100Hz for the lowest audible frequencies and more than 4kHz at the highest. The human auditory system blurs the various signal components within a critical band although this system&#039;s frequency selectivity is much finer than a critical band.&lt;br /&gt;
&lt;br /&gt;
The psychoacoustic model analyzes the audio signal and computes the amount of noise [[masking]] available as a function of frequency. The masking ability of a given signal component depends on its frequency position and its loudness. The encoder uses this information to decide how best to represent the input audio signal with its limited number of code bits. The MPEG/audio standard provides two example implementations of the psychoacoustic model.&lt;br /&gt;
&lt;br /&gt;
Below is a general outline of the basic steps involved in the psychoacoustic calculations for either model. Differences between the two models will be highlighted.&lt;br /&gt;
&lt;br /&gt;
* Time align audio data. There is one psychoacoustic evaluation per frame. The audio data sent to the psychoacoustic model must be concurrent with the audio data to be coded. The psychoacoustic model must account for both the delay of the audio data through the [[filterbank]] and a data offset so that the relevant data is centered within the psychoacoustic analysis window.&lt;br /&gt;
* Convert audio to a [[frequency]] domain representation. The psychoacoustic model should use a separate, independent, time-to-frequency mapping instead of the polyphase filter bank because it needs finer frequency resolution for an accurate calculation of the masking thresholds.&lt;br /&gt;
&lt;br /&gt;
Layer II and III use a 1,152 sample frame size so the 1,024 sample window does not provide complete coverage. While ideally the analysis window should completely cover the samples to be coded, a 1,024 sample window is a reasonable compromise. Samples falling outside the analysis window generally will not have a major impact on the psychoacoustic evaluation.&lt;br /&gt;
&lt;br /&gt;
For Layers II and III, the model computes two 1,024 point psychoacoustic calculations for each frame. The first calculation centers the first half of the 1,152 samples in the analysis window and the second calculation centers the second half. The model combines the results of the two calculations by using the higher of the two signal-to-mask ratios for each [[subband]]. This in effect selects the lower of the two noise masking thresholds for each subband.&lt;br /&gt;
&lt;br /&gt;
* Process spectral values in groupings related to critical band widths. To simplify the psychoacoustic calculations, both models process the frequency values in perceptual quanta.&lt;br /&gt;
&lt;br /&gt;
Psychoacoustic model 2 never actually separates tonal and non-tonal components. Instead, it computes a tonality index as a function of frequency. This index gives a measure of whether the component is more tone-like or noise-like. Model 2 uses this index to interpolate between pure tone-masking-noise and noise-masking-tone values. The tonality index is based on a measure of predictability. Model 2 uses data from the previous two analysis windows to predict, via linear extrapolation, the component values for the current window. Tonal components are more predictable and thus will have higher tonality indices. Because this process relies on more data, it is more likely to better discriminate between tonal and non-tonal components than the model 1 method.&lt;br /&gt;
&lt;br /&gt;
* Apply a spreading function. The [[masking]] ability of a given signal spreads across its surrounding [[critical band]]. The model determines the noise masking thresholds by first applying an empirically determined masking (model 1) or spreading function (model 2) to the signal components.&lt;br /&gt;
&lt;br /&gt;
* Set a lower bound for the threshold values. Both models include an empirically determined absolute masking threshold, the threshold in quiet. This threshold is the lower bound on the audibility of sound.&lt;br /&gt;
&lt;br /&gt;
* Find the masking threshold for each [[subband]]. Model 2 selects the minimum of the masking thresholds covered by the subband only where the band is wide relative to the critical band in that [[frequency]] region. It uses the average of the masking thresholds covered by the subband where the band is narrow relative to the critical band. Model 2 is not less accurate for the higher frequency subbands because it does not concentrate the non-tonal components.&lt;br /&gt;
&lt;br /&gt;
* Calculate the signal-to-mask ratio. The psychoacoustic model computes the signal-to-mask ratio as the ratio of the signal energy within the subband (or, for Layer III , a group of bands) to the minimum masking threshold for that subband. The model passes this value to the bit (or noise) allocation section of the encoder.&lt;br /&gt;
&lt;br /&gt;
==== Model 2 technical details ====&lt;br /&gt;
&amp;lt;!--commented out because it relies on missing diagrams:&lt;br /&gt;
2.1.1.1 Example for Psychoacoustic Model 2 The processes used by psychoacoustic model 2 are somewhat easier to visualize, so this model will be covered first. Figure 12a shows the result, according to psychoacoustic model 2, of transforming the audio signal to the perceptual domain (63, one-third critical band, partitions) and then applying the spreading function. Note the shift of the sinusoid peak and the expansion of the lowpass noise distribution. The perceptual transformation expands the low frequency region and compresses the higher frequency region. Because the spreading function is applied in a perceptual domain, the shape of the spreading function is relatively uniform as a function of partition. Figure 13 shows a plot of the spreading functions. Figure 12b shows the tonality index for the audio signal as computed by psychoacoustic model 2. Figure 14a shows a plot of the masking threshold as computed by the model based on the spread energy and the tonality index. This figure has plots of the masking threshold both before and after the incorporation of the threshold in quiet to illustrate its impact. Note the threshold in quiet significantly increases the noise masking threshold for the higher frequencies. The human auditory system is much less sensitive in this region. Also note how the sinusoid signal increases the masking threshold for the neighboring frequencies. The masking threshold is computed in the uniform frequency domain instead of the perceptual domain in preparation for the final step of the psychoacoustic model, the calculation of the signal-to-mask ratios (SMR) for each [[subband]]. Figure 14b is a plot of these results and figure 14c is a [[frequency]] plot of a processed audio signal using these SMR’s. In this example the audio compression was severe (768 to 64 kbits/sec) so the coder may not necessarily be able to mask all the [[quantize|quantization]] noise.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The psychoacoustic model calculates just-noticeable distortion (JND) profiles for each band in the [[filterbank]]. This noise level is used to determine the actual quantizers and quantizer levels. There are two psychoacoustic models defined by the standard. They can be applied to any layer of the MPEG/Audio algorithm. In practice however, Model 1 has been used for Layers I and II and Model 2 for Layer III. Both models compute a signal-to-mask ratio (SMR) for each band (Layers I and II) or group of bands (Layer III).&lt;br /&gt;
&lt;br /&gt;
The more sophisticated of the two, Model 2, will be discussed. The steps leading to the computation of the JND profiles is outlined below.&lt;br /&gt;
&lt;br /&gt;
;1. Time-align audio data&lt;br /&gt;
&lt;br /&gt;
The psychoacoustic model must estimate the [[masking]] thresholds for the audio data that are to be [[quantize|quantized]]. So, it must account for both the delay through the filterbank and a data offset so that the relevant data is centered within the psychoacoustic analysis window. For the Layer III algorithm, time-aligning the psychoacoustic model with the filterbank demands that the data fed to the model be delayed by 768 samples.&lt;br /&gt;
&lt;br /&gt;
;2. Spectral analysis and normalization.&lt;br /&gt;
&lt;br /&gt;
A high-resolution spectral estimate of the time-aligned data is essential for an accurate estimation of the masking thresholds in the [[critical band]]s. The low frequency resolution of the filterbank leaves no option but to compute an independent time-to-frequency mapping via a fast Fourier Transform ([[FFT]]). A Hanning window is applied to the data to reduce the edge effects of the transform window.&lt;br /&gt;
&lt;br /&gt;
Layer III operates on 1152-sample data frames. Model 2 uses a 1024- point window for spectral estimation. Ideally, the analysis window should completely cover the samples to be coded. The model computes two 1024-point psychoacoustic calculations. On the first pass, the first 576 samples are centered in the analysis window. The second pass centers the remaining samples. The model combines the results of the two calculations by using the more stringent of the two JND estimates for bit or noise allocation in each [[subband]].&lt;br /&gt;
&lt;br /&gt;
Since playback levels are unknown3, the sound-pressure level (SPL) needs to be normalized. This implies clamping the lowest point in the absolute threshold of hearing curves to +/- 1-bit [[frequency|amplitude]]. &lt;br /&gt;
&lt;br /&gt;
;3. Grouping of spectral values into threshold calculation partitions.&lt;br /&gt;
&lt;br /&gt;
The uniform [[frequency]] decomposition and poor selectivity of the filterbank do not reflect the response of the ear&#039;s Basilar Membrane. To accurately model the masking phenomenon characteristic of the Basilar Membrane, the spectral values are grouped into a large number of partitions. The exact number of threshold partitions depends on the choice of sampling rate. This transformation provides a resolution of approximately either 1 FFT line or 1/3 critical band, whichever is smaller. At low frequencies, a single line of the FFT will constitute a partition, while at high frequency|frequencies many lines are grouped into one.&lt;br /&gt;
&lt;br /&gt;
;4. Estimation of tonality indices.&lt;br /&gt;
&lt;br /&gt;
It is necessary to identify tonal and non-tonal (noise-like) components because the masking abilities of the two types of signals differ. Model 2 does not explicitly separate tonal and non-tonal components. Instead, it computes a tonality index as a function of frequency. This is an indicator of the tone-like or noise-like nature of the spectral component. The tonality index is based on a measure of predictability. Linear extrapolation is used to predict the component values of the current window from the previous two analysis windows. Model 2 uses this index to interpolate between pure tone-masking-noise and noise-masking-tone values. Tonal components are more predictable and thus have a higher tonality index. As this process has memory, it is more likely to discriminate better between tonal and non-tonal components, unlike psychoacoustic Model 116.&lt;br /&gt;
&lt;br /&gt;
;5. Simulation of the spread of masking on the Basilar Membrane.&lt;br /&gt;
&lt;br /&gt;
A strong signal component affects the audibility of weaker components in the same critical band and the adjacent bands. Model 2 simulates this phenomenon by applying a Spreading function to spread the energy of any critical band into its surrounding bands. On the [[Bark]] scale, the spreading function has a constant shape as a function of partition number, with slopes of +25 and –10 dB per Bark.&lt;br /&gt;
&lt;br /&gt;
;6. Set a lower bound for the threshold values.&lt;br /&gt;
&lt;br /&gt;
An empirically determined absolute [[masking]] threshold, the threshold in quiet, is used as a lower bound on the audibility of sound.&lt;br /&gt;
&lt;br /&gt;
;7. Determination of masking threshold per [[subband]].&lt;br /&gt;
&lt;br /&gt;
At low [[frequency|frequencies]], the minimum of the masking thresholds within a subband is chosen as the threshold value. At higher frequencies, the average of the thresholds within the subband is selected as the masking threshold. Model 2 has the same accuracy for the higher subbands as for low frequency ones because it does not concentrate non-tonal components16.&lt;br /&gt;
&lt;br /&gt;
;8. [[Pre echo]] detection and window switching decision.&lt;br /&gt;
&lt;br /&gt;
;9. Calculation of the signal-to-mask ratio (SMR).&lt;br /&gt;
&lt;br /&gt;
SMR is calculated as a ratio of signal energy within the subband (for Layers I and II) or a group of subbands (Layer III) to the minimum threshold for that subband. This is the final output of the psychoacoustic model.&lt;br /&gt;
&lt;br /&gt;
The masking threshold computed from the spread energy and the tonality index.&lt;br /&gt;
&lt;br /&gt;
== Pros and cons ==&lt;br /&gt;
=== Pros ===&lt;br /&gt;
* Widespread acceptance, support in nearly all hardware audio players and devices&lt;br /&gt;
* An [[ISO]] standard, part of MPEG specs&lt;br /&gt;
* Fast decoding, lower complexity than [[Advanced Audio Coding|AAC]] or [[Vorbis]]&lt;br /&gt;
* Anyone can create their own implementation (Specs and demo sources available)&lt;br /&gt;
* Since the patents have expired, MP3 is in the public domain.&lt;br /&gt;
&lt;br /&gt;
=== Cons ===&lt;br /&gt;
* Lower performance/efficiency than modern codecs.&lt;br /&gt;
* Problem cases that trip out all transform codecs.&lt;br /&gt;
* Sometimes, maximum bitrate (320kbps) isn&#039;t enough.&lt;br /&gt;
* Unusable for high definition audio (sampling rates higher than 48kHz).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
=== Techniques used in compression ===&lt;br /&gt;
* [[Huffman coding]]&lt;br /&gt;
* [[Quantization]]&lt;br /&gt;
* [[Joint stereo|M/S matrixing]]&lt;br /&gt;
* [[Intensity stereo]]&lt;br /&gt;
* [[Channel coupling]]&lt;br /&gt;
* Modified discrete cosine transform ([[MDCT]])&lt;br /&gt;
* Polyphase filter bank&lt;br /&gt;
&lt;br /&gt;
There is a non-standardized form of MP3 called [[MP3Pro]], which takes advantage of [[SBR]] encoding to provide better quality at low bitrates.&lt;br /&gt;
&lt;br /&gt;
=== Encoders/decoders (supported platforms) ===&lt;br /&gt;
* [[LAME]] (Win32/Posix)&lt;br /&gt;
* [[Helix MP3]] (Win32/Posix)&lt;br /&gt;
* [[Audioactive]] (Win32)&lt;br /&gt;
* [[Blade]] (Win32/Posix)&lt;br /&gt;
* [[Xing]] (Win32)&lt;br /&gt;
* [[Gogo]] (Win32/Posix)&lt;br /&gt;
&lt;br /&gt;
=== Metadata (tags) ===&lt;br /&gt;
* [[ID3v1]]&lt;br /&gt;
* [[ID3v1.1]]&lt;br /&gt;
* [[ID3v2]]&lt;br /&gt;
&lt;br /&gt;
== Further reading and bibliography ==&lt;br /&gt;
* [[Best MP3 Decoder]]&lt;br /&gt;
* [[High-frequency content in MP3s]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* &amp;lt;s&amp;gt;Roberto&#039;s listening test&amp;lt;/s&amp;gt; featuring MP3 encoders&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Mp3 MP3 at Wikipedia]&lt;br /&gt;
&lt;br /&gt;
[[Category:Codecs]]&lt;br /&gt;
[[Category:Lossy]]&lt;br /&gt;
[[Category:MP3]]&lt;/div&gt;</summary>
		<author><name>Maikmerten</name></author>
	</entry>
</feed>