1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00
Files
ffmpeg/libavcodec
Lynne 98afaae587 avcodec/aaccoder_nmr, aacenc, aacpsy: -aac_rc abr
-aac_rc cbr|abr (default cbr). ABR runs the nd-target quality solve with
the set-point owned by a slow rate servo, and joins VBR as a
quality-target mode in the psy model (fixed-reference PE reduction,
quality attack map, broadband mask floor).

The servo integrates the log rate error but applies it to the nd
set-point in rare, discrete, calm-gated steps. The set-point must be
quasi-static: any drift on content timescales moves lambda, and with it
band/PNS/scalefactor state, tracking sections in antiphase and
coarsening exactly what needs bits - measured 2x worse than a fixed
target at equal mean rate. Locally this mode IS fixed-target VBR; rate
honesty converges on the minutes scale.

Bootstrap. The set-point is seeded from the VBR calibration anchor (one
constant, NMR_VBR_ANCHOR: the two are required to agree, and moving only
one copy made ABR overshoot its rate target by up to 9%). After ~2s of
fast rate measurement off a representative window (an all-transient
head reads over-target and would coarsen the very content that needs
bits), an open-loop jump over the measured loop gain (~ -0.24 log2 rate
per target unit) corrects the seed's per-content error, applied at
1.2x - the estimator's own inverse warm-up factor, since the EMA is
seeded on target (a cold start must not read as a fake deficit) and so
recovers only ~82% of the error. One correction is not enough whatever
the gain estimate, because the 0.24 loop gain is only nominal: the boot
re-arms while the rate is still off, up to a bounded number of times,
re-measuring each time, and re-seeds the estimator on target rather than
to zero (a zero estimate pins the integrator at its clip via log2f(0)
and reads as a 100% deficit to the fill in the same frame). Its settle
window sits below the stepper's hold, or the stepper resets the shared
counter first and the re-arm never fires.

Every set-point correction is glided in at ~0.5 log2-units/s rather than
stepped: a one-frame noise-floor jump at a fixed stream time (the boot
lands at ~2s in every stream) is audible against revealing content even
at step sizes the corpus cannot see.

Bits-fill. Under the long-run target, an easy frame is topped up toward
the ask by moving lambda finer only - the quality target is a floor,
never traded away. It spends the rate the user asked for on sub-mask
margin the nd statistic cannot see (it clips at -4/band); without it,
stat-transparent content caps the rate below any ask. The fill runs from
frame one and fades continuously as the rate EMA converges (a boot-gated
fill flipped regimes at ~2s, an audible quality step), follows the psy
PE demand shape, and is slew-bounded, writing the lambda continuity
state from long frames only instead of free-diving up to 64x per frame.
The un-booted stream head behaves CBR-like until the servo takes over
(love.flac: >6k energy had swung 0.61-1.83x vs the source at frame rate
while the head ran 25% under the ask).

The reachable-range clamps do not track the calibration anchor: their
floors are set by the stat's -4/band sub-mask clip. A floor at -1.65
railed the servo on easy content (male_speech at a 128k ask pinned at
the clamp with a 10% standing deficit); -3.0 keeps 384k asks reachable
without the stall. Easy content can still fall short of very high asks
(main_theme: 196k at a 256k ask) - there is no padding. The coarse
clamp is a quality guard: set-points past it buy little rate for a lot
of quality (2.5 -> 6.0 at a 48k ask: -5% rate, +32% Zimtohrli), so asks
below about 56 kbps stereo land above the ask (24k/32k asks: ~40k).
The documentation points those rates at CBR.

Rate accuracy against the -b:a ask:
  corpus       bias    mean|err|  worst
  IgorC-3      -1.3%   2.2%       -11.8%
  IgorC-1      +1.1%   2.0%        +5.0%
  32 random    -0.3%   2.2%       -10.0%
A 4.5-minute concatenation of the IgorC-3 samples lands at 128.2 kbps
on a 128k ask. castanets/velvet ABR beat CBR; ABR corpus 0.00060 at
126k.

-aac_rc is documented, and fate-aac-nmr-abr-encode pins the per-packet
sizes through the servo's boot.
2026-10-04 17:51:10 +09:00
..
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
2026-07-01 21:05:27 +09:00
2026-07-01 21:05:27 +09:00
2026-09-12 23:52:20 +00:00
…
…
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
…
…
…
2026-09-12 23:52:20 +00:00
…
2026-09-02 22:31:34 +02:00
…
…
2026-09-28 05:54:41 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
…
…
…
…
…
…
2026-06-23 19:15:57 +02:00
…
…
…
…
…
…
…
…
…
2026-09-25 22:12:25 +00:00
…
…
…
2026-09-10 18:23:50 +00:00
…
…
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-04-28 14:31:19 +02:00
…
…
…
…
…
…
…
2026-04-28 12:29:37 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
…
2026-05-03 16:56:43 +02:00
…
…
…
…
…
2026-09-06 00:48:26 +02:00
…
2026-04-28 12:29:37 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
…
…
…
…
2026-10-03 12:15:46 +09:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-06-23 19:15:57 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-06-23 19:15:57 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
…
…
…
…
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
…
…
…
…
…
2026-05-03 18:23:03 +02:00
…
…
…
…
2026-07-07 17:35:58 +00:00
2026-07-07 17:35:58 +00:00
…
…
…
…
…
…
…
…
…
2026-06-13 15:55:40 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-05-02 21:39:02 +00:00
…
…
…
…
…
…
…
…
…
…
2026-06-23 17:15:02 +02:00
…
2026-07-28 17:54:07 +02:00
…
…
…
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
…
…
…
…
2026-09-24 08:02:22 +09:00
2026-09-24 08:02:22 +09:00
2026-07-01 21:05:27 +09:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-05-03 18:22:24 +02:00
…
…
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
…
…
…
…
…
…
…
…
…
…
…
2026-08-13 13:17:59 +02:00
…
…
…
…
…
…
…
2026-09-12 23:52:20 +00:00
…
2026-09-21 21:23:33 +00:00
…
…
…
…
…
…
2026-08-09 17:25:23 +02:00
…
2026-08-09 17:25:23 +02:00
2026-08-09 17:25:23 +02:00
2026-08-09 17:25:23 +02:00
2026-08-09 17:25:23 +02:00
2026-08-09 17:25:23 +02:00
…
…
…
…
…
…
…
2026-09-28 05:54:41 +00:00
…
…
…
2026-06-23 19:15:57 +02:00
…
2026-04-28 12:29:37 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
2026-07-28 17:54:07 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-06-23 19:15:57 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…