forge
Explore
Log in

Don't you dare go Hollow

The compound 64x64 root is gated off on screen content

Browse files at this commit

0070986de60720ed3df2934bbe2647f822e38f6aAhmet Kaan GümüşParent: ec59f4c
  • feat
    • the compound 64x64 root is gated off on screen content
    • pins re-taken
Show full message
feat(av1): the compound 64x64 root is gated off on screen content; pins re-taken

The 12-frame native arm, two arms of one build: both film rows improve on
both columns (film A +37.5/+7.6 -> +35.5/+5.6, film B +54.1/+23.9 ->
+47.8/+17.1) and screen capture loses +33.4/-23.8 -> +33.7/-23.6, at the
keep rule's screen bound. So the root's compound arm takes the same
content gate the residual arm does. Pins 9835 -> 9793 / 35798 -> 35911.
crates/ec-av1/src/encode.rsmodified+24 -2
@@ -9373,8 +9373,13 @@ pub(crate) fn encode_inter_frame(
9373 // superblock's own 16x16-mi window, the same stacks the tile9373 // superblock's own 16x16-mi window, the same stacks the tile
9374 // writer's `Whole64` arm rebuilds. Empty unless the frame9374 // writer's `Whole64` arm rebuilds. Empty unless the frame
9375 // codes `reference_select`, which is what gates the syntax.9375 // codes `reference_select`, which is what gates the syntax.
9376+ // `!screen` for the same reason the residual arm is gated
9377+ // there ([`b64_residual`]): a desktop capture's superblocks
9378+ // are flat runs the skip arm already codes for nothing, and
9379+ // MEASURED, compound at the root cost it +33.4/-23.8 ->
9380+ // +33.7/-23.6 while both film rows gained (step 1's table).
9376 let sb_compound: Vec<(i8, &Picture, crate::mvstack::CompoundMvStack)> =9381 let sb_compound: Vec<(i8, &Picture, crate::mvstack::CompoundMvStack)> =
9377- if header.reference_select && b64_compound() {9382+ if header.reference_select && b64_compound() && !screen {
9378 [9383 [
9379 (crate::mvstack::GOLDEN_FRAME, golden),9384 (crate::mvstack::GOLDEN_FRAME, golden),
9380 (crate::mvstack::ALTREF_FRAME, altref),9385 (crate::mvstack::ALTREF_FRAME, altref),
@@ -13831,8 +13836,11 @@ mod tests {
13831 // base now, not 16 ([`crate::encoder::Pyramid::leaf_q_offset`]) -- 977813836 // base now, not 16 ([`crate::encoder::Pyramid::leaf_q_offset`]) -- 9778
13832 // -> 9835 at q=150 and 35450 -> 35798 at q=60.13837 // -> 9835 at q=150 and 35450 -> 35798 at q=60.
13833 // `EC_AV1_PYRAMID=8:-32:16:-8:-48` restores these.13838 // `EC_AV1_PYRAMID=8:-32:16:-8:-48` restores these.
13839+ // Re-taken on lane-b64b: the 64x64 root prices COMPOUND references
13840+ // now ([`b64_compound`]) -- 9835 -> 9793 at q=150 and 35798 -> 35911
13841+ // at q=60. `EC_AV1_B64COMP=0` restores these.
13834 let pins: [(u8, usize, u64); 2] =13842 let pins: [(u8, usize, u64); 2] =
13835- [(150, 9835, 0xfdac_0219_4a6e_111e), (60, 35798, 0xe57e_aa3f_8b48_d206)];13843+ [(150, 9793, 0x31ac_a6a7_6a00_5ab7), (60, 35911, 0xcd51_00e3_7008_f372)];
13836 for (q, bytes, hash) in pins {13844 for (q, bytes, hash) in pins {
13837 let encoded = encode_sequence(&source, q, 0.5).unwrap();13845 let encoded = encode_sequence(&source, q, 0.5).unwrap();
13838 assert_eq!(13846 assert_eq!(
@@ -14386,6 +14394,9 @@ mod tests {
14386 let _ = crate::tile::take_compound_pair_hits();14394 let _ = crate::tile::take_compound_pair_hits();
14387 let _ = crate::tile::take_compound_size_hits();14395 let _ = crate::tile::take_compound_size_hits();
14388 let _ = crate::tile::take_compound_leaf_mode_hits();14396 let _ = crate::tile::take_compound_leaf_mode_hits();
14397+ let _ = take_b64_root_hits();
14398+ let _ = take_b64_residual_hits();
14399+ let _ = take_b64_compound_hits();
14389 let _ = crate::motion::take_census();14400 let _ = crate::motion::take_census();
14390 // The entry-surface arm: run the SAME ladder through the14401 // The entry-surface arm: run the SAME ladder through the
14391 // streaming facade the editor's export calls, which must print14402 // streaming facade the editor's export calls, which must print
@@ -14433,6 +14444,17 @@ mod tests {
14433 // a compound reference at all, which compound mode they took, and14444 // a compound reference at all, which compound mode they took, and
14434 // which pair (gate-blind-to-feature -- a compound mode nobody14445 // which pair (gate-blind-to-feature -- a compound mode nobody
14435 // picks cannot be what a BD number credits).14446 // picks cannot be what a BD number credits).
14447+ // The 64x64 root's own fire shares (lane-b64/tx64/b64b): how many
14448+ // superblocks were left whole at all, and how many of those coded
14449+ // a residual or took a compound reference.
14450+ let (roots, root_res, root_comp) = (
14451+ take_b64_root_hits(),
14452+ take_b64_residual_hits(),
14453+ take_b64_compound_hits(),
14454+ );
14455+ eprintln!(
14456+ "{name}: 64x64 roots {roots} (with a residual {root_res}, compound {root_comp})"
14457+ );
14436 let comp_modes = crate::tile::take_compound_mode_hits();14458 let comp_modes = crate::tile::take_compound_mode_hits();
14437 let comp_pairs = crate::tile::take_compound_pair_hits();14459 let comp_pairs = crate::tile::take_compound_pair_hits();
14438 let comp_sizes = crate::tile::take_compound_size_hits();14460 let comp_sizes = crate::tile::take_compound_size_hits();
lanes/b64b/bin-r2added+0 -0

Binary file changed

lanes/b64b/r2-ship.logadded+20 -0
@@ -0,0 +1,20 @@
1+
2+running 1 test
3+
4+native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
5+| clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6+|---|---|---|---|---|
7+bars 1080p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+bars 1080p: pricer armings default=17 real=185
9+bars 1080p: motion_mode 32x32 SIMPLE=36908 OBMC=0 WARP=163 | 16x16 SIMPLE=4594 OBMC=0 WARP=318 | 8x8 SIMPLE=18266 OBMC=0 WARP=1382 (0.0% OBMC / 3.0% WARP of 61631 eligible)
10+bars 1080p: inter var-tx depths of 11232 blocks -- leaf single 0=1669 1=1025 (38.0% split) | leaf compound 0=885 1=616 (41.0% split) | 32x32 single 0=756 1=1777 (70.2% split) | 32x32 compound 0=2250 1=2254 (50.0% split)
11+bars 1080p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
12+bars 1080p: filter intra on=true blocks 29028 (modes DC=6905 V=3000 H=5419 D157=9117 PAETH=4587)
13+test encode::tests::bd_rate_screen_native has been running for over 60 seconds
14+| bars 1080p 1920x1024 | 44.11 dB/217737 B, 47.66 dB/318868 B, 51.05 dB/440424 B, 54.26 dB/587284 B | +1.8% | -14.4% | 45.4s:11.3s:23.7s |
15+bars 2160p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
16+bars 2160p: pricer armings default=14 real=175
17+bars 2160p: motion_mode 32x32 SIMPLE=31585 OBMC=0 WARP=290 | 16x16 SIMPLE=2756 OBMC=0 WARP=678 | 8x8 SIMPLE=7509 OBMC=0 WARP=447 (0.0% OBMC / 3.3% WARP of 43265 eligible)
18+bars 2160p: inter var-tx depths of 9192 blocks -- leaf single 0=1220 1=600 (33.0% split) | leaf compound 0=1083 1=221 (16.9% split) | 32x32 single 0=371 1=1234 (76.9% split) | 32x32 compound 0=141 1=4322 (96.8% split)
19+bars 2160p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
20+bars 2160p: filter intra on=true blocks 12387 (modes DC=3329 V=811 H=2621 D157=3956 PAETH=1670)