ec-av1 rate loop: restore main's comment text in level model (no prose added)
Browse files at this commita8e773b9ca3ca46ba09d7e2489c3351fee3cd07eParent: f61cd971 changed file +6 -5
crates/ec-av1/src/encoder/mod.rsmodified+6 -5
| @@ -226,7 +226,7 @@ impl LevelPlan { | ||
| 226 | 226 | /// cannot build a debt a later transient has to repay; each frame's step is |
| 227 | 227 | /// bounded by `STEP_CLAMP` regardless of history. |
| 228 | 228 | /// |
| 229 | -/// The state is kept PER LEVEL, flat path included: each frame's size is | |
| 229 | +/// In pyramid mode the state is kept PER LEVEL: each frame's size is | |
| 230 | 230 | /// predicted from the previous frame of its own level, against that level's |
| 231 | 231 | /// own share of the budget, which is the whole "two-pass-free model" this |
| 232 | 232 | /// encoder carries. |
| @@ -297,10 +297,11 @@ impl RateLoop { | ||
| 297 | 297 | fn new(target_bytes: f64, start_q: f64, pyramid: Option<Pyramid>, gop: usize) -> Self { |
| 298 | 298 | // THE LEVEL MODEL. Every coded frame of the run is priced by its own |
| 299 | 299 | // q offset through `WEIGHT_LEVEL_GAIN`, in units of one leaf, and the |
| 300 | - // run's `gop` frame targets are shared out in those units. The old pyramid model priced a group as "one hidden frame worth | |
| 301 | - // `ARF_WEIGHT` = 2 leaves plus `m - 1` leaves", which was wrong twice | |
| 302 | - // over and the two errors cancelled (lane-pyr6): the group has coded | |
| 303 | - // TWO hidden frames since the mid level landed (four with | |
| 300 | + // run's `gop` frame targets are shared out in those units. The old | |
| 301 | + // model priced a group as "one hidden frame worth `ARF_WEIGHT` = 2 | |
| 302 | + // leaves plus `m - 1` leaves", which was wrong twice over and the two | |
| 303 | + // errors cancelled (lane-pyr6): the group has coded TWO hidden frames | |
| 304 | + // since the mid level landed (four with | |
| 304 | 305 | // [`Pyramid::quarter_q_offset`]), and a hidden frame is worth far |
| 305 | 306 | // more than two leaves -- the census reads the top ARF at 24x a leaf |
| 306 | 307 | // and the mid at 5x. Both are fixed here, in one diff. |