vulkan_av1: add workaround for NVIDIA drivers tested on broken CTS

The first release of the CTS for AV1 decoding had incorrect
offsets for the OrderHints values.
The CTS will be fixed, and eventually, the drivers will be
updated to the proper spec-conforming behaviour, but we still
need to add a workaround as this will take months.

Only NVIDIA use these values at all, so limit the workaround
to only NVIDIA. Also, other vendors don't tend to provide accurate
CTS information.
This commit is contained in:
Lynne 2024-04-14 14:11:44 +02:00
parent 3cca8dfbd8
commit db09f1a5d8
No known key found for this signature in database
GPG key ID: A2FEA5F03F034464
3 changed files with 28 additions and 4 deletions

View file

@ -1115,6 +1115,7 @@ int ff_vk_decode_init(AVCodecContext *avctx)
FFVulkanFunctions *vk;
const VkVideoProfileInfoKHR *profile;
const FFVulkanDecodeDescriptor *vk_desc;
const VkPhysicalDeviceDriverProperties *driver_props;
VkVideoDecodeH264SessionParametersCreateInfoKHR h264_params = {
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR,
@ -1276,6 +1277,14 @@ int ff_vk_decode_init(AVCodecContext *avctx)
return AVERROR_EXTERNAL;
}
driver_props = &dec->shared_ctx->s.driver_props;
if (driver_props->driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY &&
driver_props->conformanceVersion.major == 1 &&
driver_props->conformanceVersion.minor == 3 &&
driver_props->conformanceVersion.subminor == 8 &&
driver_props->conformanceVersion.patch < 3)
dec->quirk_av1_offset = 1;
ff_vk_decode_flush(avctx);
av_log(avctx, AV_LOG_VERBOSE, "Vulkan decoder initialization sucessful\n");