diff options
author | fbarchard@google.com <fbarchard@google.com> | 2015-03-26 23:21:08 +0000 |
---|---|---|
committer | fbarchard@google.com <fbarchard@google.com> | 2015-03-26 23:21:08 +0000 |
commit | e6ca9cc2a2e01ca7bdd7dbed92b87c6f7f4d1c98 (patch) | |
tree | c5670707d2d8284dff12a6b1967e53379f697e85 /include/libyuv/scale_row.h | |
parent | f16f33d4ce8e6a1c40e2426ad7b457d2927bb4f7 (diff) | |
download | libyuv-e6ca9cc2a2e01ca7bdd7dbed92b87c6f7f4d1c98.tar.gz |
Scale down by 2 AVX2 port. Processes twice as many pixels as SSE2 and takes advantage of 3 argument instructions to reduce register usage and number of instructions.
BUG=314
TESTED=libyuvTest.ScaleDownBy2_Box
R=tpsiaki@google.com
Review URL: https://webrtc-codereview.appspot.com/42959004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1347 16f28f9a-4ce2-e073-06de-1de4eb20be90
Diffstat (limited to 'include/libyuv/scale_row.h')
-rw-r--r-- | include/libyuv/scale_row.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/libyuv/scale_row.h b/include/libyuv/scale_row.h index 07033fe7..1fea6ce1 100644 --- a/include/libyuv/scale_row.h +++ b/include/libyuv/scale_row.h @@ -23,6 +23,13 @@ extern "C" { #define LIBYUV_DISABLE_X86 #endif +// Visual C 2012 required for AVX2. +#if defined(_M_IX86) && !defined(__clang__) && \ + defined(_MSC_VER) && _MSC_VER >= 1700 +#define VISUALC_HAS_AVX2 1 +#endif // VisualStudio >= 2012 + + // The following are available on all x86 platforms: #if !defined(LIBYUV_DISABLE_X86) && \ (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) @@ -42,6 +49,11 @@ extern "C" { #define HAS_FIXEDDIV1_X86 #endif +// The following are available on VS2012. +#if !defined(LIBYUV_DISABLE_X86) && defined(VISUALC_HAS_AVX2) +#define HAS_SCALEROWDOWN2_AVX2 +#endif + // The following are available on Neon platforms: #if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \ (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) @@ -202,6 +214,8 @@ void ScaleRowDown2Linear_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, uint8* dst_ptr, int dst_width); void ScaleRowDown2Box_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, uint8* dst_ptr, int dst_width); +void ScaleRowDown2Box_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); void ScaleRowDown4_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, uint8* dst_ptr, int dst_width); void ScaleRowDown4Box_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, @@ -228,6 +242,8 @@ void ScaleRowDown2Linear_Any_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, uint8* dst_ptr, int dst_width); void ScaleRowDown2Box_Any_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, uint8* dst_ptr, int dst_width); +void ScaleRowDown2Box_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride, + uint8* dst_ptr, int dst_width); void ScaleAddRows_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, uint16* dst_ptr, int src_width, int src_height); |