From 2d62fa6d16e0575ba59bc9a380529eea5fe37c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 6 Sep 2026 07:02:23 +0300 Subject: [PATCH] test(av1): the raw inter-tile decode entry point takes the frame's own tx_select bit Three gop round-trip tests decoded inter tiles through decode_inter_frame_tile, which hard-coded tx_select=false with a comment claiming this crate's encoder always writes TxMode::Largest. Inter frames write Select by default now, so the reader consumed the first tx_depth symbol as coefficient data and failed with a hallucinated empty-reference-slot refusal (class: test asserts against a stale header, second instance; the key-frame twin was fixed one merge ago). The entry point now takes tx_select and the tests pass Encoded::tx_select. --- crates/ec-av1/src/decode.rs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index e30bcee4..1a1bec92 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -32632,7 +32632,13 @@ pub(crate) fn decode_inter_frame_tile( force_integer_mv: bool, interp_fixed: Option, enable_dual_filter: bool, - reference_select: bool, fctx: &crate::decode::FrameCtx, + reference_select: bool, + // This frame header's `tx_mode == TxMode::Select`: `Encoded::tx_select`. + // Hard-coding `false` here desynced at the first `tx_depth` symbol once + // inter frames coded Select by default (class: test asserts against a + // stale header, second instance). + tx_select: bool, + fctx: &crate::decode::FrameCtx, ) -> Result { let single_tile = TileInfo { mi_col_starts: vec![0, mi_cols], @@ -32670,9 +32676,7 @@ pub(crate) fn decode_inter_frame_tile( false, [0; 2], true, - // `tx_select`: this raw entry point decodes this crate's own encoder's - // streams, which always write `TxMode::Largest`. - false, + tx_select, false, false, false, @@ -36763,7 +36767,9 @@ mod tests { false, Some(mc::InterpFilterKind::Regular), false, - false, fctx, + false, + false, + fctx, ) .unwrap_err(); let msg = err.to_string(); @@ -37157,7 +37163,9 @@ mod tests { false, Some(mc::InterpFilterKind::Regular), false, - false, fctx, + false, + frame.tx_select, + fctx, ) .unwrap(); assert_eq!( @@ -37466,7 +37474,9 @@ mod tests { false, Some(mc::InterpFilterKind::Regular), false, - false, fctx, + false, + frame.tx_select, + fctx, ) .unwrap(); assert_eq!(decoded.y, ffmpeg_frames[i].y, "frame {i} luma vs ffmpeg");