Skip to content

Draft: [3.0] dav1d: add support for DXVA decoding

Steve Lhomme requested to merge robUx4/vlc:30-dav1d-hw into 3.0.x

This is based on a patchset submitted to dav1d dav1d!1404 but lack some tests. This adds a new API to dav1d to do the frame decoding outside of dav1d (still using it's full AV1 bitstream parsing).

We use this new API to check if the DXVA hardware can decode that AV1 stream (D3D11 and D3D9). This is possible on recent GPU's (and integrated GPU's). If the hardware cannot handle it, we just use the regular software decoder of dav1d.

This is a 3.0-first branch as it may be first in 3.0. I have the same feature for 4.0 but the code is significantly different as 3.0 lacks decoder device, video contexts and relies on the video output pool.

When no option is provided, the hardware decoder is the one matching the video output (D3D11 vs D3D9). The user can also set the hardware decoder to use. In that case the same option as libavcodec is used so the user doesn't have to do anything special to use hardware decoding whether (s)he is playing AV1 or other content.

Recent libavcodec is capable of using DXVA to decode AV1. But we cannot fallback to/from it to use dav1d for decoding if the hardware cannot decode that stream. dav1d support in libavcodec also doesn't allow that internally.

Edited by Steve Lhomme

Merge request reports