From b6dbce6bfeaabde2a7b581c4c6888d532d32f3ac Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Thu, 7 Feb 2013 18:38:54 +0000 Subject: Revert "Sync libwebp with head#I6ecefe33" This reverts commit 4b2196c929b70f2cdc1c2556580d349db89356d8 Change-Id: I3c026866c336663666cb5a2e9e34ecffd1f05595 --- src/enc/syntax.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/enc/syntax.c') diff --git a/src/enc/syntax.c b/src/enc/syntax.c index 4b20c1aa..99c21fec 100644 --- a/src/enc/syntax.c +++ b/src/enc/syntax.c @@ -11,9 +11,8 @@ #include -#include "../utils/utils.h" -#include "webp/format_constants.h" #include "./vp8enci.h" +#include "webp/format_constants.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { @@ -22,6 +21,18 @@ extern "C" { //------------------------------------------------------------------------------ // Helper functions +// TODO(later): Move to webp/format_constants.h? +static void PutLE24(uint8_t* const data, uint32_t val) { + data[0] = (val >> 0) & 0xff; + data[1] = (val >> 8) & 0xff; + data[2] = (val >> 16) & 0xff; +} + +static void PutLE32(uint8_t* const data, uint32_t val) { + PutLE24(data, val); + data[3] = (val >> 24) & 0xff; +} + static int IsVP8XNeeded(const VP8Encoder* const enc) { return !!enc->has_alpha_; // Currently the only case when VP8X is needed. // This could change in the future. @@ -62,7 +73,7 @@ static WebPEncodingError PutVP8XHeader(const VP8Encoder* const enc) { assert(pic->width <= MAX_CANVAS_SIZE && pic->height <= MAX_CANVAS_SIZE); if (enc->has_alpha_) { - flags |= ALPHA_FLAG; + flags |= ALPHA_FLAG_BIT; } PutLE32(vp8x + TAG_SIZE, VP8X_CHUNK_SIZE); -- cgit v1.2.3