summaryrefslogtreecommitdiff
path: root/thirdparty/libwebp/src/utils/utils.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-03-04 13:49:50 +0100
committerGitHub <noreply@github.com>2019-03-04 13:49:50 +0100
commitd2c57e8431a6dd3a279eec9abdd6acd4ba288ca8 (patch)
tree7c516cd7752f1c8a23e5752d489003239099c1bc /thirdparty/libwebp/src/utils/utils.h
parent6e13002034152981efdceed864b4e48d70018a49 (diff)
parent93f6a065f8e0e083582890a245b7dcc3cd8c7ef6 (diff)
Merge pull request #26577 from akien-mga/webp-1.0.2
libwebp: Sync with upstream 1.0.2
Diffstat (limited to 'thirdparty/libwebp/src/utils/utils.h')
-rw-r--r--thirdparty/libwebp/src/utils/utils.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/thirdparty/libwebp/src/utils/utils.h b/thirdparty/libwebp/src/utils/utils.h
index da97b5d38f..c7620f91ec 100644
--- a/thirdparty/libwebp/src/utils/utils.h
+++ b/thirdparty/libwebp/src/utils/utils.h
@@ -107,19 +107,6 @@ static WEBP_INLINE void PutLE32(uint8_t* const data, uint32_t val) {
PutLE16(data + 2, (int)(val >> 16));
}
-// Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either
-// based on table or not. Can be used as fallback if clz() is not available.
-#define WEBP_NEED_LOG_TABLE_8BIT
-extern const uint8_t WebPLogTable8bit[256];
-static WEBP_INLINE int WebPLog2FloorC(uint32_t n) {
- int log_value = 0;
- while (n >= 256) {
- log_value += 8;
- n >>= 8;
- }
- return log_value + WebPLogTable8bit[n];
-}
-
// Returns (int)floor(log2(n)). n must be > 0.
// use GNU builtins where available.
#if defined(__GNUC__) && \
@@ -138,6 +125,19 @@ static WEBP_INLINE int BitsLog2Floor(uint32_t n) {
return first_set_bit;
}
#else // default: use the C-version.
+// Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either
+// based on table or not. Can be used as fallback if clz() is not available.
+#define WEBP_NEED_LOG_TABLE_8BIT
+extern const uint8_t WebPLogTable8bit[256];
+static WEBP_INLINE int WebPLog2FloorC(uint32_t n) {
+ int log_value = 0;
+ while (n >= 256) {
+ log_value += 8;
+ n >>= 8;
+ }
+ return log_value + WebPLogTable8bit[n];
+}
+
static WEBP_INLINE int BitsLog2Floor(uint32_t n) { return WebPLog2FloorC(n); }
#endif