diff --git a/src/dec/io.c b/src/dec/io.c index 82c7c0d3..8a9ee4e7 100644 --- a/src/dec/io.c +++ b/src/dec/io.c @@ -408,7 +408,7 @@ static int ExportAlpha(WebPDecParams* const p, int y_pos) { static int ExportAlphaRGBA4444(WebPDecParams* const p, int y_pos) { const WebPRGBABuffer* const buf = &p->output->u.RGBA; - uint8_t* base_rgba = buf->rgba + (p->last_y + y_pos) * buf->stride; + uint8_t* const base_rgba = buf->rgba + (p->last_y + y_pos) * buf->stride; uint8_t* alpha_dst = base_rgba + 1; int num_lines_out = 0; const WEBP_CSP_MODE colorspace = p->output->colorspace; diff --git a/src/dsp/upsampling.c b/src/dsp/upsampling.c index 094c7311..3ba35dfb 100644 --- a/src/dsp/upsampling.c +++ b/src/dsp/upsampling.c @@ -206,11 +206,11 @@ const WebPYUV444Converter WebPYUV444Converters[MODE_LAST] = { #define PREMULTIPLY(x, m) (((x) * (m) + (1UL << 23)) >> 24) #endif -static void ApplyAlphaMultiply(uint8_t* rgba, int alpha_1rst, +static void ApplyAlphaMultiply(uint8_t* rgba, int alpha_first, int w, int h, int stride) { while (h-- > 0) { - uint8_t* const rgb = rgba + (alpha_1rst ? 1 : 0); - const uint8_t* const alpha = rgba + (alpha_1rst ? 0 : 3); + uint8_t* const rgb = rgba + (alpha_first ? 1 : 0); + const uint8_t* const alpha = rgba + (alpha_first ? 0 : 3); int i; for (i = 0; i < w; ++i) { const uint32_t a = alpha[4 * i]; @@ -232,8 +232,13 @@ static void ApplyAlphaMultiply(uint8_t* rgba, int alpha_1rst, #define MULTIPLIER(a) ((a) * 0x11) #define PREMULTIPLY(x, m) (((x) * (m)) >> 12) -static WEBP_INLINE uint8_t dither_hi(uint8_t x) { return (x & 0xf0) | (x >> 4); } -static WEBP_INLINE uint8_t dither_lo(uint8_t x) { return (x & 0x0f) | (x << 4); } +static WEBP_INLINE uint8_t dither_hi(uint8_t x) { + return (x & 0xf0) | (x >> 4); +} + +static WEBP_INLINE uint8_t dither_lo(uint8_t x) { + return (x & 0x0f) | (x << 4); +} static void ApplyAlphaMultiply4444(uint8_t* rgba4444, int w, int h, int stride) {