modify WebPParseHeaders to allow reuse by GetFeatures

moves the implementation to ParseHeadersInternal. this also allows
decoding to start at a VP8X sub-chunk, e.g. 'ALPH'.

Change-Id: I06791f87d90f888de32746ecb02705e4b0ff227a
This commit is contained in:
James Zern
2012-06-08 21:50:45 +00:00
parent e2ffe446bd
commit fb4943bdf9
3 changed files with 100 additions and 87 deletions

View File

@ -22,7 +22,6 @@ extern "C" {
#define NUM_ARGB_CACHE_ROWS 16
static const size_t kHeaderBytes = 5;
static const int kCodeLengthLiterals = 16;
static const int kCodeLengthRepeatCode = 16;
static const int kCodeLengthExtraBits[3] = { 2, 3, 7 };
@ -98,7 +97,7 @@ static int ReadImageInfo(VP8LBitReader* const br,
int VP8LGetInfo(const uint8_t* data, size_t data_size,
int* const width, int* const height, int* const has_alpha) {
if (data == NULL || data_size < kHeaderBytes) {
if (data == NULL || data_size < VP8L_FRAME_HEADER_SIZE) {
return 0; // not enough data
} else {
int w, h, a;