From 1da7ad663d1681701174572ce5bb017ced7fea31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 30 Aug 2026 19:31:13 +0300 Subject: [PATCH] feat(av1): wire decode::set_bit_depth from stream.rs per frame BIT_DEPTH silently defaulted to 8 forever -- set_bit_depth existed (decode.rs) but nothing called it. stream.rs now reads seq.color_config.bit_depth per frame (defaulting to 8 with no sequence header yet, matching every fixture) and sets it right next to set_enable_edge_filter, for the same cross-sequence-on-one-thread reason. --- crates/ec-av1/src/stream.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 652590fc..a6aa4799 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -418,6 +418,15 @@ pub fn decode_stream(data: &[u8]) -> Result> { // inter frames are decoded on a thread that previously decoded a // different sequence would inherit that sequence's bit. crate::decode::set_enable_edge_filter(enable_edge_filter); + // lane-hbd r5: `BIT_DEPTH` (decode.rs) drives `crate::decode::sample_max`, + // which every dequant/inverse-transform clamp reads -- set per frame, + // not once per process, for the same cross-sequence-on-one-thread + // reason as `set_enable_edge_filter` above. Defaults to 8 when no + // sequence header has been seen yet, matching every existing fixture. + let bit_depth = parser + .sequence_header() + .map_or(8, |seq| seq.color_config.bit_depth); + crate::decode::set_bit_depth(bit_depth); // lane-av1comp: `comp_group_idx`/`compound_idx`'s own gating bits. let enable_masked_compound = parser .sequence_header()