From 3ec98b77bd92a47049cedf7237da34db1e3357ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sat, 5 Sep 2026 20:05:03 +0300 Subject: [PATCH] test(av1): the clamp gate's candidate is far outside the frame but inside the spec's MV width lane-migrid: the fixture stored 100000 in a motion vector, which the spec (and libaom's own int16_t `MV`) cannot represent; 30000 is still far past this 16x16-px frame's clamp window, so the expected clamped value is unchanged. --- crates/ec-av1/src/mvstack.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ec-av1/src/mvstack.rs b/crates/ec-av1/src/mvstack.rs index f6b05f7b..9ab02e5d 100644 --- a/crates/ec-av1/src/mvstack.rs +++ b/crates/ec-av1/src/mvstack.rs @@ -2712,11 +2712,13 @@ mod tests { // A 4x4-mi frame (16x16 px), block 1x1 mi at (1, 1): room for one // neighbour above and one to the left, tight edges on every side. let mut grid = MiGrid::new(4, 4); - grid.set(0, 1, inter((100_000, 100_000))); + // lane-migrid: far outside this 16x16-px frame, but inside the + // spec's own MV width (`MiInfo` stores libaom's `int16_t` mv). + grid.set(0, 1, inter((30_000, 30_000))); let stack = find_mv_stack(&grid, 1, 1, 1, 1, 1, 4, 4); - // Unclamped this candidate is (100000, 100000); spec 7.10.2.14 caps + // Unclamped this candidate is (30000, 30000); spec 7.10.2.14 caps // it at the frame edge (2 mi below/right) plus the block's own 4x4 // span plus MV_BORDER (128), all in 1/8-pel: (2*4)*8 + 1*4*8 + 128 = // 64 + 32 + 128 = 224.