diff options
author | Frank Barchard <fbarchard@chromium.org> | 2018-10-03 12:10:41 -0700 |
---|---|---|
committer | Frank Barchard <fbarchard@chromium.org> | 2018-10-03 19:14:01 +0000 |
commit | 20bf569a049bc5f4a4954c401cc6fff11d453274 (patch) | |
tree | aa0bab8e93be70010f58328d98362433be03cf95 /source/scale_common.cc | |
parent | 9a07219dc8fbf2b77e390d16bd24809444838a91 (diff) | |
download | libyuv-20bf569a049bc5f4a4954c401cc6fff11d453274.tar.gz |
Fix ConvertToI420() for odd crop_y
The original src_u calculation of FOURCC_I420 shifted half width if
crop_y is odd.
This CL fixs the problem and also add a test case for it.
Bug: b:115278653
Test: pass libyuv_unittest
Change-Id: Ia9732d22e64e13de26df47726ba44ad1c5a06484
Reviewed-on: https://chromium-review.googlesource.com/c/1258743
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source/scale_common.cc')
-rw-r--r-- | source/scale_common.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/scale_common.cc b/source/scale_common.cc index a94fe9f8..63690271 100644 --- a/source/scale_common.cc +++ b/source/scale_common.cc @@ -542,7 +542,9 @@ void ScaleFilterCols64_C(uint8_t* dst_ptr, // Same as 8 bit arm blender but return is cast to uint16_t #define BLENDER(a, b, f) \ - (uint16_t)((int)(a) + (int)((((int64_t)((f)) * ((int64_t)(b) - (int)(a))) + 0x8000) >> 16)) + (uint16_t)( \ + (int)(a) + \ + (int)((((int64_t)((f)) * ((int64_t)(b) - (int)(a))) + 0x8000) >> 16)) void ScaleFilterCols_16_C(uint16_t* dst_ptr, const uint16_t* src_ptr, |