Remove mt AVIF encoder for now (#964)

This commit is contained in:
Jake Archibald
2021-03-03 12:02:43 +00:00
committed by GitHub
parent 37d778e4da
commit 7f6ee3204f
2 changed files with 1 additions and 25 deletions

View File

@@ -13,22 +13,11 @@
import type { AVIFModule } from 'codecs/avif/enc/avif_enc';
import type { EncodeOptions } from '../shared/meta';
import wasmUrlWithoutMT from 'url:codecs/avif/enc/avif_enc.wasm';
import wasmUrlWithMT from 'url:codecs/avif/enc/avif_enc_mt.wasm';
import workerUrl from 'omt:codecs/avif/enc/avif_enc_mt.worker.js';
import { initEmscriptenModule } from 'features/worker-utils';
import { threads } from 'wasm-feature-detect';
let emscriptenModule: Promise<AVIFModule>;
async function init() {
if (await threads()) {
const avifEncoder = await import('codecs/avif/enc/avif_enc_mt');
return initEmscriptenModule<AVIFModule>(
avifEncoder.default,
wasmUrlWithMT,
workerUrl,
);
}
const avifEncoder = await import('codecs/avif/enc/avif_enc.js');
return initEmscriptenModule(avifEncoder.default, wasmUrlWithoutMT);
}

View File

@@ -68,9 +68,6 @@ 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';
@@ -141,17 +138,7 @@ export const theRest = (async () => {
if (!supportsWebP) items.push(webpDec.main, ...webpDec.deps, webpDecWasm);
// AVIF
if (supportsThreads) {
items.push(
avifEncMtWorker.main,
...avifEncMtWorker.deps,
avifEncMt.main,
...avifEncMt.deps,
avifEncMtWasm,
);
} else {
items.push(avifEnc.main, ...avifEnc.deps, avifEncWasm);
}
items.push(avifEnc.main, ...avifEnc.deps, avifEncWasm);
// JXL
if (supportsThreads && supportsSimd) {