mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-15 18:19:47 +00:00
Fix AVIF multithreading (#981)
This commit is contained in:
@@ -68,6 +68,9 @@ import webpDecWasm from 'url:codecs/webp/dec/webp_dec.wasm';
|
||||
import wp2DecWasm from 'url:codecs/wp2/dec/wp2_dec.wasm';
|
||||
|
||||
// AVIF
|
||||
import * as avifEncMtWorker from 'entry-data:codecs/avif/enc/avif_enc_mt.worker.js';
|
||||
import * as avifEncMt from 'entry-data:codecs/avif/enc/avif_enc_mt';
|
||||
import avifEncMtWasm from 'url:codecs/avif/enc/avif_enc_mt.wasm';
|
||||
import avifEncWasm from 'url:codecs/avif/enc/avif_enc.wasm';
|
||||
import * as avifEnc from 'entry-data:codecs/avif/enc/avif_enc.js';
|
||||
|
||||
@@ -138,7 +141,17 @@ export const theRest = (async () => {
|
||||
if (!supportsWebP) items.push(webpDec.main, ...webpDec.deps, webpDecWasm);
|
||||
|
||||
// AVIF
|
||||
items.push(avifEnc.main, ...avifEnc.deps, avifEncWasm);
|
||||
if (supportsThreads) {
|
||||
items.push(
|
||||
avifEncMtWorker.main,
|
||||
...avifEncMtWorker.deps,
|
||||
avifEncMt.main,
|
||||
...avifEncMt.deps,
|
||||
avifEncMtWasm,
|
||||
);
|
||||
} else {
|
||||
items.push(avifEnc.main, ...avifEnc.deps, avifEncWasm);
|
||||
}
|
||||
|
||||
// JXL
|
||||
if (supportsThreads && supportsSimd) {
|
||||
|
||||
Reference in New Issue
Block a user