Minih264
Minimalistic H264/SVC encoder single header library
Install / Use
/learn @lieff/Minih264README
minih264
Small, but yet reasonably fast H264/SVC encoder single-header library with SSE/NEON optimizations. Decoder can be popped up in future.
Disclaimer: code highly experimental.
Comparison with x264
Rough comparison with x264 on an i7-6700K:
x264 -I 30 --profile baseline --preset veryfast --tune zerolatency -b 0 -r 1 --qp 33 --ipratio 1.0 --qcomp 1.0 -o x264.264 --fps 30 vectors/foreman.cif --input-res 352x288 --slices 1 --threads 1
vs
./h264enc_x64 vectors/foreman.cif
| x264 | minih264 | | ------------ | -------- | | source: ~4.6mb | 409kb | | binary: 1.2mb | 100kb | | time: 0,282s | 0,503s | | out size: 320kb | 391kb |
PSNR:
x264: PSNR y:32.774824 u:38.874450 v:39.926132 average:34.084281 min:31.842667 max:36.630286
minih264: PSNR y:33.321686 u:38.858879 v:39.955914 average:34.574459 min:32.389171 max:37.174073
First intra frame screenshot (left-to-right: original 152064, minih264 5067, x264 5297 bytes):

You can compare results in motion using ffplay/mpv players on vectors/out_ref.264 and vectors/x264.264 .
Usage
TBD
SVC
Minih264 supports both spatial and temporal layers. Spatial layers are almost same as encode 2 independent AVC streams except for Intra frames prediction. Following diagram shows minih264 SVC scheme for two spatial layers:

That's because P frames spatial prediction are almost useless in practice. But for Intra frames there is a ~20% benefit in full resolution frame size. Note that decoder must have both base layer I frame and full resolution SVC I frame to decode whole sequence of next P frames in full resolution.
Limitations
The following major features are not supported compared to x264 (baseline):
- Trellis quantization.
- Select prediction mode using Sum of Absolute Transform Differences (SATD).
- 4x4 motion compensation.
Interesting links
- https://www.videolan.org/developers/x264.html
- https://www.openh264.org/
- https://github.com/cisco/openh264
- http://iphome.hhi.de/suehring/tml/
- https://github.com/oneam/h264bsd
- https://github.com/fhunleth/hollowcore-h264
- https://github.com/digetx/h264_decoder
- https://github.com/lspbeyond/p264decoder
- https://github.com/jcasal-homer/HomerHEVC
- https://github.com/ultravideo/kvazaar
- https://github.com/neocoretechs/h264j
- https://github.com/jcodec/jcodec
Related Skills
qqbot-channel
343.1kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
99.7k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
343.1kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
ddd
Guía de Principios DDD para el Proyecto > 📚 Documento Complementario : Este documento define los principios y reglas de DDD. Para ver templates de código, ejemplos detallados y guías paso
