diff options
author | volzhs <volzhs@gmail.com> | 2020-01-17 03:49:31 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2020-01-17 03:49:31 +0900 |
commit | 65f2ab1b61d0949bae7f06553b081e1aae276148 (patch) | |
tree | e9b85cdc26a2a140ac6675d90dced255eb72c3c6 /thirdparty/libwebp/src/enc | |
parent | 6b64c60b0eade65ca1147a0af39baefec732d652 (diff) |
Update libwebp to 1.1.0
Diffstat (limited to 'thirdparty/libwebp/src/enc')
-rw-r--r-- | thirdparty/libwebp/src/enc/histogram_enc.c | 2 | ||||
-rw-r--r-- | thirdparty/libwebp/src/enc/picture_csp_enc.c | 18 | ||||
-rw-r--r-- | thirdparty/libwebp/src/enc/vp8i_enc.h | 6 |
3 files changed, 15 insertions, 11 deletions
diff --git a/thirdparty/libwebp/src/enc/histogram_enc.c b/thirdparty/libwebp/src/enc/histogram_enc.c index d89b98524a..a4e6bf3a98 100644 --- a/thirdparty/libwebp/src/enc/histogram_enc.c +++ b/thirdparty/libwebp/src/enc/histogram_enc.c @@ -641,7 +641,7 @@ static void HistogramAnalyzeEntropyBin(VP8LHistogramSet* const image_histo, // Merges some histograms with same bin_id together if it's advantageous. // Sets the remaining histograms to NULL. static void HistogramCombineEntropyBin(VP8LHistogramSet* const image_histo, - int *num_used, + int* num_used, const uint16_t* const clusters, uint16_t* const cluster_mappings, VP8LHistogram* cur_combo, diff --git a/thirdparty/libwebp/src/enc/picture_csp_enc.c b/thirdparty/libwebp/src/enc/picture_csp_enc.c index 02d9df76d5..718e014ed2 100644 --- a/thirdparty/libwebp/src/enc/picture_csp_enc.c +++ b/thirdparty/libwebp/src/enc/picture_csp_enc.c @@ -29,11 +29,15 @@ #define USE_INVERSE_ALPHA_TABLE #ifdef WORDS_BIGENDIAN -#define ALPHA_OFFSET 0 // uint32_t 0xff000000 is 0xff,00,00,00 in memory +// uint32_t 0xff000000 is 0xff,00,00,00 in memory +#define CHANNEL_OFFSET(i) (i) #else -#define ALPHA_OFFSET 3 // uint32_t 0xff000000 is 0x00,00,00,ff in memory +// uint32_t 0xff000000 is 0x00,00,00,ff in memory +#define CHANNEL_OFFSET(i) (3-(i)) #endif +#define ALPHA_OFFSET CHANNEL_OFFSET(0) + //------------------------------------------------------------------------------ // Detection of non-trivial transparency @@ -997,10 +1001,10 @@ static int PictureARGBToYUVA(WebPPicture* picture, WebPEncCSP colorspace, return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION); } else { const uint8_t* const argb = (const uint8_t*)picture->argb; - const uint8_t* const a = argb + (0 ^ ALPHA_OFFSET); - const uint8_t* const r = argb + (1 ^ ALPHA_OFFSET); - const uint8_t* const g = argb + (2 ^ ALPHA_OFFSET); - const uint8_t* const b = argb + (3 ^ ALPHA_OFFSET); + const uint8_t* const a = argb + CHANNEL_OFFSET(0); + const uint8_t* const r = argb + CHANNEL_OFFSET(1); + const uint8_t* const g = argb + CHANNEL_OFFSET(2); + const uint8_t* const b = argb + CHANNEL_OFFSET(3); picture->colorspace = WEBP_YUV420; return ImportYUVAFromRGBA(r, g, b, a, 4, 4 * picture->argb_stride, @@ -1050,7 +1054,7 @@ int WebPPictureYUVAToARGB(WebPPicture* picture) { const int height = picture->height; const int argb_stride = 4 * picture->argb_stride; uint8_t* dst = (uint8_t*)picture->argb; - const uint8_t *cur_u = picture->u, *cur_v = picture->v, *cur_y = picture->y; + const uint8_t* cur_u = picture->u, *cur_v = picture->v, *cur_y = picture->y; WebPUpsampleLinePairFunc upsample = WebPGetLinePairConverter(ALPHA_OFFSET > 0); diff --git a/thirdparty/libwebp/src/enc/vp8i_enc.h b/thirdparty/libwebp/src/enc/vp8i_enc.h index 24e1944610..fedcaeea27 100644 --- a/thirdparty/libwebp/src/enc/vp8i_enc.h +++ b/thirdparty/libwebp/src/enc/vp8i_enc.h @@ -31,8 +31,8 @@ extern "C" { // version numbers #define ENC_MAJ_VERSION 1 -#define ENC_MIN_VERSION 0 -#define ENC_REV_VERSION 3 +#define ENC_MIN_VERSION 1 +#define ENC_REV_VERSION 0 enum { MAX_LF_LEVELS = 64, // Maximum loop filter level MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost @@ -249,7 +249,7 @@ typedef struct { int percent0_; // saved initial progress percent DError left_derr_; // left error diffusion (u/v) - DError *top_derr_; // top diffusion error - NULL if disabled + DError* top_derr_; // top diffusion error - NULL if disabled uint8_t* y_left_; // left luma samples (addressable from index -1 to 15). uint8_t* u_left_; // left u samples (addressable from index -1 to 7) |