dav1d 1.5.5

A sense of direction

We just released dav1d 1.5.5, the fifth maintenance release of the Sonic series of dav1d, the best AV1 software decoder.

dav1d is our open source AV1 decoder: small, fast, portable, and decoding AV1 in VLC, FFmpeg, Firefox, Chrome, Safari, Android, Windows and most places where hardware decoding is not available. It runs on billions of devices, which is also why we keep polishing it long after the big optimizations are done.

In July, I wrote that dav1d was in maintenance, with the remaining work on the less common architectures. 1.5.5 is what that maintenance looks like in practice: 70 commits from 16 contributors, almost all of them making something measurably faster or measurably harder to crash.

Faster on every architecture

If this release has a theme, it is CDEF direction search: the same function got new assembly on x86 with AVX-512, on AArch64, and on RISC-V for VLEN 128 and 256+. Three instruction sets, one release. Everyone was looking for direction, and everyone found it.

On x86, a large batch of commits optimizes the cdef and loopfilter SIMD routines, warp_affine, load_tmvs, the high bit-depth idct64, ipred_h and the smooth intra predictions on SSSE3, the Wiener and SGR loop restoration filters, and the high bit-depth pal_pred. Nothing spectacular in isolation; together, they shave real time off real decoding.

On AArch64, the CDEF filters and direction search were optimized for both bit depths, along with emu_edge and ipred_filter. The assembly also moved to register type aliases, and movrel is now always PIC. And in the series of tools you did not know you wanted: the ARM code gained helpers to printf values from inside hand-written assembly, which makes debugging NEON kernels a lot less archaeological.

On RISC-V, the direction search arrived for the two vector length classes we target, and a SIGSEGV in generate_grain_y was fixed in the process.

The parts between the SIMD

Not everything is assembly. The reference MV code now collapses runs of identical temporal MVs, and save_tmvs got faster on all platforms. Palette decoding was reworked with better entropy coding choices and fewer lookups. The loopfilter level cache was split into separate luma and chroma planes, which sounds cosmetic and is actually about cache lines. Film grain keeps working pointers to its line buffers and reorders the overlap loops.

One honest note: 1.5.4 had moved a constant computation out of a cdef loop, and GCC 13 through 16 responded by generating slower code. The change is reverted in 1.5.5. Compilers keep us humble.

Hardened edges

The robustness work continues, fueled by fuzzing and error-path review: an out-of-bounds read in the high bit-depth SGR AVX-512 assembly, an assertion failure when ITU-T T.35 metadata allocation fails, tile state reallocation and frame task creation now reporting errors correctly, and a reference index bound fixed in an assertion. The dav1d CLI got the same treatment: leaks in the error paths, out-of-bounds reads when probing Annex B and Section 5 streams, and --sizelimit values that overflow are now all handled. Building with the newest MSVC works again, too.

Conclusion

Thanks to everyone who contributed to this release: the x86 and film grain batches from Herman Semenoff, the AArch64 wave from Arpad Panyik, the RISC-V direction search from Najmus Sakib Afsan, the palette work from Christophe Gisquet, the CLI and threading fixes from Henrik Gramner, the ARM debug tooling and MSVC fix from Martin Storsjö, and the other fixes from contributors old and new.

Most of the new energy around here goes to dav2d, our AV2 decoder, and dav1d is exactly where a mature project should be: quietly getting faster and sturdier on every architecture that matters. Enjoy 1.5.5, from VideoLAN with love.

Patches welcome.