diff options
author | volzhs <volzhs@gmail.com> | 2016-07-08 19:29:58 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2016-07-08 21:44:40 +0900 |
commit | ddd446f274d33d8624da3fd842c23e9ede0e6b11 (patch) | |
tree | f3b5de16472af57350b4f1de8d40b64365423b90 /drivers/webp/enc/backward_references.h | |
parent | dc58be9f3542d640771722187959f56f042b5baa (diff) |
Update webp driver to 0.5.1 (upstream)
Diffstat (limited to 'drivers/webp/enc/backward_references.h')
-rw-r--r-- | drivers/webp/enc/backward_references.h | 22 |
1 files changed, 13 insertions, 9 deletions
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 <assert.h> #include <stdlib.h> -#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 } |