diff --git a/crates/ec-av1/src/encoder/mod.rs b/crates/ec-av1/src/encoder/mod.rs index dce7801a..bfb0d87a 100644 --- a/crates/ec-av1/src/encoder/mod.rs +++ b/crates/ec-av1/src/encoder/mod.rs @@ -226,7 +226,7 @@ impl LevelPlan { /// cannot build a debt a later transient has to repay; each frame's step is /// bounded by `STEP_CLAMP` regardless of history. /// -/// In pyramid mode the state is kept PER LEVEL: each frame's size is +/// The state is kept PER LEVEL, flat path included: each frame's size is /// predicted from the previous frame of its own level, against that level's /// own share of the budget, which is the whole "two-pass-free model" this /// encoder carries. @@ -297,11 +297,7 @@ impl RateLoop { fn new(target_bytes: f64, start_q: f64, pyramid: Option, gop: usize) -> Self { // THE LEVEL MODEL. Every coded frame of the run is priced by its own // q offset through `WEIGHT_LEVEL_GAIN`, in units of one leaf, and the - // run's `gop` frame targets are shared out in those units. The flat - // path is the same run with no hidden levels and no offsets, so the - // key frame is budgeted against the GOP there too: its overshoot is - // re-planned over the leaves, never slammed into their shared `q`. - // The old pyramid model priced a group as "one hidden frame worth + // run's `gop` frame targets are shared out in those units. The old pyramid model priced a group as "one hidden frame worth // `ARF_WEIGHT` = 2 leaves plus `m - 1` leaves", which was wrong twice // over and the two errors cancelled (lane-pyr6): the group has coded // TWO hidden frames since the mid level landed (four with @@ -372,8 +368,6 @@ impl RateLoop { .position(|p| p.is_some_and(|p| p.slot == slot && (slot != 1 || p.offset == offset))) } - /// Which controller a level uses: the key, the hidden ARF levels and the - /// leaves each steer their own `q`. fn slot(&self, level: Level) -> usize { match level { Level::Key => 0,