Skip to content

FAAC 3.0

Choose a tag to compare

@nschimme nschimme released this 19 Nov 02:40
· 9 commits to master since this release

A major release: libfaac ABI 3, the new LGPL libfaad/faad decoder, the libfaam/faam MP4 muxer and libfaar/faar resampler, HE-AAC v2 with Parametric Stereo (build option), and many encoder, decoder and CLI improvements.

Breaking: the libfaac ABI changed (3) and -q values are not comparable with 2.2. See the first three items below (the third changes 8-channel decoding), and rebuild code written against ABI 2.

Changes by Nils Schimmelmann

  • libfaac ABI 3: faac_params takes a whole-stream bitrate with explicit ABR, VBR and CBR modes, channels, stereo_mode, stream_format (including MPEG-2 ADTS) and channel layouts; faac_encoder_info carries the AudioSpecificConfig; float input is unity full scale; faac_library_info reports SBR and PS through flags. Each shared library now has its own ABI version, separate from the release. Code built for ABI 2 recompiles but misbehaves: a per-channel bit_rate encodes at 1/N of the rate and old-scale float input encodes as silence
  • -q values are not comparable with 2.2: the same -q now gives a different bitrate
  • faad reads channelConfiguration 7 as 7.1 wide (centre, FLC/FRC, FL/FR, surrounds, LFE), as Apple's decoder and FDK's do; FFmpeg reads it as front, side and back pairs unless run with -strict 1, and FAAD2 returns the pairs in stream order labelled front, side and back (the faad2 shim reports those labels). Eight-channel streams from 2.2 and earlier used configuration 7 and coded the input's BL BR as the second pair and SL SR as the third, so they come out with the pairs moved; encode 7.1 again from the source instead of relying on the channel order of old streams
  • New decoder libfaad and faad: a complete rewrite from the FAAC codebase (not derived from FAAD2), LGPL-2.1-or-later, with its own libfaad3 API; faad reports DAB+ support in FAAD_LIB_DAB
  • New libraries and tools: libfaam and faam (MP4 muxer, demuxer and tag editor) and libfaar and faar (sample rate converter); faac writes MP4 through libfaam and resamples through libfaar
  • HE-AAC v2 encoding with Parametric Stereo behind -Dencoder-ps, off by default because the PS patents have not expired; stereo AUTO picks it only for explicit stereo bitrates up to 16 kbps total (14 kbps at 44.1 kHz, 12 kbps at 32 kHz), below where it used to fall back to LC or HE-AAC v1; --profile auto|lc|he-v1|he-v2 selects explicitly. -Dencoder-sbr=false builds an LC-only encoder
  • HE-AAC v1 auto ceiling raised from 32 kbps per channel to 1 bit/s per Hz of sample rate through 48 kHz (48 kbps per channel at 48 kHz, 44.1 at 44.1 kHz, 32 at 32 kHz where it was 12), so a stereo -b 80 at 48 kHz that was AAC-LC is now HE-AAC v1
  • Automatic resampling: --rate auto (default), keep or <Hz>. In ABR and CBR input above 48 kHz goes to 44.1 or 48 kHz and 44.1/48 kHz input goes to 32 kHz at very low bitrates when the encoder resolves to AAC-LC (--profile lc or an LC-only build); 48 kHz stereo input also goes to 32 kHz up to 10 kbps total when it resolves to HE-AAC. --rate keep turns it off; the MP4 tag records the mapping. VBR keeps the input rate, capped at 96 kHz. faar takes --quality fast|good|high, --dither none|tpdf|shaped and -D, with output rates 7350-192000 Hz; input above 48 kHz is resampled with high
  • Filter bank: AAC-LC long windows use a Kaiser-Bessel Derived window again instead of the sine window, to cut spectral leakage from loud low-frequency tones into the broadband noise floor (bass-heavy intros at high quality); short windows, LFE channels and the HE-AAC core keep sine
  • Encoder retunes: stereo masking and M/S selection, short-window onset targets (less pre-echo), SBR envelopes and transient borders, and the HE-AAC auto ceiling
  • CBR carries the fraction of a bit when the rate is not a whole number of bits per frame, so the decoder buffer no longer drifts on long streams
  • Every frame now fits its cap: the CBR reservoir, --cap-rate and the ISO frame limit. A frame still too big at minimum quality drops its top bands instead of being written over the limit; only a cap below an empty frame (about 290 bits stereo LC, 470 HE) can be exceeded
  • Dynamic range control: faac --drc <profile> writes dynamic_range_info from the input's K-weighted loudness (profiles: film, film-light, music, music-light, speech; --drc-ref-level sets the program level); libfaac gains drc_profile and drc_ref_level and FAAC_LIB_DRC, off with -Dencoder-drc=false. faad takes --drc-cut and --drc-boost in percent and --drc-target-level in dBFS; libfaad uses dBFS for drc_target_level and drc_ref_level, and faad -i prints the stream's reference level
  • faad puts FFmpeg's and Apple's 5.1, 6.1, 7.0 and 7.1 PCE streams, fdkaac's 7.1 and channelConfiguration 11 and 12 streams in WAVE order with the matching channel mask from the first frame, and keeps the order when a stream is joined between PCEs (except FFmpeg's 7.0, whose two back pairs swap until a PCE arrives); configurations 11 and 12 were refused before, and the frames of a stream before its first PCE decoded as noise on the pair channels
  • Eight-channel streams are signalled with a program config element in the AudioSpecificConfig and in every 32nd ADTS frame; faad and faam read them
  • faac warns when a WAVE_FORMAT_EXTENSIBLE file's channel mask is not the order it reads (quad or 6.0, for example) and rejects 7-channel input with a clear message; encoded output is unchanged
  • faad --downmix also folds to 3.0, 4.0, 5.0 and 5.1 layouts, in addition to mono and stereo; libfaad takes the target's WAVE speaker mask
  • Gapless: faad and faam trim by iTunSMPB or, without it, by the edit list and the decoded sample count; Nero HE-AAC priming is read without the decoder delay and FAAC 1.x priming is inferred from the encoder tag
  • libfaam: chapters (chpl plus a QuickTime text track), built out with -Dmuxer-chapters=false, and custom tags are copied
  • libfaam edits the first moov of a file that has several, the one other readers parse, instead of the last
  • frontend tags: added generic typed metadata entries (faam_metadata_entry) to faam and faac, supporting lyrics (--lyrics, --lyrics-file), grouping (--grouping), copyright (--copyright), description (--description), work (--work), movement (--movement), and BPM (--bpm) tags, with ID3v1 genre text mapping
  • frontend: the MP4 encoder tag (©too) records rate or mode, profile and cutoff always, and resampling, M/S, TNS, PNS and the other settings only when they differ from the defaults; --no-encoder-info omits it. Initialize console code page to UTF-8 on Windows; align option help columns; handle 5.0 and 7.1 channel ordering
  • frontend I/O & pipes: incremental WAV and RF64 header reading, float PCM support in either byte order, --faststart for MP4 moov positioning, hardened MP4 pipe handling, and error reporting on stream failure
  • frontend CLI alignment: unified -v <level> verbosity control (-v0 quiet mode, -v1 progress updates, -v2 completion summaries) and aligned usage display across faac, faad, faam and faar; progress callbacks throttled to ~30 Hz with %7.1f bitrate formatting; name build options when compiled-out features are requested
  • CLI options modernized with the old names kept as aliases; --tag accepts = as a separator; ADTS stream info is reported after the first frame
  • High-resolution VBR improved above 48 kHz; the SBR stop frequency stays above the start frequency at 64 kHz and up; LFE channels stay on long windows
  • Hardening: the encoder API and WAV reader reject hostile input, allocation failures are handled, and a request for more channels than the build supports is refused
  • libfaad: faster S16 output and SBR windows with bit-exact output: ~21% (AAC-LC) and ~26% (HE-AAC v1) faster on an ESP32-S3, ~10% less CPU time on x86-64 at -O2 and unchanged at -O3
  • Win32 GUI (faacgui): ported to shared encoding engine with libfaam MP4 output, quality and stereo mode labels, and conditional HE-AAC options
  • Build options: decoder-sbr, decoder-ps, decoder-dab, decoder-drc, muxer, muxer-video, muxer-fragmented, muxer-chapters, resampler and resampler-float; faac and faad name the build option when a stream or request needs a feature that was compiled out
  • CMake package: the install adds faacConfig.cmake, so find_package(faac CONFIG COMPONENTS faac faad3 faam faar) provides the faac::faac, faac::faad3, faac::faam and faac::faar targets; FAAC_USE_STATIC_LIBS=ON selects the static archives. The libraries are also Meson dependencies named faac, faad3, faam and faar
  • Documentation and man pages rewritten for libfaac, libfaad, libfaar and libfaam; build: detect host byte order without config.h; add unit, integration, ABI, link and fuzz test coverage

Changes by Mar Dominguez

  • libfaad: pair and enhance SBR channels only for the element that filled them, so a change of element layout no longer reads uninitialized envelopes
  • libfaad: apply SBR to a channel only while the element that filled it is still in the frame, so an element sent without SBR no longer inherits the payload of the one it replaced

Downloads

Windows builds (faac-3.0-MSVC.zip, faac-3.0-MSYS2-UCRT64.zip) are attached; they hold the faac, faad, faam and faar tools, libraries, headers and man pages.

Full changelog: faac-2.2...faac-3.0