GPUOpen-LibrariesAndSDKs / AMF

The Advanced Media Framework (AMF) SDK provides developers with optimal access to AMD devices for multimedia processing
Other
601 stars 151 forks source link

[Bug]: RX Vega HEVC encoder responds that it supports PreAnalysis but fails when set. #411

Closed Masa-tam closed 6 months ago

Masa-tam commented 1 year ago

Describe the bug When AMF_VIDEO_ENCODER_HEVC_CAP_PRE_ANALYSIS is queried from AMFVideoEncoder_HEVC component to the GetCaps object, TRUE is returned.

AMF_VIDEO_ENCODER_HEVC_PRE_ANALYSIS_ENABLE operation on the AMFVideoEncoder_HEVC component returns AMF_INVALID_ARG.

To Reproduce Steps to reproduce the behavior:

  1. Apply the following patches
    
    diff --git a/amf/public/samples/CPPSamples/CapabilityManager/CapabilityManager.cpp b/amf/public/samples/CPPSamples/CapabilityManager/CapabilityManager.cpp
    index 1da0a16..f2ccb96 100644
    --- a/amf/public/samples/CPPSamples/CapabilityManager/CapabilityManager.cpp
    +++ b/amf/public/samples/CPPSamples/CapabilityManager/CapabilityManager.cpp
    @@ -341,6 +341,18 @@ bool QueryEncoderForCodecHEVC(const wchar_t *componentID, amf::AMFContext* pCont
             encoderCaps->GetProperty(AMF_VIDEO_ENCODER_HEVC_CAP_NUM_OF_STREAMS, &maxNumOfStreams);
             std::wcout << L"\t\tMax Number of streams supported:" << maxNumOfStreams << std::endl;

-static const int codecIndex = 0; // set to 0 for AVC, 1 for HEVC, 2 for AV1 +static const int codecIndex = 1; // set to 0 for AVC, 1 for HEVC, 2 for AV1 static_assert(!bEnable10bit || codecIndex != 0, "HEVC or AV1 required for 10 bit"); static const wchar_t pCodecNames[] = { AMFVideoEncoderVCE_AVC, AMFVideoEncoder_HEVC, AMFVideoEncoder_AV1 }; static const wchar_t fileNames[] = { L"./output.h264", L"./output.h265", L"./output.av1" }; diff --git a/amf/public/samples/CPPSamples/common/MiscHelpers.cpp b/amf/public/samples/CPPSamples/common/MiscHelpers.cpp index cfc923e..af4cce5 100644 --- a/amf/public/samples/CPPSamples/common/MiscHelpers.cpp +++ b/amf/public/samples/CPPSamples/common/MiscHelpers.cpp @@ -178,6 +178,8 @@ AMF_RESULT SetEncoderDefaultsHEVC(amf::AMFComponent* pEncoder, amf_int64 bitRate res = pEncoder->SetProperty(AMF_VIDEO_ENCODER_HEVC_LOWLATENCY_MODE, true); AMF_RETURN_IF_FAILED(res, L"SetProperty(AMF_VIDEO_ENCODER_HEVC_LOWLATENCY_MODE, true) failed"); }

Setup (please complete the following information):

Debug Log (please upload or paste):

2023-09-06 15:19:19.240     8BE0 [AMFEncoderHEVC] Warning: SetProperty HevcEnablePreAnalysis not found
2023-09-06 15:19:19.240     8BE0 [MiscHelpers]   Error: D:\src\AMF\amf\public\samples\CPPSamples\common\MiscHelpers.cpp(182):AMF_ERROR 4 : AMF_INVALID_ARG: SetProperty(AMF_VIDEO_ENCODER_HEVC_PRE_ANALYSIS_ENABLE, true) failed

Expected behavior Capability returns the correct result. Probably unsupported.

rhutsAMD commented 6 months ago

PA is supported starting on Radeon RX 5000 Series or newer GPUs as well as Ryzen 2000 U/H series or newer APUs as stated in the PreAnalysis API doc. Setting AMF_VIDEO_ENCODER_HEVC_PRE_ANALYSIS_ENABLE on the RX Vega correctly returns AMF_INVALID_ARG in agreement with the support described in the PA API doc while it is possible that the cap misreports PA support for the legacy RX Vega.

Closing as PA is not supported on the RX Vega, and the legacy GPU is no longer actively supported.