forge
Explore
Log in

Don't you dare go Hollow

The five-type fire count is preset 0's

Browse files at this commit

878e910f8f9ee3db611ed6681444bb27d90733cfAhmet Kaan GümüşParent: d4cc317
  • test
    • the five-type fire count is preset 0's
    • every preset with the lever must still reach a non-DCT type
Show full message
test(av1): the five-type fire count is preset 0's; every preset with the lever must still reach a non-DCT type
crates/ec-av1/src/encoder.rsmodified+19 -2
@@ -3669,8 +3669,22 @@ mod tests {
36693669 let hits = crate::encode::take_tx_type_hits();
36703670 // The type search is a speed lever (`speed::TX_TYPE_SEARCH`); above
36713671 // the presets that carry it only `DCT_DCT` is offered, and the
3672- // exactness half below is what still runs there.
3672+ // exactness half below is what still runs there. The FULL five-type
3673+ // fire count is preset 0's to make: a faster preset prunes modes and
3674+ // partitions before a type is ever priced on them, so `ADST_ADST` and
3675+ // `IDTX` stop winning on this clip at preset 6 (measured: hits
3676+ // `[0, 6192, 0, 79, 284, ..]`). Every preset that carries the lever
3677+ // still has to reach SOME non-`DCT_DCT` type -- that is the
3678+ // "reachable at all" statement, class `gate-blind-to-feature`.
36733679 if crate::speed::at(&crate::speed::TX_TYPE_SEARCH) {
3680+ let non_dct: usize = hits.iter().sum::<usize>()
3681+ - hits[crate::transform::TxType::DctDct as usize];
3682+ assert!(
3683+ non_dct > 0,
3684+ "every luma transform unit took DCT_DCT: {hits:?}"
3685+ );
3686+ }
3687+ if crate::speed::at(&crate::speed::TX_TYPE_SEARCH) && crate::speed::speed() == 0 {
36743688 for (name, ty) in [
36753689 ("DCT_DCT", crate::transform::TxType::DctDct),
36763690 ("ADST_ADST", crate::transform::TxType::AdstAdst),
@@ -3684,7 +3698,10 @@ mod tests {
36843698 );
36853699 }
36863700 } else {
3687- eprintln!("SKIP the fire count at preset {}: no type search", crate::speed::speed());
3701+ eprintln!(
3702+ "SKIP the five-type fire count at preset {}: {hits:?}",
3703+ crate::speed::speed()
3704+ );
36883705 }
36893706 let ours = crate::stream::decode_stream(&stream).expect("our decoder");
36903707 assert_eq!(ours.len(), sources.len(), "our decoder's frames");