The first try failed to work with some build flags
The gcc version affected is very old and unmaintained AFAIK thus i made no
attempt to report this to the gcc developers.
The workaround is pushed as it may still affect users and does affect one
fate client
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -67,7 +67,7 @@ static int query_formats(AVFilterContext *ctx) |
67 | 67 |
return 0; |
68 | 68 |
} |
69 | 69 |
|
70 |
-#define ABS(a) ((a) > 0 ? (a) : -(a)) |
|
70 |
+#define ABS(a) (((a) ^ ((a) >> 31)) - ((a) >> 31)) |
|
71 | 71 |
|
72 | 72 |
static int diff_c(const uint8_t *a, const uint8_t *b, ptrdiff_t s) |
73 | 73 |
{ |
... | ... |
@@ -389,8 +389,8 @@ static void compute_affinity(PullupContext *s, PullupField *f) |
389 | 389 |
int v = f->vars[i]; |
390 | 390 |
int lv = f->prev->vars[i]; |
391 | 391 |
int rv = f->next->vars[i]; |
392 |
- int lc = f->combs[i] - (v + lv) + ABS(v - lv); |
|
393 |
- int rc = f->next->combs[i] - (v + rv) + ABS(v - rv); |
|
392 |
+ int lc = f-> combs[i] - 2*(v < lv ? v : lv); |
|
393 |
+ int rc = f->next->combs[i] - 2*(v < rv ? v : rv); |
|
394 | 394 |
|
395 | 395 |
lc = FFMAX(lc, 0); |
396 | 396 |
rc = FFMAX(rc, 0); |