tvlabs/edge264

Simple H.264 decoder

What it solves

edge264 is an H.264/AVC video decoder designed to provide a high-performance, cross-platform alternative to existing solutions. It focuses on reducing code size and improving execution speed by utilizing modern software engineering practices, such as replacing hand-crafted assembly with compiler-based vector extensions.

How it works

The decoder functions as a cross-platform library that processes H.264/AVC bitstreams. It uses a forward-pipeline architecture that mimics hardware decoders, where code is structured as a directed acyclic graph (DAG) to optimize for L1 cache usage. It supports multiple CPU architectures (x86, ARM, WebAssembly) by leveraging Clang and GCC vector extensions, allowing it to maintain high performance across different hardware without needing separate assembly implementations for each platform.

Who it’s for

This project is for developers who need a lightweight, efficient, and portable H.264 decoder for their applications. It is particularly well-suited for those working in environments where performance and small binary size are critical, such as web-based applications via WebAssembly or systems requiring cross-platform consistency.

Highlights

  • Cross-platform support for macOS, Linux, Windows, and WebAssembly.
  • Uses compiler vector extensions instead of hand-crafted assembly for better maintainability and portability.
  • Implements advanced techniques like register-saturating SIMD and on-the-fly bitstream unescaping to maximize speed.
  • Includes a custom test suite and supports runtime CPU detection to dispatch the fastest code paths.
  • Designed for easy integration into existing projects via a standard CMake interface.

Related

  • Project
  • Project
  • Project
  • Project