Sample format or bit depth conversion, and limiter - nu774/qaac GitHub Wiki

DSP options such as --normalize, --gain, --limiter, --matrix-preset, --matrix-file, --rate, --lowpass, --drc will convert internal sample format to float. This can be seen by turning --verbose on. Note that qaac doesn't automatically back convert sample format to integer.

When you want to convert sample format to integer, use -b with desired bit depth. This is mandatory for ALAC encoding that accepts only integer format. For ALAC encoding, 16 20, 24, and 32 bits are allowed.

For PCM output, arbitrary bit depth between 2 and 32 is allowed for -b. -b 32 means 32 bit float in case of PCM.

When bit depth is decreased (re-quantized) and target bit depth ≦ 18, qaac will apply TPDF dither by default. You can disable it by --no-dither.

About limiter

Since float format can hold sample values greater than 0dBFS and integer format cannot, float -> int conversion has a possibility of clipping. If you want to avoid hard clips, use --limiter. When limiter is on, qaac will apply smart limiter that only affects portions surrounding peaks beyond (near) 0dBFS. It will search peaks, then applies non linear filter to half cycle (zero-crossing point to next zero-crossing point) surrounding each peak. The result falls within 0dBFS range and still is smoothly connected to other parts, and has much less audible distortions than simple dumb hard clip.

This works like the following images:

original
limitter on
⚠️ **GitHub.com Fallback** ⚠️