diff --git a/src/enc/alpha_enc.c b/src/enc/alpha_enc.c index 56b46153..514d6d0e 100644 --- a/src/enc/alpha_enc.c +++ b/src/enc/alpha_enc.c @@ -217,7 +217,7 @@ static uint32_t GetFilterMap(const uint8_t* alpha, int width, int height, // For low number of colors, NONE yields better compression. filter = (num_colors <= kMinColorsForFilterNone) ? WEBP_FILTER_NONE - : WebPEstimateBestFilter(alpha, width, height, width); + : WebPEstimateBestFilter(alpha, width, height); bit_map |= 1 << filter; // For large number of colors, try FILTER_NONE in addition to the best // filter as well. diff --git a/src/utils/filters_utils.c b/src/utils/filters_utils.c index 48b1606f..fec7bc5d 100644 --- a/src/utils/filters_utils.c +++ b/src/utils/filters_utils.c @@ -35,14 +35,14 @@ static WEBP_INLINE int GradientPredictor(uint8_t a, uint8_t b, uint8_t c) { WEBP_FILTER_TYPE WebPEstimateBestFilter( const uint8_t* WEBP_COUNTED_BY((size_t)width* height) data, int width, - int height, int stride) { + int height) { int i, j; int bins[WEBP_FILTER_LAST][SMAX]; WEBP_UNSAFE_MEMSET(bins, 0, sizeof(bins)); // We only sample every other pixels. That's enough. for (j = 2; j < height - 1; j += 2) { - const uint8_t* const p = data + j * stride; + const uint8_t* const p = data + j * width; int mean = p[0]; for (i = 2; i < width - 1; i += 2) { const int diff0 = SDIFF(p[i], mean); diff --git a/src/utils/filters_utils.h b/src/utils/filters_utils.h index d852c23c..a4a8fd12 100644 --- a/src/utils/filters_utils.h +++ b/src/utils/filters_utils.h @@ -27,7 +27,7 @@ extern "C" { // Fast estimate of a potentially good filter. WEBP_FILTER_TYPE WebPEstimateBestFilter( const uint8_t* WEBP_COUNTED_BY((size_t)width* height) data, int width, - int height, int stride); + int height); #ifdef __cplusplus } // extern "C"