enc: disable pic->stats/extra_info w/WEBP_DISABLE_STATS

Change-Id: I4ca3fa45710bd6bbe131b2ae047b1e268241657c
This commit is contained in:
James Zern
2017-11-22 17:01:19 -08:00
parent 541179a9a5
commit f593d71a64
5 changed files with 47 additions and 0 deletions

View File

@ -289,11 +289,17 @@ static int GeneratePartition0(VP8Encoder* const enc) {
pos3 = VP8BitWriterPos(bw);
#if !defined(WEBP_DISABLE_STATS)
if (enc->pic_->stats) {
enc->pic_->stats->header_bytes[0] = (int)((pos2 - pos1 + 7) >> 3);
enc->pic_->stats->header_bytes[1] = (int)((pos3 - pos2 + 7) >> 3);
enc->pic_->stats->alpha_data_size = (int)enc->alpha_data_size_;
}
#else
(void)pos1;
(void)pos2;
(void)pos3;
#endif
if (bw->error_) {
return WebPEncodingSetError(enc->pic_, VP8_ENC_ERROR_OUT_OF_MEMORY);
}