CropAndScale() makes offset_x and offset_y even if the U,V planes are
subsampled. This may result in the update rect being off by one. To
prevent that, always pass even offset_x and offset_y to CropAndScale().
Round the offset up when dividing crop size by 2 to make the cropping
more centered and symmetrical.
Note: The code was originally added in
https://webrtc-review.googlesource.com/c/src/+/123230.
Bug: webrtc:15910
Change-Id: I4a70d460702f03dee72a5b8292cb25766c3e6aca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/346323
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/main@{#42052}