Rect tx-size context compared against the block side, not max_txsize_rect
Browse files at this commit606ff1583f2ba275c3fde538577a389b17d76b16Parent: 71e7de0- fix
- rect tx-size context compared against the block side, not max_txsize_rect
1 changed file +6 -0
crates/ec-av1/src/decode.rsmodified+6 -0
| @@ -5848,6 +5848,12 @@ fn tx_size_context_rect( | |||
| 5848 | own_w: usize, | 5848 | own_w: usize, |
| 5849 | own_h: usize, | 5849 | own_h: usize, |
| 5850 | ) -> usize { | 5850 | ) -> usize { |
| 5851 | + // `get_tx_size_context` compares against `max_txsize_rect_lookup[bsize]`, | ||
| 5852 | + // not the block's own side: no transform is wider or taller than 64, so a | ||
| 5853 | + // block with a 128 side resolves against 64 (the square path already caps | ||
| 5854 | + // this way, lane-sb128b r1). Without the cap the 64x128 half of a 128-root | ||
| 5855 | + // VERT reads the tx-depth symbol off row 0 where libaom uses row 1. | ||
| 5856 | + let (own_w, own_h) = (own_w.min(64), own_h.min(64)); | ||
| 5851 | let above = mi_r > n.tile_row0_mi && tx_px_at(n, false, mi_r - 1, mi_c) as usize >= own_w; | 5857 | let above = mi_r > n.tile_row0_mi && tx_px_at(n, false, mi_r - 1, mi_c) as usize >= own_w; |
| 5852 | let left = mi_c > n.tile_col0_mi && tx_h_px_at(n, false, mi_r, mi_c - 1) as usize >= own_h; | 5858 | let left = mi_c > n.tile_col0_mi && tx_h_px_at(n, false, mi_r, mi_c - 1) as usize >= own_h; |
| 5853 | usize::from(above) + usize::from(left) | 5859 | usize::from(above) + usize::from(left) |