summaryrefslogtreecommitdiffstats
path: root/media/libwebp/dsp/rescaler.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-01-21 13:09:32 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-01-21 13:09:32 +0100
commitd1a0bfe221b91ea37a34d0b0360f347d2a6394e5 (patch)
tree5bba8c28b5415c90e90156bfa59a641a99118b99 /media/libwebp/dsp/rescaler.c
parent9a954e2d1619788f658f6ec30c7dbd89b3d48b0d (diff)
downloadUXP-d1a0bfe221b91ea37a34d0b0360f347d2a6394e5.tar
UXP-d1a0bfe221b91ea37a34d0b0360f347d2a6394e5.tar.gz
UXP-d1a0bfe221b91ea37a34d0b0360f347d2a6394e5.tar.lz
UXP-d1a0bfe221b91ea37a34d0b0360f347d2a6394e5.tar.xz
UXP-d1a0bfe221b91ea37a34d0b0360f347d2a6394e5.zip
Update libwebp to version 1.0.2
This resolves #939.
Diffstat (limited to 'media/libwebp/dsp/rescaler.c')
-rw-r--r--media/libwebp/dsp/rescaler.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libwebp/dsp/rescaler.c b/media/libwebp/dsp/rescaler.c
index f70e6beef..6bf387f8e 100644
--- a/media/libwebp/dsp/rescaler.c
+++ b/media/libwebp/dsp/rescaler.c
@@ -21,6 +21,7 @@
#define ROUNDER (WEBP_RESCALER_ONE >> 1)
#define MULT_FIX(x, y) (((uint64_t)(x) * (y) + ROUNDER) >> WEBP_RESCALER_RFIX)
+#define MULT_FIX_FLOOR(x, y) (((uint64_t)(x) * (y)) >> WEBP_RESCALER_RFIX)
//------------------------------------------------------------------------------
// Row import
@@ -138,7 +139,7 @@ void WebPRescalerExportRowShrink_C(WebPRescaler* const wrk) {
if (yscale) {
for (x_out = 0; x_out < x_out_max; ++x_out) {
const uint32_t frac = (uint32_t)MULT_FIX(frow[x_out], yscale);
- const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale);
+ const int v = (int)MULT_FIX_FLOOR(irow[x_out] - frac, wrk->fxy_scale);
assert(v >= 0 && v <= 255);
dst[x_out] = v;
irow[x_out] = frac; // new fractional start
@@ -153,6 +154,7 @@ void WebPRescalerExportRowShrink_C(WebPRescaler* const wrk) {
}
}
+#undef MULT_FIX_FLOOR
#undef MULT_FIX
#undef ROUNDER