mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 14:34:33 +02:00
Add a second multi-thread method
method 1 grouping: [parse + reconstruction] // [filtering + output] method 2 grouping: [parse] // [reconstruction+filtering + output] Depending on some heuristics (see VP8ThreadMethod()), we can pick one of the other when -mt flag (or option.use_threads) is selected. Conservatively, we always use method #2 for now until the heuristic is refined (so, timing should be the same the before this patch) + replace 'use_threads' by 'mt_method' + define MIN_WIDTH_FOR_THREADS constant + fix comment alignment Change-Id: I11a756dea9070d6e21b1a9481d357a1e8aa0663e
This commit is contained in:
@ -662,8 +662,8 @@ static int ParseFrame(VP8Decoder* const dec, VP8Io* io) {
|
||||
return VP8SetError(dec, VP8_STATUS_USER_ABORT, "Output aborted.");
|
||||
}
|
||||
}
|
||||
if (dec->use_threads_ && !WebPWorkerSync(&dec->worker_)) {
|
||||
return 0;
|
||||
if (dec->mt_method_ > 0) {
|
||||
if (!WebPWorkerSync(&dec->worker_)) return 0;
|
||||
}
|
||||
|
||||
// Finish
|
||||
@ -728,7 +728,7 @@ void VP8Clear(VP8Decoder* const dec) {
|
||||
if (dec == NULL) {
|
||||
return;
|
||||
}
|
||||
if (dec->use_threads_) {
|
||||
if (dec->mt_method_ > 0) {
|
||||
WebPWorkerEnd(&dec->worker_);
|
||||
}
|
||||
ALPHDelete(dec->alph_dec_);
|
||||
|
Reference in New Issue
Block a user