Rect intra blocks inside an inter frame read tx_depth off the key frame's deblock-grid ctx
Browse files at this commit1ca3e1be04093081251ec38093527bb18fb7f81cParent: 98416c4- fix
- rect intra blocks inside an inter frame read tx_depth off the key frame's deblock-grid ctx
1 changed file +13 -0
- crates/ec-av1/src/decode.rs +13 -0
crates/ec-av1/src/decode.rsmodified+13 -0
| @@ -6736,6 +6736,19 @@ fn tx_size_context_rect( | |||
| 6736 | // this way, lane-sb128b r1). Without the cap the 64x128 half of a 128-root | 6736 | // this way, lane-sb128b r1). Without the cap the 64x128 half of a 128-root |
| 6737 | // VERT reads the tx-depth symbol off row 0 where libaom uses row 1. | 6737 | // VERT reads the tx-depth symbol off row 0 where libaom uses row 1. |
| 6738 | let (own_w, own_h) = (own_w.min(64), own_h.min(64)); | 6738 | let (own_w, own_h) = (own_w.min(64), own_h.min(64)); |
| 6739 | + // lane-midcut r2: on an INTER frame `get_tx_size_context` reads the real | ||
| 6740 | + // `TXFM_CONTEXT` bands and lets an INTER neighbour contribute its BLOCK | ||
| 6741 | + // size ([`tx_size_context_txfm_rect`]); the deblock-grid approximation | ||
| 6742 | + // below is the KEY FRAME's, and it is right only where those bands were | ||
| 6743 | + // never written. The 1:4 intra strip already branched this way at its own | ||
| 6744 | + // call site -- every other rect intra reader reached from an inter frame | ||
| 6745 | + // (2:1 strips, the 32-level and 64-level 1:4 bodies) read `tx_size_cat*` | ||
| 6746 | + // off the wrong row whenever the neighbour above was an inter block whose | ||
| 6747 | + // var-tx tree had split (measured: a 32x8 intra strip at mi(118,280) of | ||
| 6748 | + // the 10-bit 3840x1608 stream read ctx 1 where aomdec reads ctx 2). | ||
| 6749 | + if INTRA_IN_INTER_MODE.with(std::cell::Cell::get).is_some() { | ||
| 6750 | + return tx_size_context_txfm_rect(n, (mi_r, mi_c), own_w, own_h); | ||
| 6751 | + } | ||
| 6739 | let above = mi_r > n.tile_row0_mi && tx_px_at(n, false, mi_r - 1, mi_c) as usize >= own_w; | 6752 | let above = mi_r > n.tile_row0_mi && tx_px_at(n, false, mi_r - 1, mi_c) as usize >= own_w; |
| 6740 | let left = mi_c > n.tile_col0_mi && tx_h_px_at(n, false, mi_r, mi_c - 1) as usize >= own_h; | 6753 | let left = mi_c > n.tile_col0_mi && tx_h_px_at(n, false, mi_r, mi_c - 1) as usize >= own_h; |
| 6741 | if std::env::var_os("EC_TRACE_MODE_STEP").is_some() { | 6754 | if std::env::var_os("EC_TRACE_MODE_STEP").is_some() { |