mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
simplify checks for enabling SSE2 code
also fixes build issues under vs11 which has a native arm compiler for windows 8 targets Change-Id: Id76c2deae9fc9de147d13ad0d34edffcb5a726c4
This commit is contained in:
parent
7937b409e7
commit
f06817aaea
@ -37,11 +37,11 @@ static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) {
|
||||
: "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
|
||||
: "a"(info_type));
|
||||
}
|
||||
#elif defined(_MSC_VER) // Visual C++
|
||||
#elif defined(WEBP_MSC_SSE2)
|
||||
#define GetCPUInfo __cpuid
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER)
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(WEBP_MSC_SSE2)
|
||||
static int x86CPUInfo(CPUFeature feature) {
|
||||
int cpu_info[4];
|
||||
GetCPUInfo(cpu_info, 1);
|
||||
|
@ -715,7 +715,7 @@ void VP8DspInit(void) {
|
||||
|
||||
// If defined, use CPUInfo() to overwrite some pointers with faster versions.
|
||||
if (VP8GetCPUInfo) {
|
||||
#if defined(__SSE2__) || defined(_MSC_VER)
|
||||
#if defined(WEBP_USE_SSE2)
|
||||
if (VP8GetCPUInfo(kSSE2)) {
|
||||
VP8DspInitSSE2();
|
||||
}
|
||||
|
@ -10,7 +10,9 @@
|
||||
// Author: somnath@google.com (Somnath Banerjee)
|
||||
// cduvivier@google.com (Christian Duvivier)
|
||||
|
||||
#if defined(__SSE2__) || defined(_MSC_VER)
|
||||
#include "./dsp.h"
|
||||
|
||||
#if defined(WEBP_USE_SSE2)
|
||||
|
||||
#include <emmintrin.h>
|
||||
#include "../dec/vp8i.h"
|
||||
@ -898,4 +900,4 @@ void VP8DspInitSSE2(void) {
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif //__SSE2__ || _MSC_VER
|
||||
#endif // WEBP_USE_SSE2
|
||||
|
@ -21,6 +21,14 @@ extern "C" {
|
||||
//------------------------------------------------------------------------------
|
||||
// CPU detection
|
||||
|
||||
#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))
|
||||
#define WEBP_MSC_SSE2 // Visual C++ SSE2 targets
|
||||
#endif
|
||||
|
||||
#if defined(__SSE2__) || defined(WEBP_MSC_SSE2)
|
||||
#define WEBP_USE_SSE2
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
kSSE2,
|
||||
kSSE3,
|
||||
|
@ -9,6 +9,7 @@
|
||||
//
|
||||
// Author: Skal (pascal.massimino@gmail.com)
|
||||
|
||||
#include "./dsp.h"
|
||||
#include "../enc/vp8enci.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
@ -734,7 +735,7 @@ void VP8EncDspInit(void) {
|
||||
|
||||
// If defined, use CPUInfo() to overwrite some pointers with faster versions.
|
||||
if (VP8GetCPUInfo) {
|
||||
#if defined(__SSE2__) || defined(_MSC_VER)
|
||||
#if defined(WEBP_USE_SSE2)
|
||||
if (VP8GetCPUInfo(kSSE2)) {
|
||||
VP8EncDspInitSSE2();
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
//
|
||||
// Author: Christian Duvivier (cduvivier@google.com)
|
||||
|
||||
#if defined(__SSE2__) || defined(_MSC_VER)
|
||||
#include "./dsp.h"
|
||||
|
||||
#if defined(WEBP_USE_SSE2)
|
||||
#include <emmintrin.h>
|
||||
|
||||
#include "../enc/vp8enci.h"
|
||||
@ -831,4 +833,4 @@ void VP8EncDspInitSSE2(void) {
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif //__SSE2__
|
||||
#endif // WEBP_USE_SSE2
|
||||
|
@ -227,7 +227,7 @@ void WebPInitUpsamplers(void) {
|
||||
|
||||
// If defined, use CPUInfo() to overwrite some pointers with faster versions.
|
||||
if (VP8GetCPUInfo) {
|
||||
#if defined(__SSE2__) || defined(_MSC_VER)
|
||||
#if defined(WEBP_USE_SSE2)
|
||||
if (VP8GetCPUInfo(kSSE2)) {
|
||||
WebPInitUpsamplersSSE2();
|
||||
}
|
||||
|
@ -9,12 +9,13 @@
|
||||
//
|
||||
// Author: somnath@google.com (Somnath Banerjee)
|
||||
|
||||
#if defined(__SSE2__) || defined(_MSC_VER)
|
||||
#include "./dsp.h"
|
||||
|
||||
#if defined(WEBP_USE_SSE2)
|
||||
|
||||
#include <assert.h>
|
||||
#include <emmintrin.h>
|
||||
#include <string.h>
|
||||
#include "./dsp.h"
|
||||
#include "./yuv.h"
|
||||
#include "../dec/webpi.h"
|
||||
|
||||
@ -212,4 +213,4 @@ void WebPInitUpsamplersSSE2(void) {
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif //__SSE2__ || _MSC_VER
|
||||
#endif // WEBP_USE_SSE2
|
||||
|
Loading…
x
Reference in New Issue
Block a user