forge
Explore
Log in

Don't you dare go Hollow

wip(av1): finish the txb_skip 7-context rewire; find TX16 tx_type mismatch

Browse files at this commit

dcf114768dae66863cbf00ded222ea144e1c8afaAhmet Kaan GümüşParent: ab94637
Adds the luma_skip_ctx debug trace and a partition_w16 trace print (both
gated behind EC_AV1_TRACE) used to bisect the pinned mb.obu stream against
a fprintf-instrumented aomdec build. The 7-context txb_skip rewire itself
(cdf.rs/cdf_state.rs/decode.rs, prior round) compiles and the whole ec-av1
suite is green, but the pinned stream still desyncs: tracing symbol-by-
symbol against real aomdec's EC_TXBCTX/EC_TXBSKIP/EC_TXTYPE_VAL output
shows the two decoders already disagree on a NON-split 16x16 block's own
tx_type (mi_row=4,mi_col=0 in the second superblock quadrant: real reads
tx_type=3 off a reduced 5-symbol intra set, txs_ctx=2/tx_set_type=2/eset=2;
ours reads tx_type=2) -- upstream of the txb_skip multi-TU logic this round
targeted, and not fixed by it. tx_size_context/get_txb_ctx_general/
SKIP_CONTEXTS were all checked byte-for-byte against libaom's
av1/common/txb_common.h and match.

The gate (a_real_aomenc_intra_stream_with_tx_select_decodes_pixel_exact,
stream.rs) is not wired to this recipe: it still passes today only via its
own soft-skip path (every attempt either refuses or never resolves a split
tx_depth), so wiring it now would just turn a silent skip into the same
real failure traced above. Left unwired until the tx_type mismatch is
fixed.
crates/ec-av1/examples/probe_txsel.rsadded+63 -0
@@ -0,0 +1,63 @@
1+use std::io::Write;
2+use std::process::{Command, Stdio};
3+
4+fn main() {
5+ let path = std::env::args()
6+ .nth(1)
7+ .unwrap_or_else(|| "/tmp/mb.obu".into());
8+ let stream = std::fs::read(&path).expect("read stream");
9+ let frames = match ec_av1::stream::decode_stream(&stream) {
10+ Ok(f) => f,
11+ Err(e) => {
12+ eprintln!("decode error: {e}");
13+ std::process::exit(1);
14+ }
15+ };
16+ let (width, height) = (64usize, 64usize);
17+ let mut child = Command::new("ffmpeg")
18+ .args([
19+ "-v", "error", "-f", "obu", "-i", "-", "-f", "rawvideo", "-pix_fmt", "yuv420p", "-",
20+ ])
21+ .stdin(Stdio::piped())
22+ .stdout(Stdio::piped())
23+ .stderr(Stdio::piped())
24+ .spawn()
25+ .expect("ffmpeg spawn");
26+ child
27+ .stdin
28+ .take()
29+ .unwrap()
30+ .write_all(&stream)
31+ .expect("write stream");
32+ let out = child.wait_with_output().expect("ffmpeg run");
33+ if !out.status.success() {
34+ eprintln!("ffmpeg refused: {}", String::from_utf8_lossy(&out.stderr));
35+ std::process::exit(1);
36+ }
37+ let luma = width * height;
38+ let chroma = luma / 4;
39+ let y_ref = &out.stdout[..luma];
40+ let u_ref = &out.stdout[luma..luma + chroma];
41+ let v_ref = &out.stdout[luma + chroma..luma + 2 * chroma];
42+
43+ let pic = &frames[0];
44+ let y_match = pic.y == y_ref;
45+ let u_match = pic.u == u_ref;
46+ let v_match = pic.v == v_ref;
47+ println!("decoded ok, y_match={y_match} u_match={u_match} v_match={v_match}");
48+ if !y_match {
49+ for i in 0..luma {
50+ if pic.y[i] != y_ref[i] {
51+ println!(
52+ "first luma mismatch at idx {i} (row {} col {}): ours={} ref={}",
53+ i / width,
54+ i % width,
55+ pic.y[i],
56+ y_ref[i]
57+ );
58+ break;
59+ }
60+ }
61+ }
62+ std::process::exit(if y_match && u_match && v_match { 0 } else { 2 });
63+}
crates/ec-av1/src/cdf.rsmodified+150 -0
@@ -3758,3 +3758,153 @@ pub const INTRA_TX_TYPE_SET1_8: [[u16; 8]; 13] = [
37583758 /// at the flat 5-way default (unlike its trained `TX_16X16` neighbour,
37593759 /// [`INTRA_TX_TYPE_SET2_16`]) -- every mode reads the same uniform CDF.
37603760 pub const INTRA_TX_TYPE_SET2_8: [[u16; 6]; 13] = [[6554, 13107, 19661, 26214, 32768, 0]; 13];
3761+/// The full luma sub-range of spec `TXB_SKIP_CONTEXTS` (contexts 0..6, the
3762+/// `plane_bsize != tx_size` `skip_contexts[top][left]` table plus its own
3763+/// single `plane_bsize == tx_size` context 0), for a `TxMode::Select` block
3764+/// whose luma transform is split into several transform units smaller than
3765+/// the block itself -- the single-context `TXB_SKIP_LUMA_*` constants above
3766+/// stay for every other caller, which only ever reads context 0.
3767+pub const TXB_SKIP_LUMA_8_Q0_CTX: [[u16; 3]; 7] = [
3768+ [31548, 32768, 0],
3769+ [1549, 32768, 0],
3770+ [10130, 32768, 0],
3771+ [16656, 32768, 0],
3772+ [18591, 32768, 0],
3773+ [26308, 32768, 0],
3774+ [32537, 32768, 0],
3775+];
3776+pub const TXB_SKIP_LUMA_8_Q1_CTX: [[u16; 3]; 7] = [
3777+ [31782, 32768, 0],
3778+ [1836, 32768, 0],
3779+ [10689, 32768, 0],
3780+ [17604, 32768, 0],
3781+ [21622, 32768, 0],
3782+ [27518, 32768, 0],
3783+ [32399, 32768, 0],
3784+];
3785+pub const TXB_SKIP_LUMA_8_CTX: [[u16; 3]; 7] = [
3786+ [31957, 32768, 0],
3787+ [3230, 32768, 0],
3788+ [11153, 32768, 0],
3789+ [18123, 32768, 0],
3790+ [20143, 32768, 0],
3791+ [26536, 32768, 0],
3792+ [31986, 32768, 0],
3793+];
3794+pub const TXB_SKIP_LUMA_8_Q3_CTX: [[u16; 3]; 7] = [
3795+ [31903, 32768, 0],
3796+ [2044, 32768, 0],
3797+ [7528, 32768, 0],
3798+ [14618, 32768, 0],
3799+ [16182, 32768, 0],
3800+ [24168, 32768, 0],
3801+ [31037, 32768, 0],
3802+];
3803+pub const TXB_SKIP_LUMA_16_Q0_CTX: [[u16; 3]; 7] = [
3804+ [29957, 32768, 0],
3805+ [5391, 32768, 0],
3806+ [18039, 32768, 0],
3807+ [23566, 32768, 0],
3808+ [22431, 32768, 0],
3809+ [25822, 32768, 0],
3810+ [32197, 32768, 0],
3811+];
3812+pub const TXB_SKIP_LUMA_16_Q1_CTX: [[u16; 3]; 7] = [
3813+ [31901, 32768, 0],
3814+ [10311, 32768, 0],
3815+ [18047, 32768, 0],
3816+ [24806, 32768, 0],
3817+ [23288, 32768, 0],
3818+ [27914, 32768, 0],
3819+ [32296, 32768, 0],
3820+];
3821+pub const TXB_SKIP_LUMA_16_CTX: [[u16; 3]; 7] = [
3822+ [32363, 32768, 0],
3823+ [10692, 32768, 0],
3824+ [19090, 32768, 0],
3825+ [24357, 32768, 0],
3826+ [24442, 32768, 0],
3827+ [28312, 32768, 0],
3828+ [32169, 32768, 0],
3829+];
3830+pub const TXB_SKIP_LUMA_16_Q3_CTX: [[u16; 3]; 7] = [
3831+ [32510, 32768, 0],
3832+ [8430, 32768, 0],
3833+ [17318, 32768, 0],
3834+ [24154, 32768, 0],
3835+ [23674, 32768, 0],
3836+ [28789, 32768, 0],
3837+ [32139, 32768, 0],
3838+];
3839+pub const TXB_SKIP_LUMA_32_Q0_CTX: [[u16; 3]; 7] = [
3840+ [17920, 32768, 0],
3841+ [1818, 32768, 0],
3842+ [7282, 32768, 0],
3843+ [25273, 32768, 0],
3844+ [10923, 32768, 0],
3845+ [31554, 32768, 0],
3846+ [32624, 32768, 0],
3847+];
3848+pub const TXB_SKIP_LUMA_32_Q1_CTX: [[u16; 3]; 7] = [
3849+ [26726, 32768, 0],
3850+ [1045, 32768, 0],
3851+ [11703, 32768, 0],
3852+ [20590, 32768, 0],
3853+ [18554, 32768, 0],
3854+ [25970, 32768, 0],
3855+ [31938, 32768, 0],
3856+];
3857+pub const TXB_SKIP_LUMA_32_CTX: [[u16; 3]; 7] = [
3858+ [30669, 32768, 0],
3859+ [3832, 32768, 0],
3860+ [11663, 32768, 0],
3861+ [18889, 32768, 0],
3862+ [19782, 32768, 0],
3863+ [23313, 32768, 0],
3864+ [31330, 32768, 0],
3865+];
3866+pub const TXB_SKIP_LUMA_32_Q3_CTX: [[u16; 3]; 7] = [
3867+ [31671, 32768, 0],
3868+ [2056, 32768, 0],
3869+ [11746, 32768, 0],
3870+ [16852, 32768, 0],
3871+ [18635, 32768, 0],
3872+ [24715, 32768, 0],
3873+ [31484, 32768, 0],
3874+];
3875+pub const TXB_SKIP_LUMA_64_Q0_CTX: [[u16; 3]; 7] = [
3876+ [6308, 32768, 0],
3877+ [117, 32768, 0],
3878+ [1638, 32768, 0],
3879+ [2161, 32768, 0],
3880+ [16384, 32768, 0],
3881+ [10923, 32768, 0],
3882+ [30247, 32768, 0],
3883+];
3884+pub const TXB_SKIP_LUMA_64_Q1_CTX: [[u16; 3]; 7] = [
3885+ [26584, 32768, 0],
3886+ [188, 32768, 0],
3887+ [8847, 32768, 0],
3888+ [24519, 32768, 0],
3889+ [22938, 32768, 0],
3890+ [30583, 32768, 0],
3891+ [32608, 32768, 0],
3892+];
3893+pub const TXB_SKIP_LUMA_64_CTX: [[u16; 3]; 7] = [
3894+ [28573, 32768, 0],
3895+ [3183, 32768, 0],
3896+ [17802, 32768, 0],
3897+ [25977, 32768, 0],
3898+ [26677, 32768, 0],
3899+ [27832, 32768, 0],
3900+ [32387, 32768, 0],
3901+];
3902+pub const TXB_SKIP_LUMA_64_Q3_CTX: [[u16; 3]; 7] = [
3903+ [31539, 32768, 0],
3904+ [8433, 32768, 0],
3905+ [20576, 32768, 0],
3906+ [27904, 32768, 0],
3907+ [27852, 32768, 0],
3908+ [30026, 32768, 0],
3909+ [32441, 32768, 0],
3910+];
crates/ec-av1/src/cdf_state.rsmodified+39 -35
@@ -116,10 +116,14 @@ pub(crate) struct Cdfs {
116116 pub cfl_alpha: [[u16; 17]; 6],
117117 /// The angle a directional mode is nudged by.
118118 pub angle_delta: [[u16; 8]; 8],
119- /// The one-context all-zero flag of a 16x16 luma transform.
120- pub txb_skip_luma_16: [[u16; 3]; 1],
121- /// The one-context all-zero flag of an 8x8 luma transform.
122- pub txb_skip_luma_8: [[u16; 3]; 1],
119+ /// The all-zero flag of a 16x16 luma transform, 7 contexts (index 0 for
120+ /// a lone TU whose own bsize equals the block's; 1..6 the
121+ /// `skip_contexts[top][left]` table when `TxMode::Select` splits the
122+ /// block's luma into several smaller transform units, spec
123+ /// `get_txb_ctx_general`).
124+ pub txb_skip_luma_16: [[u16; 3]; 7],
125+ /// The same, for an 8x8 luma transform.
126+ pub txb_skip_luma_8: [[u16; 3]; 7],
123127 /// The all-zero flag of an 8x8 chroma transform.
124128 pub txb_skip_chroma_8: [[u16; 3]; 3],
125129 /// The all-zero flag of a 4x4 chroma transform.
@@ -170,10 +174,10 @@ pub(crate) struct Cdfs {
170174 /// `PARTITION_NONE` is ever coded against it, but the alphabet still
171175 /// adapts on every read, same as every other partition table.
172176 pub partition_w8: [[u16; 5]; 4],
173- /// The one-context all-zero flag of a 32x32 luma transform.
174- pub txb_skip_luma_32: [[u16; 3]; 1],
177+ /// The same as `txb_skip_luma_16`'s 7 contexts, for a 32x32 luma transform.
178+ pub txb_skip_luma_32: [[u16; 3]; 7],
175179 /// The same, for a 64x64 luma transform.
176- pub txb_skip_luma_64: [[u16; 3]; 1],
180+ pub txb_skip_luma_64: [[u16; 3]; 7],
177181 /// The all-zero flag of a 16x16 chroma transform.
178182 pub txb_skip_chroma_16: [[u16; 3]; 3],
179183 /// The all-zero flag of a 32x32 chroma transform.
@@ -464,20 +468,20 @@ impl Cdfs {
464468 cfl_sign: cdf::CFL_SIGN,
465469 cfl_alpha: cdf::CFL_ALPHA,
466470 angle_delta: cdf::ANGLE_DELTA,
467- txb_skip_luma_16: [pick(
468- q_ctx,
469- cdf::TXB_SKIP_LUMA_16_Q0,
470- cdf::TXB_SKIP_LUMA_16_Q1,
471- cdf::TXB_SKIP_LUMA_16,
472- cdf::TXB_SKIP_LUMA_16_Q3,
473- )],
474- txb_skip_luma_8: [pick(
475- q_ctx,
476- cdf::TXB_SKIP_LUMA_8_Q0,
477- cdf::TXB_SKIP_LUMA_8_Q1,
478- cdf::TXB_SKIP_LUMA_8,
479- cdf::TXB_SKIP_LUMA_8_Q3,
480- )],
471+ txb_skip_luma_16: pick(
472+ q_ctx,
473+ cdf::TXB_SKIP_LUMA_16_Q0_CTX,
474+ cdf::TXB_SKIP_LUMA_16_Q1_CTX,
475+ cdf::TXB_SKIP_LUMA_16_CTX,
476+ cdf::TXB_SKIP_LUMA_16_Q3_CTX,
477+ ),
478+ txb_skip_luma_8: pick(
479+ q_ctx,
480+ cdf::TXB_SKIP_LUMA_8_Q0_CTX,
481+ cdf::TXB_SKIP_LUMA_8_Q1_CTX,
482+ cdf::TXB_SKIP_LUMA_8_CTX,
483+ cdf::TXB_SKIP_LUMA_8_Q3_CTX,
484+ ),
481485 txb_skip_chroma_8: pick(
482486 q_ctx,
483487 cdf::TXB_SKIP_CHROMA_8_Q0,
@@ -634,20 +638,20 @@ impl Cdfs {
634638 ),
635639 partition_w16: cdf::PARTITION_W16,
636640 partition_w8: cdf::PARTITION_W8,
637- txb_skip_luma_32: [pick(
638- q_ctx,
639- cdf::TXB_SKIP_LUMA_32_Q0,
640- cdf::TXB_SKIP_LUMA_32_Q1,
641- cdf::TXB_SKIP_LUMA_32,
642- cdf::TXB_SKIP_LUMA_32_Q3,
643- )],
644- txb_skip_luma_64: [pick(
645- q_ctx,
646- cdf::TXB_SKIP_LUMA_64_Q0,
647- cdf::TXB_SKIP_LUMA_64_Q1,
648- cdf::TXB_SKIP_LUMA_64,
649- cdf::TXB_SKIP_LUMA_64_Q3,
650- )],
641+ txb_skip_luma_32: pick(
642+ q_ctx,
643+ cdf::TXB_SKIP_LUMA_32_Q0_CTX,
644+ cdf::TXB_SKIP_LUMA_32_Q1_CTX,
645+ cdf::TXB_SKIP_LUMA_32_CTX,
646+ cdf::TXB_SKIP_LUMA_32_Q3_CTX,
647+ ),
648+ txb_skip_luma_64: pick(
649+ q_ctx,
650+ cdf::TXB_SKIP_LUMA_64_Q0_CTX,
651+ cdf::TXB_SKIP_LUMA_64_Q1_CTX,
652+ cdf::TXB_SKIP_LUMA_64_CTX,
653+ cdf::TXB_SKIP_LUMA_64_Q3_CTX,
654+ ),
651655 txb_skip_chroma_16: pick(
652656 q_ctx,
653657 cdf::TXB_SKIP_CHROMA_16_Q0,
crates/ec-av1/src/decode.rsmodified+81 -5
@@ -381,17 +381,37 @@ fn read_coeffs(
381381 /// [`crate::tile`]'s own private `Neighbour`.
382382 #[derive(Clone, Copy, Default)]
383383 struct Neighbour {
384- coded: bool,
384+ /// The transform unit's cumulative coefficient level (spec `cul_level`,
385+ /// `decodetxb.c`'s `read_coeffs_txb`): the sum of every coded level's
386+ /// magnitude, clamped to `COEFF_CONTEXT_MASK` (7). A plain "coded or not"
387+ /// boolean (`level != 0`) is enough for every context this decoder read
388+ /// until now, but the *luma* `txb_skip_ctx` of a transform unit smaller
389+ /// than its own block (`TxMode::Select`, spec `get_txb_ctx_general`)
390+ /// needs the actual magnitude tier of its above/left neighbours, not
391+ /// just whether they coded anything.
392+ level: u8,
385393 dc: Option<bool>,
386394 }
387395
388396 fn neighbour_state(grid: &[i32]) -> Neighbour {
397+ let cul: u32 = grid.iter().map(|&l| l.unsigned_abs()).sum();
389398 Neighbour {
390- coded: grid.iter().any(|&l| l != 0),
399+ level: cul.min(7) as u8,
391400 dc: (grid[0] != 0).then_some(grid[0] < 0),
392401 }
393402 }
394403
404+/// spec `get_txb_ctx_general`'s `skip_contexts[top][left]` table (plane 0,
405+/// transform unit smaller than the block it sits in): `top`/`left` are the
406+/// above/left neighbours' magnitude tiers, each already clamped to 4.
407+const SKIP_CONTEXTS: [[usize; 5]; 5] = [
408+ [1, 2, 2, 2, 3],
409+ [2, 4, 4, 4, 5],
410+ [2, 4, 4, 4, 5],
411+ [2, 4, 4, 4, 5],
412+ [3, 5, 5, 5, 6],
413+];
414+
395415 /// The neighbour state a block's contexts are read from — a duplicate of
396416 /// [`crate::tile`]'s own private `Neighbours` (that module is another lane's
397417 /// territory this round), kept at the same two granularities the real writer
@@ -601,14 +621,37 @@ impl Neighbours {
601621 for cell in 0..side_mi {
602622 let above = &self.above[mi_c + cell][plane];
603623 let left = &self.left[mi_r + cell][plane];
604- above_coded |= above.coded;
605- left_coded |= left.coded;
624+ above_coded |= above.level != 0;
625+ left_coded |= left.level != 0;
606626 vote += dc_vote(above.dc) + dc_vote(left.dc);
607627 }
608628 (above_coded, left_coded, vote)
609629 })
610630 }
611631
632+ /// The luma `txb_skip_ctx` of a transform unit smaller than its own block
633+ /// (spec `get_txb_ctx_general`, plane 0, `plane_bsize != tx_size`): the
634+ /// above/left neighbours' magnitude tiers, OR-reduced over the unit's own
635+ /// span and each clamped to 4, indexed into [`SKIP_CONTEXTS`]. Unlike
636+ /// [`Self::around_mi`]'s plain coded/uncoded bit, this needs the real
637+ /// cumulative level -- a lone-TU block never calls this (its `txb_skip_ctx`
638+ /// is always 0, spec's `plane_bsize == tx_size` branch).
639+ fn luma_skip_ctx(&self, (mi_r, mi_c): (usize, usize), side_mi: usize) -> usize {
640+ let mut top = 0u8;
641+ let mut left = 0u8;
642+ for cell in 0..side_mi {
643+ top |= self.above[mi_c + cell][0].level;
644+ left |= self.left[mi_r + cell][0].level;
645+ }
646+ let ctx = SKIP_CONTEXTS[(top as usize).min(4)][(left as usize).min(4)];
647+ if std::env::var_os("EC_AV1_TRACE").is_some() {
648+ eprintln!(
649+ "TRACE luma_skip_ctx mi=({mi_r},{mi_c}) side_mi={side_mi} top={top} left={left} ctx={ctx}"
650+ );
651+ }
652+ ctx
653+ }
654+
612655 /// Writes one coded block into every cell it covers, on both grids: the
613656 /// mode/side arrays up to `side`'s own width, and the coefficient-context
614657 /// arrays up to the true frame edge — the units past it are left at their
@@ -1032,9 +1075,16 @@ fn read_plane(
10321075 base_q_idx: u8,
10331076 cfl: Option<(i32, &[i32])>,
10341077 filter_intra: Option<usize>,
1078+ // Only meaningful for `plane_idx == 0`: `Some` when this transform unit is
1079+ // smaller than its own block (spec `get_txb_ctx_general`'s
1080+ // `plane_bsize != tx_size` branch), carrying the already-looked-up
1081+ // `SKIP_CONTEXTS` value; `None` everywhere else (a lone luma TU, or any
1082+ // chroma plane), where `txb_skip_ctx` is 0 or the usual OR-of-neighbours
1083+ // formula below.
1084+ luma_skip_ctx: Option<usize>,
10351085 ) -> Result<Vec<i32>> {
10361086 let skip_ctx = if plane_idx == 0 {
1037- 0
1087+ luma_skip_ctx.unwrap_or(0)
10381088 } else {
10391089 usize::from(around.0) + usize::from(around.1)
10401090 };
@@ -1215,6 +1265,7 @@ fn decode_block(
12151265 base_q_idx,
12161266 None,
12171267 filter_intra,
1268+ None,
12181269 )?;
12191270 let ac = alpha.map(|_| cfl_ac_q3(y, px, py, side));
12201271 let u_grid = read_plane(
@@ -1235,6 +1286,7 @@ fn decode_block(
12351286 base_q_idx,
12361287 alpha.zip(ac.as_deref()).map(|((au, _), ac)| (au, ac)),
12371288 None,
1289+ None,
12381290 )?;
12391291 let v_grid = read_plane(
12401292 dec,
@@ -1254,6 +1306,7 @@ fn decode_block(
12541306 base_q_idx,
12551307 alpha.zip(ac.as_deref()).map(|((_, av), ac)| (av, ac)),
12561308 None,
1309+ None,
12571310 )?;
12581311 neighbours.record(at, side, mode, &[luma_grid, u_grid, v_grid]);
12591312 } else {
@@ -1274,6 +1327,11 @@ fn decode_block(
12741327 let tu_py = py + tu_row * logical_tx;
12751328 let tu_around = neighbours.around_mi(tu_mi, logical_tx)[0];
12761329 let tu_reach = Reach::of(logical_tx, tu_px, tu_py, y.width, y.height);
1330+ // This transform unit's own bsize (`logical_tx`) is smaller
1331+ // than the block it sits in (`side`), so `txb_skip_ctx` is
1332+ // the neighbour-magnitude table, not the lone-TU 0 (spec
1333+ // `get_txb_ctx_general`'s `plane_bsize != tx_size` branch).
1334+ let tu_skip_ctx = neighbours.luma_skip_ctx(tu_mi, logical_tx / MI);
12771335 let tu_grid = read_plane(
12781336 dec,
12791337 cdfs,
@@ -1292,6 +1350,7 @@ fn decode_block(
12921350 base_q_idx,
12931351 None,
12941352 filter_intra,
1353+ Some(tu_skip_ctx),
12951354 )?;
12961355 neighbours.record_mi_luma(tu_mi, logical_tx, &tu_grid);
12971356 }
@@ -1316,6 +1375,7 @@ fn decode_block(
13161375 base_q_idx,
13171376 alpha.zip(ac.as_deref()).map(|((au, _), ac)| (au, ac)),
13181377 None,
1378+ None,
13191379 )?;
13201380 let v_grid = read_plane(
13211381 dec,
@@ -1335,6 +1395,7 @@ fn decode_block(
13351395 base_q_idx,
13361396 alpha.zip(ac.as_deref()).map(|((_, av), ac)| (av, ac)),
13371397 None,
1398+ None,
13381399 )?;
13391400 neighbours.record_split_luma(at, side, mode, [&u_grid, &v_grid]);
13401401 }
@@ -1458,6 +1519,7 @@ fn decode_leaf8(
14581519 base_q_idx,
14591520 None,
14601521 filter_intra,
1522+ None,
14611523 )?;
14621524 let ac = alpha.map(|_| cfl_ac_q3(y, px, py, 8));
14631525 u_grid = read_plane(
@@ -1478,6 +1540,7 @@ fn decode_leaf8(
14781540 base_q_idx,
14791541 alpha.zip(ac.as_deref()).map(|((au, _), ac)| (au, ac)),
14801542 None,
1543+ None,
14811544 )?;
14821545 v_grid = read_plane(
14831546 dec,
@@ -1497,6 +1560,7 @@ fn decode_leaf8(
14971560 base_q_idx,
14981561 alpha.zip(ac.as_deref()).map(|((_, av), ac)| (av, ac)),
14991562 None,
1563+ None,
15001564 )?;
15011565 }
15021566 neighbours.record_mi(leaf_mi, 8, &[luma_grid, u_grid, v_grid]);
@@ -2570,6 +2634,12 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
25702634 let ctx16 = neighbours.partition_ctx(at16, SUB);
25712635 if has_cols16 && has_rows16 {
25722636 let part16 = dec.symbol(&mut cdfs.partition_w16[ctx16]);
2637+ if std::env::var_os("EC_AV1_TRACE").is_some() {
2638+ eprintln!(
2639+ "TRACE partition_w16 mi=({},{}) ctx={ctx16} value={part16}",
2640+ at16.0, at16.1
2641+ );
2642+ }
25732643 if part16 == PARTITION_NONE {
25742644 decode_block(
25752645 &mut dec,
@@ -3265,6 +3335,7 @@ fn decode_inter_block(
32653335 base_q_idx,
32663336 None,
32673337 None,
3338+ None,
32683339 )?;
32693340 let ac = alpha.map(|_| cfl_ac_q3(y, px, py, side));
32703341 u_grid = read_plane(
@@ -3285,6 +3356,7 @@ fn decode_inter_block(
32853356 base_q_idx,
32863357 alpha.zip(ac.as_deref()).map(|((au, _), ac)| (au, ac)),
32873358 None,
3359+ None,
32883360 )?;
32893361 v_grid = read_plane(
32903362 dec,
@@ -3304,6 +3376,7 @@ fn decode_inter_block(
33043376 base_q_idx,
33053377 alpha.zip(ac.as_deref()).map(|((_, av), ac)| (av, ac)),
33063378 None,
3379+ None,
33073380 )?;
33083381 }
33093382 }
@@ -3660,6 +3733,7 @@ fn decode_inter_block8(
36603733 base_q_idx,
36613734 None,
36623735 None,
3736+ None,
36633737 )?;
36643738 u_grid = read_plane(
36653739 dec,
@@ -3679,6 +3753,7 @@ fn decode_inter_block8(
36793753 base_q_idx,
36803754 None,
36813755 None,
3756+ None,
36823757 )?;
36833758 v_grid = read_plane(
36843759 dec,
@@ -3698,6 +3773,7 @@ fn decode_inter_block8(
36983773 base_q_idx,
36993774 None,
37003775 None,
3776+ None,
37013777 )?;
37023778 }
37033779 }