Arbitrary-sized motion detection in screen video coding