Force_integer_mv motion-mode gate asserts non-vacuity per attempt
Browse files at this commit50503af092ea77b052d6770536f4108003fdabddParent: a9eda25- test
- force_integer_mv motion-mode gate asserts non-vacuity per attempt
2 changed files +26 -0
crates/ec-av1/src/decode.rsmodified+6 -0
| @@ -12395,6 +12395,12 @@ fn decode_inter_block( | |||
| 12395 | // per-frame value (spec 5.9.2: coded per frame only when | 12395 | // per-frame value (spec 5.9.2: coded per frame only when |
| 12396 | // `seq_force_integer_mv == SELECT_INTEGER_MV`, threaded from | 12396 | // `seq_force_integer_mv == SELECT_INTEGER_MV`, threaded from |
| 12397 | // `FrameHeader::force_integer_mv`). | 12397 | // `FrameHeader::force_integer_mv`). |
| 12398 | + // libaom `av1_is_scaled` is `x_scale_fp != REF_NO_SCALE || | ||
| 12399 | + // y_scale_fp != REF_NO_SCALE`; the y half is unreachable here | ||
| 12400 | + // because a reference whose height differs from this frame's | ||
| 12401 | + // true size is refused before any tile decodes ("a reference | ||
| 12402 | + // picture whose height does not match this frame's own true | ||
| 12403 | + // size", ~14681). Whoever lifts that refusal adds the y term. | ||
| 12398 | let ref_is_scaled = | 12404 | let ref_is_scaled = |
| 12399 | mc::scale_factor(py_ref.width, frame_width) != mc::REF_NO_SCALE; | 12405 | mc::scale_factor(py_ref.width, frame_width) != mc::REF_NO_SCALE; |
| 12400 | let proj_ok = num_proj_ref( | 12406 | let proj_ok = num_proj_ref( |
crates/ec-av1/src/stream.rsmodified+20 -0
| @@ -8171,6 +8171,13 @@ mod tests { | |||
| 8171 | for cq in [32u32, 45, 55] { | 8171 | for cq in [32u32, 45, 55] { |
| 8172 | for step in [4u32, 8] { | 8172 | for step in [4u32, 8] { |
| 8173 | attempts += 1; | 8173 | attempts += 1; |
| 8174 | + // lane-fimv r1: per-attempt snapshots. The aggregate | ||
| 8175 | + // assertions below are satisfied by a single lucky cq/step | ||
| 8176 | + // cell; these prove EVERY attempt that decoded and | ||
| 8177 | + // pixel-compared really carried the header state and the | ||
| 8178 | + // forced alphabet under test (class gate-blind-to-feature). | ||
| 8179 | + let attempt_fimv_before = crate::decode::fimv_frame_hits(); | ||
| 8180 | + let attempt_alphabet_before = crate::decode::fimv_alphabet_hits(); | ||
| 8174 | let duration = frame_count as f64 / 25.0; | 8181 | let duration = frame_count as f64 / 25.0; |
| 8175 | // Flat screen-content tiles with hard edges, translating by a | 8182 | // Flat screen-content tiles with hard edges, translating by a |
| 8176 | // whole number of pixels per frame: static enough for | 8183 | // whole number of pixels per frame: static enough for |
| @@ -8306,6 +8313,19 @@ mod tests { | |||
| 8306 | assert_eq!(got.u, want.u, "{name} frame {i} U vs ffmpeg (cq {cq} step {step})"); | 8313 | assert_eq!(got.u, want.u, "{name} frame {i} U vs ffmpeg (cq {cq} step {step})"); |
| 8307 | assert_eq!(got.v, want.v, "{name} frame {i} V vs ffmpeg (cq {cq} step {step})"); | 8314 | assert_eq!(got.v, want.v, "{name} frame {i} V vs ffmpeg (cq {cq} step {step})"); |
| 8308 | } | 8315 | } |
| 8316 | + assert!( | ||
| 8317 | + crate::decode::fimv_frame_hits() > attempt_fimv_before, | ||
| 8318 | + "{name} (cq {cq} step {step}): decoded and compared all \ | ||
| 8319 | + frames but no frame header had force_integer_mv=1 -- \ | ||
| 8320 | + this attempt is vacuous" | ||
| 8321 | + ); | ||
| 8322 | + assert!( | ||
| 8323 | + crate::decode::fimv_alphabet_hits() > attempt_alphabet_before, | ||
| 8324 | + "{name} (cq {cq} step {step}): no block was forced onto the \ | ||
| 8325 | + 2-symbol obmc alphabet by force_integer_mv while \ | ||
| 8326 | + allow_warped_motion=1 and num_proj_ref>=1 -- this attempt \ | ||
| 8327 | + is vacuous" | ||
| 8328 | + ); | ||
| 8309 | matched += 1; | 8329 | matched += 1; |
| 8310 | } | 8330 | } |
| 8311 | } | 8331 | } |