fn peak_of(settings: &CaptureSettings) -> Option<PeakBucket>Expand description
The peak a capped constant quantizer runs under (RateSettings::capped), as NVENC’s
constant rate takes it: the target held to the codec’s ceiling, and its buffer.
NVENC’s constant quantizer takes no cap, and its quality-targeting VBR codes a picture of its
own rather than the constant quantizer’s, so the session switches (PeakBucket): it codes at
its constant quantizer until its output overflows the peak, then through the constant rate at
the peak with the quantizer as its minQP, and back. The rate-control mode is one of the
parameters nvEncReconfigureEncoder takes without a reset (hold_rate), so neither switch
costs a key frame. A peak past the rate the level the session declared carries leaves it at
its constant quantizer, since a raised level is a key frame.