diff --git a/src/dec/webp.c b/src/dec/webp.c index 34480474..ec05ff2f 100644 --- a/src/dec/webp.c +++ b/src/dec/webp.c @@ -14,7 +14,7 @@ #include "./vp8i.h" #include "./vp8li.h" #include "./webpi.h" -#include "../webp/format_constants.h" +#include "../webp/mux_types.h" // ALPHA_FLAG #if defined(__cplusplus) || defined(c_plusplus) extern "C" { diff --git a/src/enc/syntax.c b/src/enc/syntax.c index c157cafd..24e008c3 100644 --- a/src/enc/syntax.c +++ b/src/enc/syntax.c @@ -12,7 +12,8 @@ #include #include "../utils/utils.h" -#include "../webp/format_constants.h" +#include "../webp/format_constants.h" // RIFF constants +#include "../webp/mux_types.h" // ALPHA_FLAG #include "./vp8enci.h" #if defined(__cplusplus) || defined(c_plusplus) diff --git a/src/webp/demux.h b/src/webp/demux.h index 2a999cd0..cfb4fdfe 100644 --- a/src/webp/demux.h +++ b/src/webp/demux.h @@ -45,7 +45,6 @@ #ifndef WEBP_WEBP_DEMUX_H_ #define WEBP_WEBP_DEMUX_H_ -#include "./format_constants.h" #include "./mux_types.h" #if defined(__cplusplus) || defined(c_plusplus) diff --git a/src/webp/format_constants.h b/src/webp/format_constants.h index 2ac8fe67..8b3d6778 100644 --- a/src/webp/format_constants.h +++ b/src/webp/format_constants.h @@ -12,6 +12,9 @@ #ifndef WEBP_WEBP_FORMAT_CONSTANTS_H_ #define WEBP_WEBP_FORMAT_CONSTANTS_H_ +// Create fourcc of the chunk from the chunk tag characters. +#define MKFOURCC(a, b, c, d) ((uint32_t)(a) | (b) << 8 | (c) << 16 | (d) << 24) + // VP8 related constants. #define VP8_SIGNATURE 0x9d012a // Signature in VP8 data. #define VP8_MAX_PARTITION0_SIZE (1 << 19) // max size of mode partition @@ -70,19 +73,6 @@ typedef enum { #define FRGM_CHUNK_SIZE 6 // Size of a FRGM chunk. #define VP8X_CHUNK_SIZE 10 // Size of a VP8X chunk. -// VP8X Feature Flags. -#if !(defined(__cplusplus) || defined(c_plusplus)) -typedef enum WebPFeatureFlags WebPFeatureFlags; -#endif -enum WebPFeatureFlags { - FRAGMENTS_FLAG = 0x00000001, - ANIMATION_FLAG = 0x00000002, - XMP_FLAG = 0x00000004, - EXIF_FLAG = 0x00000008, - ALPHA_FLAG = 0x00000010, - ICCP_FLAG = 0x00000020 -}; - #define MAX_CANVAS_SIZE (1 << 24) // 24-bit max for VP8X width/height. #define MAX_IMAGE_AREA (1ULL << 32) // 32-bit max for width x height. #define MAX_LOOP_COUNT (1 << 16) // maximum value for loop-count diff --git a/src/webp/mux.h b/src/webp/mux.h index 713d738c..85a89227 100644 --- a/src/webp/mux.h +++ b/src/webp/mux.h @@ -45,7 +45,6 @@ #ifndef WEBP_WEBP_MUX_H_ #define WEBP_WEBP_MUX_H_ -#include "./format_constants.h" #include "./mux_types.h" #if defined(__cplusplus) || defined(c_plusplus) diff --git a/src/webp/mux_types.h b/src/webp/mux_types.h index 84d94472..4006a540 100644 --- a/src/webp/mux_types.h +++ b/src/webp/mux_types.h @@ -5,7 +5,7 @@ // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ // ----------------------------------------------------------------------------- // -// Internal header for some common data-types used by mux and demux libraries. +// Data-types common to the mux and demux libraries. // // Author: Urvang (urvang@google.com) @@ -20,14 +20,23 @@ extern "C" { #endif -// Create fourcc of the chunk from the chunk tag characters. -#define MKFOURCC(a, b, c, d) ((uint32_t)(a) | (b) << 8 | (c) << 16 | (d) << 24) +#if !(defined(__cplusplus) || defined(c_plusplus)) +typedef enum WebPFeatureFlags WebPFeatureFlags; +typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; +#endif + +// VP8X Feature Flags. +enum WebPFeatureFlags { + FRAGMENTS_FLAG = 0x00000001, + ANIMATION_FLAG = 0x00000002, + XMP_FLAG = 0x00000004, + EXIF_FLAG = 0x00000008, + ALPHA_FLAG = 0x00000010, + ICCP_FLAG = 0x00000020 +}; // Dispose method (animation only). Indicates how the area used by the current // frame is to be treated before rendering the next frame on the canvas. -#if !(defined(__cplusplus) || defined(c_plusplus)) -typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; -#endif enum WebPMuxAnimDispose { WEBP_MUX_DISPOSE_NONE, // Do not dispose. WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color.