From ddd446f274d33d8624da3fd842c23e9ede0e6b11 Mon Sep 17 00:00:00 2001 From: volzhs Date: Fri, 8 Jul 2016 19:29:58 +0900 Subject: Update webp driver to 0.5.1 (upstream) --- drivers/webp/enc/backward_references.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'drivers/webp/enc/backward_references.h') diff --git a/drivers/webp/enc/backward_references.h b/drivers/webp/enc/backward_references.h index e410b06f7d..0cadb11e11 100644 --- a/drivers/webp/enc/backward_references.h +++ b/drivers/webp/enc/backward_references.h @@ -15,8 +15,8 @@ #include #include -#include "webp/types.h" -#include "webp/format_constants.h" +#include "../webp/types.h" +#include "../webp/format_constants.h" #ifdef __cplusplus extern "C" { @@ -115,11 +115,12 @@ static WEBP_INLINE uint32_t PixOrCopyDistance(const PixOrCopy* const p) { typedef struct VP8LHashChain VP8LHashChain; struct VP8LHashChain { - // Stores the most recently added position with the given hash value. - int32_t hash_to_first_index_[HASH_SIZE]; - // chain_[pos] stores the previous position with the same hash value - // for every pixel in the image. - int32_t* chain_; + // The 20 most significant bits contain the offset at which the best match + // is found. These 20 bits are the limit defined by GetWindowSizeForHashChain + // (through WINDOW_SIZE = 1<<20). + // The lower 12 bits contain the length of the match. The 12 bit limit is + // defined in MaxFindCopyLength with MAX_LENGTH=4096. + uint32_t* offset_length_; // This is the maximum size of the hash_chain that can be constructed. // Typically this is the pixel count (width x height) for a given image. int size_; @@ -127,6 +128,9 @@ struct VP8LHashChain { // Must be called first, to set size. int VP8LHashChainInit(VP8LHashChain* const p, int size); +// Pre-compute the best matches for argb. +int VP8LHashChainFill(VP8LHashChain* const p, int quality, + const uint32_t* const argb, int xsize, int ysize); void VP8LHashChainClear(VP8LHashChain* const p); // release memory // ----------------------------------------------------------------------------- @@ -192,8 +196,8 @@ static WEBP_INLINE void VP8LRefsCursorNext(VP8LRefsCursor* const c) { // refs[0] or refs[1]. VP8LBackwardRefs* VP8LGetBackwardReferences( int width, int height, const uint32_t* const argb, int quality, - int low_effort, int* const cache_bits, VP8LHashChain* const hash_chain, - VP8LBackwardRefs refs[2]); + int low_effort, int* const cache_bits, + const VP8LHashChain* const hash_chain, VP8LBackwardRefs refs[2]); #ifdef __cplusplus } -- cgit v1.2.3 From e55c6f823251fcff366c7ce93b3ab0bf1fdedd68 Mon Sep 17 00:00:00 2001 From: volzhs Date: Fri, 8 Jul 2016 22:10:25 +0900 Subject: Modified webp source codes for godot --- drivers/webp/enc/backward_references.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/webp/enc/backward_references.h') diff --git a/drivers/webp/enc/backward_references.h b/drivers/webp/enc/backward_references.h index 0cadb11e11..b72a01fb0e 100644 --- a/drivers/webp/enc/backward_references.h +++ b/drivers/webp/enc/backward_references.h @@ -15,8 +15,8 @@ #include #include -#include "../webp/types.h" -#include "../webp/format_constants.h" +#include "webp/types.h" +#include "webp/format_constants.h" #ifdef __cplusplus extern "C" { -- cgit v1.2.3