From 0db7e15aecc9fd3c094e24d2b4909d3ae8401d0c Mon Sep 17 00:00:00 2001 From: szombathy-tamas Date: Sat, 7 Nov 2026 01:25:53 +0100 Subject: [PATCH] VK: an AV1 sequence without a colour description passes "unspecified" colours "FillVideoAV1ColorConfig" copied the colour primaries, transfer characteristics and matrix coefficients whatever the flags say; without "COLOR_DESCRIPTION_PRESENT" AV1 infers UNSPECIFIED (2), and the desc's 0s (reserved for primaries and transfer) made the driver refuse the session parameters with VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR. --- Source/VK/VideoHelpersVK.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/VK/VideoHelpersVK.h b/Source/VK/VideoHelpersVK.h index 882c562c..640b12d5 100644 --- a/Source/VK/VideoHelpersVK.h +++ b/Source/VK/VideoHelpersVK.h @@ -451,9 +451,12 @@ static inline void FillVideoAV1ColorConfig(StdVideoAV1ColorConfig& colorConfig, colorConfig.BitDepth = desc.bitDepth; colorConfig.subsampling_x = desc.subsamplingX; colorConfig.subsampling_y = desc.subsamplingY; - colorConfig.color_primaries = (StdVideoAV1ColorPrimaries)desc.colorPrimaries; - colorConfig.transfer_characteristics = (StdVideoAV1TransferCharacteristics)desc.transferCharacteristics; - colorConfig.matrix_coefficients = (StdVideoAV1MatrixCoefficients)desc.matrixCoefficients; + + // Without a colour description AV1 infers "unspecified" for all three (0 is reserved for primaries and transfer) + bool hasColorDescription = !!(desc.flags & VideoAV1SequenceBits::COLOR_DESCRIPTION_PRESENT); + colorConfig.color_primaries = hasColorDescription ? (StdVideoAV1ColorPrimaries)desc.colorPrimaries : STD_VIDEO_AV1_COLOR_PRIMARIES_UNSPECIFIED; + colorConfig.transfer_characteristics = hasColorDescription ? (StdVideoAV1TransferCharacteristics)desc.transferCharacteristics : STD_VIDEO_AV1_TRANSFER_CHARACTERISTICS_UNSPECIFIED; + colorConfig.matrix_coefficients = hasColorDescription ? (StdVideoAV1MatrixCoefficients)desc.matrixCoefficients : STD_VIDEO_AV1_MATRIX_COEFFICIENTS_UNSPECIFIED; colorConfig.chroma_sample_position = (StdVideoAV1ChromaSamplePosition)desc.chromaSamplePosition; }