changeset 1833:19d4f76e003d

Improve RLE compression by checking for "first byte" condition in the compressor.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 22 Jun 2018 16:35:08 +0300
parents 843d3a593f05
children 69871828838c
files tools/lib64gfx.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64gfx.c	Fri Jun 22 16:34:18 2018 +0300
+++ b/tools/lib64gfx.c	Fri Jun 22 16:35:08 2018 +0300
@@ -666,7 +666,7 @@
     {
         // If new data byte is different, or we exceed the rleMaxCount
         // for the active runs mode(s) .. then encode the run.
-        if (data != prev ||
+        if ((data != prev && prev != -1) ||
             ((cfg->flags & DM_RLE_WORD_RUNS) && count >= cfg->rleMaxCountW) ||
             (((cfg->flags & DM_RLE_RUNS_MASK) == DM_RLE_BYTE_RUNS) && count >= cfg->rleMaxCountB))
         {