diff options
author | volzhs <volzhs@gmail.com> | 2016-12-22 09:54:15 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2016-12-24 00:46:09 +0900 |
commit | e04c7e11ec2fabf34aaf515103bc0b6086e1aabd (patch) | |
tree | 7e8e1947eb71efe8bf45632610ee2776c9ef0b3e /thirdparty/libwebp/utils/rescaler.c | |
parent | 2c8a1729152f5bcb1cb81d24b1e642634bff7174 (diff) |
Update libwebp to 0.5.2
Diffstat (limited to 'thirdparty/libwebp/utils/rescaler.c')
-rw-r--r-- | thirdparty/libwebp/utils/rescaler.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/thirdparty/libwebp/utils/rescaler.c b/thirdparty/libwebp/utils/rescaler.c index 00c9300bfb..d2278a52ff 100644 --- a/thirdparty/libwebp/utils/rescaler.c +++ b/thirdparty/libwebp/utils/rescaler.c @@ -48,11 +48,15 @@ void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height, wrk->y_sub = wrk->y_expand ? y_sub - 1 : y_sub; wrk->y_accum = wrk->y_expand ? wrk->y_sub : wrk->y_add; if (!wrk->y_expand) { - // this is WEBP_RESCALER_FRAC(dst_height, x_add * y_add) without the cast. + // This is WEBP_RESCALER_FRAC(dst_height, x_add * y_add) without the cast. + // Its value is <= WEBP_RESCALER_ONE, because dst_height <= wrk->y_add, and + // wrk->x_add >= 1; const uint64_t ratio = (uint64_t)dst_height * WEBP_RESCALER_ONE / (wrk->x_add * wrk->y_add); if (ratio != (uint32_t)ratio) { - // We can't represent the ratio with the current fixed-point precision. + // When ratio == WEBP_RESCALER_ONE, we can't represent the ratio with the + // current fixed-point precision. This happens when src_height == + // wrk->y_add (which == src_height), and wrk->x_add == 1. // => We special-case fxy_scale = 0, in WebPRescalerExportRow(). wrk->fxy_scale = 0; } else { |