From 7fd0fc55a497ab9bfe2d755845a3c68089b4e432 Mon Sep 17 00:00:00 2001 From: k4idyn <252943111+k4idyn@users.noreply.github.com> Date: Fri, 29 May 2026 21:27:37 -0600 Subject: [PATCH] fix(amf): wire h264_amf coder and profile mapping --- src/video.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/video.cpp b/src/video.cpp index f2281ce841a..2d1097a9899 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -119,6 +119,16 @@ namespace video { } // namespace qsv + namespace amf { + + enum class coder_e : int { + auto_ = 0, + cabac = 1, + cavlc = 2, + }; + + } // namespace amf + util::Either dxgi_init_avcodec_hardware_input_buffer(platf::avcodec_encode_device_t *); util::Either vaapi_init_avcodec_hardware_input_buffer(platf::avcodec_encode_device_t *); util::Either cuda_init_avcodec_hardware_input_buffer(platf::avcodec_encode_device_t *); @@ -814,9 +824,22 @@ namespace video { {"rc"s, &config::video.amd.amd_rc_h264}, {"usage"s, &config::video.amd.amd_usage_h264}, {"vbaq"s, &config::video.amd.amd_vbaq}, + {"coder"s, &config::video.amd.amd_coder}, {"enforce_hrd"s, &config::video.amd.amd_enforce_hrd}, }, - {}, // SDR-specific options + { + // SDR-specific options + {"profile"s, [](const config_t &) { + switch (config::video.amd.amd_coder) { + case (int) amf::coder_e::cavlc: + return "constrained_baseline"s; + case (int) amf::coder_e::cabac: + return "high"s; + default: + return "main"s; + } + }}, + }, {}, // HDR-specific options {}, // YUV444 SDR-specific options {}, // YUV444 HDR-specific options