From 563e52d62e90eeb7f1ff1cf114a33639fb46b476 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 16 Sep 2011 12:07:55 -0700 Subject: [PATCH] cosmetics after '76036f5 Refactor decoder library' reference 'VP8X' consistently / spelling sort header size defines alphabetically on their logical boundaries drop useless cast const updates Change-Id: I9409814c5b89773ae8910dc74887f91435e6ac82 --- src/dec/idec.c | 6 +++--- src/dec/vp8.c | 2 +- src/dec/webp.c | 8 ++++---- src/dec/webpi.h | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dec/idec.c b/src/dec/idec.c index 2998ec1c..048d3c5a 100644 --- a/src/dec/idec.c +++ b/src/dec/idec.c @@ -232,7 +232,7 @@ static void RestoreContext(const MBContext* context, VP8Decoder* const dec, //------------------------------------------------------------------------------ -static VP8StatusCode IDecError(WebPIDecoder* idec, VP8StatusCode error) { +static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) { if (idec->state_ == STATE_VP8_DATA) { VP8Io* const io = &idec->io_; if (io->teardown) { @@ -243,7 +243,7 @@ static VP8StatusCode IDecError(WebPIDecoder* idec, VP8StatusCode error) { return error; } -static void ChangeState(WebPIDecoder* idec, DecState new_state, +static void ChangeState(WebPIDecoder* const idec, DecState new_state, uint32_t consumed_bytes) { idec->state_ = new_state; idec->mem_.start_ += consumed_bytes; @@ -272,7 +272,7 @@ static VP8StatusCode DecodeWebPHeaders(WebPIDecoder* const idec) { static VP8StatusCode DecodeVP8FrameHeader(WebPIDecoder* const idec) { const uint8_t* data = idec->mem_.buf_ + idec->mem_.start_; - uint32_t curr_size = MemDataSize(&idec->mem_); + const uint32_t curr_size = MemDataSize(&idec->mem_); uint32_t bits; if (curr_size < VP8_FRAME_HEADER_SIZE) { diff --git a/src/dec/vp8.c b/src/dec/vp8.c index 2d73d939..9149284b 100644 --- a/src/dec/vp8.c +++ b/src/dec/vp8.c @@ -265,7 +265,7 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { "null VP8Io passed to VP8GetHeaders()"); } - buf = (uint8_t*)io->data; + buf = io->data; buf_size = io->data_size; // Process Pre-VP8 chunks. diff --git a/src/dec/webp.c b/src/dec/webp.c index aeb5314e..91ac75f7 100644 --- a/src/dec/webp.c +++ b/src/dec/webp.c @@ -19,7 +19,7 @@ extern "C" { //------------------------------------------------------------------------------ // RIFF layout is: -// 0ffset tag +// Offset tag // 0...3 "RIFF" 4-byte tag // 4...7 size of image data (including metadata) starting at offset 8 // 8...11 "WEBP" our form-type signature @@ -215,7 +215,7 @@ VP8StatusCode WebPParseHeaders(const uint8_t** data, uint32_t* data_size, return VP8_STATUS_BITSTREAM_ERROR; // Wrong RIFF Header. } - // Skip over VP8x header. + // Skip over VP8X header. status = WebPParseVP8X(&buf, &buf_size, &vp8x_skip_size, NULL, NULL, NULL); if (status != VP8_STATUS_OK) { return status; // Wrong VP8X Chunk / Insufficient data. @@ -481,7 +481,7 @@ static VP8StatusCode GetFeatures(const uint8_t* data, uint32_t data_size, return status; // Wrong RIFF Header / Insufficient data. } - // Skip over VP8x. + // Skip over VP8X. status = WebPParseVP8X(&data, &data_size, &vp8x_skip_size, &features->width, &features->height, &flags); if (status != VP8_STATUS_OK) { @@ -489,7 +489,7 @@ static VP8StatusCode GetFeatures(const uint8_t* data, uint32_t data_size, } if (vp8x_skip_size > 0) { - return VP8_STATUS_OK; // Return features from VP8x header. + return VP8_STATUS_OK; // Return features from VP8X header. } // Skip over VP8 header. diff --git a/src/dec/webpi.h b/src/dec/webpi.h index f3ead259..6c14460b 100644 --- a/src/dec/webpi.h +++ b/src/dec/webpi.h @@ -19,7 +19,7 @@ extern "C" { #include "../webp/decode_vp8.h" //------------------------------------------------------------------------------ -// WebPDecParams: Decoding output parameters. Transcient internal object. +// WebPDecParams: Decoding output parameters. Transient internal object. typedef struct WebPDecParams WebPDecParams; typedef int (*OutputFunc)(const VP8Io* const io, WebPDecParams* const p); @@ -63,10 +63,10 @@ void WebPResetDecParams(WebPDecParams* const params); #define TAG_SIZE 4 #define CHUNK_HEADER_SIZE 8 #define RIFF_HEADER_SIZE 12 -#define VP8X_CHUNK_SIZE 12 -#define TILE_CHUNK_SIZE 8 #define FRAME_CHUNK_SIZE 20 #define LOOP_CHUNK_SIZE 4 +#define TILE_CHUNK_SIZE 8 +#define VP8X_CHUNK_SIZE 12 #define VP8_FRAME_HEADER_SIZE 10 // Size of the frame header within VP8 data. // Validates the RIFF container (if detected) and skips over it.