4 Commits

Author SHA1 Message Date
5b460bde8b libavutil/hwcontext_amf: add format validation in transfer_data functions 2025-03-21 17:36:13 +01:00
7225e307be Added support for direct RGB input to AMF encoder 2025-03-06 15:38:58 +01:00
f00a08c0ce avutil/hwcontext_amf: fix crash on uninit after init failed
amf_device_create() calls amf_device_uninit() on errors, but if things
were not initialized it will null deref amf_ctx->factory.

Fixes: https://github.com/mpv-player/mpv/issues/15814

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-02-07 13:30:01 +01:00
9e7242579e 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.
2025-02-04 00:14:14 +01:00