forge
Explore
Log in

Don't you dare go Hollow

NEWMV against GOLDEN/ALTREF with a swept early-out, plus a motion-search census

Browse files at this commit

242c4318a3df32ae7b2f5de957563d31bcd58a50Ahmet Kaan GümüşParent: 082d0dc
  • feat
    • NEWMV against GOLDEN/ALTREF with a swept early-out, plus a motion-search census
Show full message
feat(av1): NEWMV against GOLDEN/ALTREF with a swept early-out, plus a motion-search census
crates/ec-av1/src/encode.rsmodified+16 -7
@@ -165,15 +165,22 @@ fn split_inter_8() -> bool {
165165 /// NEARESTMV candidate it always had.
166166 const LEAF_NEW_MV: bool = true;
167167
168-/// Whether GOLDEN/ALTREF get a `NEWMV` search of their own. Set from the
169-/// lane report's measurement.
170-const EXTRA_REF_NEW_MV: bool = false;
168+/// Whether GOLDEN/ALTREF get a `NEWMV` search of their own. Measured on the
169+/// BD gate: with the early-out below at its swept margin, -1.7/-2.5/-0.0
170+/// points vs libaom and -1.6/-2.3/-0.0 vs rav1e for 4%/4%/0.3% more motion
171+/// searches (the census `bd_rate_vs_libaom_and_rav1e` prints).
172+const EXTRA_REF_NEW_MV: bool = true;
171173
172174 /// How much cheaper an extra reference's `NEARESTMV` has to be than LAST's
173175 /// own best vector before that reference's `NEWMV` search is skipped: a
174176 /// factor on the search cost scale, `1.0` meaning "as good or better".
175-/// Swept on the BD gate (see the lane report) -- `0.0` never skips.
176-const EXTRA_NEW_SKIP_MARGIN: f64 = 0.0;
177+/// Swept on the BD gate over 0.15/0.25/0.35/0.5/0.8/1.0/1.5 and off (`0.0`,
178+/// never skip): the whole BD gain survives down to 0.35 (+124.8/+150.4/+80.9
179+/// vs libaom, against +124.9/+150.3/+81.0 with no early-out at all) while the
180+/// extra searches drop from +27% to +4% of the base count -- and on screen
181+/// capture, where an extra reference's NEWMV wins nothing, it skips 99.7% of
182+/// them. Below 0.35 the gain starts eroding (0.15: +125.3/+151.7).
183+const EXTRA_NEW_SKIP_MARGIN: f64 = 0.35;
177184
178185 /// [`EXTRA_NEW_SKIP_MARGIN`], swept by `EC_AV1_MV_SKIP_MARGIN`.
179186 fn extra_new_skip_margin() -> f64 {
@@ -7441,7 +7448,9 @@ mod tests {
74417448 /// hair without failing anything; this pins the streams themselves.
74427449 /// Every number below was measured 2026-09-06 (lane-av1fwd) and is
74437450 /// identical at `a6649c4e`, the merge before that lane's three exact
7444- /// speed steps.
7451+ /// speed steps; the q=150 pin moved with lane-av1mv's extra-reference
7452+ /// `NEWMV` (a coded-bits change, not a speed step -- the BD gate is what
7453+ /// judged it).
74457454 #[test]
74467455 fn the_encoders_own_streams_are_byte_identical_to_their_pins() {
74477456 if !have_ffmpeg() {
@@ -7463,7 +7472,7 @@ mod tests {
74637472 })
74647473 };
74657474 let pins: [(u8, usize, u64); 2] =
7466- [(150, 7416, 0x75632db72a63d5f1), (60, 27927, 0xb63a984f521b7341)];
7475+ [(150, 7397, 0xca56a6962842df67), (60, 27780, 0x584a5034ed4c3b27)];
74677476 for (q, bytes, hash) in pins {
74687477 let encoded = encode_sequence(&source, q, 0.5).unwrap();
74697478 assert_eq!(