forge
Explore
Log in

Don't you dare go Hollow

Compound reference on by default -- BD down on all three gate clips

Browse files at this commit

e062d5bb1a397496aa6a4af46d82ad0080e196cbAhmet Kaan GümüşParent: 3cac217
  • feat
    • compound reference on by default -- BD down on all three gate clips
Show full message
feat(av1): compound reference on by default -- BD down on all three gate clips

Flat BD gate, same machine: vs libaom +121.2/+146.4/+79.1 -> +120.1/+128.5/+73.0
(1080p/2160p/screen), vs rav1e +71.8/+97.8/+17.0 -> +67.8/+86.0/+13.7, wall
6.5/5.6/6.2 s -> 7.5/6.4/6.4 s. Compound takes 8.1%/8.6%/13.8% of coded inter
blocks; modes NEAREST_NEAREST 1218/1439/1848, GLOBAL_GLOBAL 268/377/0, NEW_NEW
203/34/0; pairs LAST+GOLDEN 450/397/311, LAST+ALTREF 1239/1453/1537.

The three GOP round trips in decode.rs called decode_inter_frame_tile_lr with a
hard-coded reference_select = false while decoding a tile the ENCODER wrote
(stale-header class); they now pass the encoder's own bit. Byte pins updated.
crates/ec-av1/src/decode.rsmodified+12 -2
@@ -37493,7 +37493,12 @@ mod tests {
37493 false,37493 false,
37494 Some(mc::InterpFilterKind::Regular),37494 Some(mc::InterpFilterKind::Regular),
37495 false,37495 false,
37496- false,37496+ // The encoder's own `reference_select` (spec 5.9.22): these
37497+ // GOP round trips decode a tile the ENCODER wrote, so the
37498+ // header bit must be the one it wrote, not a hard-coded
37499+ // `false` (stale-header class -- a `reference_select` stream
37500+ // reads a `comp_mode` symbol this decode would skip).
37501+ crate::encode::reference_select(),
37497 frame.tx_select,37502 frame.tx_select,
37498 &frame.loop_restoration,37503 &frame.loop_restoration,
37499 Some(frame.start_cdfs.0.clone()),37504 Some(frame.start_cdfs.0.clone()),
@@ -37812,7 +37817,12 @@ mod tests {
37812 false,37817 false,
37813 Some(mc::InterpFilterKind::Regular),37818 Some(mc::InterpFilterKind::Regular),
37814 false,37819 false,
37815- false,37820+ // The encoder's own `reference_select` (spec 5.9.22): these
37821+ // GOP round trips decode a tile the ENCODER wrote, so the
37822+ // header bit must be the one it wrote, not a hard-coded
37823+ // `false` (stale-header class -- a `reference_select` stream
37824+ // reads a `comp_mode` symbol this decode would skip).
37825+ crate::encode::reference_select(),
37816 frame.tx_select,37826 frame.tx_select,
37817 &frame.loop_restoration,37827 &frame.loop_restoration,
37818 Some(frame.start_cdfs.0.clone()),37828 Some(frame.start_cdfs.0.clone()),
crates/ec-av1/src/encode.rsmodified+2 -2
@@ -3724,7 +3724,7 @@ pub(crate) fn flat_order_hints(order_hint: u32, key_hint: u32, has_altref: bool)
3724 /// `EC_AV1_COMPOUND=1` arms it in a test build (which is what the BD gate3724 /// `EC_AV1_COMPOUND=1` arms it in a test build (which is what the BD gate
3725 /// runs as), and every block still codes SINGLE, so the only cost is one3725 /// runs as), and every block still codes SINGLE, so the only cost is one
3726 /// `comp_mode` symbol per inter block.3726 /// `comp_mode` symbol per inter block.
3727-const REFERENCE_SELECT: bool = false;3727+const REFERENCE_SELECT: bool = true;
3728 3728
3729 /// [`REFERENCE_SELECT`], with the test-build environment override.3729 /// [`REFERENCE_SELECT`], with the test-build environment override.
3730 pub(crate) fn reference_select() -> bool {3730 pub(crate) fn reference_select() -> bool {
@@ -8294,7 +8294,7 @@ mod tests {
8294 })8294 })
8295 };8295 };
8296 let pins: [(u8, usize, u64); 2] =8296 let pins: [(u8, usize, u64); 2] =
8297- [(150, 7444, 0x76eb980832d719f1), (60, 27692, 0x8c88f7e73455d439)];8297+ [(150, 7209, 0xacdd_6952_78c1_49f2), (60, 27353, 0x9be8_7898_f08d_3b77)];
8298 for (q, bytes, hash) in pins {8298 for (q, bytes, hash) in pins {
8299 let encoded = encode_sequence(&source, q, 0.5).unwrap();8299 let encoded = encode_sequence(&source, q, 0.5).unwrap();
8300 assert_eq!(8300 assert_eq!(