forge
Explore
Log in

Don't you dare go Hollow

The clamp gate's candidate is far outside the frame but inside the spec's MV width

Browse files at this commit

3ec98b77bd92a47049cedf7237da34db1e3357adAhmet Kaan GümüşParent: 3c15699
  • test
    • the clamp gate's candidate is far outside the frame but inside the spec's MV width
Show full message
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.rsmodified+4 -2
@@ -2712,11 +2712,13 @@ mod tests {
2712 // A 4x4-mi frame (16x16 px), block 1x1 mi at (1, 1): room for one2712 // A 4x4-mi frame (16x16 px), block 1x1 mi at (1, 1): room for one
2713 // neighbour above and one to the left, tight edges on every side.2713 // neighbour above and one to the left, tight edges on every side.
2714 let mut grid = MiGrid::new(4, 4);2714 let mut grid = MiGrid::new(4, 4);
2715- grid.set(0, 1, inter((100_000, 100_000)));2715+ // lane-migrid: far outside this 16x16-px frame, but inside the
2716+ // spec's own MV width (`MiInfo` stores libaom's `int16_t` mv).
2717+ grid.set(0, 1, inter((30_000, 30_000)));
2716 2718
2717 let stack = find_mv_stack(&grid, 1, 1, 1, 1, 1, 4, 4);2719 let stack = find_mv_stack(&grid, 1, 1, 1, 1, 1, 4, 4);
2718 2720
2719- // Unclamped this candidate is (100000, 100000); spec 7.10.2.14 caps2721+ // Unclamped this candidate is (30000, 30000); spec 7.10.2.14 caps
2720 // it at the frame edge (2 mi below/right) plus the block's own 4x42722 // it at the frame edge (2 mi below/right) plus the block's own 4x4
2721 // span plus MV_BORDER (128), all in 1/8-pel: (2*4)*8 + 1*4*8 + 128 =2723 // span plus MV_BORDER (128), all in 1/8-pel: (2*4)*8 + 1*4*8 + 128 =
2722 // 64 + 32 + 128 = 224.2724 // 64 + 32 + 128 = 224.