From b432b7da2d8dd78db1fb4621f1be1a3c12d49cb2 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Mon, 6 May 2013 05:36:58 +0000 Subject: [PATCH] Fix for clobber registers on SumSquareError_SSE2 used for PSNR BUG=none TEST=none Review URL: https://webrtc-codereview.appspot.com/1410004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@683 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/compare_posix.cc | 2 +- util/psnr.cc | 2 +- util/ssim.cc | 9 +++++---- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.chromium b/README.chromium index 3543ef79c..4fc980308 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 682 +Version: 683 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index e29ce16b5..74545dbcf 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 682 +#define LIBYUV_VERSION 683 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/compare_posix.cc b/source/compare_posix.cc index 6f9c260a0..f24835d77 100644 --- a/source/compare_posix.cc +++ b/source/compare_posix.cc @@ -56,7 +56,7 @@ uint32 SumSquareError_SSE2(const uint8* src_a, const uint8* src_b, int count) { : : "memory", "cc" #if defined(__SSE2__) - , "xmm0", "xmm1", "xmm2", "xmm5" + , "xmm0", "xmm1", "xmm2", "xmm3", "xmm5" #endif ); return sse; diff --git a/util/psnr.cc b/util/psnr.cc index 01b61fc80..85ada628b 100644 --- a/util/psnr.cc +++ b/util/psnr.cc @@ -159,7 +159,7 @@ static uint32 SumSquareError_SSE2(const uint8* src_a, : : "memory", "cc" #if defined(__SSE2__) - , "xmm0", "xmm1", "xmm2", "xmm5" + , "xmm0", "xmm1", "xmm2", "xmm3", "xmm5" #endif ); // NOLINT return sse; diff --git a/util/ssim.cc b/util/ssim.cc index 2131b886b..f2aca02fd 100644 --- a/util/ssim.cc +++ b/util/ssim.cc @@ -20,10 +20,11 @@ extern "C" { typedef unsigned int uint32; // NOLINT typedef unsigned short uint16; // NOLINT -#if defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) +#if !defined(LIBYUV_DISABLE_X86) && \ + (defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 2))) #define __SSE2__ #endif -#ifdef __SSE2__ +#if !defined(LIBYUV_DISABLE_X86) && defined(__SSE2__) #include #endif @@ -48,7 +49,7 @@ static const double kiW[KERNEL + 1 + 1] = { 1. / 726., // 1 / sum(i:0..3, j..6) K[i]*K[j] }; -#ifdef __SSE2__ +#if !defined(LIBYUV_DISABLE_X86) && defined(__SSE2__) #define PWEIGHT(A, B) static_cast(K[(A)] * K[(B)]) // weight product #define MAKE_WEIGHT(L) \ @@ -130,7 +131,7 @@ double GetSSIMFullKernel(const uint8 *org, const uint8 *rec, double area_weight) { uint32 xm = 0, ym = 0, xxm = 0, xym = 0, yym = 0; -#ifndef __SSE2__ +#if defined(LIBYUV_DISABLE_X86) || !defined(__SSE2__) org += yo * stride + xo; rec += yo * stride + xo;