forge
Explore
Log in

Don't you dare go Hollow

Compile r4's delta_q wiring -- inter-frame path finish

Browse files at this commit

457c077c08d59a6ba3815ada379085248521887cAhmet Kaan GümüşParent: ceb740d
  • fix
    • compile r4's delta_q wiring -- inter-frame path finish
Show full message
fix(av1): compile r4's delta_q wiring -- inter-frame path finish

decode_inter_frame_tile_with_cdfs was missing the DeltaParams param r4
threaded through the key-frame path only (decode.rs:9579 signature,
tile-entry DELTA_Q_PRESENT/DELTA_Q_RES/CURRENT_Q_IDX reset). Both
stream.rs call sites now pass header.delta. Narrowed the whole-frame
refusal to delta_lf_present only, since delta_q is now genuinely read
(maybe_read_delta_q fires on both key and inter frames); delta_lf still
has no deblocker consumer so it keeps refusing by name under a new
string: "a frame with delta_lf_present set (this decoder never applies
per-superblock loop-filter deltas)" (replaces the old combined
delta_q_present-or-delta_lf_present refusal).
crates/ec-av1/src/decode.rsmodified+10 -0
@@ -9636,6 +9636,10 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
9636 // palette syntax libaom's `read_intra_block_mode_info` reads under the9636 // palette syntax libaom's `read_intra_block_mode_info` reads under the
9637 // same `av1_allow_palette` gate as the key-frame path.9637 // same `av1_allow_palette` gate as the key-frame path.
9638 allow_screen_content_tools: bool,9638 allow_screen_content_tools: bool,
9639+ // lane-realworld r5: this frame header's own `delta` (spec 5.9.17/5.9.18),
9640+ // same contract as [`decode_key_frame_tile_with_cdfs`]'s own `delta`
9641+ // param -- only `q_present`/`q_res` are read.
9642+ delta: DeltaParams,
9639 ) -> Result<(Picture, Cdfs, crate::motion_field::MotionField)> {9643 ) -> Result<(Picture, Cdfs, crate::motion_field::MotionField)> {
9640 let tpl_frame = tpl_field.map(|field| TplFrameArgs {9644 let tpl_frame = tpl_field.map(|field| TplFrameArgs {
9641 field,9645 field,
@@ -9765,6 +9769,12 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
9765 let scan4 = default_scan(TX4);9769 let scan4 = default_scan(TX4);
9766 9770
9767 let mut cdfs = initial_cdfs.unwrap_or_else(|| Cdfs::new(q_ctx_of(base_q_idx)));9771 let mut cdfs = initial_cdfs.unwrap_or_else(|| Cdfs::new(q_ctx_of(base_q_idx)));
9772+ // spec `decode_tile`: `CurrentQIndex` resets to the frame's own
9773+ // `base_q_idx` at the top of every tile (single tile here, same as
9774+ // `decode_key_frame_tile_with_cdfs`'s per-tile reset).
9775+ DELTA_Q_PRESENT.with(|c| c.set(delta.q_present));
9776+ DELTA_Q_RES.with(|c| c.set(1i32 << delta.q_res));
9777+ CURRENT_Q_IDX.with(|c| c.set(i32::from(base_q_idx)));
9768 let mut dec = SymbolDecoder::new(data);9778 let mut dec = SymbolDecoder::new(data);
9769 // lane-comppin r9: tile-entry range, the earliest point comparable9779 // lane-comppin r9: tile-entry range, the earliest point comparable
9770 // against aomdec's own `r->ec.rng` right after `aom_reader_init` -- the9780 // against aomdec's own `r->ec.rng` right after `aom_reader_init` -- the
crates/ec-av1/src/stream.rsmodified+8 -2
@@ -165,10 +165,14 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> {
165 // intrabc call at all -- that symbol is intra-frame-only). A165 // intrabc call at all -- that symbol is intra-frame-only). A
166 // genuine palette/intrabc use still refuses by name deeper in the166 // genuine palette/intrabc use still refuses by name deeper in the
167 // block readers, so no whole-frame refusal is needed here anymore.167 // block readers, so no whole-frame refusal is needed here anymore.
168- if header.delta.q_present || header.delta.lf_present {168+ // lane-realworld r5: delta_q is now read (maybe_read_delta_q,
169+ // CURRENT_Q_IDX) -- only delta_lf still lacks a deblocker consumer
170+ // (MiGrid/fill_lf_grid needs a new per-block field), so only that
171+ // half still refuses by name.
172+ if header.delta.lf_present {
169 return Err(Error::unsupported(173 return Err(Error::unsupported(
170 "AV1 decode_stream",174 "AV1 decode_stream",
171- "a frame with delta_q_present or delta_lf_present set (this decoder never reads the per-superblock delta symbols)",175+ "a frame with delta_lf_present set (this decoder never applies per-superblock loop-filter deltas)",
172 ));176 ));
173 }177 }
174 if header.segmentation.enabled {178 if header.segmentation.enabled {
@@ -420,6 +424,7 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> {
420 header.reduced_tx_set,424 header.reduced_tx_set,
421 header.allow_screen_content_tools,425 header.allow_screen_content_tools,
422 header.allow_intrabc,426 header.allow_intrabc,
427+ header.delta,
423 )?;428 )?;
424 // A key frame codes no inter blocks -- its own saved motion429 // A key frame codes no inter blocks -- its own saved motion
425 // field has no cells set, matching libaom's own "intra frame430 // field has no cells set, matching libaom's own "intra frame
@@ -503,6 +508,7 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> {
503 header.is_motion_mode_switchable,508 header.is_motion_mode_switchable,
504 header.allow_warped_motion,509 header.allow_warped_motion,
505 header.allow_screen_content_tools,510 header.allow_screen_content_tools,
511+ header.delta,
506 )?512 )?
507 };513 };
508 // Spec 7.20: `disable_frame_end_update_cdf` stores the frame's514 // Spec 7.20: `disable_frame_end_update_cdf` stores the frame's