From 8c3f9a470607cfe2489410975cc7f6a34790e26a Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Fri, 4 Aug 2017 13:32:12 +0200 Subject: [PATCH] Speed-up LZ77. No need to look for a bigger maximum reach if we reach the end of the image. Change-Id: I56b166f9266f15cdff5aa59a75559972db19858f --- src/enc/backward_references_enc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/enc/backward_references_enc.c b/src/enc/backward_references_enc.c index 6baaf11f..06d57283 100644 --- a/src/enc/backward_references_enc.c +++ b/src/enc/backward_references_enc.c @@ -493,6 +493,7 @@ static int BackwardReferencesLz77(int xsize, int ysize, if (reach > max_reach) { len = j - i; max_reach = reach; + if (max_reach >= pix_count) break; } } } else {