mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-19 02:12:52 +01:00
Increase initial buffer size for VP8L Bit Writer.
Increase the initial buffer size for VP8L Bit Writer from 4bpp to 8bpp. The resize buffer is expensive (requires realloc and copy) and this additional memory (0.5 * W * H) doesn't add much overhead on the lossless encoder. Change-Id: Ic1fe55cd7bc3d1afadc799e4c2c8786ec848ee66
This commit is contained in:
parent
a7d2ee39be
commit
fde2904b8a
@ -1096,7 +1096,8 @@ int VP8LEncodeImage(const WebPConfig* const config,
|
||||
|
||||
width = picture->width;
|
||||
height = picture->height;
|
||||
if (!VP8LBitWriterInit(&bw, (width * height) >> 1)) {
|
||||
// Initialize BitWriter with size corresponding to 8bpp.
|
||||
if (!VP8LBitWriterInit(&bw, width * height)) {
|
||||
err = VP8_ENC_ERROR_OUT_OF_MEMORY;
|
||||
goto Error;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user