64 bit clip for argb scale down

BUG=302
TEST=out\release\libyuv_unittest --gtest_filter=*ARGBScaleDownClipBy3by4*
R=tpsiaki@google.com

Review URL: https://webrtc-codereview.appspot.com/6549004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@947 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
fbarchard@google.com 2014-01-03 02:13:35 +00:00
parent 909c76e317
commit c23b817eab
3 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 946
Version: 947
License: BSD
License File: LICENSE

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 946
#define LIBYUV_VERSION 947
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT

View File

@ -171,9 +171,9 @@ static void ScaleARGBBilinearDown(int src_width, int src_height,
assert(src_height > 0);
assert(dst_width > 0);
assert(dst_height > 0);
int xlast = x + (dst_width - 1) * dx;
int xl = (dx >= 0) ? x : xlast;
int xr = (dx >= 0) ? xlast : x;
int64 xlast = x + static_cast<int64>(dst_width - 1) * dx;
int64 xl = (dx >= 0) ? x : xlast;
int64 xr = (dx >= 0) ? xlast : x;
xl = (xl >> 16) & ~3; // Left edge aligned.
xr = (xr >> 16) + 1; // Right most pixel used.
int clip_src_width = (((xr - xl) + 1 + 3) & ~3) * 4; // Width aligned to 4.