Repository navigation
Speed up H.264 CAVLC coefficient decoding
- Expand short coefficient levels in place with SIMD.
- Verify signed coefficients, bit positions and independent frame hashes.
- Record decode and memory measurements from 540p through 6K.
Decode performance
On a 5472×3648 H.264 AVI, five fresh processes per decoder ran in alternating order on two physical P-cores of an Intel Core i5-12450H. The first 33 frames took a median of 3.07 s with Mediana 0.1.81 Native AOT, 2.80 s with the updated Native AOT build, and 2.80 s with FFmpeg 6.1.1 and two decoder threads. The Mediana CPU time fell from 5.61 to 5.31 s and peak RSS from 272 to 269 MiB. Two other series measured 2.95 s and 3.04 s for the updated build. Process-CPU sampling over 132 frames recorded 10.10 → 9.20 s in the direct CAVLC block parser.
With .NET 11 JIT, the median cold 33-frame process time was 3.71 → 3.81 s. Across 132 frames the CPU time changed from 25.66 to 24.67 s with process time close to 14.8 s in both builds. Three consecutive 1080×720 indexed HLS requests took a median of 11.30 → 11.21 s in total. Each output segment was byte-identical to 0.1.81.
All 513 checked frame hashes matched FFmpeg across the 6K AVI and four CAVLC clips at 540p, 720p and 1080p, including 4:2:2 and High 10. Mediana frame timestamps and durations matched 0.1.81.