mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-14 21:09:55 +02:00
multi-thread decoding: ~25-30% faster
To be enabled with the flag WEBP_USE_THREAD. For now it's only available on unix (pthread), when using Makefile.unix Will be switched on more generally later. In-loop filtering and output (=rescaling/yuv->rgb conversion) is done in parallel to bitstream decoding, lagging 1 row behind. Example: examples/dwebp bryce.webp -v Time to decode picture: 0.680s examples/dwebp bryce.webp -v -mt Time to decode picture: 0.515s Change-Id: Ic30a897423137a3bdace9c4e30465ef758fe53f2
This commit is contained in:
@ -92,6 +92,12 @@ static VP8StatusCode DecodeInto(const uint8_t* data, uint32_t data_size,
|
||||
io.data_size = data_size;
|
||||
WebPInitCustomIo(params, &io); // Plug the I/O functions.
|
||||
|
||||
#ifdef WEBP_USE_THREAD
|
||||
dec->use_threads_ = params->options && (params->options->use_threads > 0);
|
||||
#else
|
||||
dec->use_threads_ = 0;
|
||||
#endif
|
||||
|
||||
// Decode bitstream header, update io->width/io->height.
|
||||
if (!VP8GetHeaders(dec, &io)) {
|
||||
status = VP8_STATUS_BITSTREAM_ERROR;
|
||||
|
Reference in New Issue
Block a user