diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-09 03:00:20 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-09 03:00:20 +0100 |
commit | 2decf5c6dd3df823b385dce62b067fb5b13d399d (patch) | |
tree | 184d92f32ba8836021b947e6db8409795fc2016b /src/3rdparty/libwebp/src/utils | |
parent | 5904479f50ccafc9556475b4e039d707eadc58b7 (diff) | |
parent | 0e8422bedc8c84ff7c08c6b3163329e82c2007dd (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta1
Change-Id: If83b53844d5110c40d94a2e7a6dbfa1f09604f46
Diffstat (limited to 'src/3rdparty/libwebp/src/utils')
-rw-r--r-- | src/3rdparty/libwebp/src/utils/bit_writer_utils.c | 1 | ||||
-rw-r--r-- | src/3rdparty/libwebp/src/utils/utils.h | 26 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/3rdparty/libwebp/src/utils/bit_writer_utils.c b/src/3rdparty/libwebp/src/utils/bit_writer_utils.c index f4f476c..7f83b4c 100644 --- a/src/3rdparty/libwebp/src/utils/bit_writer_utils.c +++ b/src/3rdparty/libwebp/src/utils/bit_writer_utils.c @@ -248,6 +248,7 @@ int VP8LBitWriterClone(const VP8LBitWriter* const src, dst->bits_ = src->bits_; dst->used_ = src->used_; dst->error_ = src->error_; + dst->cur_ = dst->buf_ + current_size; return 1; } diff --git a/src/3rdparty/libwebp/src/utils/utils.h b/src/3rdparty/libwebp/src/utils/utils.h index da97b5d..c7620f9 100644 --- a/src/3rdparty/libwebp/src/utils/utils.h +++ b/src/3rdparty/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 |