Commit 667de22f authored by fbarchard@google.com's avatar fbarchard@google.com

clip by adjusting pointer

BUG=302
TEST=ARGBScaleDownClipBy2_None
R=tpsiaki@google.com

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

git-svn-id: http://libyuv.googlecode.com/svn/trunk@945 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 6dc80ab5
...@@ -676,11 +676,15 @@ static void ScaleARGB(const uint8* src, int src_stride, ...@@ -676,11 +676,15 @@ static void ScaleARGB(const uint8* src, int src_stride,
ScaleSlope(src_width, src_height, dst_width, dst_height, filtering, ScaleSlope(src_width, src_height, dst_width, dst_height, filtering,
&x, &y, &dx, &dy); &x, &y, &dx, &dy);
if (clip_x) { if (clip_x) {
x += clip_x * dx; int64 clipf = static_cast<int64>(clip_x) * dx;
x += (clipf & 0xffff);
src += (clipf >> 16) * 4;
dst += clip_x * 4; dst += clip_x * 4;
} }
if (clip_y) { if (clip_y) {
y += clip_y * dy; int64 clipf = static_cast<int64>(clip_y) * dy;
y += (clipf & 0xffff);
src += (clipf >> 16) * src_stride;
dst += clip_y * dst_stride; dst += clip_y * dst_stride;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment