ec-av1: rect intrabc review round 2 -- square residual stride, per-leaf LF grid, frame-level tx_mode key
Browse files at this commitd5adb7ab317af46661700f2ca90b2dff8ea63aaaParent: a4e3e6e2 changed files +135 -42
- crates/ec-av1/src/decode.rs +78 -32
- lanes/av1intrabc.report.md +57 -10
crates/ec-av1/src/decode.rsmodified+78 -32
| @@ -123,6 +123,11 @@ pub(crate) struct FrameCtx { | ||
| 123 | 123 | pub(crate) cur_segment_id: std::cell::Cell<u8>, |
| 124 | 124 | pub(crate) seg_tile_origin: std::cell::Cell<(usize, usize)>, |
| 125 | 125 | pub(crate) tx_select_inter: std::cell::Cell<bool>, |
| 126 | + /// This FRAME's own `tx_mode == TxMode::Select`, set for EVERY frame | |
| 127 | + /// (intra included). [`Self::tx_select_inter`] cannot stand in for it: | |
| 128 | + /// an intrabc block rides an INTRA frame, but libaom still reads its | |
| 129 | + /// var-tx `txfm_partition` tree under the frame's `TxMode::Select`. | |
| 130 | + pub(crate) tx_select_frame: std::cell::Cell<bool>, | |
| 126 | 131 | pub(crate) reduced_tx_set_inter: std::cell::Cell<bool>, |
| 127 | 132 | pub(crate) enable_filter_intra_inter: std::cell::Cell<bool>, |
| 128 | 133 | pub(crate) palette_pred: std::cell::RefCell<Option<Vec<u16>>>, |
| @@ -222,6 +227,7 @@ impl FrameCtx { | ||
| 222 | 227 | cur_segment_id: std::cell::Cell::new(0), |
| 223 | 228 | seg_tile_origin: std::cell::Cell::new((0, 0)), |
| 224 | 229 | tx_select_inter: std::cell::Cell::new(false), |
| 230 | + tx_select_frame: std::cell::Cell::new(false), | |
| 225 | 231 | reduced_tx_set_inter: std::cell::Cell::new(true), |
| 226 | 232 | enable_filter_intra_inter: std::cell::Cell::new(false), |
| 227 | 233 | palette_pred: std::cell::RefCell::new(None), |
| @@ -1617,6 +1623,7 @@ pub(crate) fn set_inter_tx_mode( | ||
| 1617 | 1623 | enable_filter_intra: bool, fctx: &crate::decode::FrameCtx, |
| 1618 | 1624 | ) { |
| 1619 | 1625 | fctx.tx_select_inter.with(|c| c.set(tx_select)); |
| 1626 | + fctx.tx_select_frame.with(|c| c.set(tx_select)); | |
| 1620 | 1627 | fctx.reduced_tx_set_inter.with(|c| c.set(reduced_tx_set)); |
| 1621 | 1628 | fctx.enable_filter_intra_inter.with(|c| c.set(enable_filter_intra)); |
| 1622 | 1629 | } |
| @@ -10929,6 +10936,13 @@ fn decode_intrabc_rect( | ||
| 10929 | 10936 | // shape this helper is called at, so the uv plane block is ONE unit -- |
| 10930 | 10937 | // the same call `decode_token_recon_block`'s own chroma loop makes. |
| 10931 | 10938 | let (cw, ch) = (bw / 2, bh / 2); |
| 10939 | + // lane-av1-intrabc r2: the square stride the proven INTER path uses | |
| 10940 | + // (`side`). The residual grids, the prediction windows AND | |
| 10941 | + // `TxParams::stride` are all laid out at it -- the block's own width | |
| 10942 | + // panicked `TxParams::run` on every coded VERT strip (8x16/16x32: `h` | |
| 10943 | + // exceeds the stride). | |
| 10944 | + let side = bw.max(bh); | |
| 10945 | + let cside = cw.max(ch); | |
| 10932 | 10946 | // `av1_calc_mi_size`'s 8-px-aligned grid: a block hanging over the right |
| 10933 | 10947 | // or bottom frame edge reads no transform-tree symbol for the units |
| 10934 | 10948 | // outside it. |
| @@ -10950,36 +10964,51 @@ fn decode_intrabc_rect( | ||
| 10950 | 10964 | // coefficient is read. `flush_recon` first -- the source is this frame's |
| 10951 | 10965 | // own reconstruction, including the writes this superblock has queued. |
| 10952 | 10966 | flush_recon(fctx, y, u, v); |
| 10953 | - let mut pred_y = vec![0u16; bw * bh]; | |
| 10967 | + // `mc::predict_with_filter` writes a DENSE window; the residual machinery | |
| 10968 | + // reads it at the square stride, so re-lay it -- the same step the inter | |
| 10969 | + // path takes for its own square prediction buffer. | |
| 10970 | + let mut pred_y_dense = vec![0u16; bw * bh]; | |
| 10954 | 10971 | mc::predict_with_filter( |
| 10955 | 10972 | &y.data, y.width, y.true_width, y.true_height, |
| 10956 | 10973 | mv_to_q4(px, dv_col, true), mv_to_q4(py, dv_row, true), |
| 10957 | - bw, bh, mc::InterpFilterKind::Bilinear, &mut pred_y, fctx, | |
| 10974 | + bw, bh, mc::InterpFilterKind::Bilinear, &mut pred_y_dense, fctx, | |
| 10958 | 10975 | ); |
| 10959 | - let mut pred_u = vec![0u16; cw * ch]; | |
| 10976 | + let mut pred_y = vec![0u16; side * side]; | |
| 10977 | + for row in 0..bh { | |
| 10978 | + pred_y[row * side..][..bw].copy_from_slice(&pred_y_dense[row * bw..][..bw]); | |
| 10979 | + } | |
| 10980 | + let mut pred_u_dense = vec![0u16; cw * ch]; | |
| 10960 | 10981 | mc::predict_with_filter( |
| 10961 | 10982 | &u.data, u.width, u.true_width, u.true_height, |
| 10962 | 10983 | mv_to_q4(cpx, dv_col, false), mv_to_q4(cpy, dv_row, false), |
| 10963 | - cw, ch, mc::InterpFilterKind::Bilinear, &mut pred_u, fctx, | |
| 10984 | + cw, ch, mc::InterpFilterKind::Bilinear, &mut pred_u_dense, fctx, | |
| 10964 | 10985 | ); |
| 10965 | - let mut pred_v = vec![0u16; cw * ch]; | |
| 10986 | + let mut pred_u = vec![0u16; cside * cside]; | |
| 10987 | + for row in 0..ch { | |
| 10988 | + pred_u[row * cside..][..cw].copy_from_slice(&pred_u_dense[row * cw..][..cw]); | |
| 10989 | + } | |
| 10990 | + let mut pred_v_dense = vec![0u16; cw * ch]; | |
| 10966 | 10991 | mc::predict_with_filter( |
| 10967 | 10992 | &v.data, v.width, v.true_width, v.true_height, |
| 10968 | 10993 | mv_to_q4(cpx, dv_col, false), mv_to_q4(cpy, dv_row, false), |
| 10969 | - cw, ch, mc::InterpFilterKind::Bilinear, &mut pred_v, fctx, | |
| 10994 | + cw, ch, mc::InterpFilterKind::Bilinear, &mut pred_v_dense, fctx, | |
| 10970 | 10995 | ); |
| 10996 | + let mut pred_v = vec![0u16; cside * cside]; | |
| 10997 | + for row in 0..ch { | |
| 10998 | + pred_v[row * cside..][..cw].copy_from_slice(&pred_v_dense[row * cw..][..cw]); | |
| 10999 | + } | |
| 10971 | 11000 | let reduced = fctx.reduced_tx_set_inter.with(std::cell::Cell::get); |
| 10972 | 11001 | let luma_tx_type: TxType; |
| 10973 | 11002 | let (luma_grid, u_grid, v_grid); |
| 10974 | 11003 | if skip { |
| 10975 | 11004 | // No residual syntax at all: the prediction IS the block. |
| 10976 | - push_mc_rect(0, px, py, bw, bw, bh, Pred::Inline(&pred_y, bw), &ZERO_RESIDUAL[..bw * bh], fctx); | |
| 10977 | - push_mc_rect(1, cpx, cpy, cw, cw, ch, Pred::Inline(&pred_u, cw), &ZERO_RESIDUAL[..cw * ch], fctx); | |
| 10978 | - push_mc_rect(2, cpx, cpy, cw, cw, ch, Pred::Inline(&pred_v, cw), &ZERO_RESIDUAL[..cw * ch], fctx); | |
| 11005 | + push_mc_rect(0, px, py, side, bw, bh, Pred::Inline(&pred_y, side), &ZERO_RESIDUAL[..bw * bh], fctx); | |
| 11006 | + push_mc_rect(1, cpx, cpy, cside, cw, ch, Pred::Inline(&pred_u, cside), &ZERO_RESIDUAL[..cw * ch], fctx); | |
| 11007 | + push_mc_rect(2, cpx, cpy, cside, cw, ch, Pred::Inline(&pred_v, cside), &ZERO_RESIDUAL[..cw * ch], fctx); | |
| 10979 | 11008 | luma_tx_type = TxType::DctDct; |
| 10980 | - luma_grid = Grid::Zero(bw * bh); | |
| 10981 | - u_grid = Grid::Zero(cw * ch); | |
| 10982 | - v_grid = Grid::Zero(cw * ch); | |
| 11009 | + luma_grid = Grid::Zero(side * side); | |
| 11010 | + u_grid = Grid::Zero(cside * cside); | |
| 11011 | + v_grid = Grid::Zero(cside * cside); | |
| 10983 | 11012 | } else { |
| 10984 | 11013 | match leaves.as_ref() { |
| 10985 | 11014 | None => { |
| @@ -10990,55 +11019,69 @@ fn decode_intrabc_rect( | ||
| 10990 | 11019 | cdfs, |
| 10991 | 11020 | rect_inter_luma_set(bw, bh, fctx)?, |
| 10992 | 11021 | (bw, bh), |
| 10993 | - bw, | |
| 11022 | + side, | |
| 10994 | 11023 | 0, |
| 10995 | 11024 | around[0], |
| 10996 | 11025 | 0, |
| 10997 | 11026 | y, |
| 10998 | 11027 | px, |
| 10999 | 11028 | py, |
| 11000 | - Pred::Inline(&pred_y, bw), | |
| 11029 | + Pred::Inline(&pred_y, side), | |
| 11001 | 11030 | None, |
| 11002 | 11031 | None, fctx, |
| 11003 | 11032 | )?; |
| 11004 | 11033 | luma_tx_type = tx_type; |
| 11005 | - luma_grid = embed_grid_stride(&grid, bw, bh, bw); | |
| 11034 | + luma_grid = embed_grid_stride(&grid, bw, bh, side); | |
| 11006 | 11035 | let (ug, _) = read_inter_plane_rect( |
| 11007 | 11036 | dec, |
| 11008 | 11037 | cdfs, |
| 11009 | 11038 | rect_inter_chroma_set(cw, ch)?, |
| 11010 | 11039 | (cw, ch), |
| 11011 | - cw, | |
| 11040 | + cside, | |
| 11012 | 11041 | 1, |
| 11013 | 11042 | around[1], |
| 11014 | 11043 | 0, |
| 11015 | 11044 | u, |
| 11016 | 11045 | cpx, |
| 11017 | 11046 | cpy, |
| 11018 | - Pred::Inline(&pred_u, cw), | |
| 11047 | + Pred::Inline(&pred_u, cside), | |
| 11019 | 11048 | Some(luma_tx_type), |
| 11020 | 11049 | None, fctx, |
| 11021 | 11050 | )?; |
| 11022 | - u_grid = embed_grid_stride(&ug, cw, ch, cw); | |
| 11051 | + u_grid = embed_grid_stride(&ug, cw, ch, cside); | |
| 11023 | 11052 | let (vg, _) = read_inter_plane_rect( |
| 11024 | 11053 | dec, |
| 11025 | 11054 | cdfs, |
| 11026 | 11055 | rect_inter_chroma_set(cw, ch)?, |
| 11027 | 11056 | (cw, ch), |
| 11028 | - cw, | |
| 11057 | + cside, | |
| 11029 | 11058 | 2, |
| 11030 | 11059 | around[2], |
| 11031 | 11060 | 0, |
| 11032 | 11061 | v, |
| 11033 | 11062 | cpx, |
| 11034 | 11063 | cpy, |
| 11035 | - Pred::Inline(&pred_v, cw), | |
| 11064 | + Pred::Inline(&pred_v, cside), | |
| 11036 | 11065 | Some(luma_tx_type), |
| 11037 | 11066 | None, fctx, |
| 11038 | 11067 | )?; |
| 11039 | - v_grid = embed_grid_stride(&vg, cw, ch, cw); | |
| 11068 | + v_grid = embed_grid_stride(&vg, cw, ch, cside); | |
| 11040 | 11069 | } |
| 11041 | 11070 | Some(leaves) => { |
| 11071 | + // P2 (lane-av1-intrabc r2): libaom `get_transform_size` applies | |
| 11072 | + // the split override to LUMA only, per leaf -- the step the | |
| 11073 | + // proven inter var-tx path applies right after its own residual | |
| 11074 | + // loop ([`Neighbours::fill_lf_grid_leaf_luma`]). Without it the | |
| 11075 | + // leaf's own transform edges are never filtered. | |
| 11076 | + for &(row, col, tw, th) in leaves.iter() { | |
| 11077 | + neighbours.fill_lf_grid_leaf_luma( | |
| 11078 | + (mi_r + row, mi_c + col), | |
| 11079 | + tw / MI, | |
| 11080 | + th / MI, | |
| 11081 | + tw as u8, | |
| 11082 | + th as u8, | |
| 11083 | + ); | |
| 11084 | + } | |
| 11042 | 11085 | // One residual per transform unit, in the order the tree coded |
| 11043 | 11086 | // them; each unit reads its own neighbour-magnitude context off |
| 11044 | 11087 | // the units already decoded before it, and every unit adds onto |
| @@ -11047,7 +11090,7 @@ fn decode_intrabc_rect( | ||
| 11047 | 11090 | for (idx, &(row, col, tw, th)) in leaves.iter().enumerate() { |
| 11048 | 11091 | let tu_mi = (mi_r + row, mi_c + col); |
| 11049 | 11092 | let (tu_px, tu_py) = (px + col * MI, py + row * MI); |
| 11050 | - let tu_pred = Pred::Inline(&pred_y, bw).offset(row * MI * bw + col * MI); | |
| 11093 | + let tu_pred = Pred::Inline(&pred_y, side).offset(row * MI * side + col * MI); | |
| 11051 | 11094 | let (tu_grid, tu_tx_type) = if tw == th { |
| 11052 | 11095 | let scan = default_scan(tw.min(32)); |
| 11053 | 11096 | let tu_skip_ctx = neighbours.luma_skip_ctx(tu_mi, tw / MI); |
| @@ -11075,7 +11118,7 @@ fn decode_intrabc_rect( | ||
| 11075 | 11118 | cdfs, |
| 11076 | 11119 | rect_inter_luma_set(tw, th, fctx)?, |
| 11077 | 11120 | (tw, th), |
| 11078 | - bw, | |
| 11121 | + side, | |
| 11079 | 11122 | 0, |
| 11080 | 11123 | neighbours.around_mi_rect(tu_mi, tw, th)[0], |
| 11081 | 11124 | 0, |
| @@ -11101,36 +11144,36 @@ fn decode_intrabc_rect( | ||
| 11101 | 11144 | cdfs, |
| 11102 | 11145 | rect_inter_chroma_set(cw, ch)?, |
| 11103 | 11146 | (cw, ch), |
| 11104 | - cw, | |
| 11147 | + cside, | |
| 11105 | 11148 | 1, |
| 11106 | 11149 | around[1], |
| 11107 | 11150 | 0, |
| 11108 | 11151 | u, |
| 11109 | 11152 | cpx, |
| 11110 | 11153 | cpy, |
| 11111 | - Pred::Inline(&pred_u, cw), | |
| 11154 | + Pred::Inline(&pred_u, cside), | |
| 11112 | 11155 | Some(luma_tx_type), |
| 11113 | 11156 | None, fctx, |
| 11114 | 11157 | )?; |
| 11115 | - u_grid = embed_grid_stride(&ug, cw, ch, cw); | |
| 11158 | + u_grid = embed_grid_stride(&ug, cw, ch, cside); | |
| 11116 | 11159 | let (vg, _) = read_inter_plane_rect( |
| 11117 | 11160 | dec, |
| 11118 | 11161 | cdfs, |
| 11119 | 11162 | rect_inter_chroma_set(cw, ch)?, |
| 11120 | 11163 | (cw, ch), |
| 11121 | - cw, | |
| 11164 | + cside, | |
| 11122 | 11165 | 2, |
| 11123 | 11166 | around[2], |
| 11124 | 11167 | 0, |
| 11125 | 11168 | v, |
| 11126 | 11169 | cpx, |
| 11127 | 11170 | cpy, |
| 11128 | - Pred::Inline(&pred_v, cw), | |
| 11171 | + Pred::Inline(&pred_v, cside), | |
| 11129 | 11172 | Some(luma_tx_type), |
| 11130 | 11173 | None, fctx, |
| 11131 | 11174 | )?; |
| 11132 | - v_grid = embed_grid_stride(&vg, cw, ch, cw); | |
| 11133 | - luma_grid = Grid::Zero(bw * bh); | |
| 11175 | + v_grid = embed_grid_stride(&vg, cw, ch, cside); | |
| 11176 | + luma_grid = Grid::Zero(side * side); | |
| 11134 | 11177 | } |
| 11135 | 11178 | } |
| 11136 | 11179 | } |
| @@ -19256,7 +19299,7 @@ fn read_block_tx_size_rect( | ||
| 19256 | 19299 | (bh / MI).min(mi_rows.saturating_sub(at_mi.0)), |
| 19257 | 19300 | ); |
| 19258 | 19301 | let mut leaves = Vec::new(); |
| 19259 | - if !fctx.tx_select_inter.with(std::cell::Cell::get) { | |
| 19302 | + if !fctx.tx_select_frame.with(std::cell::Cell::get) { | |
| 19260 | 19303 | for row in (0..bh / MI).step_by(tx / MI) { |
| 19261 | 19304 | for col in (0..bw / MI).step_by(tx / MI) { |
| 19262 | 19305 | leaves.push((row, col, tx, tx)); |
| @@ -19292,7 +19335,7 @@ fn read_block_tx_size_rect( | ||
| 19292 | 19335 | return Ok(Some(leaves)); |
| 19293 | 19336 | } |
| 19294 | 19337 | let (tx_w, tx_h) = (bw, bh); |
| 19295 | - if !fctx.tx_select_inter.with(std::cell::Cell::get) { | |
| 19338 | + if !fctx.tx_select_frame.with(std::cell::Cell::get) { | |
| 19296 | 19339 | // `TX_MODE_LARGEST`: no symbol at all, the whole block is one |
| 19297 | 19340 | // transform, and `set_txfm_ctxs` records exactly what |
| 19298 | 19341 | // `txfm_partition_update` would for that same unit. |
| @@ -23080,6 +23123,9 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | ||
| 23080 | 23123 | // otherwise inherit it and read its `tx_depth` context off the inter |
| 23081 | 23124 | // frame's stale `TXFM_CONTEXT` bands. |
| 23082 | 23125 | fctx.tx_select_inter.with(|c| c.set(false)); |
| 23126 | + // lane-av1-intrabc r2: the FRAME's own tx_mode -- an intrabc block's | |
| 23127 | + // tx-size read keys on it even inside an intra tile. | |
| 23128 | + fctx.tx_select_frame.with(|c| c.set(tx_select)); | |
| 23083 | 23129 | if mi_cols == 0 || mi_rows == 0 { |
| 23084 | 23130 | return Err(unsupported("a frame with no mode-info grid")); |
| 23085 | 23131 | } |
lanes/av1intrabc.report.mdmodified+57 -10
| @@ -20,8 +20,9 @@ from libaom's `av1_predict_intra_block`/`predict_inter_block` intrabc path: | ||
| 20 | 20 | skip/LF grids, and the DV into the intrabc mi grid. |
| 21 | 21 | |
| 22 | 22 | Wired at all 2:1 rect intrabc slots: `decode_block_rect` (16x32/32x16), |
| 23 | -`decode_block_rect4` (32x8/8x32 + 16x8/8x16), `decode_leaf_rect`, | |
| 24 | -`decode_block_rect64`, `decode_block_128rect`; engagement counters | |
| 23 | +`decode_block_rect4` (32x8/8x32 + 16x8/8x16), `decode_leaf_rect`; in | |
| 24 | +`decode_block_rect64`/`decode_block_128rect` the wiring REFUSES the shape (a | |
| 25 | +named refusal slot, not a reconstruction); engagement counters | |
| 25 | 26 | `intrabc_rect_hits` / `intrabc_rect_vartx_hits` exposed on `decode_probe`. |
| 26 | 27 | |
| 27 | 28 | ## 2. Byte-exactness witnesses |
| @@ -30,8 +31,9 @@ In-gate (flipped pin -> witness): `stream::tests:: | ||
| 30 | 31 | a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips`. Its |
| 31 | 32 | `testsrc2-cq50-txs0` arm used to stop at the rect-strip refusal; it now decodes |
| 32 | 33 | 1 frame, **1 intrabc block on a HORZ/VERT rect strip**, pixel-exact vs ffmpeg. |
| 33 | -Gate totals: 187 rect `use_intrabc` reads, 5 intrabc blocks over 5 arms, | |
| 34 | -8 frames compared, 0 mismatches, 0 named refusals. | |
| 34 | +Gate totals (re-measured, reviewer-corrected): **2** intrabc blocks over **2** | |
| 35 | +arms -- 4 arms decode ZERO intrabc blocks (out of scope), 187 rect | |
| 36 | +`use_intrabc` reads, 8 frames compared, 0 mismatches, 0 named refusals. | |
| 35 | 37 | |
| 36 | 38 | Standalone recipes (aomenc oracle at `~/.cache/aom-oracle/build/aomenc`, probe |
| 37 | 39 | `cargo run --release -p ec-av1 --example decode_probe -- <obu>`): |
| @@ -43,8 +45,7 @@ Standalone recipes (aomenc oracle at `~/.cache/aom-oracle/build/aomenc`, probe | ||
| 43 | 45 | |`testsrc2=s=256x192:r=25 --cq-level=50 --enable-palette=0`, 1:4 off|0|--|--|REFUSED (16x8 CPR block, `--enable-1to4-partitions=0`)| |
| 44 | 46 | |`testsrc2=s=256x192:r=25 --cq-level=50 --enable-palette=0 --min-partition-size=4 --max-partition-size=16`|1|16x8 @(38,48)|0|**EXACT**| |
| 45 | 47 | |`testsrc2=s=256x192:r=25 --cq-level=45 --enable-palette=0`|1|16x8 @(38,48)|0|**EXACT**| |
| 46 | -|`smptebars=size=512x384:rate=25 --cq-level=50`|2|16x8 @(76,92) skip=0, 8x32 @(80,104) skip=1|mixed|**EXACT**| | |
| 47 | -|`smptebars=size=1024x768:rate=25 --cq-level=50`|1|8x32 @(64,74)|1|**EXACT**| | |
| 48 | +|`testsrc2=s=256x192:r=25 --cq-level=45 --enable-palette=1`|1|16x8 @(38,48)|0|**EXACT**| | |
| 48 | 49 | |`testsrc2=s=256x192:r=25 --cq-level=50`, 1:4 off, `--enable-tx-size-search=1`|0|--|--|REFUSED| |
| 49 | 50 | |
| 50 | 51 | Every `EXACT` row is `cmp` of the probe's raw output against ffmpeg |
| @@ -58,10 +59,12 @@ witnesses exercise `decode_block_rect4`'s wiring through the same helper. | ||
| 58 | 59 | `intra block copy on a HORZ/VERT/1:4 rect intra strip (reconstruction is not |
| 59 | 60 | ported at this shape)` at `decode_rect4_16_strip`, `decode_block_rect4`'s 1:4 |
| 60 | 61 | arm and `decode_block_128rect`. Reason this is NOT this lane's helper: a 1:4 |
| 61 | -strip is coded as a PAIR (both children share one chroma block), so the chroma | |
| 62 | -prediction comes from the pair's top-left mi and the chroma coefficient state | |
| 63 | -is written over the pair span -- a different neighbour/bookkeeping model from | |
| 64 | -the 2:1 helper above. Reachable witnesses for whoever takes it next: | |
| 62 | +strip is coded as a PAIR (both children share one chroma block). The chroma is | |
| 63 | +sourced at the pair's **odd-mi member** -- the BOTTOM strip of a `HORZ_4` pair, | |
| 64 | +the RIGHT strip of a `VERT_4` one (`is_chroma_reference`, `av1_common_int.h` | |
| 65 | +-- the reviewer corrected an earlier, inverted note in this report) -- and the | |
| 66 | +pair's chroma transform is read once for the pair, so its neighbour and | |
| 67 | +coefficient bookkeeping is a different model from the 2:1 helper above. Reachable witnesses for whoever takes it next: | |
| 65 | 68 | `aomenc --allintra` (already stops there today), `--allintra` cpu-used 0 |
| 66 | 69 | (lands there after the tx-depth/tx-band work, see lane-av1-txbands), and this |
| 67 | 70 | hand-made recipe: `testsrc2=s=640x480:r=25 --cq-level=60 --enable-palette=1 |
| @@ -85,6 +88,50 @@ the refusal that remains is only the square/leaf path's. | ||
| 85 | 88 | lane-av1-txbands is editing the same file, so the workspace-wide run belongs |
| 86 | 89 | to the batch-level gate. |
| 87 | 90 | |
| 91 | +## 4b. Review round 2 (2026-09-20) -- what the fixes did and what is STILL open | |
| 92 | + | |
| 93 | +Fixed on this branch (reviewer findings P1-2 / P2 and part of P1-1): | |
| 94 | + | |
| 95 | +- **P1-2 (panic)**: every rect residual/prediction in `decode_intrabc_rect` now | |
| 96 | + uses the proven INTER path's square stride (`side = bw.max(bh)`, | |
| 97 | + `cside = cw.max(ch)`), and the prediction window is re-laid at that stride. | |
| 98 | + Before: `TxParams::run` panicked (`range end index 8 out of range`) on every | |
| 99 | + coded VERT strip. | |
| 100 | +- **P2 (LF grid)**: the var-tx arm now applies | |
| 101 | + `Neighbours::fill_lf_grid_leaf_luma` per leaf (LUMA only), the step the | |
| 102 | + proven inter var-tx path applies. | |
| 103 | +- **P1-1 (tx-mode)**: the intrabc tx-size read no longer keys on | |
| 104 | + `fctx.tx_select_inter` (forced false by the key-frame tile decoder) but on a | |
| 105 | + new frame-level `fctx.tx_select_frame`, set for EVERY frame from the frame | |
| 106 | + header's own `tx_mode == TxMode::Select`. Measured effect: the var-tx arm now | |
| 107 | + fires (`intrabc_rect_vartx_hits == 1`) on the encode below. | |
| 108 | + | |
| 109 | +**STILL NOT BYTE-EXACT** -- two repros, both with the mismatch confined to the | |
| 110 | +frame's BOTTOM 64-row band (luma rows h-64..h-1, chroma rows h/2-32..h/2-1): | |
| 111 | + | |
| 112 | +``` | |
| 113 | +# var-tx leaf arm (intrabc_rect=1, var-tx tree=1): 4520/73728 bytes differ | |
| 114 | +ffmpeg -v error -f lavfi -i testsrc2=s=256x192:r=25 -t 0.2 -pix_fmt yuv420p -strict -1 -f yuv4mpegpipe - | ~/.cache/aom-oracle/build/aomenc --codec=av1 --bit-depth=8 --input-bit-depth=8 --passes=1 --end-usage=q --cpu-used=0 --lag-in-frames=0 --kf-max-dist=1 --limit=1 --threads=1 --tile-columns=0 --min-partition-size=8 --max-partition-size=32 --sb-size=64 --tune-content=screen --enable-intrabc=1 --cq-level=45 --enable-palette=0 --enable-tx-size-search=1 --enable-rect-partitions=1 --enable-1to4-partitions=1 --obu -o /tmp/a31.obu - | |
| 115 | +# coded rect arm (intrabc_rect=2): no panic now, 7900/294912 bytes differ | |
| 116 | +# ... same recipe, testsrc2=s=512x384:r=25 --cq-level=45 --enable-palette=1 | |
| 117 | +# --enable-tx-size-search=0 | |
| 118 | +``` | |
| 119 | + | |
| 120 | +First divergence of the 256x192 arm: luma row 128, column 224 (the bottom | |
| 121 | +superblock row); of the 512x384 arm: luma row 320, column 424. So a coded rect | |
| 122 | +intrabc block in the bottom band still reconstructs wrong -- the shapes the | |
| 123 | +in-gate witness covers (`testsrc2-cq50-txs0`, `--enable-tx-size-search=0`, | |
| 124 | +skip and coded 16x8) stay pixel-exact, and every `smptebars`/`testsrc2` recipe | |
| 125 | +above is EXACT, so the defect is specific to these two arms and is the first | |
| 126 | +thing the next round must localize (per-block DV/prediction trace against | |
| 127 | +`EC_VARTX`/`EC_ISTEP`). | |
| 128 | + | |
| 129 | +**Verdict: NOT merge-ready.** The two P1s are addressed structurally (no panic, | |
| 130 | +correct tx-mode keying) and the P2 step is in, but the reviewer's merge | |
| 131 | +unblock condition -- a coded rect intrabc witness in BOTH orientations plus a | |
| 132 | +TX_MODE_SELECT one, all byte-exact -- is NOT met: the TX_MODE_SELECT arm is | |
| 133 | +exactly the 256x192 repro above and it is still 4520 bytes off. | |
| 134 | + | |
| 88 | 135 | ## 5. Deferred |
| 89 | 136 | |
| 90 | 137 | 1. **1:4 pair-strip intrabc** -- named above, with the model difference and the |