diff options
author | Derek Sollenberger <djsollen@google.com> | 2013-02-07 18:38:54 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-02-07 18:38:54 +0000 |
commit | b6dbce6bfeaabde2a7b581c4c6888d532d32f3ac (patch) | |
tree | 1dd0a6f6cc091618520b48d4127d62c8c880e1d0 /src/enc/syntax.c | |
parent | 4b2196c929b70f2cdc1c2556580d349db89356d8 (diff) | |
download | webp-b6dbce6bfeaabde2a7b581c4c6888d532d32f3ac.tar.gz |
Revert "Sync libwebp with head#I6ecefe33"
This reverts commit 4b2196c929b70f2cdc1c2556580d349db89356d8
Change-Id: I3c026866c336663666cb5a2e9e34ecffd1f05595
Diffstat (limited to 'src/enc/syntax.c')
-rw-r--r-- | src/enc/syntax.c | 17 |
1 files changed, 14 insertions, 3 deletions
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 <assert.h> -#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); |