align buffer for double too

sometimes, gcc insert sse2 storeu instructions (like in VP8InitFilter())
with aligment requirements.

Bug was visible 'sometimes' in non-debug mode, when trying to use -af.

Change-Id: If3ec282bbbb9f9d0d33ca4b2c4bed46cd26fe495
This commit is contained in:
Pascal Massimino 2011-05-05 19:32:38 -07:00
parent 842c009b38
commit e9273902f1

View File

@ -155,7 +155,8 @@ static VP8Encoder* InitEncoder(const WebPConfig* const config,
16 + 16 + 16 + 8 + 1 + // left y/u/v
2 * ALIGN_CST) // align all
* sizeof(uint8_t);
const size_t lf_stats_size = config->autofilter ? sizeof(LFStats) : 0;
const size_t lf_stats_size =
config->autofilter ? sizeof(LFStats) + ALIGN_CST : 0;
VP8Encoder* enc;
uint8_t* mem;
size_t size = sizeof(VP8Encoder) + ALIGN_CST // main struct
@ -215,7 +216,7 @@ static VP8Encoder* InitEncoder(const WebPConfig* const config,
mem += preds_w * preds_h * sizeof(uint8_t);
enc->nz_ = 1 + (uint32_t*)mem;
mem += nz_size;
enc->lf_stats_ = lf_stats_size ? (LFStats*)mem : NULL;
enc->lf_stats_ = lf_stats_size ? (LFStats*)DO_ALIGN(mem) : NULL;
mem += lf_stats_size;
// top samples (all 16-aligned)