diff --git a/src/dec/vp8.c b/src/dec/vp8.c index 9f09b074..904cc70b 100644 --- a/src/dec/vp8.c +++ b/src/dec/vp8.c @@ -94,7 +94,7 @@ int VP8CheckSignature(const uint8_t* const data, size_t data_size) { } int VP8GetInfo(const uint8_t* data, size_t data_size, size_t chunk_size, - int* width, int* height) { + int* const width, int* const height) { if (data == NULL || data_size < VP8_FRAME_HEADER_SIZE) { return 0; // not enough data } diff --git a/src/dec/vp8i.h b/src/dec/vp8i.h index af96dc91..b999ec12 100644 --- a/src/dec/vp8i.h +++ b/src/dec/vp8i.h @@ -290,17 +290,6 @@ struct VP8Decoder { int VP8SetError(VP8Decoder* const dec, VP8StatusCode error, const char* const msg); -// Returns true if the next 3 bytes in data contain the VP8 signature. -int VP8CheckSignature(const uint8_t* const data, size_t data_size); - -// Validates the VP8 data-header and retrieves basic header information viz -// width and height. Returns 0 in case of formatting error. *width/*height -// can be passed NULL. -int VP8GetInfo(const uint8_t* data, - size_t data_size, // data available so far - size_t chunk_size, // total data size expect in the chunk - int *width, int *height); - // in tree.c void VP8ResetProba(VP8Proba* const proba); void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec); diff --git a/src/dec/vp8li.h b/src/dec/vp8li.h index 605b85e3..82d943da 100644 --- a/src/dec/vp8li.h +++ b/src/dec/vp8li.h @@ -87,15 +87,6 @@ typedef struct { // in vp8l.c -// Returns true if the next byte(s) in data is a VP8L signature. -int VP8LCheckSignature(const uint8_t* const data, size_t size); - -// Validates the VP8L data-header and retrieves basic header information viz -// width, height and alpha. Returns 0 in case of formatting error. -// width/height/has_alpha can be passed NULL. -int VP8LGetInfo(const uint8_t* data, size_t data_size, // data available so far - int* const width, int* const height, int* const has_alpha); - // Decodes a raw image stream (without header) and store the alpha data // into *output, which must be of size width x height. Returns false in case // of error. diff --git a/src/webp/decode_vp8.h b/src/webp/decode_vp8.h index 7cbb2457..93e86566 100644 --- a/src/webp/decode_vp8.h +++ b/src/webp/decode_vp8.h @@ -151,6 +151,29 @@ WEBP_EXTERN(void) VP8Clear(VP8Decoder* const dec); WEBP_EXTERN(void) VP8Delete(VP8Decoder* const dec); //------------------------------------------------------------------------------ +// Miscellaneous VP8/VP8L bitstream probing functions. + +// Returns true if the next 3 bytes in data contain the VP8 signature. +WEBP_EXTERN(int) VP8CheckSignature(const uint8_t* const data, size_t data_size); + +// Validates the VP8 data-header and retrieves basic header information viz +// width and height. Returns 0 in case of formatting error. *width/*height +// can be passed NULL. +WEBP_EXTERN(int) VP8GetInfo( + const uint8_t* data, + size_t data_size, // data available so far + size_t chunk_size, // total data size expected in the chunk + int* const width, int* const height); + +// Returns true if the next byte(s) in data is a VP8L signature. +WEBP_EXTERN(int) VP8LCheckSignature(const uint8_t* const data, size_t size); + +// Validates the VP8L data-header and retrieves basic header information viz +// width, height and alpha. Returns 0 in case of formatting error. +// width/height/has_alpha can be passed NULL. +WEBP_EXTERN(int) VP8LGetInfo( + const uint8_t* data, size_t data_size, // data available so far + int* const width, int* const height, int* const has_alpha); #if defined(__cplusplus) || defined(c_plusplus) } // extern "C"