diff options
author | wm4 <wm4@nowhere> | 2013-07-05 20:26:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-05 20:26:32 +0200 |
commit | 1709b65a72700fbd42aebddefc1b3dc94eed5662 (patch) | |
tree | 1283065e27f4e376529e5ee6584dc543660dc391 /video/out/dither.c | |
parent | 0d6f5fbe5433a0040fd6b06d8b8a7cd61952f36e (diff) | |
download | mpv-1709b65a72700fbd42aebddefc1b3dc94eed5662.tar.bz2 mpv-1709b65a72700fbd42aebddefc1b3dc94eed5662.tar.xz |
dither: don't use long double
This fixes compilation with broken libcs, like on Cygwin. C99
absolutely requires long double and associated functions like expl,
even if long double is double. But newlib (used by cygwin) omits
declaration for these if long double is equivalent to double.
The extra precision is not needed here, so remove it to make life
easier for the single person using mpv with cygwin.
Diffstat (limited to 'video/out/dither.c')
-rw-r--r-- | video/out/dither.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/dither.c b/video/out/dither.c index 1919010e74..ac3e9f41d6 100644 --- a/video/out/dither.c +++ b/video/out/dither.c @@ -79,14 +79,14 @@ static void makegauss(struct ctx *k, unsigned int sizeb) for (index_t c = 0; c < k->size2; c++) k->gauss[c] = 0; - long double sigma = -logl(1.5 / UINT64_MAX * gauss_size2) / k->gauss_radius; + double sigma = -log(1.5 / UINT64_MAX * gauss_size2) / k->gauss_radius; for (index_t gy = 0; gy <= k->gauss_radius; gy++) { for (index_t gx = 0; gx <= gy; gx++) { int cx = (int)gx - k->gauss_radius; int cy = (int)gy - k->gauss_radius; int sq = cx * cx + cy * cy; - long double e = expl(-sqrtl(sq) * sigma); + double e = exp(-sqrt(sq) * sigma); uint64_t v = e / gauss_size2 * UINT64_MAX; k->gauss[XY(k, gx, gy)] = k->gauss[XY(k, gy, gx)] = |