尝试把 https://github.com/strukturag/libde265 编译到 wasm
结果因为 emscripten 默认栈大小只有 64K,爆栈了,真是各有各的搞笑死法,把栈调到 128K 好了
但是 1920x864 分辨率 60FPS 4Mbps 码率的视频都差一点(确认已经 -flto -O3 -msimd128,大约 22ms 一帧
而且我的生产环境也上不了多线程
今天尝试 port edge264
https://github.com/tvlabs/edge264/issues/15#issuecomment-3778814842
这次更搞笑,有个方法直接就要 420K 的栈空间
还剩下几个兼容性问题,不知道是 port 的不对还是本来就有问题
Baseline profile level 4 倒是运行的很稳定,可是现在在用 tinyh264 也很稳定
WebAssembly compilation · Issue #15 · tvlabs/edge264

Hi @traffaillac, Thanks for creating this great library. In case you're interested, to build this as a WebAssembly module, a few very minor changes were needed: diff --git c/edge264.c w/edge264.c i...

GitHub
突然想到,Android 现在也还是有个 software-only 的 H.264 解码器的
找了下在 https://cs.android.com/android/platform/superproject/main/+/main:external/libavc/examples/avcdec/main.c;bpv=0;bpt=0
又是 libavc 这种 generic 到没法搜索的名字
有 ssse3 和 sse4.2 加速,还没仔细看,如果能编译到 wasm 的话应该比 tinyh264 有更好的兼容性和性能吧

这个 libavc 用起来太迷了
它的 API 就像 ioctl,只有一个方法,传递不同的 request object(包括 request code)和 response object
(这个我写了个 C++ template function 能简化一些
然后它支持两种内存管理方式,demo 里全混在一起,反正我也看不懂 AI 也看不懂,根本不知道要按什么顺序调用 request

#cpp