add version getters for decoder and encoder

WebPGetDecoderVersion() and WebPGetEncoderVersion()
will not return 0.1.2 encoded as 0x000102

dwebp and cwebp also have a new "-version" flag

Change-Id: I4fb4b5a8fc4e53681a386ff4b74fffb639fa237a
This commit is contained in:
Pascal Massimino
2011-03-24 16:17:10 -07:00
parent be4867d2f8
commit 650ffa3bbb
8 changed files with 43 additions and 1 deletions

View File

@ -16,6 +16,12 @@
extern "C" {
#endif
//-----------------------------------------------------------------------------
int WebPGetDecoderVersion() {
return (DEC_MAJ_VERSION << 16) | (DEC_MIN_VERSION << 8) | DEC_REV_VERSION;
}
//-----------------------------------------------------------------------------
// VP8Decoder

View File

@ -22,6 +22,11 @@ extern "C" {
//-----------------------------------------------------------------------------
// Various defines and enums
// version numbers
#define DEC_MAJ_VERSION 0
#define DEC_MIN_VERSION 1
#define DEC_REV_VERSION 2
#define ONLY_KEYFRAME_CODE // to remove any code related to P-Frames
// intra prediction modes

View File

@ -23,6 +23,11 @@ extern "C" {
//-----------------------------------------------------------------------------
// Various defines and enums
// version numbers
#define ENC_MAJ_VERSION 0
#define ENC_MIN_VERSION 1
#define ENC_REV_VERSION 2
// intra prediction modes
enum { B_DC_PRED = 0, // 4x4 modes
B_TM_PRED = 1,

View File

@ -27,6 +27,12 @@ extern "C" {
#define MAX_DIMENSION 16384 // maximum width/height allowed by the spec
//-----------------------------------------------------------------------------
int WebPGetEncoderVersion() {
return (ENC_MAJ_VERSION << 16) | (ENC_MIN_VERSION << 8) | ENC_REV_VERSION;
}
//-----------------------------------------------------------------------------
// WebPPicture
//-----------------------------------------------------------------------------

View File

@ -18,6 +18,10 @@
extern "C" {
#endif
// Return the decoder's version number, packed in hexadecimal using 8bits for
// each of major/minor/revision. E.g: v2.5.7 is 0x020507.
int WebPGetDecoderVersion();
// Retrieve basic header information: width, height.
// This function will also validate the header and return 0 in
// case of formatting error.

View File

@ -22,6 +22,10 @@ extern "C" {
#define WEBP_ENCODER_ABI_VERSION 0x0001
// Return the encoder's version number, packed in hexadecimal using 8bits for
// each of major/minor/revision. E.g: v2.5.7 is 0x020507.
int WebPGetEncoderVersion();
//-----------------------------------------------------------------------------
// One-stop-shop call! No questions asked: