| Index: third_party/libwebp/enc/webp_enc.c
|
| diff --git a/third_party/libwebp/enc/webpenc.c b/third_party/libwebp/enc/webp_enc.c
|
| similarity index 96%
|
| rename from third_party/libwebp/enc/webpenc.c
|
| rename to third_party/libwebp/enc/webp_enc.c
|
| index a7d04ea2cef54455c2d60bfa715422134ed1966e..f18461ef92ba176acf2039e494b824f964866401 100644
|
| --- a/third_party/libwebp/enc/webpenc.c
|
| +++ b/third_party/libwebp/enc/webp_enc.c
|
| @@ -16,9 +16,9 @@
|
| #include <string.h>
|
| #include <math.h>
|
|
|
| -#include "./cost.h"
|
| -#include "./vp8enci.h"
|
| -#include "./vp8li.h"
|
| +#include "./cost_enc.h"
|
| +#include "./vp8i_enc.h"
|
| +#include "./vp8li_enc.h"
|
| #include "../utils/utils.h"
|
|
|
| // #define PRINT_MEMORY_INFO
|
| @@ -75,7 +75,7 @@ static void ResetBoundaryPredictions(VP8Encoder* const enc) {
|
| //-------------------+---+---+---+---+---+---+---+
|
| // dynamic proba | ~ | x | x | x | x | x | x |
|
| //-------------------+---+---+---+---+---+---+---+
|
| -// fast mode analysis| | | | | x | x | x |
|
| +// fast mode analysis|[x]|[x]| | | x | x | x |
|
| //-------------------+---+---+---+---+---+---+---+
|
| // basic rd-opt | | | | x | x | x | x |
|
| //-------------------+---+---+---+---+---+---+---+
|
| @@ -315,18 +315,21 @@ int WebPReportProgress(const WebPPicture* const pic,
|
|
|
| int WebPEncode(const WebPConfig* config, WebPPicture* pic) {
|
| int ok = 0;
|
| + if (pic == NULL) return 0;
|
|
|
| - if (pic == NULL)
|
| - return 0;
|
| WebPEncodingSetError(pic, VP8_ENC_OK); // all ok so far
|
| - if (config == NULL) // bad params
|
| + if (config == NULL) { // bad params
|
| return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER);
|
| - if (!WebPValidateConfig(config))
|
| + }
|
| + if (!WebPValidateConfig(config)) {
|
| return WebPEncodingSetError(pic, VP8_ENC_ERROR_INVALID_CONFIGURATION);
|
| - if (pic->width <= 0 || pic->height <= 0)
|
| + }
|
| + if (pic->width <= 0 || pic->height <= 0) {
|
| return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION);
|
| - if (pic->width > WEBP_MAX_DIMENSION || pic->height > WEBP_MAX_DIMENSION)
|
| + }
|
| + if (pic->width > WEBP_MAX_DIMENSION || pic->height > WEBP_MAX_DIMENSION) {
|
| return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION);
|
| + }
|
|
|
| if (pic->stats != NULL) memset(pic->stats, 0, sizeof(*pic->stats));
|
|
|
| @@ -339,8 +342,8 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) {
|
|
|
| if (pic->use_argb || pic->y == NULL || pic->u == NULL || pic->v == NULL) {
|
| // Make sure we have YUVA samples.
|
| - if (config->preprocessing & 4) {
|
| - if (!WebPPictureSmartARGBToYUVA(pic)) {
|
| + if (config->use_sharp_yuv || (config->preprocessing & 4)) {
|
| + if (!WebPPictureSharpARGBToYUVA(pic)) {
|
| return 0;
|
| }
|
| } else {
|
|
|