# LAME 3.101 (beta 3, May 2026) q4 patched (Visual Studio cVBRb build)

This is a modified Visual Studio build of the LAME MP3 encoder.

Original LAME Project:
https://lame.sourceforge.io/

Fork:
Constrained VBR (cVBR), bitrate boost, SIMD, and OpenMP work
by Cole Williams
https://www.lamemp3.co.uk/

## DESCRIPTION

This is the cVBRb Visual Studio branch of this fork.

It extends the standard LAME encoder with:

* Constrained Variable Bitrate (cVBR) mode
* bitrate boost logic for rapid or demanding audio changes
* q4-related bug patch from this fork
* runtime-selected CPU-specific SIMD paths, including SSE2, AVX2, and AVX-512 where supported
* OpenMP-assisted quantization in VBR mode
* OpenMP-assisted Huffman work in ABR mode
* mpg123-based MP3 decoding support

This build is intended as the performance-focused Visual Studio branch. It is
separate from the standard cVBR branch, which provides constrained VBR without
the bitrate boost feature.

## FEATURES

### Constrained VBR (cVBR)

Constrained VBR is a modified VBR mode that can enforce a strict minimum bitrate
and, optionally, a maximum bitrate.

This is useful for compatibility targets, streaming constraints, bitrate floors,
or any situation where normal VBR behavior is too free to drop below a chosen
minimum.

### Difference from standard LAME -F option

The standard -F option in LAME does NOT enforce a hard minimum bitrate.

-F only biases the encoder toward higher bitrates during VBR encoding. The
encoder may still select lower bitrate frames when it determines that they are
sufficient.

The --vbr-min-strict option enforces a hard minimum bitrate.

When --vbr-min-strict is enabled, any frame that would be encoded below the
bitrate specified with -b is clamped to that minimum. No frames will be encoded
below the configured bitrate.

In short:

-F                  -> suggestion (soft constraint)
--vbr-min-strict    -> rule (hard constraint)

### Bitrate Boost

The cVBRb branch adds bitrate boost logic.

This feature is intended to detect rapid, complex, or demanding changes in the
audio and increase bitrate allocation where appropriate. It is designed to work
alongside cVBR, but it is separate from the strict minimum bitrate behavior of
--vbr-min-strict.

The command-line option is:

--bitrate-boost[=n]
Enables bitrate boost. The optional level n may be 1, 2, or 3.

If no value is supplied, level 1 is used.

Boost levels:

* 1 -> light
* 2 -> medium
* 3 -> aggressive

ABR support:

Bitrate boost also works with ABR encoding. In ABR mode, bitrate boost is limited
to level 1.

Examples:

lame -V0 -b 192 --vbr-min-strict --bitrate-boost input.wav output.mp3

lame -V0 -b 192 --vbr-min-strict --bitrate-boost=2 input.wav output.mp3

lame -V0 -b 192 --vbr-min-strict --vbr-max 320 --bitrate-boost=3 input.wav output.mp3

In practical terms:

* --vbr-min-strict sets a hard bitrate floor
* --vbr-max can set an optional bitrate ceiling
* --bitrate-boost can raise allocation within the available range when the audio
  appears to need it

Bitrate boost is part of the cVBRb branch and should not be treated as a
standard LAME feature.

### q4 Bug Patch

This build includes a q4-related bug fix from this fork.

The patch is intended to correct behavior in the affected VBR path and should
not be treated as a separate preset, quality mode, or compatibility option.

### MP3 Decoding Support

This Visual Studio build includes MP3 decoding support through mpg123.

mpg123 is statically linked into the executable/build output. A separate
libmpg123-0.dll is not required for --decode support.

Decode example:

lame --decode input.mp3 output.wav

### SIMD / CPU Notes

This Visual Studio cVBRb build includes runtime-selected CPU-specific SIMD paths.

Depending on the executable provided and the CPU feature support available at
runtime, supported paths may include:

* SSE2
* AVX2
* AVX-512

The AVX2 and AVX-512 paths are selected only when the build and host CPU support
them. On systems without the required CPU features, the build should fall back to
the available supported path.

The SIMD paths are intended to improve performance in selected hot paths. They
should not be interpreted as changing the meaning of the command-line options or
as separate quality modes.

### OpenMP Notes

This build uses OpenMP to assist performance in selected quantization work.

OpenMP support may introduce an additional runtime dependency depending on the
compiler and runtime used to build the executable. Keep any required OpenMP
runtime DLLs beside the executable if they are listed as dependencies.

## USAGE

Standard LAME options are supported.

Additional cVBR options:

--vbr-min-strict
Enables constrained VBR mode with a strict minimum bitrate.
The minimum bitrate is set with -b.

--vbr-max <bitrate>
Sets the maximum allowed bitrate for constrained VBR mode.

Additional cVBRb option:

--bitrate-boost[=n]
Enables bitrate boost. The optional level n may be 1, 2, or 3.
If no value is supplied, level 1 is used.

Bitrate boost also works with ABR encoding. In ABR mode, bitrate boost is limited
to level 1.

Examples:

lame -V0 -b 192 --vbr-min-strict --vbr-max 320 input.wav output.mp3

lame -V0 -b 192 --vbr-min-strict --bitrate-boost=2 input.wav output.mp3

lame -V0 -b 192 --vbr-min-strict --vbr-max 320 --bitrate-boost=3 input.wav output.mp3

lame --abr 192 --bitrate-boost input.wav output.mp3

In the first example, VBR encoding is constrained between 192 kbps and 320 kbps.

In the second and third examples, bitrate boost is also enabled.

Decode example:

lame --decode input.mp3 output.wav

## BUILD INFORMATION

### Windows Visual Studio

This package is built with Microsoft Visual Studio.

The build may be provided in:

* x86 / 32-bit
* x64 / 64-bit

This Visual Studio cVBRb build includes:

* statically linked mpg123 decoding support
* runtime-selected SIMD paths, including SSE2, AVX2, and AVX-512 where supported

Because mpg123 is statically linked, no separate libmpg123-0.dll is required.

### Dependency Notes

To check runtime DLL dependencies, use:

dumpbin /dependents lame.exe

or, with MinGW tools:

objdump -p lame.exe | grep "DLL Name"

If an OpenMP runtime DLL is listed, it must be distributed beside the executable.

## LICENSE

LAME is distributed under the GNU Lesser General Public License (LGPL).

mpg123 is distributed under the GNU Lesser General Public License (LGPL).
This build links mpg123 for MP3 decoding support.

See COPYING and the relevant dependency licenses for details.

## DISCLAIMER

This is an unofficial build of LAME with additional features.
It is not affiliated with or endorsed by the original LAME project.

The cVBRb branch contains experimental and performance-focused changes specific
to this fork.

---

Cole Williams
https://www.lamemp3.co.uk/
