The lambda re-verdicts for OBMC, local warp and a key-frame lambda factor
Browse files at this commit7e184463690f94ca66b2a7215c45b887a8fb65bfParent: f72bb81- docs
- the lambda re-verdicts for OBMC, local warp and a key-frame lambda factor
1 changed file +47 -2
- crates/ec-av1/src/encode.rs +47 -2
crates/ec-av1/src/encode.rsmodified+47 -2
| @@ -134,6 +134,25 @@ fn lambda_scale() -> f64 { | |||
| 134 | /// left in it is paid for over the whole group. This encoder has no temporal | 134 | /// left in it is paid for over the whole group. This encoder has no temporal |
| 135 | /// propagation model at all, and this factor is the cheapest stand-in for one. | 135 | /// propagation model at all, and this factor is the cheapest stand-in for one. |
| 136 | /// Swept by `EC_AV1_LAMBDA_KEY` in a test build, like [`lambda_scale`]. | 136 | /// Swept by `EC_AV1_LAMBDA_KEY` in a test build, like [`lambda_scale`]. |
| 137 | +/// | ||
| 138 | +/// MEASURED and NOT KEPT. 640x384 gate at [`LAMBDA_SCALE`] 0.05, BD vs | ||
| 139 | +/// libaom / vs rav1e: | ||
| 140 | +/// | ||
| 141 | +/// | k_key | 1080p | 2160p | screen | | ||
| 142 | +/// |---|---|---|---| | ||
| 143 | +/// | 1.0 | +71.9 / +29.6 | +87.1 / +49.3 | +48.7 / -4.0 | | ||
| 144 | +/// | 0.85 | +71.5 / +29.4 | +87.0 / +48.3 | +49.7 / -3.9 | | ||
| 145 | +/// | 0.7 | +71.3 / +28.9 | +87.2 / +48.6 | +49.4 / -4.1 | | ||
| 146 | +/// | 0.5 | +71.4 / +28.9 | +88.7 / +49.6 | +50.1 / -3.4 | | ||
| 147 | +/// | ||
| 148 | +/// The two films want the key frame coded finer and the screen capture wants | ||
| 149 | +/// the opposite, by about the same amount, and at native the whole lever is | ||
| 150 | +/// inside the +-0.3 band that decides nothing: k_key 0.7 reads +16.9 / -0.3, | ||
| 151 | +/// +47.2 / +19.2, +51.4 / -14.7 against 1.0's +17.0 / -0.3, +47.0 / +19.2, | ||
| 152 | +/// +51.6 / -14.2. A gate whose GOP is one key frame in twelve cannot see a | ||
| 153 | +/// per-frame-type weight; the real lever here is temporal propagation | ||
| 154 | +/// (libaom's `tpl`), which weighs each BLOCK by how much of it later frames | ||
| 155 | +/// predict from, not each frame. | ||
| 137 | const KEY_LAMBDA_FACTOR: f64 = 1.0; | 156 | const KEY_LAMBDA_FACTOR: f64 = 1.0; |
| 138 | 157 | ||
| 139 | /// [`KEY_LAMBDA_FACTOR`], or what `EC_AV1_LAMBDA_KEY` names in a test build. | 158 | /// [`KEY_LAMBDA_FACTOR`], or what `EC_AV1_LAMBDA_KEY` names in a test build. |
| @@ -2515,8 +2534,16 @@ impl Reach { | |||
| 2515 | /// film -- 85% of them, far past libaom's own rate -- and costs another 0.3 | 2534 | /// film -- 85% of them, far past libaom's own rate -- and costs another 0.3 |
| 2516 | /// BD points on top of the 0.4 the 32x32 candidate already costs. A tool | 2535 | /// BD points on top of the 0.4 the 32x32 candidate already costs. A tool |
| 2517 | /// that wins the local RD on five blocks in six and loses ladder bytes is | 2536 | /// that wins the local RD on five blocks in six and loses ladder bytes is |
| 2518 | -/// the `local-RD-on-references` class again, not a missing footprint. The | 2537 | +/// the `local-RD-on-references` class again, not a missing footprint. |
| 2519 | -/// tool stays OFF by default; the upgrade path is the price, not the size | 2538 | +/// |
| 2539 | +/// RE-MEASURED on lane-av1lambda at [`LAMBDA_SCALE`] 0.05 (min side 8): | ||
| 2540 | +/// +16.7 / -0.5, +47.1 / +19.2, +51.8 / -14.2 against the same build with | ||
| 2541 | +/// the knob off (+17.0 / -0.3, +47.0 / +19.2, +51.6 / -14.2). The 0.7-point | ||
| 2542 | +/// loss on the 1080p film became a 0.3-point win and the other two rows went | ||
| 2543 | +/// 0.1-0.2 the other way, so OBMC is now neutral rather than a loss -- half | ||
| 2544 | +/// of the "local win, ladder loss" it was charged with was the rate weight. | ||
| 2545 | +/// It still does not meet the keep rule (two down, one flat, both columns). | ||
| 2546 | +/// The tool stays OFF by default; the upgrade path is the price, not the size | ||
| 2520 | /// (the 640x384 arm reads +78.9/+36.4, +94.9/+56.3, +54.2/+0.8 at min side 8 | 2547 | /// (the 640x384 arm reads +78.9/+36.4, +94.9/+56.3, +54.2/+0.8 at min side 8 |
| 2521 | /// against +78.8/+36.1, +95.1/+56.4, +54.5/+1.1 off -- two rows down, the | 2548 | /// against +78.8/+36.1, +95.1/+56.4, +54.5/+1.1 off -- two rows down, the |
| 2522 | /// 1080p film up, i.e. the same disagreement between the two gates). | 2549 | /// 1080p film up, i.e. the same disagreement between the two gates). |
| @@ -2571,6 +2598,24 @@ fn motion_mode_bits(write_w: usize, write_h: usize, motion: u8, warp_alphabet: b | |||
| 2571 | /// candidate above it (`obmc_min_side`): a local RD win that does not convert | 2598 | /// candidate above it (`obmc_min_side`): a local RD win that does not convert |
| 2572 | /// into ladder bytes. | 2599 | /// into ladder bytes. |
| 2573 | /// | 2600 | /// |
| 2601 | +/// RE-MEASURED on lane-av1lambda, after [`LAMBDA_SCALE`] moved 0.1 -> 0.05, | ||
| 2602 | +/// because a tool whose gain is local and whose cost is the rate it adds is | ||
| 2603 | +/// exactly what a halved rate weight re-judges. The verdict FLIPS SIGN: | ||
| 2604 | +/// | ||
| 2605 | +/// | clip | warp on | off (both at lambda 0.05) | | ||
| 2606 | +/// |---|---|---| | ||
| 2607 | +/// | film 1080p | +16.7 / -0.5 | +17.0 / -0.3 | | ||
| 2608 | +/// | film 2160p | +47.0 / +19.1 | +47.0 / +19.2 | | ||
| 2609 | +/// | screen | +51.3 / -14.3 | +51.6 / -14.2 | | ||
| 2610 | +/// | ||
| 2611 | +/// two rows down against libaom (0.3 each) with the third flat, and the rav1e | ||
| 2612 | +/// column inside 0.1 everywhere -- which reads as a keep rather than the | ||
| 2613 | +/// 0.7/0.9 loss it was. The knob still ships OFF here: the margin is 0.3 BD | ||
| 2614 | +/// points on a table whose other levers move whole points, and turning warp | ||
| 2615 | +/// on by default is a stream-feature change (`enable_warped_motion` in the | ||
| 2616 | +/// sequence header) that wants its own conformance pass, not a lambda lane's | ||
| 2617 | +/// side effect. | ||
| 2618 | +/// | ||
| 2574 | /// The WARPED_CAUSAL prediction of one square single-reference block: the | 2619 | /// The WARPED_CAUSAL prediction of one square single-reference block: the |
| 2575 | /// decoder's own warp-sample walk (`decode::find_samples` + | 2620 | /// decoder's own warp-sample walk (`decode::find_samples` + |
| 2576 | /// `warp::select_samples`), least-squares model (`warp::find_projection`) and | 2621 | /// `warp::select_samples`), least-squares model (`warp::find_projection`) and |