aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext.c
diff options
context:
space:
mode:
authorDmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>2024-10-15 11:07:54 +0200
committerDmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>2025-02-04 00:14:14 +0100
commit9e7242579e8e5d23dd012cd090d79030001c8d41 (patch)
tree2ab82b12e110e0b6272886cfcf73036a75e0727c /libavutil/hwcontext.c
parent1c5961e4b42565bb6573fe013e2db8036b4e9ae6 (diff)
downloadffmpeg-9e7242579e8e5d23dd012cd090d79030001c8d41.tar.gz
avutil: add hwcontext_amf.
Adds hwcontext_amf, enabling a shared AMF context for encoders, decoders, and AMF-based filters, without copy to the host memory. Code also was tested in HandBrake. Benefits: - Optimizations for direct video memory access from CPU - Significant performance boost in full AMF pipelines with filters - Integration of GPU filters like VPP, Super Resolution, and Compression Artefact Removal(in future plans) - VCN power management control for decoders. - Ability to specify which VCN instance to use for decoding (like for encoder) - AMD will soon introduce full AMF API for multimedia accelerator MA35D - With AMF API, integration will be much easier: GPU and the accelerator will have the same API - including encoder, decoder, scaler, color converter, Windows and Linux. Learn more: https://www.amd.com/en/products/accelerators/alveo/ma35d.html Changes by versions: v2: Header file cleanup. v3: Removed an unnecessary class. v4: code cleanup and improved error handling v5: Fixes related to HandBrake integration. v6: Sequential filters error and memory leak have been fixed.
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r--libavutil/hwcontext.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index fa99a0d8a4..f06d49c45c 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -66,6 +66,9 @@ static const HWContextType * const hw_table[] = {
#if CONFIG_VULKAN
&ff_hwcontext_type_vulkan,
#endif
+#if CONFIG_AMF
+ &ff_hwcontext_type_amf,
+#endif
NULL,
};
@@ -82,6 +85,7 @@ static const char *const hw_type_names[] = {
[AV_HWDEVICE_TYPE_VIDEOTOOLBOX] = "videotoolbox",
[AV_HWDEVICE_TYPE_MEDIACODEC] = "mediacodec",
[AV_HWDEVICE_TYPE_VULKAN] = "vulkan",
+ [AV_HWDEVICE_TYPE_AMF] = "amf",
};
typedef struct FFHWDeviceContext {