diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-12-11 10:19:31 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-12-11 10:19:31 +0100 |
commit | 178b8572d71a34975ffd7ada87227e1b8ed7296e (patch) | |
tree | 1ca3314f2a20983cd919c7078ae8f20eadb259de /src/3rdparty/libwebp/src/enc/vp8l_enc.c | |
parent | 7abea3cc2d4295298e7682c755c4de9f674d55b4 (diff) | |
parent | 904aa931871fe2ebe5cc6b14a55f37658e15ee89 (diff) | |
download | qtimageformats-178b8572d71a34975ffd7ada87227e1b8ed7296e.tar.gz |
Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Ib84ba922bb21f9e6c52c3096e7ae0fc10025c202
Diffstat (limited to 'src/3rdparty/libwebp/src/enc/vp8l_enc.c')
-rw-r--r-- | src/3rdparty/libwebp/src/enc/vp8l_enc.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/enc/vp8l_enc.c index a89184e..2713edc 100644 --- a/src/3rdparty/libwebp/src/enc/vp8l_enc.c +++ b/src/3rdparty/libwebp/src/enc/vp8l_enc.c @@ -809,6 +809,7 @@ static WebPEncodingError EncodeImageNoHuffman(VP8LBitWriter* const bw, err = VP8_ENC_ERROR_OUT_OF_MEMORY; goto Error; } + VP8LHistogramSetClear(histogram_image); // Build histogram image and symbols from backward references. VP8LHistogramStoreRefs(refs, histogram_image->histograms[0]); @@ -1248,14 +1249,20 @@ static WebPEncodingError MakeInputImageCopy(VP8LEncoder* const enc) { const WebPPicture* const picture = enc->pic_; const int width = picture->width; const int height = picture->height; - int y; + err = AllocateTransformBuffer(enc, width, height); if (err != VP8_ENC_OK) return err; if (enc->argb_content_ == kEncoderARGB) return VP8_ENC_OK; - for (y = 0; y < height; ++y) { - memcpy(enc->argb_ + y * width, - picture->argb + y * picture->argb_stride, - width * sizeof(*enc->argb_)); + + { + uint32_t* dst = enc->argb_; + const uint32_t* src = picture->argb; + int y; + for (y = 0; y < height; ++y) { + memcpy(dst, src, width * sizeof(*dst)); + dst += width; + src += picture->argb_stride; + } } enc->argb_content_ = kEncoderARGB; assert(enc->current_width_ == width); |