mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-07 01:06:46 +08:00
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
This commit is contained in:
parent
5fcf38cfc8
commit
7aa2bf9284
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 775
|
Version: 776
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,6 @@
|
|||||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||||
#define INCLUDE_LIBYUV_VERSION_H_
|
#define INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|
||||||
#define LIBYUV_VERSION 775
|
#define LIBYUV_VERSION 776
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||||
|
|||||||
@ -22,6 +22,9 @@ namespace libyuv {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Remove this macro if OVERREAD is safe.
|
||||||
|
#define AVOID_OVERREAD 1
|
||||||
|
|
||||||
static __inline int Abs(int v) {
|
static __inline int Abs(int v) {
|
||||||
return v >= 0 ? v : -v;
|
return v >= 0 ? v : -v;
|
||||||
}
|
}
|
||||||
@ -741,6 +744,7 @@ static void ScaleRowDown38_2_Box_SSSE3(const uint8* src_ptr,
|
|||||||
#define HAS_SCALEADDROWS_SSE2
|
#define HAS_SCALEADDROWS_SSE2
|
||||||
|
|
||||||
// Reads 16xN bytes and produces 16 shorts at a time.
|
// 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))
|
__declspec(naked) __declspec(align(16))
|
||||||
static void ScaleAddRows_SSE2(const uint8* src_ptr, ptrdiff_t src_stride,
|
static void ScaleAddRows_SSE2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
uint16* dst_ptr, int src_width,
|
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 defined(HAS_SCALEADDROWS_SSE2)
|
||||||
if (TestCpuFlag(kCpuHasSSE2) &&
|
if (TestCpuFlag(kCpuHasSSE2) &&
|
||||||
|
#ifdef AVOID_OVERREAD
|
||||||
|
IS_ALIGNED(src_width, 16) &&
|
||||||
|
#endif
|
||||||
IS_ALIGNED(src_ptr, 16) && IS_ALIGNED(src_stride, 16)) {
|
IS_ALIGNED(src_ptr, 16) && IS_ALIGNED(src_stride, 16)) {
|
||||||
ScaleAddRows = ScaleAddRows_SSE2;
|
ScaleAddRows = ScaleAddRows_SSE2;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user