Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Zhao Zhili via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Zhao Zhili <quinkblack@foxmail.com>
Subject: [FFmpeg-devel] Re: [Question] Learning about VVC and wasm
Date: Fri, 14 Nov 2025 12:09:25 +0800
Message-ID: <tencent_5D67803A34C93E8F573F9CAAE0C65AE83509@qq.com> (raw)
In-Reply-To: <2845058.ABUECyqndK@basile.remlab.net>



> On Nov 14, 2025, at 02:19, Rémi Denis-Courmont via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> 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 -- ffmpeg-devel@ffmpeg.org
> To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

  reply	other threads:[~2025-11-14  4:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 16:46 [FFmpeg-devel] " Sidd via ffmpeg-devel
2025-11-13 17:42 ` [FFmpeg-devel] " Frank Plowman via ffmpeg-devel
2025-11-13 17:56   ` Sidd via ffmpeg-devel
2025-11-13 18:10     ` Frank Plowman via ffmpeg-devel
2025-11-13 18:16       ` Sidd via ffmpeg-devel
2025-11-13 18:19     ` Rémi Denis-Courmont via ffmpeg-devel
2025-11-14  4:09       ` Zhao Zhili via ffmpeg-devel [this message]
2025-11-14 11:30         ` Rémi Denis-Courmont via ffmpeg-devel
2025-11-14 11:59           ` Zhao Zhili via ffmpeg-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_5D67803A34C93E8F573F9CAAE0C65AE83509@qq.com \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=quinkblack@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git