Commit 7aa2bf92 authored by fbarchard@google.com's avatar fbarchard@google.com

Scale avoid overread for DrMemory

BUG=263
TEST=Scale unittests still pass with same performance.
R=mflodman@webrtc.org

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

git-svn-id: http://libyuv.googlecode.com/svn/trunk@776 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 5fcf38cf
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 775
Version: 776
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 775
#define LIBYUV_VERSION 776
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -22,6 +22,9 @@ namespace libyuv {
extern "C" {
#endif
// Remove this macro if OVERREAD is safe.
#define AVOID_OVERREAD 1
static __inline int Abs(int v) {
return v >= 0 ? v : -v;
}
......@@ -741,6 +744,7 @@ static void ScaleRowDown38_2_Box_SSSE3(const uint8* src_ptr,
#define HAS_SCALEADDROWS_SSE2
// Reads 16xN bytes and produces 16 shorts at a time.
// TODO(fbarchard): Make this handle 4xN bytes for any width ARGB.
__declspec(naked) __declspec(align(16))
static void ScaleAddRows_SSE2(const uint8* src_ptr, ptrdiff_t src_stride,
uint16* dst_ptr, int src_width,
......@@ -2046,6 +2050,9 @@ static void ScalePlaneBox(int src_width, int src_height,
}
#if defined(HAS_SCALEADDROWS_SSE2)
if (TestCpuFlag(kCpuHasSSE2) &&
#ifdef AVOID_OVERREAD
IS_ALIGNED(src_width, 16) &&
#endif
IS_ALIGNED(src_ptr, 16) && IS_ALIGNED(src_stride, 16)) {
ScaleAddRows = ScaleAddRows_SSE2;
}
......
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