Commit 15c3d45c authored by fbarchard@google.com's avatar fbarchard@google.com

Change WIN32 to _M_IX86 and use YUV_DISABLE_ASM consistently

BUG=none
TEST=none
Review URL: http://webrtc-codereview.appspot.com/277008

git-svn-id: http://libyuv.googlecode.com/svn/trunk@84 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 1c2d8be1
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 83
Version: 84
License: BSD
License File: LICENSE
......
......@@ -15,11 +15,11 @@
#include "libyuv/basic_types.h"
#include "libyuv/cpu_id.h"
#include "row.h"
namespace libyuv {
#if defined(__ARM_NEON__) && \
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
#define HAS_SUMSQUAREERROR_NEON
static uint32 SumSquareError_NEON(const uint8* src_a,
......@@ -59,8 +59,7 @@ static uint32 SumSquareError_NEON(const uint8* src_a,
return sse;
}
#elif defined(WIN32) && \
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#elif defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_SUMSQUAREERROR_SSE2
__declspec(naked)
static uint32 SumSquareError_SSE2(const uint8* src_a,
......@@ -100,8 +99,7 @@ static uint32 SumSquareError_SSE2(const uint8* src_a,
}
}
#elif (defined(__x86_64__) || defined(__i386__)) && \
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_SUMSQUAREERROR_SSE2
static uint32 SumSquareError_SSE2(const uint8* src_a,
const uint8* src_b, int count) {
......
......@@ -8,12 +8,11 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "row.h"
#include <assert.h>
#include "libyuv/basic_types.h"
#include "libyuv/cpu_id.h"
#include "row.h"
#include "video_common.h"
namespace libyuv {
......@@ -22,7 +21,7 @@ namespace libyuv {
// and vst would select which 2 components to write. The low level would need
// to be ARGBToBG, ARGBToGB, ARGBToRG, ARGBToGR
#if defined(WIN32) && !defined(COVERAGE_ENABLED)
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_ARGBTOBAYERROW_SSSE3
__declspec(naked)
static void ARGBToBayerRow_SSSE3(const uint8* src_argb,
......@@ -46,8 +45,7 @@ static void ARGBToBayerRow_SSSE3(const uint8* src_argb,
}
}
#elif (defined(__x86_64__) || defined(__i386__)) && \
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_ARGBTOBAYERROW_SSSE3
static void ARGBToBayerRow_SSSE3(const uint8* src_argb, uint8* dst_bayer,
......
......@@ -17,7 +17,7 @@
namespace libyuv {
#if defined(__ARM_NEON__) && !defined(DISABLE_ASM)
#if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
#define HAS_SPLITUV_NEON
// Reads 16 pairs of UV and write even values to dst_u and odd to dst_v
// Alignment requirement: 16 bytes for pointers, and multiple of 16 pixels.
......@@ -39,7 +39,7 @@ static void SplitUV_NEON(const uint8* src_uv,
);
}
#elif defined(WIN32) && !defined(DISABLE_ASM)
#elif defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_SPLITUV_SSE2
__declspec(naked)
static void SplitUV_SSE2(const uint8* src_uv,
......@@ -76,7 +76,7 @@ static void SplitUV_SSE2(const uint8* src_uv,
}
}
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(DISABLE_ASM)
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_SPLITUV_SSE2
static void SplitUV_SSE2(const uint8* src_uv,
uint8* dst_u, uint8* dst_v, int pix) {
......@@ -230,7 +230,7 @@ int I420Mirror(const uint8* src_y, int src_stride_y,
// SetRows32 writes 'count' bytes using a 32 bit value repeated
#if defined(__ARM_NEON__) && !defined(DISABLE_ASM)
#if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
#define HAS_SETROW_NEON
static void SetRow32_NEON(uint8* dst, uint32 v32, int count) {
asm volatile (
......@@ -246,7 +246,7 @@ static void SetRow32_NEON(uint8* dst, uint32 v32, int count) {
);
}
#elif defined(WIN32) && !defined(DISABLE_ASM)
#elif defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_SETROW_SSE2
__declspec(naked)
static void SetRow32_SSE2(uint8* dst, uint32 v32, int count) {
......@@ -265,7 +265,7 @@ static void SetRow32_SSE2(uint8* dst, uint32 v32, int count) {
}
}
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(DISABLE_ASM)
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_SETROW_SSE2
static void SetRow32_SSE2(uint8* dst, uint32 v32, int count) {
......@@ -360,7 +360,7 @@ int I420Rect(uint8* dst_y, int dst_stride_y,
return 0;
}
#if defined(WIN32) && !defined(DISABLE_ASM)
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_HALFROW_SSE2
__declspec(naked)
static void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
......@@ -385,7 +385,7 @@ static void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
}
}
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(DISABLE_ASM)
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_HALFROW_SSE2
static void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
uint8* dst_uv, int pix) {
......@@ -603,7 +603,7 @@ int NV12ToI420(const uint8* src_y,
width, height);
}
#if defined(WIN32) && !defined(DISABLE_ASM)
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_SPLITYUY2_SSE2
__declspec(naked)
static void SplitYUY2_SSE2(const uint8* src_yuy2,
......@@ -651,8 +651,7 @@ static void SplitYUY2_SSE2(const uint8* src_yuy2,
}
}
#elif (defined(__x86_64__) || defined(__i386__)) && \
!defined(DISABLE_ASM)
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_SPLITYUY2_SSE2
static void SplitYUY2_SSE2(const uint8* src_yuy2, uint8* dst_y,
uint8* dst_u, uint8* dst_v, int pix) {
......@@ -762,7 +761,7 @@ int Q420ToI420(const uint8* src_y, int src_stride_y,
return 0;
}
#if defined(WIN32) && !defined(DISABLE_ASM)
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_YUY2TOI420ROW_SSE2
__declspec(naked)
void YUY2ToI420RowY_SSE2(const uint8* src_yuy2,
......@@ -899,8 +898,7 @@ void UYVYToI420RowUV_SSE2(const uint8* src_uyvy, int stride_uyvy,
}
}
#elif (defined(__x86_64__) || defined(__i386__)) && \
!defined(DISABLE_ASM)
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_YUY2TOI420ROW_SSE2
static void YUY2ToI420RowY_SSE2(const uint8* src_yuy2,
......
......@@ -17,8 +17,8 @@
namespace libyuv {
#if (defined(WIN32) || defined(__x86_64__) || defined(__i386__)) && \
!defined(LIBYUV_DISABLE_ASM)
#if (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) && \
!defined(YUV_DISABLE_ASM)
// Note static const preferred, but gives internal compiler error on gcc 4.2
// Shuffle table for reversing the bytes.
uvec8 kShuffleReverse = {
......@@ -58,7 +58,7 @@ void TransposeUVWx8_NEON(const uint8* src, int src_stride,
int width);
#endif
#if defined(WIN32) && !defined(LIBYUV_DISABLE_ASM)
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_TRANSPOSE_WX8_SSSE3
__declspec(naked)
static void TransposeWx8_SSSE3(const uint8* src, int src_stride,
......@@ -276,8 +276,7 @@ __asm {
ret
}
}
#elif (defined(__i386__) || defined(__x86_64__)) && \
!defined(LIBYUV_DISABLE_ASM) && !defined(TARGET_IPHONE_SIMULATOR)
#elif (defined(__i386__) || defined(__x86_64__)) && !defined(YUV_DISABLE_ASM)
#define HAS_TRANSPOSE_WX8_SSSE3
static void TransposeWx8_SSSE3(const uint8* src, int src_stride,
uint8* dst, int dst_stride, int width) {
......@@ -854,7 +853,7 @@ static void ReverseRow_C(const uint8* src, uint8* dst, int width) {
}
}
#if defined(WIN32) && !defined(LIBYUV_DISABLE_ASM)
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_REVERSE_ROW_SSSE3
__declspec(naked)
static void ReverseRow_SSSE3(const uint8* src, uint8* dst, int width) {
......@@ -877,7 +876,7 @@ __asm {
}
#elif (defined(__i386__) || defined(__x86_64__)) && \
!defined(LIBYUV_DISABLE_ASM) && !defined(TARGET_IPHONE_SIMULATOR)
!defined(YUV_DISABLE_ASM)
#define HAS_REVERSE_ROW_SSSE3
static void ReverseRow_SSSE3(const uint8* src, uint8* dst, int width) {
intptr_t temp_width = static_cast<intptr_t>(width);
......@@ -1053,7 +1052,7 @@ void RotateUV270(const uint8* src, int src_stride,
width, height);
}
#if defined(WIN32) && !defined(LIBYUV_DISABLE_ASM)
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_REVERSE_ROW_UV_SSSE3
__declspec(naked)
void ReverseRowUV_SSSE3(const uint8* src,
......@@ -1084,7 +1083,7 @@ __asm {
}
#elif (defined(__i386__) || defined(__x86_64__)) && \
!defined(LIBYUV_DISABLE_ASM) && !defined(TARGET_IPHONE_SIMULATOR)
!defined(YUV_DISABLE_ASM)
#define HAS_REVERSE_ROW_UV_SSSE3
void ReverseRowUV_SSSE3(const uint8* src,
uint8* dst_a, uint8* dst_b,
......
......@@ -9,11 +9,11 @@
*/
#include "libyuv/basic_types.h"
#include "row.h"
namespace libyuv {
#if defined(__ARM_NEON__) && \
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
void ReverseRow_NEON(const uint8* src, uint8* dst, int width) {
asm volatile (
......
......@@ -49,7 +49,7 @@ void SetUseReferenceImpl(bool use) {
*
*/
#if defined(__ARM_NEON__) && !defined(COVERAGE_ENABLED)
#if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
#define HAS_SCALEROWDOWN2_NEON
void ScaleRowDown2_NEON(const uint8* src_ptr, int /* src_stride */,
uint8* dst, int dst_width) {
......@@ -505,8 +505,8 @@ static void ScaleRowDown38_2_Int_NEON(const uint8* src_ptr, int src_stride,
*/
// Constants for SSE2 code
#elif (defined(WIN32) || defined(__i386__) || defined(__x86_64__)) && \
!defined(COVERAGE_ENABLED) && !TARGET_IPHONE_SIMULATOR
#elif (defined(_M_IX86) || defined(__i386__) || defined(__x86_64__)) && \
!defined(YUV_DISABLE_ASM)
#if defined(_MSC_VER)
#define TALIGN16(t, var) __declspec(align(16)) t _ ## var
#elif defined(OSX) && defined(__i386__)
......@@ -590,7 +590,7 @@ extern "C" TALIGN16(const uint16, scaleab2[8]) =
{ 65536 / 3, 65536 / 3, 65536 / 2, 65536 / 3, 65536 / 3, 65536 / 2, 0, 0 };
#endif
#if defined(WIN32) && !defined(COVERAGE_ENABLED)
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_SCALEROWDOWN2_SSE2
// Reads 32 pixels, throws half away and writes 16 pixels.
......@@ -1444,8 +1444,7 @@ static void ScaleFilterCols34_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
}
}
#elif (defined(__x86_64__) || defined(__i386__)) && \
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
// GCC versions of row functions are verbatim conversions from Visual C.
// Generated using gcc disassembly on Visual C object file:
......
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