diff --git a/server/glz-encode.tmpl.c b/server/glz-encode.tmpl.c index 48bab50b..92deb0e1 100644 --- a/server/glz-encode.tmpl.c +++ b/server/glz-encode.tmpl.c @@ -276,19 +276,15 @@ static void FNAME(compress_seg)(Encoder *encoder, uint32_t seg_idx, PIXEL *from, if (LZ_EXPECT_CONDITIONAL(ip > (PIXEL *)(seg->lines))) { if (SAME_PIXEL(ip[-1], ip[0]) && SAME_PIXEL(ip[0], ip[1]) && SAME_PIXEL(ip[1], ip[2])) { - PIXEL x; + PIXEL x = ip[2]; + pix_dist = 1; image_dist = 0; ip += 3; - ref = anchor + 2; - ref_limit = (PIXEL *)(seg->lines_end); len = 3; - x = *ref; - - while (ip < ip_bound) { // TODO: maybe separate a run from the same seg or from - // different ones in order to spare ref < ref_limit + while (ip < ip_bound) { if (!SAME_PIXEL(*ip, x)) { ip++; break;