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:
Vikas Arora 2014-02-11 11:12:21 -08:00
parent a7d2ee39be
commit fde2904b8a

View File

@ -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;
}