The AB arm at the 128 root ships OFF -- measured flat to 0.1 worse on every gate row
Browse files at this commit7c89e33a322e037cae64f869c9689f00d34dbbcaParent: 62a90fb- feat
- the AB arm at the 128 root ships OFF -- measured flat to 0.1 worse on every gate row
1 changed file +16 -2
- crates/ec-av1/src/encode.rs +16 -2
crates/ec-av1/src/encode.rsmodified+16 -2
| @@ -834,11 +834,22 @@ pub(crate) fn force_b128_rect(which: u8) { | |||
| 834 | /// arms ship, at its own footprint ([`search_root_128_ab`], | 834 | /// arms ship, at its own footprint ([`search_root_128_ab`], |
| 835 | /// `crate::tile::write_inter_block_128_rect`). `EC_AV1_B128AB=0` is this | 835 | /// `crate::tile::write_inter_block_128_rect`). `EC_AV1_B128AB=0` is this |
| 836 | /// arm's attribution control. | 836 | /// arm's attribution control. |
| 837 | +/// | ||
| 838 | +/// **Off by default** (`EC_AV1_B128AB=1` turns it on): measured on both gates | ||
| 839 | +/// and it does not pay. The shapes fire 0-2 roots a frame against ~1000 coded | ||
| 840 | +/// blocks (`EC_AV1_B128_CENSUS`), and every row is flat or 0.1 worse -- | ||
| 841 | +/// long-GOP film A +22.0/-8.5 against a +21.9/-8.6 control, film B +75.8/+0.8 | ||
| 842 | +/// against the same, 12-frame film A +18.1/-6.2 against +18.0/-6.3, film B | ||
| 843 | +/// +23.1/-3.3 against +23.0/-3.5, screen byte-identical (lane-ab128). The | ||
| 844 | +/// machinery is written, witnessed sample-exact through both decoders on all | ||
| 845 | +/// four shapes, and kept for the arm that makes it pay: a non-skip piece (the | ||
| 846 | +/// 64x64 pieces could carry the 64 root's residual, which is where libaom's | ||
| 847 | +/// AB shapes earn their keep) or a cheaper partition price. | ||
| 837 | fn b128_ab() -> bool { | 848 | fn b128_ab() -> bool { |
| 838 | static ENV: std::sync::LazyLock<Option<bool>> = std::sync::LazyLock::new(|| { | 849 | static ENV: std::sync::LazyLock<Option<bool>> = std::sync::LazyLock::new(|| { |
| 839 | crate::envflags::var("EC_AV1_B128AB").ok().map(|v| v != "0") | 850 | crate::envflags::var("EC_AV1_B128AB").ok().map(|v| v != "0") |
| 840 | }); | 851 | }); |
| 841 | - ENV.unwrap_or(true) && b128_root() | 852 | + ENV.unwrap_or(false) && b128_root() |
| 842 | } | 853 | } |
| 843 | 854 | ||
| 844 | /// How many 128 roots the search left as each AB shape since the last take, | 855 | /// How many 128 roots the search left as each AB shape since the last take, |
| @@ -12876,7 +12887,10 @@ pub(crate) fn encode_inter_frame( | |||
| 12876 | // 64x64 pieces plus one 128x64 / 64x128 half. All four are priced; | 12887 | // 64x64 pieces plus one 128x64 / 64x128 half. All four are priced; |
| 12877 | // the cheapest joins the candidate list below. | 12888 | // the cheapest joins the candidate list below. |
| 12878 | let forced_ab = FORCE_B128_AB.load(std::sync::atomic::Ordering::Relaxed); | 12889 | let forced_ab = FORCE_B128_AB.load(std::sync::atomic::Ordering::Relaxed); |
| 12879 | - let root_ab = (sb128_search && b128_ab() && cells.len() == 4 && forced_rect == 0) | 12890 | + let root_ab = (sb128_search |
| 12891 | + && (b128_ab() || forced_ab != 0) | ||
| 12892 | + && cells.len() == 4 | ||
| 12893 | + && forced_rect == 0) | ||
| 12880 | .then(|| { | 12894 | .then(|| { |
| 12881 | let mut best: Option<(usize, _)> = None; | 12895 | let mut best: Option<(usize, _)> = None; |
| 12882 | for symbol in 4..=7usize { | 12896 | for symbol in 4..=7usize { |