MCPcopy Create free account
hub / github.com/ZDoom/Raze / InitThreadContext

Function InitThreadContext

libraries/webp/src/dec/frame_dec.c:641–658  ·  view source on GitHub ↗

Initialize multi/single-thread worker

Source from the content-addressed store, hash-verified

639
640// Initialize multi/single-thread worker
641static int InitThreadContext(VP8Decoder* const dec) {
642 dec->cache_id_ = 0;
643 if (dec->mt_method_ > 0) {
644 WebPWorker* const worker = &dec->worker_;
645 if (!WebPGetWorkerInterface()->Reset(worker)) {
646 return VP8SetError(dec, VP8_STATUS_OUT_OF_MEMORY,
647 "thread initialization failed.");
648 }
649 worker->data1 = dec;
650 worker->data2 = (void*)&dec->thread_ctx_.io_;
651 worker->hook = FinishRow;
652 dec->num_caches_ =
653 (dec->filter_type_ > 0) ? MT_CACHE_LINES : MT_CACHE_LINES - 1;
654 } else {
655 dec->num_caches_ = ST_CACHE_LINES;
656 }
657 return 1;
658}
659
660int VP8GetThreadMethod(const WebPDecoderOptions* const options,
661 const WebPHeaderStructure* const headers,

Callers 1

VP8InitFrameFunction · 0.85

Calls 3

WebPGetWorkerInterfaceFunction · 0.85
VP8SetErrorFunction · 0.85
ResetMethod · 0.45

Tested by

no test coverage detected