Commit b50e0572 authored by fbarchard@google.com's avatar fbarchard@google.com

Save and restore last 16 bytes of filtered rows when used for ARGBInterpolate.

BUG=50
TEST=none
Review URL: https://webrtc-codereview.appspot.com/673012

git-svn-id: http://libyuv.googlecode.com/svn/trunk@303 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 05b5cf96
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 302
Version: 303
License: BSD
License File: LICENSE
......
......@@ -217,6 +217,7 @@ int ARGBShade(const uint8* src_argb, int src_stride_argb,
// 'interpolation' is specified as 8 bit fraction where 0 means 100% src_argb0
// and 255 means 1% src_argb0 and 99% src_argb1.
// Internally uses ARGBScale bilinear filtering.
// Caveat: This function will write up to 16 bytes beyond the end of dst_argb.
int ARGBInterpolate(const uint8* src_argb0, int src_stride_argb0,
const uint8* src_argb1, int src_stride_argb1,
uint8* dst_argb, int dst_stride_argb,
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 302
#define LIBYUV_VERSION 303
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -1147,9 +1147,13 @@ int ARGBInterpolate(const uint8* src_argb0, int src_stride_argb0,
ScaleARGBFilterRows = ScaleARGBFilterRows_SSSE3;
}
#endif
uint8 last16[16];
for (int y = 0; y < height; ++y) {
// Filter extrudes edge for its scaling purpose.
memcpy(last16, dst_argb + width * 4, 16); // Save last 16 beyond end.
ScaleARGBFilterRows(dst_argb, src_argb0, src_argb1 - src_argb0,
width, interpolation);
memcpy(dst_argb + width * 4, last16, 16); // Restore last 16 beyond end.
src_argb0 += src_stride_argb0;
src_argb1 += src_stride_argb1;
dst_argb += dst_stride_argb;
......
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