forge
Explore
Log in

Don't you dare go Hollow

Wire decode::set_bit_depth from stream.rs per frame

Browse files at this commit

1da7ad663d1681701174572ce5bb017ced7fea31Ahmet Kaan GümüşParent: 6820e1a
  • feat
    • wire decode::set_bit_depth from stream.rs per frame
Show full message
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.rsmodified+9 -0
@@ -418,6 +418,15 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> {
418418 // inter frames are decoded on a thread that previously decoded a
419419 // different sequence would inherit that sequence's bit.
420420 crate::decode::set_enable_edge_filter(enable_edge_filter);
421+ // lane-hbd r5: `BIT_DEPTH` (decode.rs) drives `crate::decode::sample_max`,
422+ // which every dequant/inverse-transform clamp reads -- set per frame,
423+ // not once per process, for the same cross-sequence-on-one-thread
424+ // reason as `set_enable_edge_filter` above. Defaults to 8 when no
425+ // sequence header has been seen yet, matching every existing fixture.
426+ let bit_depth = parser
427+ .sequence_header()
428+ .map_or(8, |seq| seq.color_config.bit_depth);
429+ crate::decode::set_bit_depth(bit_depth);
421430 // lane-av1comp: `comp_group_idx`/`compound_idx`'s own gating bits.
422431 let enable_masked_compound = parser
423432 .sequence_header()