edge264 GitHub Repository Overview Project Description edge264 is a minimalist software decoder for the H.264/AVC video format, focused on delivering state-of-the-art performance. It is a work in progress, with GStreamer and VLC plugins planned for future releases. Features Supports Progressive High and MVC 3D profiles up to level 6.2 Handles any resolution up to 8K UHD Outputs 8-bit 4:2:0 planar YUV Supports slices and arbitrary slice order Slice and frame multithreading support Per-slice reference picture list Memory Management Control Operations (MMCO) Long-term reference frames support Supported Platforms Windows: x86, x64 Linux: x86, x64, ARM64 Mac OS: x64 Compiling and Testing Developed entirely in C using 128-bit vector extensions and intrinsics Can be compiled with GNU GCC or LLVM Clang Optional SDL2 library for runtime display support with edge264test Compile with customizable make options: CC - C compiler (default cc) CFLAGS - additional compilation flags VARIANTS - select variants such as x86-64-v2, x86-64-v3, and logs BUILDTEST - compile the test executable (default yes) FORCEINTRIN - enforce intrinsics for x86 or ARM64 (for WebAssembly) Testing program edge264test can decode .264 files and compare to .yuv reference files Example commands provided for building and testing the decoder Example Usage API Reference edge264findstartcode(const uint8t buf, const uint8t end, int fourbyte): Finds next H.264 start code. edge264alloc(int nthreads, logcb, logarg, logmbs, alloccb, freecb, allocarg): Allocates and initializes a decoder context. edge264decodeNAL(dec, buf, end, nonblocking, freecb, freearg, nextNAL): Decodes a single Network Abstraction Layer unit. edge264getframe(dec, out, borrow): Retrieves the next decoded frame ready for output. edge264returnframe(dec, returnarg): Returns ownership of a borrowed frame. edge264flush(dec): Flushes internal decoder state and stops background processing. edge264free(pdec): Frees the decoder context. Roadmap Stress testing (in progress) Multithreading (in progress) Error recovery (in progress) Integration with VLC, ffmpeg, and GStreamer ARM32 architecture support PAFF and MBAFF support Support for 4:0:0, 4:2:2, and 4:4:4 chroma formats 9-14 bit depths with separate luma/chroma depths Transform-bypass for macroblocks with QP=0 SEI message support AVX-2 optimizations Programming Techniques Single header file structure consolidates all internal data and functions Use of code blocks and DAG-like loop architecture to reduce code size Tree branching with jump tables for directional intra modes to share code Optimization