Commit 5d66c69d authored by jzern's avatar jzern Committed by Commit bot

libwebp: cherry-pick arm gcc-4.9 fix

dsp/lossless: workaround gcc-4.9 bug on arm

force Sub3() to not be inlined, otherwise the code in Select() will be
incorrect.
https://android-review.googlesource.com/#/c/102511

Change-Id: I90ae58bf3e6cc92ca9897f69974733d562e29aaf

BUG=414154

Review URL: https://codereview.chromium.org/577793004

Cr-Commit-Position: refs/heads/master@{#295506}
parent 1ad53a56
......@@ -26,3 +26,4 @@ Cherry-picks:
Revert patch f7fc4bc: dec/webp.c: don't wait for data before reporting w/h
0524d9e dsp: detect mips64 & disable mips32 code
b7e5a5c MIPS: detect mips32r6 and disable mips32r1 code
637b388 dsp/lossless: workaround gcc-4.9 bug on arm
......@@ -450,12 +450,21 @@ static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,
return ((uint32_t)a << 24) | (r << 16) | (g << 8) | b;
}
static WEBP_INLINE int Sub3(int a, int b, int c) {
// gcc-4.9 on ARM generates incorrect code in Select() when Sub3() is inlined.
#if defined(__arm__) && LOCAL_GCC_VERSION == 0x409
# define LOCAL_INLINE __attribute__ ((noinline))
#else
# define LOCAL_INLINE WEBP_INLINE
#endif
static LOCAL_INLINE int Sub3(int a, int b, int c) {
const int pb = b - c;
const int pa = a - c;
return abs(pb) - abs(pa);
}
#undef LOCAL_INLINE
static WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) {
const int pa_minus_pb =
Sub3((a >> 24) , (b >> 24) , (c >> 24) ) +
......
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