Wenyong Huang 289fc5efbf Enhance/Fix sample socket-api and workload (#2006) 2 سال پیش
..
.gitignore 892af84161 Update sample workload wasm-av1 and add workload XNNPACK (#443) 5 سال پیش
CMakeLists.avx_wasm.txt 27e7e160af Upgrade toolkits (#1878) 2 سال پیش
CMakeLists.txt 289fc5efbf Enhance/Fix sample socket-api and workload (#2006) 2 سال پیش
README.md 27e7e160af Upgrade toolkits (#1878) 2 سال پیش
av1-clang.patch 892af84161 Update sample workload wasm-av1 and add workload XNNPACK (#443) 5 سال پیش
build.sh 27e7e160af Upgrade toolkits (#1878) 2 سال پیش
wasm-av1.patch 74be7a0b7c Add more checks to enhance security (#446) 5 سال پیش

README.md

"wasm-av1" sample introduction

This sample demonstrates how to build wasm-av1 into WebAssembly with simd support and run it with iwasm.

Preparation

please refer to installation instructions.

Build with wasi-sdk

$ mkdir build && cd build
$ cmake ..
$ make
# to verify
$ ls testavx.wasm

Or build with EMSDK

just run the convenience script:

./build.sh

the script builds wasm-av1 and runs it with iwasm, which basically contains the following steps:

  • hack emcc to delete some objects in libc.a
  • patch wasm-av1 and build it with emcc compiler
  • build iwasm with simd and libc-emcc support
  • run testav1.aot with iwasm

Run workload

Firstly please build iwasm with simd support:

$ cd <wamr dir>/product-mini/platforms/linux/
$ mkdir build && cd build
$ cmake .. -DWAMR_BUILD_LIBC_EMCC=1
$ make

Then compile wasm file to aot file and run:

$ cd <dir of testavx.wasm>
$ <wamr dir>/wamr-compiler/build/wamrc -o testavx.aot testavx.wasm
# copy sample data like <wamr dir>/samples/workload/wasm-av1/av1/third_party/samples/elephants_dream_480p24.ivf
# make sure you declare the access priority of the directory in which the sample data is
$ <wamr dir>/product-mini/platforms/linux/build/iwasm --dir=. testavx.aot elephants_dream_480p24.ivf