ref: 61a03c2924fbebb2a58640ccf01fb96befe9aa39
parent: e85482baacd9feb689ad5d96d3f39bbfd3473cd6
author: Martin Storsjö <[email protected]>
date: Thu Feb 7 10:13:20 EST 2019
decode: Use abs() instead of labs() Both inputs and the assigned variable here are int, so there's no need to use labs() which uses long (which varies in size among supported platforms).
--- a/src/decode.c
+++ b/src/decode.c
@@ -331,8 +331,8 @@
int mvd[8], ret = 0;
const int thresh = 4 * iclip(imax(bw4, bh4), 4, 28);
for (int i = 0; i < np; i++) {
- mvd[i] = labs(pts[i][1][0] - pts[i][0][0] - mv.x) +
- labs(pts[i][1][1] - pts[i][0][1] - mv.y);
+ mvd[i] = abs(pts[i][1][0] - pts[i][0][0] - mv.x) +
+ abs(pts[i][1][1] - pts[i][0][1] - mv.y);
if (mvd[i] > thresh)
mvd[i] = -1;
else