mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-16 10:39:53 +00:00
Make emscripten with threads compile
This commit is contained in:
BIN
codecs/really_big.jpg
Normal file
BIN
codecs/really_big.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 MiB |
@@ -14,14 +14,12 @@ echo "============================================="
|
|||||||
emcc \
|
emcc \
|
||||||
${OPTIMIZE} \
|
${OPTIMIZE} \
|
||||||
--bind \
|
--bind \
|
||||||
-D WEBP_USE_THREAD \
|
-D WEBP_USE_THREAD=1 \
|
||||||
-s ALLOW_MEMORY_GROWTH=1 \
|
|
||||||
-s USE_PTHREADS=1 \
|
-s USE_PTHREADS=1 \
|
||||||
-s ASSERTIONS=1 \
|
-s ASSERTIONS=1 \
|
||||||
-s PTHREAD_POOL_SIZE=2 \
|
-s PTHREAD_POOL_SIZE=4 \
|
||||||
-s TOTAL_MEMORY=268435456 \
|
-s TOTAL_MEMORY=268435456 \
|
||||||
-s WASM_MEM_MAX=268435456 \
|
-s WASM_MEM_MAX=268435456 \
|
||||||
-s 'EXPORT_NAME="webp_enc"' \
|
|
||||||
--std=c++11 \
|
--std=c++11 \
|
||||||
-I node_modules/libwebp \
|
-I node_modules/libwebp \
|
||||||
-o ./webp_enc.js \
|
-o ./webp_enc.js \
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
Module.onRuntimeInitialized = async _ => {
|
Module.onRuntimeInitialized = async _ => {
|
||||||
console.log('Version:', Module.version().toString(16));
|
console.log('Version:', Module.version().toString(16));
|
||||||
const image = await loadImage('../example.png');
|
const image = await loadImage('../really_big.jpg');
|
||||||
let start = performance.now();
|
let start = performance.now();
|
||||||
const result = Module.encode(image.data, image.width, image.height, {
|
const result = Module.encode(image.data, image.width, image.height, {
|
||||||
quality: 75,
|
quality: 75,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Reference in New Issue
Block a user