mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 11:09:41 +00:00
Multithread AVIF PoC
This commit is contained in:
committed by
Ingvar Stepanyan
parent
63ac34a662
commit
685558847f
@@ -1,5 +1,6 @@
|
||||
#include <emscripten/bind.h>
|
||||
#include <emscripten/val.h>
|
||||
#include <emscripten/threading.h>
|
||||
#include "avif/avif.h"
|
||||
|
||||
using namespace emscripten;
|
||||
@@ -71,7 +72,7 @@ val encode(std::string buffer, int width, int height, AvifOptions options) {
|
||||
avifImageRGBToYUV(image, &srcRGB);
|
||||
|
||||
avifEncoder* encoder = avifEncoderCreate();
|
||||
encoder->maxThreads = 1;
|
||||
encoder->maxThreads = emscripten_num_logical_cores();
|
||||
encoder->minQuantizer = options.minQuantizer;
|
||||
encoder->maxQuantizer = options.maxQuantizer;
|
||||
encoder->minQuantizerAlpha = options.minQuantizerAlpha;
|
||||
|
||||
Reference in New Issue
Block a user