> On Nov 14, 2025, at 02:19, Rémi Denis-Courmont via ffmpeg-devel > <[email protected]> wrote: > > Le torstaina 13. marraskuuta 2025, 19.56.30 Itä-Euroopan normaaliaika Sidd > via > ffmpeg-devel a écrit : >> Regarding the assembly, since FFmpeg is known for handcrafting it, are >> there any references of help in their docs regarding this? > > Generally, the ISA should cover assembler in the specifications. > > For FFmpeg, WASM optimisations are embryonic at best. There is no > documentation since there is very little experience with them as yet.
The wasm and wasm simd has already reached a considerable level of maturity. For H.265 decoding, I was able to achieve a speed boost of approximately 120% compared to the version without SIMD (decoding performance increased from 54 fps to 114 fps for 1080p video), and 55% compared to the version of compiler auto vectorize (from 74 fps to 114 fps). emscripten has good documentation https://emscripten.org/docs/porting/simd.html With wasi(WebAssembly System Interface) like wasmtime runtime, ffmpeg can be running like normal cmdline program outside of Web browser. checkasm works as other cpu arch, perf also works as for native program. https://docs.wasmtime.dev/examples-profiling-perf.html wasm itself is focus on reuse native code, it’s the same for wasm simd. From emscripten, > There are five different ways to leverage WebAssembly SIMD in your C/C++ > programs: > Enable LLVM/Clang SIMD autovectorizer to automatically target WebAssembly > SIMD, without requiring changes to C/C++ source code. > Write SIMD code using the GCC/Clang SIMD Vector Extensions > (__attribute__((vector_size(16)))) > Write SIMD code using the WebAssembly SIMD intrinsics (#include > <wasm_simd128.h>) > Compile existing SIMD code that uses the x86 SSE, SSE2, SSE3, SSSE3, SSE4.1, > SSE4.2, AVX or AVX2 intrinsics (#include <*mmintrin.h>) > Compile existing SIMD code that uses the ARM NEON intrinsics (#include > <arm_neon.h>) Auto conversion doesn’t work for us since we have no x86 or arm intrinsics. wasm simd intrinsics is a good balance(I’m only talk about this non-native instruction case). The technique and how to make it work with FFmpeg isn’t a problem. The question is how many usecase is there, I cannot predict usage. > >> I have gone through their ASM lessons and know the basics of them but am >> quite far from being good at writing it. > >> And if I may ask, what exactly are the current drawbacks of the current C >> implementation? > > FFmpeg (and also dav1d and x264) generally dislike C intrinsic optimisations > because: > - they are generally incompatible with run-time feature detection, > - the syntax tends to be even more cumbersome than assembler, > - the compiler may mess up the register allocation and > perform unnecessary moves or spills, > - some functionality may not even be exposed via intrinsics. > > I do not know if any of those points are relevant for WASM though. > > -- > Rémi Denis-Courmont > https://www.remlab.net/ > > > > _______________________________________________ > ffmpeg-devel mailing list -- [email protected] > To unsubscribe send an email to [email protected] _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
