From 88c73d8a7a7ccaaef1aeda6515e32d9b7b5ac9e1 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 11 Jul 2017 15:36:14 -0700 Subject: [PATCH] backward_references_enc.h: fix WINDOW_SIZE_BITS check this check was relocated in: b903b80c Split cost-based backward references in its own file. quiets -Wundef Change-Id: I7f7a4773fb8cc77ca9f671b11f50d5db2275d415 --- src/enc/backward_references_enc.c | 1 - src/enc/backward_references_enc.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/enc/backward_references_enc.c b/src/enc/backward_references_enc.c index 02b69466..3c230f35 100644 --- a/src/enc/backward_references_enc.c +++ b/src/enc/backward_references_enc.c @@ -26,7 +26,6 @@ #define MAX_ENTROPY (1e30f) // 1M window (4M bytes) minus 120 special codes for short distances. -#define WINDOW_SIZE_BITS 20 #define WINDOW_SIZE ((1 << WINDOW_SIZE_BITS) - 120) // Minimum number of pixels for which it is cheaper to encode a diff --git a/src/enc/backward_references_enc.h b/src/enc/backward_references_enc.h index c8ef6f03..a270dc41 100644 --- a/src/enc/backward_references_enc.h +++ b/src/enc/backward_references_enc.h @@ -116,6 +116,7 @@ static WEBP_INLINE uint32_t PixOrCopyDistance(const PixOrCopy* const p) { // If you change this, you need MAX_LENGTH_BITS + WINDOW_SIZE_BITS <= 32 as it // is used in VP8LHashChain. #define MAX_LENGTH_BITS 12 +#define WINDOW_SIZE_BITS 20 // We want the max value to be attainable and stored in MAX_LENGTH_BITS bits. #define MAX_LENGTH ((1 << MAX_LENGTH_BITS) - 1) #if MAX_LENGTH_BITS + WINDOW_SIZE_BITS > 32