From 0beed01aa580b48b603d91b0bd16832f1d97ade2 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 19 Feb 2016 19:22:34 -0800 Subject: [PATCH] cosmetics: fix indent after 2f5e898 2f5e898 fix multiple allocation for transform buffer Change-Id: Ied5c89c0040671e2eddf23c8b7a78e0d817dd18e --- src/enc/vp8l.c | 40 ++++++++++++++++++++-------------------- src/enc/vp8li.h | 14 +++++++------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/enc/vp8l.c b/src/enc/vp8l.c index 29a5a555..e77581c6 100644 --- a/src/enc/vp8l.c +++ b/src/enc/vp8l.c @@ -1128,21 +1128,21 @@ static void ClearTransformBuffer(VP8LEncoder* const enc) { static WebPEncodingError AllocateTransformBuffer(VP8LEncoder* const enc, int width, int height) { WebPEncodingError err = VP8_ENC_OK; - const int tile_size = 1 << enc->transform_bits_; - const uint64_t image_size = width * height; - // Ensure enough size for tiles, as well as for two scanlines and two - // extra pixels for CopyImageWithPrediction. - const uint64_t argb_scratch_size = - enc->use_predict_ ? tile_size * width + width + 2 : 0; - const int transform_data_size = - (enc->use_predict_ || enc->use_cross_color_) - ? VP8LSubSampleSize(width, enc->transform_bits_) * - VP8LSubSampleSize(height, enc->transform_bits_) - : 0; + const int tile_size = 1 << enc->transform_bits_; + const uint64_t image_size = width * height; + // Ensure enough size for tiles, as well as for two scanlines and two + // extra pixels for CopyImageWithPrediction. + const uint64_t argb_scratch_size = + enc->use_predict_ ? tile_size * width + width + 2 : 0; + const int transform_data_size = + (enc->use_predict_ || enc->use_cross_color_) + ? VP8LSubSampleSize(width, enc->transform_bits_) * + VP8LSubSampleSize(height, enc->transform_bits_) + : 0; const uint64_t mem_size = - image_size + WEBP_ALIGN_CST + - argb_scratch_size + WEBP_ALIGN_CST + - (uint64_t)transform_data_size; + image_size + WEBP_ALIGN_CST + + argb_scratch_size + WEBP_ALIGN_CST + + (uint64_t)transform_data_size; uint32_t* mem = enc->transform_mem_; if (mem == NULL || mem_size > enc->transform_mem_size_) { ClearTransformBuffer(enc); @@ -1154,13 +1154,13 @@ static WebPEncodingError AllocateTransformBuffer(VP8LEncoder* const enc, enc->transform_mem_ = mem; enc->transform_mem_size_ = (size_t)mem_size; } - enc->argb_ = mem; - mem = (uint32_t*)WEBP_ALIGN(mem + image_size); - enc->argb_scratch_ = mem; - mem = (uint32_t*)WEBP_ALIGN(mem + argb_scratch_size); - enc->transform_data_ = mem; + enc->argb_ = mem; + mem = (uint32_t*)WEBP_ALIGN(mem + image_size); + enc->argb_scratch_ = mem; + mem = (uint32_t*)WEBP_ALIGN(mem + argb_scratch_size); + enc->transform_data_ = mem; - enc->current_width_ = width; + enc->current_width_ = width; Error: return err; } diff --git a/src/enc/vp8li.h b/src/enc/vp8li.h index 7443238f..6e2721d2 100644 --- a/src/enc/vp8li.h +++ b/src/enc/vp8li.h @@ -25,17 +25,17 @@ extern "C" { #endif typedef struct { - const WebPConfig* config_; // user configuration and parameters - const WebPPicture* pic_; // input picture. + const WebPConfig* config_; // user configuration and parameters + const WebPPicture* pic_; // input picture. - uint32_t* argb_; // Transformed argb image data. - uint32_t* argb_scratch_; // Scratch memory for argb rows - // (used for prediction). - uint32_t* transform_data_; // Scratch memory for transform data. + uint32_t* argb_; // Transformed argb image data. + uint32_t* argb_scratch_; // Scratch memory for argb rows + // (used for prediction). + uint32_t* transform_data_; // Scratch memory for transform data. uint32_t* transform_mem_; // Currently allocated memory. size_t transform_mem_size_; // Currently allocated memory size. - int current_width_; // Corresponds to packed image width. + int current_width_; // Corresponds to packed image width. // Encoding parameters derived from quality parameter. int histo_bits_;