summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjzern@chromium.org <jzern@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-06 07:27:59 +0000
committerjzern@chromium.org <jzern@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-06 07:27:59 +0000
commit5e2cd3a6c2a07d8386d942079f29dd1bff79fe51 (patch)
treeef36deddd13749e0f26025cc099536476410fd04
parenta22cc40b69b9e4d8010a6349d772e5b819a9cbdb (diff)
downloadchromium_src-5e2cd3a6c2a07d8386d942079f29dd1bff79fe51.zip
chromium_src-5e2cd3a6c2a07d8386d942079f29dd1bff79fe51.tar.gz
chromium_src-5e2cd3a6c2a07d8386d942079f29dd1bff79fe51.tar.bz2
libwebp: mips build fixes
dsp: detect mips64 & disable mips32 code enc_mips32: workaround gcc-4.9 bug BUG=374343 Review URL: https://codereview.chromium.org/442853003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287728 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--third_party/libwebp/README.chromium3
-rw-r--r--third_party/libwebp/dsp/cpu.c2
-rw-r--r--third_party/libwebp/dsp/dsp.h2
-rw-r--r--third_party/libwebp/dsp/enc_mips32.c9
4 files changed, 14 insertions, 2 deletions
diff --git a/third_party/libwebp/README.chromium b/third_party/libwebp/README.chromium
index 4bf7edf..8021584 100644
--- a/third_party/libwebp/README.chromium
+++ b/third_party/libwebp/README.chromium
@@ -20,5 +20,8 @@ Local changes:
* Removed examples/, documentation and build related files, keeping only
the contents of src/ less mux/ which is unused.
* Merged COPYING/PATENTS to LICENSE
+ * fcf7687 enc_mips32: workaround gcc-4.9 bug
+ (to be upstreamed if the problem persists in the final ndk r10 release)
Cherry-picks:
Revert patch f7fc4bc: dec/webp.c: don't wait for data before reporting w/h
+ 0524d9e dsp: detect mips64 & disable mips32 code
diff --git a/third_party/libwebp/dsp/cpu.c b/third_party/libwebp/dsp/cpu.c
index 3456504..086da83 100644
--- a/third_party/libwebp/dsp/cpu.c
+++ b/third_party/libwebp/dsp/cpu.c
@@ -118,7 +118,7 @@ static int armCPUInfo(CPUFeature feature) {
return 1;
}
VP8CPUInfo VP8GetCPUInfo = armCPUInfo;
-#elif defined(__mips__)
+#elif defined(WEBP_USE_MIPS32)
static int mipsCPUInfo(CPUFeature feature) {
(void)feature;
return 1;
diff --git a/third_party/libwebp/dsp/dsp.h b/third_party/libwebp/dsp/dsp.h
index 596febb..73a8253 100644
--- a/third_party/libwebp/dsp/dsp.h
+++ b/third_party/libwebp/dsp/dsp.h
@@ -60,7 +60,7 @@ extern "C" {
#define WEBP_USE_NEON
#endif
-#if defined(__mips__)
+#if defined(__mips__) && !defined(__mips64)
#define WEBP_USE_MIPS32
#endif
diff --git a/third_party/libwebp/dsp/enc_mips32.c b/third_party/libwebp/dsp/enc_mips32.c
index 6acde8a..def9a16 100644
--- a/third_party/libwebp/dsp/enc_mips32.c
+++ b/third_party/libwebp/dsp/enc_mips32.c
@@ -20,6 +20,10 @@
#include "../enc/vp8enci.h"
#include "../enc/cost.h"
+#if defined(__GNUC__) && defined(__ANDROID__) && LOCAL_GCC_VERSION == 0x409
+#define WORK_AROUND_GCC
+#endif
+
static const int kC1 = 20091 + (1 << 16);
static const int kC2 = 35468;
@@ -641,6 +645,7 @@ int VP8GetResidualCostMIPS32(int ctx0, const VP8Residual* const res) {
GET_SSE_INNER(C, C + 1, C + 2, C + 3) \
GET_SSE_INNER(D, D + 1, D + 2, D + 3)
+#if !defined(WORK_AROUND_GCC)
static int SSE16x16(const uint8_t* a, const uint8_t* b) {
int count;
int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
@@ -742,6 +747,8 @@ static int SSE4x4(const uint8_t* a, const uint8_t* b) {
return count;
}
+#endif // WORK_AROUND_GCC
+
#undef GET_SSE_MIPS32
#undef GET_SSE_MIPS32_INNER
@@ -759,9 +766,11 @@ void VP8EncDspInitMIPS32(void) {
VP8TDisto4x4 = Disto4x4;
VP8TDisto16x16 = Disto16x16;
VP8FTransform = FTransform;
+#if !defined(WORK_AROUND_GCC)
VP8SSE16x16 = SSE16x16;
VP8SSE8x8 = SSE8x8;
VP8SSE16x8 = SSE16x8;
VP8SSE4x4 = SSE4x4;
+#endif
#endif // WEBP_USE_MIPS32
}