The five-type fire count is preset 0's
Browse files at this commit878e910f8f9ee3db611ed6681444bb27d90733cfParent: d4cc317- test
- the five-type fire count is preset 0's
- every preset with the lever must still reach a non-DCT type
1 changed file +19 -2
- crates/ec-av1/src/encoder.rs +19 -2
crates/ec-av1/src/encoder.rsmodified+19 -2
| @@ -3669,8 +3669,22 @@ mod tests { | |||
| 3669 | let hits = crate::encode::take_tx_type_hits(); | 3669 | let hits = crate::encode::take_tx_type_hits(); |
| 3670 | // The type search is a speed lever (`speed::TX_TYPE_SEARCH`); above | 3670 | // The type search is a speed lever (`speed::TX_TYPE_SEARCH`); above |
| 3671 | // the presets that carry it only `DCT_DCT` is offered, and the | 3671 | // 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`. | ||
| 3673 | if crate::speed::at(&crate::speed::TX_TYPE_SEARCH) { | 3679 | 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 { | ||
| 3674 | for (name, ty) in [ | 3688 | for (name, ty) in [ |
| 3675 | ("DCT_DCT", crate::transform::TxType::DctDct), | 3689 | ("DCT_DCT", crate::transform::TxType::DctDct), |
| 3676 | ("ADST_ADST", crate::transform::TxType::AdstAdst), | 3690 | ("ADST_ADST", crate::transform::TxType::AdstAdst), |
| @@ -3684,7 +3698,10 @@ mod tests { | |||
| 3684 | ); | 3698 | ); |
| 3685 | } | 3699 | } |
| 3686 | } else { | 3700 | } 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 | + ); | ||
| 3688 | } | 3705 | } |
| 3689 | let ours = crate::stream::decode_stream(&stream).expect("our decoder"); | 3706 | let ours = crate::stream::decode_stream(&stream).expect("our decoder"); |
| 3690 | assert_eq!(ours.len(), sources.len(), "our decoder's frames"); | 3707 | assert_eq!(ours.len(), sources.len(), "our decoder's frames"); |