diff --git a/crates/ec-av1/src/encoder/mod.rs b/crates/ec-av1/src/encoder/mod.rs index bfb0d87a..80c4a490 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. /// -/// The state is kept PER LEVEL, flat path included: each frame's size is +/// In pyramid mode the state is kept PER LEVEL: 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,10 +297,11 @@ 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 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 + // run's `gop` frame targets are shared out in those units. The old + // 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 // [`Pyramid::quarter_q_offset`]), and a hidden frame is worth far // more than two leaves -- the census reads the top ARF at 24x a leaf // and the mid at 5x. Both are fixed here, in one diff.