Compile r4's delta_q wiring -- inter-frame path finish
Browse files at this commit457c077c08d59a6ba3815ada379085248521887cParent: ceb740d- fix
- compile r4's delta_q wiring -- inter-frame path finish
2 changed files +18 -2
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 the | 9636 | // 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 comparable | 9779 | // lane-comppin r9: tile-entry range, the earliest point comparable |
| 9770 | // against aomdec's own `r->ec.rng` right after `aom_reader_init` -- the | 9780 | // 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). A | 165 | // intrabc call at all -- that symbol is intra-frame-only). A |
| 166 | // genuine palette/intrabc use still refuses by name deeper in the | 166 | // 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 motion | 429 | // A key frame codes no inter blocks -- its own saved motion |
| 425 | // field has no cells set, matching libaom's own "intra frame | 430 | // 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's | 514 | // Spec 7.20: `disable_frame_end_update_cdf` stores the frame's |