|
@@ -28,7 +28,13 @@ |
|
|
|
|
|
|
|
|
static int cmpint(void const *i1, void const *i2) |
|
|
static int cmpint(void const *i1, void const *i2) |
|
|
{ |
|
|
{ |
|
|
return *(double const *)i1 < *(double const *)i2; |
|
|
|
|
|
|
|
|
/* On Linux amd64, this is 20 to 30 % faster than using a real |
|
|
|
|
|
* comparison (which wouldn't work on Windows since it expects both |
|
|
|
|
|
* negative and positive values), a ternary operator, or floats instead |
|
|
|
|
|
* of doubles. */ |
|
|
|
|
|
union { int32_t i; double d; } u; |
|
|
|
|
|
u.d = *(double const *)i1 - *(double const *)i2; |
|
|
|
|
|
return u.i; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pipi_image_t *pipi_median(pipi_image_t *src, int radius) |
|
|
pipi_image_t *pipi_median(pipi_image_t *src, int radius) |
|
|