lane-av1-444interband: the inter 1:4 strip's chroma pair rewrite is 4:2:0-only
Browse files at this commit11dc08738723c007eacac2a5a86610f73ed85a94Parent: 14fead31 changed file +20 -0
- crates/ec-av1/src/decode.rs +20 -0
crates/ec-av1/src/decode.rsmodified+20 -0
| @@ -8980,6 +8980,13 @@ impl Neighbours { | |||
| 8980 | let round_up_even = |n: usize| n.div_ceil(2) * 2; | 8980 | let round_up_even = |n: usize| n.div_ceil(2) * 2; |
| 8981 | let (bound_h, bound_w) = (round_up_even(self.mi_rows), round_up_even(self.mi_cols)); | 8981 | let (bound_h, bound_w) = (round_up_even(self.mi_rows), round_up_even(self.mi_cols)); |
| 8982 | let state = neighbour_state(grid); | 8982 | let state = neighbour_state(grid); |
| 8983 | + if crate::envflags::env_flag!("EC_CHROMA_PUB") { | ||
| 8984 | + eprintln!( | ||
| 8985 | + "EC_CHROMA_PUB plane={plane} mi=({mi_r},{mi_c}) wh=({w_px},{h_px}) lvl={} dc={}", | ||
| 8986 | + state.level, | ||
| 8987 | + state.dc.map_or(-1, |s| i32::from(s)) | ||
| 8988 | + ); | ||
| 8989 | + } | ||
| 8983 | for cell in 0..(h_px / MI).min(bound_h.saturating_sub(mi_r)) { | 8990 | for cell in 0..(h_px / MI).min(bound_h.saturating_sub(mi_r)) { |
| 8984 | self.left[mi_r + cell][plane] = state; | 8991 | self.left[mi_r + cell][plane] = state; |
| 8985 | } | 8992 | } |
| @@ -34690,8 +34697,21 @@ fn decode_inter_block( | |||
| 34690 | // strip's own record wrote empty chroma state over those cells -- this | 34697 | // strip's own record wrote empty chroma state over those cells -- this |
| 34691 | // rewrite is what libaom's single `av1_set_contexts` call for the 8x4 | 34698 | // rewrite is what libaom's single `av1_set_contexts` call for the 8x4 |
| 34692 | // (4x8) chroma unit leaves behind. | 34699 | // (4x8) chroma unit leaves behind. |
| 34700 | + // lane-av1-444interband: 4:2:0 ONLY. At ss 0/0 every strip IS its own | ||
| 34701 | + // chroma reference (`is_chroma_reference`, no mi parity test), its own | ||
| 34702 | + // `record_rect_mi` above already stamps exactly the strip's 16x4 (4x16) | ||
| 34703 | + // chroma span -- libaom `av1_set_entropy_contexts`, or | ||
| 34704 | + // `av1_reset_entropy_context` for a skipped strip (decodeframe.c:1180) | ||
| 34705 | + // -- and the pair-form 16x8 (8x16) span anchored at `pair_mi` (== the | ||
| 34706 | + // strip's own mi at ss 0/0) smeared the strip's state over one extra | ||
| 34707 | + // row/col of cells: a skipped strip wrote zero over `left[r+1][1..2]`, | ||
| 34708 | + // erasing the 16x16-intra block to its left's U/V stamps, and the strip | ||
| 34709 | + // below read its chroma `txb_skip` off the wrong CDF row (t6 frame 1, | ||
| 34710 | + // U unit (2,8): our base 0 vs aom's base 1, `left[2][1]` 0 vs 23 -- | ||
| 34711 | + // `INTER16_CHROMA_PAIR_HITS` fired 31x on a stream that has no pairs). | ||
| 34693 | let pair_chroma = strip_chroma | 34712 | let pair_chroma = strip_chroma |
| 34694 | .filter(|s| s.has_chroma) | 34713 | .filter(|s| s.has_chroma) |
| 34714 | + .filter(|_| ss_x(fctx) == 1 && ss_y(fctx) == 1) | ||
| 34695 | .map(|s| (s, neighbour_state(&u_grid), neighbour_state(&v_grid))); | 34715 | .map(|s| (s, neighbour_state(&u_grid), neighbour_state(&v_grid))); |
| 34696 | // lane-vert46 r1: libaom stamps the chroma entropy context PER TRANSFORM | 34716 | // lane-vert46 r1: libaom stamps the chroma entropy context PER TRANSFORM |
| 34697 | // UNIT (`av1_set_entropy_contexts` inside `decode_reconstruct_tx`'s mu-chunk | 34717 | // UNIT (`av1_set_entropy_contexts` inside `decode_reconstruct_tx`'s mu-chunk |