Change #275173
| Category | ffmpeg |
| Changed by | Lynne <dev@lynne.ee> |
| Changed at | Sun 19 Jul 2026 14:41:52 |
| Repository | https://git.ffmpeg.org/ffmpeg.git |
| Project | ffmpeg |
| Branch | master |
| Revision | 646f2796c8e267fd77b6f6dacc60c6e9ea333c95 |
Comments
avcodec/aacenc: rework NMR rate control, pool CPE budgets, add decision memory Rate control: replace the integral servo with a stateless pressure offset (exp2(-K*fill/R)) so a drained reservoir cannot wind up and crater quality after loud stretches; slew-limit the final operating lambda per frame (bits deviate instead, the reservoir absorbs); seed the reservoir full at stream start; and track rate strain explicitly: a long-frame lambda EMA against anchors that scale up when the achieved distortion/mask ratio flags noise-class content (whose psy masks are wholesale violated and lambda reads inflated), plus a lambda min-tracker separating sustained starvation from transient spikes at a comfortable operating point. The resulting pressure ramp gates every pressure-adaptive tool from one place. CPE budget pooling: solve both channels of a pair jointly under one shared lambda against a pooled budget (NMRSlot defer/solve/commit) instead of an equal per-channel split, which starved the mid/carrier while the side gold-plated. Mono and VBR output are unchanged. Transients: isolated onsets are coded uniformly finer across the short run and repaid from steady stretches; dense-beat runs get a starvation-scaled boost; a transition premask clamps START-frame thresholds toward the previous long frame (an attack cannot mask backwards). Decision memory: marginal per-frame re-decisions oscillate audibly, so every stateful choice now carries hysteresis - band zeroing, PNS enter/leave with debounce (and near-masked bands staying noise until a loudness guard), per-grid stereo mode banks that survive window switches, and the short-TNS accept state. TNS-covered bands price distortion by the synthesis filter's re-amplification gain, so the trellis spends where noise will actually be heard.
Changed files
- libavcodec/aaccoder_nmr.h
- libavcodec/aacenc.h
- tests/ref/fate/id3v2-reenc-delete-metadata
- tests/ref/fate/id3v2-reenc-delete-metadata-keep
- tests/ref/fate/id3v2-reenc-delete-metadata-keep-format
- tests/ref/fate/id3v2-reenc-delete-metadata-keep-stream
- tests/ref/fate/id3v2-reenc-delete-metadata-map-metadata