RDOQ walked the 2D zigzag's tail on a 1-D transform unit
Browse files at this commitfd6f585ccec1aee2ba997f0653da19b72c138c38Parent: dab7a9c- fix
- RDOQ walked the 2D zigzag's tail on a 1-D transform unit
1 changed file +13 -1
- crates/ec-av1/src/tile.rs +13 -1
crates/ec-av1/src/tile.rsmodified+13 -1
| @@ -4959,7 +4959,19 @@ pub(crate) fn rdoq( | |||
| 4959 | // cannot cost two hundred re-codings. | 4959 | // cannot cost two hundred re-codings. |
| 4960 | let mut budget = rdoq_budget(); | 4960 | let mut budget = rdoq_budget(); |
| 4961 | let max_level = rdoq_max_level(); | 4961 | let max_level = rdoq_max_level(); |
| 4962 | - for &position in scan_of(coded).iter().rev() { | 4962 | + // lane-txw: the tail this walks back from is the tail of the unit's OWN |
| 4963 | + // scan -- a `V_DCT`/`H_DCT` unit is coded in `Mrow_Scan`/`Mcol_Scan`, so | ||
| 4964 | + // the 2D zigzag's last positions are not the ones whose removal shortens | ||
| 4965 | + // its eob. Every candidate is still priced through the class-aware writer | ||
| 4966 | + // ([`write_coeffs`]), so this changes which positions the budget reaches, | ||
| 4967 | + // never whether a decision is right. | ||
| 4968 | + let class = crate::decode::TxClass::of(tx_type); | ||
| 4969 | + let order: &[u16] = if class == crate::decode::TxClass::TwoD { | ||
| 4970 | + scan_of(coded) | ||
| 4971 | + } else { | ||
| 4972 | + class_scan_of(coded, class) | ||
| 4973 | + }; | ||
| 4974 | + for &position in order.iter().rev() { | ||
| 4963 | if budget == 0 { | 4975 | if budget == 0 { |
| 4964 | break; | 4976 | break; |
| 4965 | } | 4977 | } |