Merge "WebPEstimateBestFilter: remove unneeded stride param" into main

This commit is contained in:
James Zern
2025-08-26 10:49:51 -07:00
committed by Gerrit Code Review
3 changed files with 4 additions and 4 deletions

View File

@@ -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. // For low number of colors, NONE yields better compression.
filter = (num_colors <= kMinColorsForFilterNone) filter = (num_colors <= kMinColorsForFilterNone)
? WEBP_FILTER_NONE ? WEBP_FILTER_NONE
: WebPEstimateBestFilter(alpha, width, height, width); : WebPEstimateBestFilter(alpha, width, height);
bit_map |= 1 << filter; bit_map |= 1 << filter;
// For large number of colors, try FILTER_NONE in addition to the best // For large number of colors, try FILTER_NONE in addition to the best
// filter as well. // filter as well.

View File

@@ -35,14 +35,14 @@ static WEBP_INLINE int GradientPredictor(uint8_t a, uint8_t b, uint8_t c) {
WEBP_FILTER_TYPE WebPEstimateBestFilter( WEBP_FILTER_TYPE WebPEstimateBestFilter(
const uint8_t* WEBP_COUNTED_BY((size_t)width* height) data, int width, const uint8_t* WEBP_COUNTED_BY((size_t)width* height) data, int width,
int height, int stride) { int height) {
int i, j; int i, j;
int bins[WEBP_FILTER_LAST][SMAX]; int bins[WEBP_FILTER_LAST][SMAX];
WEBP_UNSAFE_MEMSET(bins, 0, sizeof(bins)); WEBP_UNSAFE_MEMSET(bins, 0, sizeof(bins));
// We only sample every other pixels. That's enough. // We only sample every other pixels. That's enough.
for (j = 2; j < height - 1; j += 2) { 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]; int mean = p[0];
for (i = 2; i < width - 1; i += 2) { for (i = 2; i < width - 1; i += 2) {
const int diff0 = SDIFF(p[i], mean); const int diff0 = SDIFF(p[i], mean);

View File

@@ -27,7 +27,7 @@ extern "C" {
// Fast estimate of a potentially good filter. // Fast estimate of a potentially good filter.
WEBP_FILTER_TYPE WebPEstimateBestFilter( WEBP_FILTER_TYPE WebPEstimateBestFilter(
const uint8_t* WEBP_COUNTED_BY((size_t)width* height) data, int width, const uint8_t* WEBP_COUNTED_BY((size_t)width* height) data, int width,
int height, int stride); int height);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"