The ARF temporal filter's strength swept on the deciding gate ships at 2
Browse files at this commit0717f8375d909d0c9fcbe0d143e4bfa1214b782fParent: ea60760- feat
- the ARF temporal filter's strength swept on the deciding gate ships at 2
2 changed files +33 -3
crates/ec-av1/src/encode.rsmodified+5 -1
| @@ -17076,7 +17076,11 @@ mod tests { | ||
| 17076 | 17076 | // FILTERED source ([`crate::speed::ARF_TF`]), so every hidden frame's |
| 17077 | 17077 | // pixels -- and the leaves that predict from them -- moved: |
| 17078 | 17078 | // 8269 -> 8218 bytes at q=150 and 33044 -> 33017 at q=60. |
| 17079 | - let pins: [(u8, usize, u64); 2] = [(150, 8218, 0xd533_c8ea_14ca_ae6e), (60, 33017, 0xbced_b694_dcfe_9146)]; | |
| 17079 | + // Re-taken on lane-arftf: that filter's strength swept on the deciding | |
| 17080 | + // gate lands at 2, not 3 ([`crate::speed::ARF_TF`]), so the filtered | |
| 17081 | + // anchors' pixels moved once more: 8218 -> 8307 bytes at q=150 and | |
| 17082 | + // 33017 at q=60 (the same LENGTH, different bytes). | |
| 17083 | + let pins: [(u8, usize, u64); 2] = [(150, 8307, 0xd759_b4f4_cad1_f9a8), (60, 33017, 0xfee7_d4b8_5cea_19d7)]; | |
| 17080 | 17084 | let coded: Vec<(u8, usize, u64)> = pins |
| 17081 | 17085 | .iter() |
| 17082 | 17086 | .map(|&(q, _, _)| { |
crates/ec-av1/src/speed.rsmodified+28 -2
| @@ -393,12 +393,31 @@ pub(crate) const DQ_LEVEL_K: [f64; 3] = [1.5, 1.0, 1.0]; | ||
| 393 | 393 | /// (`lanes/arfpred.report.md` section 3). Hard filtering does remove 6-7% of |
| 394 | 394 | /// the stream's bytes and gives all of it back in quality, because the leaves |
| 395 | 395 | /// still carry the grain the anchor no longer has. |
| 396 | -pub(crate) const ARF_TF: [f64; 11] = [3.0; 11]; | |
| 396 | +/// | |
| 397 | +/// lane-arftf SWEPT IT ON THE DECIDING GATE (48 pictures, film A / film B, | |
| 398 | +/// BD vs libaom `cpu-used 6` / rav1e `speed 6`, lower is better) -- the probe | |
| 399 | +/// of lane-arfpred mispredicts this lever's sign, so only these count: | |
| 400 | +/// | |
| 401 | +/// | strength | film A | film B | | |
| 402 | +/// |---|---|---| | |
| 403 | +/// | 1 | +22.6/-8.1 | +81.6/+4.8 | | |
| 404 | +/// | **2 (ships)** | **+22.2/-8.2** | **+78.6/+2.7** | | |
| 405 | +/// | 3 (was) | +22.7/-7.9 | +79.0/+2.7 | | |
| 406 | +/// | 5 | +23.9/-7.4 | +83.6/+5.1 | | |
| 407 | +/// | |
| 408 | +/// The curve is single-peaked at 2 and bracketed on both sides; 2 is down on | |
| 409 | +/// all four columns against the shipped 3 (film A -0.5/-0.3, film B | |
| 410 | +/// -0.4/0.0). | |
| 411 | +pub(crate) const ARF_TF: [f64; 11] = [2.0; 11]; | |
| 397 | 412 | |
| 398 | 413 | /// lane-arftf: the same filter on the MID ARF (the second hidden frame of a |
| 399 | 414 | /// group), whose window is the group's later leaves -- so it filters FORWARD |
| 400 | 415 | /// where the top ARF filters backward. `EC_AV1_ARF_TF_MID=<strength>` |
| 401 | -/// overrides it; `0` is off, which is where the long-GOP gate left it. | |
| 416 | +/// overrides it; `0` is off, which is where the long-GOP gate left it: | |
| 417 | +/// filtering the mid ARF at the same strength as the top one reads film A | |
| 418 | +/// +22.2/-8.3 and film B +78.9/+2.6 against the top-only +22.2/-8.2 and | |
| 419 | +/// +78.6/+2.7 -- inside the noise on three columns and 0.3 WORSE on film B's | |
| 420 | +/// libaom one, so the mechanism does not pay a second time one level down. | |
| 402 | 421 | pub(crate) const ARF_TF_MID: [f64; 11] = [0.0; 11]; |
| 403 | 422 | |
| 404 | 423 | /// lane-arftf: how many window pictures [`crate::encode::arf_temporal_filter`] |
| @@ -407,6 +426,13 @@ pub(crate) const ARF_TF_MID: [f64; 11] = [0.0; 11]; | ||
| 407 | 426 | /// display-PAST neighbours and this widens the filter backwards only (a |
| 408 | 427 | /// symmetric +-2 needs a one-group lookahead the encoder does not have). |
| 409 | 428 | /// `EC_AV1_ARF_TF_WIN=<n>` overrides it. |
| 429 | +/// | |
| 430 | +/// 4 (past-only +-2) is REFUTED on the long-GOP gate at strength 2: film A | |
| 431 | +/// +22.8/-7.8 and film B +78.9/+2.8 against 2's +22.2/-8.2 and +78.6/+2.7 -- | |
| 432 | +/// worse on three of the four columns. The census's 14.3% SAD removal was | |
| 433 | +/// measured with two neighbours on EACH side; four pictures of one-sided | |
| 434 | +/// past is a different (and worse) window, and the anchor drifts away from | |
| 435 | +/// the leaves it has to predict. | |
| 410 | 436 | pub(crate) const ARF_TF_WIN: [usize; 11] = [2; 11]; |
| 411 | 437 | |
| 412 | 438 | /// lane-arfpred: the qindex below which the ARF temporal filter is OFF -- |