Wire decode::set_bit_depth from stream.rs per frame
Browse files at this commit1da7ad663d1681701174572ce5bb017ced7fea31Parent: 6820e1a- feat
- wire decode::set_bit_depth from stream.rs per frame
1 changed file +9 -0
crates/ec-av1/src/stream.rsmodified+9 -0
| @@ -418,6 +418,15 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> { | |||
| 418 | // inter frames are decoded on a thread that previously decoded a | 418 | // inter frames are decoded on a thread that previously decoded a |
| 419 | // different sequence would inherit that sequence's bit. | 419 | // different sequence would inherit that sequence's bit. |
| 420 | crate::decode::set_enable_edge_filter(enable_edge_filter); | 420 | 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); | ||
| 421 | // lane-av1comp: `comp_group_idx`/`compound_idx`'s own gating bits. | 430 | // lane-av1comp: `comp_group_idx`/`compound_idx`'s own gating bits. |
| 422 | let enable_masked_compound = parser | 431 | let enable_masked_compound = parser |
| 423 | .sequence_header() | 432 | .sequence_header() |