AVION 0.1

Whitepaper · SDK API 14

Perception and media on a sealed memory budget

AbstractAVION 0.1 is a media and perception kernel that a host embeds through one C99 header. On Windows it decodes, presents and plays video and sound through Direct3D 12 and WASAPI. On the same pictures it runs stabilisation, multi-object tracking, time to contact, remote vibrometry, an event-camera emulation, bitstream inspection and tensor export. It contains no third-party code, commits all memory before playback and allocates nothing on the heap while running. We describe the architecture and the verification (MSVC suites 236/237 passed; failed: media_fixture_mkv_av1_4k60_test in Release and 236/237 passed; failed: media_host_tracks_tests in Debug; GCC result lines with sanitizers 102/102 passed). We then report a head-to-head on one machine against ffmpeg 8.0.1, OpenCV 4.10.0, ffplay and VLC, with one allocation counter for every process, and close with the limits. The benchmark first found two problems, a cut detector misled by hierarchical GOPs and a paused player that kept polling; both were fixed in the engine and measured again.

1The problem

Robots, drones, inspection rigs and players need the same things from a video stream: pictures on time, sound in sync, and an understanding of what moves. The usual answer is a stack of libraries, each with its own allocator, threads and copies. Its timing is the sum of everyone's worst case.

AVION owns the whole path from file or sensor to screen, speaker and host callback, under four rules:

2Architecture

Closed→Preparing→Primed→Running→Draining→Stopped

Budgets, known up front. Core 192 MiB against 177.0 MiB measured on every fixture: 4K HEVC, 7.1 audio, a 3.5-hour file. Modules 48.4 MiB and up to 5 threads.

Preparing commits every arena and creates the GPU and audio endpoints. Primed seals memory and fills the first rings. Running is the lock-free steady state. A seek changes the playback epoch; device loss drains back to Preparing without releasing the pools.

Each optional module (voice, HUD, subtitles, chapters, telemetry and perception) is one fixed region of the same arena with a known thread count. A module that would need more is disabled for that file instead of growing. The host learns every size before creating anything and provides the engine's storage, so the SDK never calls malloc.

When audio plays, the audio device is the master clock: PredictiveMasterClock runs a second-order alpha–beta estimator (in effect a phase-locked loop) on WASAPI's device position. Presentation waits on hardware events and a high-resolution timer instead of spinning.

3Perception

Hosts take the pictures as shared Direct3D textures and fences (verified with Direct3D 11 and Direct3D 12 hosts), in 8-bit, 10-bit PQ BT.2020 or FP16 scRGB: an HDR10 file reached a host at up to 5,849 cd/m². In host mode, where the host's thread drives the engine, H.264 and HEVC are decoded on the GPU into those textures, with 0.7 % of one core for a 1080p-class H.264 file and 6.8 % for 4K HDR HEVC, and no picture leaving the GPU. Python (a wheel) and .NET (a NuGet package) bind the same C99 SDK.

4Verification

Intermittency is investigated. A 4K60 HDR cold-start drop (about 4 % of starts) was traced to the quality governor's expensive tier on a thin queue; after a rule change, 0 of 200 starts dropped.

Every claim is the output of an automated test that ships with the source. Test media is generated with known ground truth (shaken clips with a known shake, pulse clips with a known rate); thirteen tests run on real footage. Allocation probes assert zero allocations while playing, stabilising, tracking and exporting.

ConfigurationResultTime
MSVC x64 /W4 /WX, ReleaseCTest serial236 / 2371,382 s
MSVC x64 /W4 /WX, DebugCTest serial, the same load236 / 2372,222 s
GCC 13.3, 48 suites × (-O2, ASan + UBSan)WSL Ubuntu 24.04, result lines102 / 102—

5Head to head

One counter for everyone. tools/bench/malloc_count.c, preloaded into each process, counts every malloc, calloc, realloc and aligned allocation. ffmpeg's steady-state rate is the difference between a 1,000- and a 3,000-frame run.

All runs used one machine: an Intel Core i7-10700 with UHD 630 graphics under Windows 11, and WSL2 (6.6.114.1) on the same CPU for the Linux rows. The inputs were LG's 4K60 HDR reel (HEVC Main10) and a 720p59.94 H.264 film, first 3,000 frames each, plus 600 frames of the film at 640×480 grey, read into memory by every program.

MeasureAVION 0.1BaselineRatio
Allocations / 1,000 frames
Scan, 4K HEVCvs ffmpeg decode + scdet0132,292—
Scan, 720p H.264vs ffmpeg decode + scdet0149,751—
Motion, 640×480vs OpenCV, outputs reused020,000DIS ultrafast572,000DIS fast227,000Farnebäck—
Survey, 640×480vs OpenCV Scharr + block means052,000—
CPU per frame, one core
Scan, 4K HEVCheaders vs software decode0.23 µs31.1 ms134,501×
Scan, 720p H.264headers vs software decode0.22 µs1.96 ms8,831×
Motion, 640×480vs OpenCV DIS ultrafast (a different output: the accuracy, against sparse LK, is in the benchmarks)0.51 ms4.35 ms8.5×
Survey, 640×480AVX2 vs OpenCV0.179 ms0.779 ms4.3×
Player CPU, 720p (Windows)
Playing% of one core, playback alone8.4 %23.9 %ffplay7.7 %VLC—
Playing, perception liveAVION's default; no counterpart8.9 %——
Paused% of one core; VLC started paused0.16 %0.16 %ffplay0.00 %VLC—

Reading the table fairly

6Limits

7Evaluating AVION 0.1

The evaluation bundle holds the SDK header and reference, the Release demo, static libraries, the Python wheel and the NuGet package, a sample clip, the CTest log of this build's Release run (236/237 passed), and the head-to-head's harness, raw results and summary. It is licensed under the AVION Evaluation & Commercial SDK License 1.1: free for evaluation, benchmarking, research and prototyping, and for use in non-commercial, academic and personal projects, which may also redistribute the unmodified binaries (section 1A); commercial production and commercial redistribution need a commercial licence. Its SHA-256, for integrity (not a signature):

AVION-0.1-Evaluation.zip · 15,267,912 bytes
78d8143b8766e2a66274bee5189646a34a11cb2d4d1acbbf1e1a3ec8e472b3da