mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
cosmetic fix: sizeof(type) -> sizeof(*var)
Change-Id: I1a39fccfdcb9f0a4b9b025d3c9b522e8edfe7fd6
This commit is contained in:
parent
80ce27d34e
commit
7badd3da4a
@ -139,23 +139,24 @@ static void MapConfigToTools(VP8Encoder* const enc) {
|
|||||||
|
|
||||||
static VP8Encoder* InitVP8Encoder(const WebPConfig* const config,
|
static VP8Encoder* InitVP8Encoder(const WebPConfig* const config,
|
||||||
WebPPicture* const picture) {
|
WebPPicture* const picture) {
|
||||||
|
VP8Encoder* enc;
|
||||||
const int use_filter =
|
const int use_filter =
|
||||||
(config->filter_strength > 0) || (config->autofilter > 0);
|
(config->filter_strength > 0) || (config->autofilter > 0);
|
||||||
const int mb_w = (picture->width + 15) >> 4;
|
const int mb_w = (picture->width + 15) >> 4;
|
||||||
const int mb_h = (picture->height + 15) >> 4;
|
const int mb_h = (picture->height + 15) >> 4;
|
||||||
const int preds_w = 4 * mb_w + 1;
|
const int preds_w = 4 * mb_w + 1;
|
||||||
const int preds_h = 4 * mb_h + 1;
|
const int preds_h = 4 * mb_h + 1;
|
||||||
const size_t preds_size = preds_w * preds_h * sizeof(uint8_t);
|
const size_t preds_size = preds_w * preds_h * sizeof(*enc->preds_);
|
||||||
const int top_stride = mb_w * 16;
|
const int top_stride = mb_w * 16;
|
||||||
const size_t nz_size = (mb_w + 1) * sizeof(uint32_t) + WEBP_ALIGN_CST;
|
const size_t nz_size = (mb_w + 1) * sizeof(*enc->nz_) + WEBP_ALIGN_CST;
|
||||||
const size_t info_size = mb_w * mb_h * sizeof(VP8MBInfo);
|
const size_t info_size = mb_w * mb_h * sizeof(*enc->mb_info_);
|
||||||
const size_t samples_size = 2 * top_stride * sizeof(uint8_t) // top-luma/u/v
|
const size_t samples_size =
|
||||||
|
2 * top_stride * sizeof(*enc->y_top_) // top-luma/u/v
|
||||||
+ WEBP_ALIGN_CST; // align all
|
+ WEBP_ALIGN_CST; // align all
|
||||||
const size_t lf_stats_size =
|
const size_t lf_stats_size =
|
||||||
config->autofilter ? sizeof(LFStats) + WEBP_ALIGN_CST : 0;
|
config->autofilter ? sizeof(*enc->lf_stats_) + WEBP_ALIGN_CST : 0;
|
||||||
VP8Encoder* enc;
|
|
||||||
uint8_t* mem;
|
uint8_t* mem;
|
||||||
const uint64_t size = (uint64_t)sizeof(VP8Encoder) // main struct
|
const uint64_t size = (uint64_t)sizeof(*enc) // main struct
|
||||||
+ WEBP_ALIGN_CST // cache alignment
|
+ WEBP_ALIGN_CST // cache alignment
|
||||||
+ info_size // modes info
|
+ info_size // modes info
|
||||||
+ preds_size // prediction modes
|
+ preds_size // prediction modes
|
||||||
@ -173,7 +174,7 @@ static VP8Encoder* InitVP8Encoder(const WebPConfig* const config,
|
|||||||
" non-zero: %ld\n"
|
" non-zero: %ld\n"
|
||||||
" lf-stats: %ld\n"
|
" lf-stats: %ld\n"
|
||||||
" total: %ld\n",
|
" total: %ld\n",
|
||||||
sizeof(VP8Encoder) + WEBP_ALIGN_CST, info_size,
|
sizeof(*enc) + WEBP_ALIGN_CST, info_size,
|
||||||
preds_size, samples_size, nz_size, lf_stats_size, size);
|
preds_size, samples_size, nz_size, lf_stats_size, size);
|
||||||
printf("Transient object sizes:\n"
|
printf("Transient object sizes:\n"
|
||||||
" VP8EncIterator: %ld\n"
|
" VP8EncIterator: %ld\n"
|
||||||
@ -203,7 +204,7 @@ static VP8Encoder* InitVP8Encoder(const WebPConfig* const config,
|
|||||||
enc->mb_info_ = (VP8MBInfo*)mem;
|
enc->mb_info_ = (VP8MBInfo*)mem;
|
||||||
mem += info_size;
|
mem += info_size;
|
||||||
enc->preds_ = ((uint8_t*)mem) + 1 + enc->preds_w_;
|
enc->preds_ = ((uint8_t*)mem) + 1 + enc->preds_w_;
|
||||||
mem += preds_w * preds_h * sizeof(uint8_t);
|
mem += preds_size;
|
||||||
enc->nz_ = 1 + (uint32_t*)WEBP_ALIGN(mem);
|
enc->nz_ = 1 + (uint32_t*)WEBP_ALIGN(mem);
|
||||||
mem += nz_size;
|
mem += nz_size;
|
||||||
enc->lf_stats_ = lf_stats_size ? (LFStats*)WEBP_ALIGN(mem) : NULL;
|
enc->lf_stats_ = lf_stats_size ? (LFStats*)WEBP_ALIGN(mem) : NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user