Skip to content

Commit

Permalink
libwebp: mips build fixes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jzern@chromium.org committed Aug 6, 2014
1 parent a22cc40 commit 5e2cd3a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions third_party/libwebp/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion third_party/libwebp/dsp/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion third_party/libwebp/dsp/dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extern "C" {
#define WEBP_USE_NEON
#endif

#if defined(__mips__)
#if defined(__mips__) && !defined(__mips64)
#define WEBP_USE_MIPS32
#endif

Expand Down
9 changes: 9 additions & 0 deletions third_party/libwebp/dsp/enc_mips32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand All @@ -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
}

0 comments on commit 5e2cd3a

Please sign in to comment.