forge
Explore
Log in

Don't you dare go Hollow

Force_integer_mv motion-mode gate asserts non-vacuity per attempt

Browse files at this commit

50503af092ea77b052d6770536f4108003fdabddAhmet Kaan GümüşParent: a9eda25
  • test
    • force_integer_mv motion-mode gate asserts non-vacuity per attempt
Show full message
test(av1): force_integer_mv motion-mode gate asserts non-vacuity per attempt

The r1 gate asserted `force_integer_mv frames > 0` and `forced-2-symbol
blocks > 0` only in aggregate over its 6 cq/step cells, so one lucky cell
would have carried five silently vacuous ones (class gate-blind-to-feature).
Both counters are now snapshotted per attempt and asserted after that
attempt's pixel compare: all 6/6 cells of each bit-depth arm carry
force_integer_mv=1 frames AND blocks forced onto the 2-symbol obmc
alphabet (114 frames / 342 blocks per arm).

Also documents at the `ref_is_scaled` site why libaom `av1_is_scaled`'s
y_scale_fp half is unreachable in this decoder: a reference whose height
differs from the frame's true size is refused before any tile decodes
(decode.rs ~14681), so the x-only test is exact here and the y term belongs
to whoever lifts that refusal.
crates/ec-av1/src/decode.rsmodified+6 -0
@@ -12395,6 +12395,12 @@ fn decode_inter_block(
1239512395 // per-frame value (spec 5.9.2: coded per frame only when
1239612396 // `seq_force_integer_mv == SELECT_INTEGER_MV`, threaded from
1239712397 // `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.
1239812404 let ref_is_scaled =
1239912405 mc::scale_factor(py_ref.width, frame_width) != mc::REF_NO_SCALE;
1240012406 let proj_ok = num_proj_ref(
crates/ec-av1/src/stream.rsmodified+20 -0
@@ -8171,6 +8171,13 @@ mod tests {
81718171 for cq in [32u32, 45, 55] {
81728172 for step in [4u32, 8] {
81738173 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();
81748181 let duration = frame_count as f64 / 25.0;
81758182 // Flat screen-content tiles with hard edges, translating by a
81768183 // whole number of pixels per frame: static enough for
@@ -8306,6 +8313,19 @@ mod tests {
83068313 assert_eq!(got.u, want.u, "{name} frame {i} U vs ffmpeg (cq {cq} step {step})");
83078314 assert_eq!(got.v, want.v, "{name} frame {i} V vs ffmpeg (cq {cq} step {step})");
83088315 }
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+ );
83098329 matched += 1;
83108330 }
83118331 }