diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2024-04-15 18:38:04 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2024-04-16 08:03:23 +0200 |
commit | a5e0b01214ffdbac811b89c6e19f657d3a0cf34b (patch) | |
tree | c1b62f9f7969971fef48c6801e3cec6a8f9d2292 /src/3rdparty/libwebp/src/enc/alpha_enc.c | |
parent | ff565219a7724e13b769f63d3a483167046bd83d (diff) |
Update bundled libwebp to version 1.4.0
[ChangeLog][Third-Party Code] Update bundled libwebp to version 1.4.0
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I34bc162e3b64be75da0f82a0a7329eb1a0356239
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/3rdparty/libwebp/src/enc/alpha_enc.c')
-rw-r--r-- | src/3rdparty/libwebp/src/enc/alpha_enc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/3rdparty/libwebp/src/enc/alpha_enc.c b/src/3rdparty/libwebp/src/enc/alpha_enc.c index 26f0034..c11a261 100644 --- a/src/3rdparty/libwebp/src/enc/alpha_enc.c +++ b/src/3rdparty/libwebp/src/enc/alpha_enc.c @@ -20,6 +20,7 @@ #include "src/utils/filters_utils.h" #include "src/utils/quant_levels_utils.h" #include "src/utils/utils.h" +#include "src/webp/encode.h" #include "src/webp/format_constants.h" // ----------------------------------------------------------------------------- @@ -55,7 +56,7 @@ static int EncodeLossless(const uint8_t* const data, int width, int height, WebPConfig config; WebPPicture picture; - WebPPictureInit(&picture); + if (!WebPPictureInit(&picture)) return 0; picture.width = width; picture.height = height; picture.use_argb = 1; @@ -66,7 +67,7 @@ static int EncodeLossless(const uint8_t* const data, int width, int height, WebPDispatchAlphaToGreen(data, width, picture.width, picture.height, picture.argb, picture.argb_stride); - WebPConfigInit(&config); + if (!WebPConfigInit(&config)) return 0; config.lossless = 1; // Enable exact, or it would alter RGB values of transparent alpha, which is // normally OK but not here since we are not encoding the input image but an @@ -83,11 +84,7 @@ static int EncodeLossless(const uint8_t* const data, int width, int height, (use_quality_100 && effort_level == 6) ? 100 : 8.f * effort_level; assert(config.quality >= 0 && config.quality <= 100.f); - // TODO(urvang): Temporary fix to avoid generating images that trigger - // a decoder bug related to alpha with color cache. - // See: https://code.google.com/p/webp/issues/detail?id=239 - // Need to re-enable this later. - ok = VP8LEncodeStream(&config, &picture, bw, /*use_cache=*/0); + ok = VP8LEncodeStream(&config, &picture, bw); WebPPictureFree(&picture); ok = ok && !bw->error_; if (!ok) { |