Improve hardware encoding/decoding and filters
Author: galad87Created Jan 25, 2024Updated Aug 28, 2026
LabelsEnhancementPatch / Help Welcome
Here's an hopefully complete table of the current state of hardware acceleration. Lately I ported some small filters to Metal, some were ports of OpenCL and CUDA libavformat filters, others were ports of CPU filter. It's quite easy to go from one shading languages to another, porting them to another API would be quite easy work.
Going forward, I think the best course of action would be to port them to Vulkan, and avoid yet another API for each GPU vendor. Libavfilter has very few GPU accelerated filters, some for CUDA, some others for OpenCL and Vulkan, so there isn't too much that can be reused.
Anyway, this all depends on external help and hopefully on some new contributors.
| Feature | QSV | NV | AMD | VT |
|---|---|---|---|---|
| Decoding | ✅ | ✅ | ✅ | |
| Encoding | ✅ | ✅ | ✅ | ✅ |
| HW download4 | ✅ | ✅ | ||
| HW upload5 | ✅ | |||
| Prefilter6 | ✅1 | ✅2 | ✅3 | |
| Detelecine | ||||
| Comb detect | ✅ | |||
| Decomb | ||||
| Yadif | ✅ | |||
| Bwdif | ✅ | |||
| Framerate Shaper | ✅ | |||
| Deblock | ||||
| HQDN3D | ||||
| NLMeans | ||||
| Chroma Smooth | ✅ | |||
| Rotate | ✅1 | ✅3 | ||
| Render Sub | ✅ | |||
| Crop & Scale | ✅1 | ✅3 | ||
| Lapsharp | ✅ | |||
| Unsharp | ✅ | |||
| Grayscale | ✅ | |||
| Pad | ✅ | |||
| Colorspace | ||||
| Format | ✅1 | ✅ | ✅3 |
- QSV VPP libavfilter;
- scale_cuda & colorspace_cuda filters, rotate is not supported;
- VideoToolbox VTPixelTransferSessionRef and VTPixelRotationSessionRef filters;
- Meaning the ability to copy a frame from the hardware decoder memory to CPU memory;
- Meaning the ability to copy a frame from CPU memory to GPU memory to allow GPU accelerated filtering;
- Filters run inside decavcodec.c to handle unexpected video size, format, and range changes mid stream;
Source: HandBrake/HandBrake