Skip to content

Commit

Permalink
Merge pull request #5 from philpem/marcespie-fix-g4-absdiff
Browse files Browse the repository at this point in the history
Fix upstream #3, bring in marcespie's G4 patch
  • Loading branch information
brouhaha authored May 26, 2020
2 parents f9bd928 + ff88137 commit 4d3f6a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bitblt_g4.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ static uint32_t g4_find_pixel (uint8_t *buf,
return (width);
}

#define absdiff(a, b) ((a) < (b) ? (b)-(a) : (a) - (b))

static void g4_encode_row (struct bit_buffer *buf,
uint32_t width,
Expand Down Expand Up @@ -253,7 +254,7 @@ static void g4_encode_row (struct bit_buffer *buf,
fprintf (stderr, "pass\n");
#endif
}
else if (abs (a1 - b1) <= 3)
else if (absdiff(a1, b1) <= 3)
{
/* vertical mode */
write_bits (buf,
Expand Down

0 comments on commit 4d3f6a3

Please sign in to comment.