mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-16 13:59:51 +02:00
Separate out mux and demux code and libraries:
- Separate out mux.h and demux.h - muxtypes.h: new header for data types common to mux/demux - Move some misc read/write utilities to utils/utils.h - Remove some duplicate methods. - Separate out mux/demux libraries Change-Id: If9b9569b10d55d922ad9317ef51710544315d6de
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "../utils/utils.h"
|
||||
#include "../webp/format_constants.h"
|
||||
#include "./vp8enci.h"
|
||||
|
||||
@ -21,18 +22,6 @@ 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.
|
||||
@ -73,7 +62,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_BIT;
|
||||
flags |= ALPHA_FLAG;
|
||||
}
|
||||
|
||||
PutLE32(vp8x + TAG_SIZE, VP8X_CHUNK_SIZE);
|
||||
|
Reference in New Issue
Block a user