Updated EMSCRIPTEN, c-gaborator
This commit is contained in:
parent
837f1fa402
commit
13279ba610
2
build.sh
2
build.sh
|
@ -9,4 +9,4 @@ docker build -t webhibiki_builder -f docker/Dockerfile .
|
|||
mkdir output 2>/dev/null
|
||||
|
||||
docker run -it --rm --volume "${ROOT_DIR}/src:/src/dist:ro" --volume "${ROOT_DIR}/output:/output:rw" webhibiki_builder
|
||||
docker run -it --rm --volume "${ROOT_DIR}/src:/src/dist:ro" --volume "${ROOT_DIR}/output:/output:rw" webhibiki_builder "-msimd128 -msse -msse2 -mavx" "webhibiki.simd"
|
||||
docker run -it --rm --volume "${ROOT_DIR}/src:/src/dist:ro" --volume "${ROOT_DIR}/output:/output:rw" webhibiki_builder "-msimd128 -msse -msse2 -msse3 -mavx" "webhibiki.simd"
|
|
@ -1,6 +1,6 @@
|
|||
FROM debian:bullseye
|
||||
|
||||
ARG EMSCRIPTEN_TAG=3.1.2
|
||||
ARG EMSCRIPTEN_TAG=3.1.16
|
||||
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt update && \
|
||||
|
|
|
@ -24,9 +24,9 @@ export CXXFLAGS="${CXXFLAGS} -I/build/include ${1} -flto -O3 -ffast-math -g0 -s
|
|||
export LDFLAGS="${CXXFLAGS} -g0 -flto -s EVAL_CTORS=2 -s ENVIRONMENT=web,worker -s WASM_BIGINT=1 -s MALLOC=emmalloc -s AUTO_NATIVE_LIBRARIES=0"
|
||||
export PATH="${PATH}:/build"
|
||||
|
||||
git clone https://git.gammaspectra.live/S.O.N.G/c-gaborator /src/c-gaborator
|
||||
git clone https://git.gammaspectra.live/S.O.N.G/c-gaborator.git /src/c-gaborator
|
||||
pushd /src/c-gaborator
|
||||
git reset --hard 8e4cea6648209bfe61def5e11d989255664dfb6d
|
||||
git reset --hard 8ef1b52d3b3ec8c06cfc7b5592b714aedf73e708
|
||||
git submodule update --init --recursive
|
||||
|
||||
mkdir build && pushd build
|
||||
|
@ -45,9 +45,9 @@ fi
|
|||
emmake make install
|
||||
cp -v lib/pffft/libpffft.a /build/lib
|
||||
|
||||
git clone https://github.com/libsndfile/libsamplerate /src/libsamplerate
|
||||
git clone https://github.com/libsndfile/libsamplerate.git /src/libsamplerate
|
||||
pushd /src/libsamplerate
|
||||
git reset --hard c96f5e3de9c4488f4e6c97f59f5245f22fda22f7
|
||||
git reset --hard aee38d0bc797d0d1a3774ef574af1d5d248d2398
|
||||
mkdir build && pushd build
|
||||
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release \
|
||||
-DLIBSAMPLERATE_EXAMPLES=OFF -DBUILD_TESTING=OFF \
|
||||
|
|
|
@ -162,13 +162,15 @@ public:
|
|||
void Transform(const float* data, size_t data_size) {
|
||||
|
||||
//printf("transform %p for size %d\n", data, data_size);
|
||||
gaborator_transform(gaborator, const_cast<float*>(data), data_size, [](uintptr_t callback_data, float* b_data, size_t size, size_t slice_size){
|
||||
auto& self = *reinterpret_cast<EventPointProcessor*>(callback_data);
|
||||
size_t return_size, slice_size;
|
||||
float* b_data = gaborator_transform(gaborator, const_cast<float*>(data), data_size, &return_size, &slice_size);
|
||||
|
||||
if(return_size > 0){
|
||||
//printf("%d got %p slices of %d size, total %d, count %d\n", callback_data, b_data, slice_size, size, size / slice_size);
|
||||
for (auto i = 0; i < size; i += slice_size){
|
||||
self.processMagnitudes(b_data + i, slice_size);
|
||||
for (auto i = 0; i < return_size; i += slice_size){
|
||||
processMagnitudes(b_data + i, slice_size);
|
||||
}
|
||||
}, reinterpret_cast<uintptr_t>(this));
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<uint8_t>& Finish(bool useCompactHash, bool usePackedPrint) {
|
||||
|
|
Loading…
Reference in a new issue