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:
Pascal Massimino
2011-07-22 13:09:10 -07:00
parent acd8ba4229
commit fc7815d692
16 changed files with 519 additions and 120 deletions

View File

@ -351,6 +351,7 @@ typedef struct {
int scaled_width, scaled_height; // final resolution
int force_rotation; // forced rotation (to be applied _last_)
int no_enhancement; // if true, discard enhancement layer
int use_threads; // if true, use multi-threaded decoding
} WebPDecoderOptions;
// Main object storing the configuration for advanced decoding.

View File

@ -67,10 +67,13 @@ struct VP8Io {
VP8IoPutHook put;
// called just before starting to decode the blocks.
// Should returns 0 in case of error.
// Must return false in case of setup error, true otherwise. If false is
// returned, teardown() will NOT be called. But if the setup succeeded
// and true is returned, then teardown() will always be called afterward.
VP8IoSetupHook setup;
// called just after block decoding is finished (or when an error occurred).
// Called just after block decoding is finished (or when an error occurred
// during put()). Is NOT called if setup() failed.
VP8IoTeardownHook teardown;
// this is a recommendation for the user-side yuv->rgb converter. This flag