1e5c31af7Sopenharmony_ci#ifndef _VKTVIDEOTESTUTILS_HPP 2e5c31af7Sopenharmony_ci#define _VKTVIDEOTESTUTILS_HPP 3e5c31af7Sopenharmony_ci/*------------------------------------------------------------------------ 4e5c31af7Sopenharmony_ci * Vulkan Conformance Tests 5e5c31af7Sopenharmony_ci * ------------------------ 6e5c31af7Sopenharmony_ci * 7e5c31af7Sopenharmony_ci * Copyright (c) 2021 The Khronos Group Inc. 8e5c31af7Sopenharmony_ci * 9e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 10e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License. 11e5c31af7Sopenharmony_ci * You may obtain a copy of the License at 12e5c31af7Sopenharmony_ci * 13e5c31af7Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 14e5c31af7Sopenharmony_ci * 15e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 16e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 17e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and 19e5c31af7Sopenharmony_ci * limitations under the License. 20e5c31af7Sopenharmony_ci * 21e5c31af7Sopenharmony_ci *//*! 22e5c31af7Sopenharmony_ci * \file 23e5c31af7Sopenharmony_ci * \brief Video Encoding and Decoding Utility Functions 24e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/ 25e5c31af7Sopenharmony_ci 26e5c31af7Sopenharmony_ci#include "vktVideoTestUtils.hpp" 27e5c31af7Sopenharmony_ci 28e5c31af7Sopenharmony_ci#include "vkDefs.hpp" 29e5c31af7Sopenharmony_ci#include "vkRefUtil.hpp" 30e5c31af7Sopenharmony_ci#include "vkMemUtil.hpp" 31e5c31af7Sopenharmony_ci#include "vkPlatform.hpp" 32e5c31af7Sopenharmony_ci#include "vktTestCase.hpp" 33e5c31af7Sopenharmony_ci#include "vktCustomInstancesDevices.hpp" 34e5c31af7Sopenharmony_ci 35e5c31af7Sopenharmony_ci#include "ycbcr/vktYCbCrUtil.hpp" 36e5c31af7Sopenharmony_ci#include "vkMd5Sum.hpp" 37e5c31af7Sopenharmony_ci 38e5c31af7Sopenharmony_cinamespace vkt 39e5c31af7Sopenharmony_ci{ 40e5c31af7Sopenharmony_cinamespace video 41e5c31af7Sopenharmony_ci{ 42e5c31af7Sopenharmony_ci 43e5c31af7Sopenharmony_ciusing namespace vk; 44e5c31af7Sopenharmony_ciusing namespace std; 45e5c31af7Sopenharmony_ci 46e5c31af7Sopenharmony_citypedef de::MovePtr<Allocation> AllocationPtr; 47e5c31af7Sopenharmony_ci 48e5c31af7Sopenharmony_cibool videoLoggingEnabled(); 49e5c31af7Sopenharmony_ci 50e5c31af7Sopenharmony_cibool imageMatchesReferenceChecksum(const ycbcr::MultiPlaneImageData& multiPlaneImageData, const std::string& referenceChecksums); 51e5c31af7Sopenharmony_ci 52e5c31af7Sopenharmony_ciVkVideoDecodeH264ProfileInfoKHR getProfileOperationH264Decode (StdVideoH264ProfileIdc stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN, 53e5c31af7Sopenharmony_ci VkVideoDecodeH264PictureLayoutFlagBitsKHR pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR); 54e5c31af7Sopenharmony_ciVkVideoEncodeH264ProfileInfoEXT getProfileOperationH264Encode (StdVideoH264ProfileIdc stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN); 55e5c31af7Sopenharmony_ciVkVideoDecodeH265ProfileInfoKHR getProfileOperationH265Decode (StdVideoH265ProfileIdc stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN); 56e5c31af7Sopenharmony_ciVkVideoEncodeH265ProfileInfoEXT getProfileOperationH265Encode (StdVideoH265ProfileIdc stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN); 57e5c31af7Sopenharmony_ci 58e5c31af7Sopenharmony_ciconst VkExtensionProperties* getVideoExtensionProperties (const VkVideoCodecOperationFlagBitsKHR codecOperation); 59e5c31af7Sopenharmony_ci 60e5c31af7Sopenharmony_cide::MovePtr<vector<VkFormat>> getSupportedFormats (const InstanceInterface& vk, 61e5c31af7Sopenharmony_ci const VkPhysicalDevice physicalDevice, 62e5c31af7Sopenharmony_ci const VkImageUsageFlags imageUsageFlags, 63e5c31af7Sopenharmony_ci const VkVideoProfileListInfoKHR* videoProfileList); 64e5c31af7Sopenharmony_ci 65e5c31af7Sopenharmony_ci 66e5c31af7Sopenharmony_ciVkImageCreateInfo makeImageCreateInfo (VkFormat format, 67e5c31af7Sopenharmony_ci const VkExtent2D& extent, 68e5c31af7Sopenharmony_ci const deUint32* queueFamilyIndex, 69e5c31af7Sopenharmony_ci const VkImageUsageFlags usage, 70e5c31af7Sopenharmony_ci void* pNext, 71e5c31af7Sopenharmony_ci const deUint32 arrayLayers = 1); 72e5c31af7Sopenharmony_ci 73e5c31af7Sopenharmony_ci 74e5c31af7Sopenharmony_civoid cmdPipelineImageMemoryBarrier2 (const DeviceInterface& vk, 75e5c31af7Sopenharmony_ci const VkCommandBuffer commandBuffer, 76e5c31af7Sopenharmony_ci const VkImageMemoryBarrier2KHR* pImageMemoryBarriers, 77e5c31af7Sopenharmony_ci const size_t imageMemoryBarrierCount = 1u, 78e5c31af7Sopenharmony_ci const VkDependencyFlags dependencyFlags = 0); 79e5c31af7Sopenharmony_ci 80e5c31af7Sopenharmony_civoid validateVideoProfileList (const InstanceInterface& vk, 81e5c31af7Sopenharmony_ci VkPhysicalDevice physicalDevice, 82e5c31af7Sopenharmony_ci const VkVideoProfileListInfoKHR* videoProfileList, 83e5c31af7Sopenharmony_ci const VkFormat format, 84e5c31af7Sopenharmony_ci const VkImageUsageFlags usage); 85e5c31af7Sopenharmony_ci 86e5c31af7Sopenharmony_cistruct DeviceContext 87e5c31af7Sopenharmony_ci{ 88e5c31af7Sopenharmony_ci Context* context{}; 89e5c31af7Sopenharmony_ci VideoDevice* vd{}; 90e5c31af7Sopenharmony_ci VkPhysicalDevice phys{VK_NULL_HANDLE}; 91e5c31af7Sopenharmony_ci VkDevice device{VK_NULL_HANDLE}; 92e5c31af7Sopenharmony_ci VkQueue decodeQueue{VK_NULL_HANDLE}; 93e5c31af7Sopenharmony_ci VkQueue transferQueue{VK_NULL_HANDLE}; 94e5c31af7Sopenharmony_ci 95e5c31af7Sopenharmony_ci const InstanceInterface& getInstanceInterface() const 96e5c31af7Sopenharmony_ci { 97e5c31af7Sopenharmony_ci return context->getInstanceInterface(); 98e5c31af7Sopenharmony_ci } 99e5c31af7Sopenharmony_ci const DeviceDriver& getDeviceDriver() const 100e5c31af7Sopenharmony_ci { 101e5c31af7Sopenharmony_ci return vd->getDeviceDriver(); 102e5c31af7Sopenharmony_ci } 103e5c31af7Sopenharmony_ci deUint32 decodeQueueFamilyIdx() const 104e5c31af7Sopenharmony_ci { 105e5c31af7Sopenharmony_ci return vd->getQueueFamilyIndexDecode(); 106e5c31af7Sopenharmony_ci } 107e5c31af7Sopenharmony_ci deUint32 transferQueueFamilyIdx() const 108e5c31af7Sopenharmony_ci { 109e5c31af7Sopenharmony_ci return vd->getQueueFamilyIndexTransfer(); 110e5c31af7Sopenharmony_ci } 111e5c31af7Sopenharmony_ci Allocator& allocator() const 112e5c31af7Sopenharmony_ci { 113e5c31af7Sopenharmony_ci return vd->getAllocator(); 114e5c31af7Sopenharmony_ci } 115e5c31af7Sopenharmony_ci void waitDecodeQueue() const 116e5c31af7Sopenharmony_ci { 117e5c31af7Sopenharmony_ci VK_CHECK(getDeviceDriver().queueWaitIdle(decodeQueue)); 118e5c31af7Sopenharmony_ci } 119e5c31af7Sopenharmony_ci void deviceWaitIdle() const 120e5c31af7Sopenharmony_ci { 121e5c31af7Sopenharmony_ci VK_CHECK(getDeviceDriver().deviceWaitIdle(device)); 122e5c31af7Sopenharmony_ci } 123e5c31af7Sopenharmony_ci}; 124e5c31af7Sopenharmony_ci 125e5c31af7Sopenharmony_ciclass VideoBaseTestInstance : public TestInstance 126e5c31af7Sopenharmony_ci{ 127e5c31af7Sopenharmony_cipublic: 128e5c31af7Sopenharmony_ci explicit VideoBaseTestInstance(Context& context) 129e5c31af7Sopenharmony_ci : TestInstance(context) 130e5c31af7Sopenharmony_ci , m_videoDevice(context) 131e5c31af7Sopenharmony_ci { 132e5c31af7Sopenharmony_ci } 133e5c31af7Sopenharmony_ci 134e5c31af7Sopenharmony_ci ~VideoBaseTestInstance() override = default; 135e5c31af7Sopenharmony_ci 136e5c31af7Sopenharmony_ci VkDevice getDeviceSupportingQueue(VkQueueFlags queueFlagsRequired = 0, 137e5c31af7Sopenharmony_ci VkVideoCodecOperationFlagsKHR videoCodecOperationFlags = 0, 138e5c31af7Sopenharmony_ci VideoDevice::VideoDeviceFlags videoDeviceFlags = VideoDevice::VIDEO_DEVICE_FLAG_NONE); 139e5c31af7Sopenharmony_ci bool createDeviceSupportingQueue(VkQueueFlags queueFlagsRequired, 140e5c31af7Sopenharmony_ci VkVideoCodecOperationFlagsKHR videoCodecOperationFlags, 141e5c31af7Sopenharmony_ci VideoDevice::VideoDeviceFlags videoDeviceFlags = VideoDevice::VIDEO_DEVICE_FLAG_NONE); 142e5c31af7Sopenharmony_ci const DeviceDriver& getDeviceDriver(); 143e5c31af7Sopenharmony_ci deUint32 getQueueFamilyIndexTransfer(); 144e5c31af7Sopenharmony_ci deUint32 getQueueFamilyIndexDecode(); 145e5c31af7Sopenharmony_ci deUint32 getQueueFamilyIndexEncode(); 146e5c31af7Sopenharmony_ci Allocator& getAllocator(); 147e5c31af7Sopenharmony_ci 148e5c31af7Sopenharmony_ci std::string getVideoDataClipA(); 149e5c31af7Sopenharmony_ci std::string getVideoDataClipB(); 150e5c31af7Sopenharmony_ci std::string getVideoDataClipC(); 151e5c31af7Sopenharmony_ci std::string getVideoDataClipD(); 152e5c31af7Sopenharmony_ci std::string getVideoDataClipH264G13(); 153e5c31af7Sopenharmony_ci std::string getVideoDataClipH265G13(); 154e5c31af7Sopenharmony_ci 155e5c31af7Sopenharmony_ciprotected: 156e5c31af7Sopenharmony_ci de::MovePtr<vector<deUint8>> loadVideoData(const string& filename); 157e5c31af7Sopenharmony_ci VideoDevice m_videoDevice; 158e5c31af7Sopenharmony_ci}; 159e5c31af7Sopenharmony_ci 160e5c31af7Sopenharmony_citypedef enum StdChromaFormatIdc 161e5c31af7Sopenharmony_ci{ 162e5c31af7Sopenharmony_ci chroma_format_idc_monochrome = STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME, 163e5c31af7Sopenharmony_ci chroma_format_idc_420 = STD_VIDEO_H264_CHROMA_FORMAT_IDC_420, 164e5c31af7Sopenharmony_ci chroma_format_idc_422 = STD_VIDEO_H264_CHROMA_FORMAT_IDC_422, 165e5c31af7Sopenharmony_ci chroma_format_idc_444 = STD_VIDEO_H264_CHROMA_FORMAT_IDC_444, 166e5c31af7Sopenharmony_ci} StdChromaFormatIdc; 167e5c31af7Sopenharmony_ci 168e5c31af7Sopenharmony_ciclass VkVideoCoreProfile 169e5c31af7Sopenharmony_ci{ 170e5c31af7Sopenharmony_cipublic: 171e5c31af7Sopenharmony_ci static bool isValidCodec(VkVideoCodecOperationFlagsKHR videoCodecOperations) 172e5c31af7Sopenharmony_ci { 173e5c31af7Sopenharmony_ci return (videoCodecOperations & (VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR | 174e5c31af7Sopenharmony_ci VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR | 175e5c31af7Sopenharmony_ci VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT | 176e5c31af7Sopenharmony_ci VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT)); 177e5c31af7Sopenharmony_ci } 178e5c31af7Sopenharmony_ci 179e5c31af7Sopenharmony_ci bool PopulateProfileExt(VkBaseInStructure const* pVideoProfileExt) 180e5c31af7Sopenharmony_ci { 181e5c31af7Sopenharmony_ci if (m_profile.videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) 182e5c31af7Sopenharmony_ci { 183e5c31af7Sopenharmony_ci VkVideoDecodeH264ProfileInfoKHR const* pProfileExt = (VkVideoDecodeH264ProfileInfoKHR const*)pVideoProfileExt; 184e5c31af7Sopenharmony_ci if (pProfileExt && (pProfileExt->sType != VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR)) 185e5c31af7Sopenharmony_ci { 186e5c31af7Sopenharmony_ci m_profile.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; 187e5c31af7Sopenharmony_ci return false; 188e5c31af7Sopenharmony_ci } 189e5c31af7Sopenharmony_ci if (pProfileExt) 190e5c31af7Sopenharmony_ci { 191e5c31af7Sopenharmony_ci m_h264DecodeProfile = *pProfileExt; 192e5c31af7Sopenharmony_ci } 193e5c31af7Sopenharmony_ci else 194e5c31af7Sopenharmony_ci { 195e5c31af7Sopenharmony_ci // Use default ext profile parameters 196e5c31af7Sopenharmony_ci m_h264DecodeProfile.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR; 197e5c31af7Sopenharmony_ci m_h264DecodeProfile.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN; 198e5c31af7Sopenharmony_ci m_h264DecodeProfile.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR; 199e5c31af7Sopenharmony_ci } 200e5c31af7Sopenharmony_ci m_profile.pNext = &m_h264DecodeProfile; 201e5c31af7Sopenharmony_ci m_h264DecodeProfile.pNext = NULL; 202e5c31af7Sopenharmony_ci } 203e5c31af7Sopenharmony_ci else if (m_profile.videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR) 204e5c31af7Sopenharmony_ci { 205e5c31af7Sopenharmony_ci VkVideoDecodeH265ProfileInfoKHR const* pProfileExt = (VkVideoDecodeH265ProfileInfoKHR const*)pVideoProfileExt; 206e5c31af7Sopenharmony_ci if (pProfileExt && (pProfileExt->sType != VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR)) 207e5c31af7Sopenharmony_ci { 208e5c31af7Sopenharmony_ci m_profile.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; 209e5c31af7Sopenharmony_ci return false; 210e5c31af7Sopenharmony_ci } 211e5c31af7Sopenharmony_ci if (pProfileExt) 212e5c31af7Sopenharmony_ci { 213e5c31af7Sopenharmony_ci m_h265DecodeProfile = *pProfileExt; 214e5c31af7Sopenharmony_ci } 215e5c31af7Sopenharmony_ci else 216e5c31af7Sopenharmony_ci { 217e5c31af7Sopenharmony_ci // Use default ext profile parameters 218e5c31af7Sopenharmony_ci m_h265DecodeProfile.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR; 219e5c31af7Sopenharmony_ci m_h265DecodeProfile.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN; 220e5c31af7Sopenharmony_ci } 221e5c31af7Sopenharmony_ci m_profile.pNext = &m_h265DecodeProfile; 222e5c31af7Sopenharmony_ci m_h265DecodeProfile.pNext = NULL; 223e5c31af7Sopenharmony_ci } 224e5c31af7Sopenharmony_ci else if (m_profile.videoCodecOperation == VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT) 225e5c31af7Sopenharmony_ci { 226e5c31af7Sopenharmony_ci VkVideoEncodeH264ProfileInfoEXT const* pProfileExt = (VkVideoEncodeH264ProfileInfoEXT const*)pVideoProfileExt; 227e5c31af7Sopenharmony_ci if (pProfileExt && (pProfileExt->sType != VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT)) 228e5c31af7Sopenharmony_ci { 229e5c31af7Sopenharmony_ci m_profile.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; 230e5c31af7Sopenharmony_ci return false; 231e5c31af7Sopenharmony_ci } 232e5c31af7Sopenharmony_ci if (pProfileExt) 233e5c31af7Sopenharmony_ci { 234e5c31af7Sopenharmony_ci m_h264EncodeProfile = *pProfileExt; 235e5c31af7Sopenharmony_ci } 236e5c31af7Sopenharmony_ci else 237e5c31af7Sopenharmony_ci { 238e5c31af7Sopenharmony_ci // Use default ext profile parameters 239e5c31af7Sopenharmony_ci m_h264DecodeProfile.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT; 240e5c31af7Sopenharmony_ci m_h264DecodeProfile.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN; 241e5c31af7Sopenharmony_ci } 242e5c31af7Sopenharmony_ci m_profile.pNext = &m_h264EncodeProfile; 243e5c31af7Sopenharmony_ci m_h264EncodeProfile.pNext = NULL; 244e5c31af7Sopenharmony_ci } 245e5c31af7Sopenharmony_ci else if (m_profile.videoCodecOperation == VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT) 246e5c31af7Sopenharmony_ci { 247e5c31af7Sopenharmony_ci VkVideoEncodeH265ProfileInfoEXT const* pProfileExt = (VkVideoEncodeH265ProfileInfoEXT const*)pVideoProfileExt; 248e5c31af7Sopenharmony_ci if (pProfileExt && (pProfileExt->sType != VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_EXT)) 249e5c31af7Sopenharmony_ci { 250e5c31af7Sopenharmony_ci m_profile.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; 251e5c31af7Sopenharmony_ci return false; 252e5c31af7Sopenharmony_ci } 253e5c31af7Sopenharmony_ci if (pProfileExt) 254e5c31af7Sopenharmony_ci { 255e5c31af7Sopenharmony_ci m_h265EncodeProfile = *pProfileExt; 256e5c31af7Sopenharmony_ci } 257e5c31af7Sopenharmony_ci else 258e5c31af7Sopenharmony_ci { 259e5c31af7Sopenharmony_ci // Use default ext profile parameters 260e5c31af7Sopenharmony_ci m_h265EncodeProfile.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_EXT; 261e5c31af7Sopenharmony_ci m_h265EncodeProfile.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN; 262e5c31af7Sopenharmony_ci } 263e5c31af7Sopenharmony_ci m_profile.pNext = &m_h265EncodeProfile; 264e5c31af7Sopenharmony_ci m_h265EncodeProfile.pNext = NULL; 265e5c31af7Sopenharmony_ci } 266e5c31af7Sopenharmony_ci else 267e5c31af7Sopenharmony_ci { 268e5c31af7Sopenharmony_ci DE_ASSERT(false && "Unknown codec!"); 269e5c31af7Sopenharmony_ci return false; 270e5c31af7Sopenharmony_ci } 271e5c31af7Sopenharmony_ci 272e5c31af7Sopenharmony_ci return true; 273e5c31af7Sopenharmony_ci } 274e5c31af7Sopenharmony_ci 275e5c31af7Sopenharmony_ci bool InitFromProfile(const VkVideoProfileInfoKHR* pVideoProfile) 276e5c31af7Sopenharmony_ci { 277e5c31af7Sopenharmony_ci m_profile = *pVideoProfile; 278e5c31af7Sopenharmony_ci m_profile.pNext = NULL; 279e5c31af7Sopenharmony_ci return PopulateProfileExt((VkBaseInStructure const*)pVideoProfile->pNext); 280e5c31af7Sopenharmony_ci } 281e5c31af7Sopenharmony_ci 282e5c31af7Sopenharmony_ci VkVideoCoreProfile(const VkVideoProfileInfoKHR* pVideoProfile) 283e5c31af7Sopenharmony_ci : m_profile(*pVideoProfile) 284e5c31af7Sopenharmony_ci { 285e5c31af7Sopenharmony_ci 286e5c31af7Sopenharmony_ci PopulateProfileExt((VkBaseInStructure const*)pVideoProfile->pNext); 287e5c31af7Sopenharmony_ci } 288e5c31af7Sopenharmony_ci 289e5c31af7Sopenharmony_ci VkVideoCoreProfile(VkVideoCodecOperationFlagBitsKHR videoCodecOperation = VK_VIDEO_CODEC_OPERATION_NONE_KHR, 290e5c31af7Sopenharmony_ci VkVideoChromaSubsamplingFlagsKHR chromaSubsampling = VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR, 291e5c31af7Sopenharmony_ci VkVideoComponentBitDepthFlagsKHR lumaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR, 292e5c31af7Sopenharmony_ci VkVideoComponentBitDepthFlagsKHR chromaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR, 293e5c31af7Sopenharmony_ci deUint32 videoH26xProfileIdc = 0) 294e5c31af7Sopenharmony_ci : m_profile({VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, NULL, videoCodecOperation, chromaSubsampling, lumaBitDepth, chromaBitDepth}), m_profileList({VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR, NULL, 1, &m_profile}) 295e5c31af7Sopenharmony_ci { 296e5c31af7Sopenharmony_ci if (!isValidCodec(videoCodecOperation)) 297e5c31af7Sopenharmony_ci { 298e5c31af7Sopenharmony_ci return; 299e5c31af7Sopenharmony_ci } 300e5c31af7Sopenharmony_ci 301e5c31af7Sopenharmony_ci VkVideoDecodeH264ProfileInfoKHR decodeH264ProfilesRequest; 302e5c31af7Sopenharmony_ci VkVideoDecodeH265ProfileInfoKHR decodeH265ProfilesRequest; 303e5c31af7Sopenharmony_ci VkVideoEncodeH264ProfileInfoEXT encodeH264ProfilesRequest; 304e5c31af7Sopenharmony_ci VkVideoEncodeH265ProfileInfoEXT encodeH265ProfilesRequest; 305e5c31af7Sopenharmony_ci VkBaseInStructure* pVideoProfileExt = NULL; 306e5c31af7Sopenharmony_ci 307e5c31af7Sopenharmony_ci if (videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) 308e5c31af7Sopenharmony_ci { 309e5c31af7Sopenharmony_ci decodeH264ProfilesRequest.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR; 310e5c31af7Sopenharmony_ci decodeH264ProfilesRequest.pNext = NULL; 311e5c31af7Sopenharmony_ci decodeH264ProfilesRequest.stdProfileIdc = (videoH26xProfileIdc == 0) ? 312e5c31af7Sopenharmony_ci STD_VIDEO_H264_PROFILE_IDC_INVALID : 313e5c31af7Sopenharmony_ci (StdVideoH264ProfileIdc)videoH26xProfileIdc; 314e5c31af7Sopenharmony_ci decodeH264ProfilesRequest.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR; 315e5c31af7Sopenharmony_ci pVideoProfileExt = (VkBaseInStructure*)&decodeH264ProfilesRequest; 316e5c31af7Sopenharmony_ci } 317e5c31af7Sopenharmony_ci else if (videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR) 318e5c31af7Sopenharmony_ci { 319e5c31af7Sopenharmony_ci decodeH265ProfilesRequest.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR; 320e5c31af7Sopenharmony_ci decodeH265ProfilesRequest.pNext = NULL; 321e5c31af7Sopenharmony_ci decodeH265ProfilesRequest.stdProfileIdc = (videoH26xProfileIdc == 0) ? 322e5c31af7Sopenharmony_ci STD_VIDEO_H265_PROFILE_IDC_INVALID : 323e5c31af7Sopenharmony_ci (StdVideoH265ProfileIdc)videoH26xProfileIdc; 324e5c31af7Sopenharmony_ci pVideoProfileExt = (VkBaseInStructure*)&decodeH265ProfilesRequest; 325e5c31af7Sopenharmony_ci } 326e5c31af7Sopenharmony_ci else if (videoCodecOperation == VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT) 327e5c31af7Sopenharmony_ci { 328e5c31af7Sopenharmony_ci encodeH264ProfilesRequest.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT; 329e5c31af7Sopenharmony_ci encodeH264ProfilesRequest.pNext = NULL; 330e5c31af7Sopenharmony_ci encodeH264ProfilesRequest.stdProfileIdc = (videoH26xProfileIdc == 0) ? 331e5c31af7Sopenharmony_ci STD_VIDEO_H264_PROFILE_IDC_INVALID : 332e5c31af7Sopenharmony_ci (StdVideoH264ProfileIdc)videoH26xProfileIdc; 333e5c31af7Sopenharmony_ci pVideoProfileExt = (VkBaseInStructure*)&encodeH264ProfilesRequest; 334e5c31af7Sopenharmony_ci } 335e5c31af7Sopenharmony_ci else if (videoCodecOperation == VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT) 336e5c31af7Sopenharmony_ci { 337e5c31af7Sopenharmony_ci encodeH265ProfilesRequest.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_EXT; 338e5c31af7Sopenharmony_ci encodeH265ProfilesRequest.pNext = NULL; 339e5c31af7Sopenharmony_ci encodeH265ProfilesRequest.stdProfileIdc = (videoH26xProfileIdc == 0) ? 340e5c31af7Sopenharmony_ci STD_VIDEO_H265_PROFILE_IDC_INVALID : 341e5c31af7Sopenharmony_ci (StdVideoH265ProfileIdc)videoH26xProfileIdc; 342e5c31af7Sopenharmony_ci pVideoProfileExt = (VkBaseInStructure*)&encodeH265ProfilesRequest; 343e5c31af7Sopenharmony_ci } 344e5c31af7Sopenharmony_ci else 345e5c31af7Sopenharmony_ci { 346e5c31af7Sopenharmony_ci DE_ASSERT(false && "Unknown codec!"); 347e5c31af7Sopenharmony_ci return; 348e5c31af7Sopenharmony_ci } 349e5c31af7Sopenharmony_ci 350e5c31af7Sopenharmony_ci PopulateProfileExt(pVideoProfileExt); 351e5c31af7Sopenharmony_ci } 352e5c31af7Sopenharmony_ci 353e5c31af7Sopenharmony_ci VkVideoCodecOperationFlagBitsKHR GetCodecType() const 354e5c31af7Sopenharmony_ci { 355e5c31af7Sopenharmony_ci return m_profile.videoCodecOperation; 356e5c31af7Sopenharmony_ci } 357e5c31af7Sopenharmony_ci 358e5c31af7Sopenharmony_ci bool IsEncodeCodecType() const 359e5c31af7Sopenharmony_ci { 360e5c31af7Sopenharmony_ci return ((m_profile.videoCodecOperation == VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT) || 361e5c31af7Sopenharmony_ci (m_profile.videoCodecOperation == VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT)); 362e5c31af7Sopenharmony_ci } 363e5c31af7Sopenharmony_ci 364e5c31af7Sopenharmony_ci bool IsDecodeCodecType() const 365e5c31af7Sopenharmony_ci { 366e5c31af7Sopenharmony_ci return ((m_profile.videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) || 367e5c31af7Sopenharmony_ci (m_profile.videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR)); 368e5c31af7Sopenharmony_ci } 369e5c31af7Sopenharmony_ci 370e5c31af7Sopenharmony_ci operator bool() const 371e5c31af7Sopenharmony_ci { 372e5c31af7Sopenharmony_ci return (m_profile.sType == VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR); 373e5c31af7Sopenharmony_ci } 374e5c31af7Sopenharmony_ci 375e5c31af7Sopenharmony_ci const VkVideoProfileInfoKHR* GetProfile() const 376e5c31af7Sopenharmony_ci { 377e5c31af7Sopenharmony_ci if (m_profile.sType == VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR) 378e5c31af7Sopenharmony_ci { 379e5c31af7Sopenharmony_ci return &m_profile; 380e5c31af7Sopenharmony_ci } 381e5c31af7Sopenharmony_ci else 382e5c31af7Sopenharmony_ci { 383e5c31af7Sopenharmony_ci return NULL; 384e5c31af7Sopenharmony_ci } 385e5c31af7Sopenharmony_ci } 386e5c31af7Sopenharmony_ci 387e5c31af7Sopenharmony_ci const VkVideoProfileListInfoKHR* GetProfileListInfo() const 388e5c31af7Sopenharmony_ci { 389e5c31af7Sopenharmony_ci if (m_profileList.sType == VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR) 390e5c31af7Sopenharmony_ci { 391e5c31af7Sopenharmony_ci return &m_profileList; 392e5c31af7Sopenharmony_ci } 393e5c31af7Sopenharmony_ci else 394e5c31af7Sopenharmony_ci { 395e5c31af7Sopenharmony_ci return NULL; 396e5c31af7Sopenharmony_ci } 397e5c31af7Sopenharmony_ci } 398e5c31af7Sopenharmony_ci 399e5c31af7Sopenharmony_ci const VkVideoDecodeH264ProfileInfoKHR* GetDecodeH264Profile() const 400e5c31af7Sopenharmony_ci { 401e5c31af7Sopenharmony_ci if (m_h264DecodeProfile.sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR) 402e5c31af7Sopenharmony_ci { 403e5c31af7Sopenharmony_ci return &m_h264DecodeProfile; 404e5c31af7Sopenharmony_ci } 405e5c31af7Sopenharmony_ci else 406e5c31af7Sopenharmony_ci { 407e5c31af7Sopenharmony_ci return NULL; 408e5c31af7Sopenharmony_ci } 409e5c31af7Sopenharmony_ci } 410e5c31af7Sopenharmony_ci 411e5c31af7Sopenharmony_ci const VkVideoDecodeH265ProfileInfoKHR* GetDecodeH265Profile() const 412e5c31af7Sopenharmony_ci { 413e5c31af7Sopenharmony_ci if (m_h265DecodeProfile.sType == VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR) 414e5c31af7Sopenharmony_ci { 415e5c31af7Sopenharmony_ci return &m_h265DecodeProfile; 416e5c31af7Sopenharmony_ci } 417e5c31af7Sopenharmony_ci else 418e5c31af7Sopenharmony_ci { 419e5c31af7Sopenharmony_ci return NULL; 420e5c31af7Sopenharmony_ci } 421e5c31af7Sopenharmony_ci } 422e5c31af7Sopenharmony_ci 423e5c31af7Sopenharmony_ci const VkVideoEncodeH264ProfileInfoEXT* GetEncodeH264Profile() const 424e5c31af7Sopenharmony_ci { 425e5c31af7Sopenharmony_ci if (m_h264DecodeProfile.sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT) 426e5c31af7Sopenharmony_ci { 427e5c31af7Sopenharmony_ci return &m_h264EncodeProfile; 428e5c31af7Sopenharmony_ci } 429e5c31af7Sopenharmony_ci else 430e5c31af7Sopenharmony_ci { 431e5c31af7Sopenharmony_ci return NULL; 432e5c31af7Sopenharmony_ci } 433e5c31af7Sopenharmony_ci } 434e5c31af7Sopenharmony_ci 435e5c31af7Sopenharmony_ci const VkVideoEncodeH265ProfileInfoEXT* GetEncodeH265Profile() const 436e5c31af7Sopenharmony_ci { 437e5c31af7Sopenharmony_ci if (m_h265DecodeProfile.sType == VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_EXT) 438e5c31af7Sopenharmony_ci { 439e5c31af7Sopenharmony_ci return &m_h265EncodeProfile; 440e5c31af7Sopenharmony_ci } 441e5c31af7Sopenharmony_ci else 442e5c31af7Sopenharmony_ci { 443e5c31af7Sopenharmony_ci return NULL; 444e5c31af7Sopenharmony_ci } 445e5c31af7Sopenharmony_ci } 446e5c31af7Sopenharmony_ci 447e5c31af7Sopenharmony_ci bool copyProfile(const VkVideoCoreProfile& src) 448e5c31af7Sopenharmony_ci { 449e5c31af7Sopenharmony_ci if (!src) 450e5c31af7Sopenharmony_ci { 451e5c31af7Sopenharmony_ci return false; 452e5c31af7Sopenharmony_ci } 453e5c31af7Sopenharmony_ci 454e5c31af7Sopenharmony_ci m_profile = src.m_profile; 455e5c31af7Sopenharmony_ci m_profile.pNext = nullptr; 456e5c31af7Sopenharmony_ci 457e5c31af7Sopenharmony_ci m_profileList = src.m_profileList; 458e5c31af7Sopenharmony_ci m_profileList.pNext = nullptr; 459e5c31af7Sopenharmony_ci 460e5c31af7Sopenharmony_ci m_profileList.pProfiles = &m_profile; 461e5c31af7Sopenharmony_ci 462e5c31af7Sopenharmony_ci PopulateProfileExt((VkBaseInStructure const*)src.m_profile.pNext); 463e5c31af7Sopenharmony_ci 464e5c31af7Sopenharmony_ci return true; 465e5c31af7Sopenharmony_ci } 466e5c31af7Sopenharmony_ci 467e5c31af7Sopenharmony_ci VkVideoCoreProfile(const VkVideoCoreProfile& other) 468e5c31af7Sopenharmony_ci { 469e5c31af7Sopenharmony_ci copyProfile(other); 470e5c31af7Sopenharmony_ci } 471e5c31af7Sopenharmony_ci 472e5c31af7Sopenharmony_ci VkVideoCoreProfile& operator=(const VkVideoCoreProfile& other) 473e5c31af7Sopenharmony_ci { 474e5c31af7Sopenharmony_ci copyProfile(other); 475e5c31af7Sopenharmony_ci return *this; 476e5c31af7Sopenharmony_ci } 477e5c31af7Sopenharmony_ci 478e5c31af7Sopenharmony_ci bool operator==(const VkVideoCoreProfile& other) const 479e5c31af7Sopenharmony_ci { 480e5c31af7Sopenharmony_ci if (m_profile.videoCodecOperation != other.m_profile.videoCodecOperation) 481e5c31af7Sopenharmony_ci { 482e5c31af7Sopenharmony_ci return false; 483e5c31af7Sopenharmony_ci } 484e5c31af7Sopenharmony_ci 485e5c31af7Sopenharmony_ci if (m_profile.chromaSubsampling != other.m_profile.chromaSubsampling) 486e5c31af7Sopenharmony_ci { 487e5c31af7Sopenharmony_ci return false; 488e5c31af7Sopenharmony_ci } 489e5c31af7Sopenharmony_ci 490e5c31af7Sopenharmony_ci if (m_profile.lumaBitDepth != other.m_profile.lumaBitDepth) 491e5c31af7Sopenharmony_ci { 492e5c31af7Sopenharmony_ci return false; 493e5c31af7Sopenharmony_ci } 494e5c31af7Sopenharmony_ci 495e5c31af7Sopenharmony_ci if (m_profile.chromaBitDepth != other.m_profile.chromaBitDepth) 496e5c31af7Sopenharmony_ci { 497e5c31af7Sopenharmony_ci return false; 498e5c31af7Sopenharmony_ci } 499e5c31af7Sopenharmony_ci 500e5c31af7Sopenharmony_ci if (m_profile.pNext != nullptr) 501e5c31af7Sopenharmony_ci { 502e5c31af7Sopenharmony_ci switch (m_profile.videoCodecOperation) { 503e5c31af7Sopenharmony_ci case vk::VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR: 504e5c31af7Sopenharmony_ci { 505e5c31af7Sopenharmony_ci auto* ours = (VkVideoDecodeH264ProfileInfoKHR*)m_profile.pNext; 506e5c31af7Sopenharmony_ci auto* theirs = (VkVideoDecodeH264ProfileInfoKHR*)other.m_profile.pNext; 507e5c31af7Sopenharmony_ci if (ours->sType != theirs->sType) 508e5c31af7Sopenharmony_ci return false; 509e5c31af7Sopenharmony_ci if (ours->stdProfileIdc != theirs->stdProfileIdc) 510e5c31af7Sopenharmony_ci return false; 511e5c31af7Sopenharmony_ci if (ours->pictureLayout != theirs->pictureLayout) 512e5c31af7Sopenharmony_ci return false; 513e5c31af7Sopenharmony_ci break; 514e5c31af7Sopenharmony_ci } 515e5c31af7Sopenharmony_ci case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR: 516e5c31af7Sopenharmony_ci { 517e5c31af7Sopenharmony_ci auto* ours = (VkVideoDecodeH265ProfileInfoKHR*)m_profile.pNext; 518e5c31af7Sopenharmony_ci auto* theirs = (VkVideoDecodeH265ProfileInfoKHR*)other.m_profile.pNext; 519e5c31af7Sopenharmony_ci if (ours->sType != theirs->sType) 520e5c31af7Sopenharmony_ci return false; 521e5c31af7Sopenharmony_ci if (ours->stdProfileIdc != theirs->stdProfileIdc) 522e5c31af7Sopenharmony_ci return false; 523e5c31af7Sopenharmony_ci break; 524e5c31af7Sopenharmony_ci } 525e5c31af7Sopenharmony_ci default: 526e5c31af7Sopenharmony_ci tcu::die("Unknown codec"); 527e5c31af7Sopenharmony_ci } 528e5c31af7Sopenharmony_ci } 529e5c31af7Sopenharmony_ci 530e5c31af7Sopenharmony_ci 531e5c31af7Sopenharmony_ci return true; 532e5c31af7Sopenharmony_ci } 533e5c31af7Sopenharmony_ci 534e5c31af7Sopenharmony_ci bool operator!=(const VkVideoCoreProfile& other) const 535e5c31af7Sopenharmony_ci { 536e5c31af7Sopenharmony_ci return !(*this == other); 537e5c31af7Sopenharmony_ci } 538e5c31af7Sopenharmony_ci 539e5c31af7Sopenharmony_ci VkVideoChromaSubsamplingFlagsKHR GetColorSubsampling() const 540e5c31af7Sopenharmony_ci { 541e5c31af7Sopenharmony_ci return m_profile.chromaSubsampling; 542e5c31af7Sopenharmony_ci } 543e5c31af7Sopenharmony_ci 544e5c31af7Sopenharmony_ci StdChromaFormatIdc GetNvColorSubsampling() const 545e5c31af7Sopenharmony_ci { 546e5c31af7Sopenharmony_ci if (m_profile.chromaSubsampling & VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR) 547e5c31af7Sopenharmony_ci { 548e5c31af7Sopenharmony_ci return chroma_format_idc_monochrome; 549e5c31af7Sopenharmony_ci } 550e5c31af7Sopenharmony_ci else if (m_profile.chromaSubsampling & VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR) 551e5c31af7Sopenharmony_ci { 552e5c31af7Sopenharmony_ci return chroma_format_idc_420; 553e5c31af7Sopenharmony_ci } 554e5c31af7Sopenharmony_ci else if (m_profile.chromaSubsampling & VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR) 555e5c31af7Sopenharmony_ci { 556e5c31af7Sopenharmony_ci return chroma_format_idc_422; 557e5c31af7Sopenharmony_ci } 558e5c31af7Sopenharmony_ci else if (m_profile.chromaSubsampling & VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR) 559e5c31af7Sopenharmony_ci { 560e5c31af7Sopenharmony_ci return chroma_format_idc_444; 561e5c31af7Sopenharmony_ci } 562e5c31af7Sopenharmony_ci 563e5c31af7Sopenharmony_ci return chroma_format_idc_monochrome; 564e5c31af7Sopenharmony_ci } 565e5c31af7Sopenharmony_ci 566e5c31af7Sopenharmony_ci deUint32 GetLumaBitDepthMinus8() const 567e5c31af7Sopenharmony_ci { 568e5c31af7Sopenharmony_ci if (m_profile.lumaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR) 569e5c31af7Sopenharmony_ci { 570e5c31af7Sopenharmony_ci return 8 - 8; 571e5c31af7Sopenharmony_ci } 572e5c31af7Sopenharmony_ci else if (m_profile.lumaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR) 573e5c31af7Sopenharmony_ci { 574e5c31af7Sopenharmony_ci return 10 - 8; 575e5c31af7Sopenharmony_ci } 576e5c31af7Sopenharmony_ci else if (m_profile.lumaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR) 577e5c31af7Sopenharmony_ci { 578e5c31af7Sopenharmony_ci return 12 - 8; 579e5c31af7Sopenharmony_ci } 580e5c31af7Sopenharmony_ci return 0; 581e5c31af7Sopenharmony_ci } 582e5c31af7Sopenharmony_ci 583e5c31af7Sopenharmony_ci deUint32 GetChromaBitDepthMinus8() const 584e5c31af7Sopenharmony_ci { 585e5c31af7Sopenharmony_ci if (m_profile.chromaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR) 586e5c31af7Sopenharmony_ci { 587e5c31af7Sopenharmony_ci return 8 - 8; 588e5c31af7Sopenharmony_ci } 589e5c31af7Sopenharmony_ci else if (m_profile.chromaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR) 590e5c31af7Sopenharmony_ci { 591e5c31af7Sopenharmony_ci return 10 - 8; 592e5c31af7Sopenharmony_ci } 593e5c31af7Sopenharmony_ci else if (m_profile.chromaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR) 594e5c31af7Sopenharmony_ci { 595e5c31af7Sopenharmony_ci return 12 - 8; 596e5c31af7Sopenharmony_ci } 597e5c31af7Sopenharmony_ci return 0; 598e5c31af7Sopenharmony_ci } 599e5c31af7Sopenharmony_ci 600e5c31af7Sopenharmony_ci bool is16BitFormat() const 601e5c31af7Sopenharmony_ci { 602e5c31af7Sopenharmony_ci return !!GetLumaBitDepthMinus8() || !!GetChromaBitDepthMinus8(); 603e5c31af7Sopenharmony_ci } 604e5c31af7Sopenharmony_ci 605e5c31af7Sopenharmony_ci static VkFormat CodecGetVkFormat(VkVideoChromaSubsamplingFlagBitsKHR chromaFormatIdc, 606e5c31af7Sopenharmony_ci VkVideoComponentBitDepthFlagBitsKHR lumaBitDepth, 607e5c31af7Sopenharmony_ci bool isSemiPlanar) 608e5c31af7Sopenharmony_ci { 609e5c31af7Sopenharmony_ci VkFormat vkFormat = VK_FORMAT_UNDEFINED; 610e5c31af7Sopenharmony_ci switch (chromaFormatIdc) 611e5c31af7Sopenharmony_ci { 612e5c31af7Sopenharmony_ci case VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR: 613e5c31af7Sopenharmony_ci switch (lumaBitDepth) 614e5c31af7Sopenharmony_ci { 615e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR: 616e5c31af7Sopenharmony_ci vkFormat = VK_FORMAT_R8_UNORM; 617e5c31af7Sopenharmony_ci break; 618e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR: 619e5c31af7Sopenharmony_ci vkFormat = VK_FORMAT_R10X6_UNORM_PACK16; 620e5c31af7Sopenharmony_ci break; 621e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR: 622e5c31af7Sopenharmony_ci vkFormat = VK_FORMAT_R12X4_UNORM_PACK16; 623e5c31af7Sopenharmony_ci break; 624e5c31af7Sopenharmony_ci default: 625e5c31af7Sopenharmony_ci DE_ASSERT(false); 626e5c31af7Sopenharmony_ci } 627e5c31af7Sopenharmony_ci break; 628e5c31af7Sopenharmony_ci case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR: 629e5c31af7Sopenharmony_ci switch (lumaBitDepth) 630e5c31af7Sopenharmony_ci { 631e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR: 632e5c31af7Sopenharmony_ci vkFormat = isSemiPlanar ? VK_FORMAT_G8_B8R8_2PLANE_420_UNORM : VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; 633e5c31af7Sopenharmony_ci break; 634e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR: 635e5c31af7Sopenharmony_ci vkFormat = isSemiPlanar ? VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 : VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16; 636e5c31af7Sopenharmony_ci break; 637e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR: 638e5c31af7Sopenharmony_ci vkFormat = isSemiPlanar ? VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 : VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16; 639e5c31af7Sopenharmony_ci break; 640e5c31af7Sopenharmony_ci default: 641e5c31af7Sopenharmony_ci DE_ASSERT(false); 642e5c31af7Sopenharmony_ci } 643e5c31af7Sopenharmony_ci break; 644e5c31af7Sopenharmony_ci case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR: 645e5c31af7Sopenharmony_ci switch (lumaBitDepth) 646e5c31af7Sopenharmony_ci { 647e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR: 648e5c31af7Sopenharmony_ci vkFormat = isSemiPlanar ? VK_FORMAT_G8_B8R8_2PLANE_422_UNORM : VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM; 649e5c31af7Sopenharmony_ci break; 650e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR: 651e5c31af7Sopenharmony_ci vkFormat = isSemiPlanar ? VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 : VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16; 652e5c31af7Sopenharmony_ci break; 653e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR: 654e5c31af7Sopenharmony_ci vkFormat = isSemiPlanar ? VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 : VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16; 655e5c31af7Sopenharmony_ci break; 656e5c31af7Sopenharmony_ci default: 657e5c31af7Sopenharmony_ci DE_ASSERT(false); 658e5c31af7Sopenharmony_ci } 659e5c31af7Sopenharmony_ci break; 660e5c31af7Sopenharmony_ci case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR: 661e5c31af7Sopenharmony_ci switch (lumaBitDepth) 662e5c31af7Sopenharmony_ci { 663e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR: 664e5c31af7Sopenharmony_ci vkFormat = isSemiPlanar ? VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT : VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM; 665e5c31af7Sopenharmony_ci break; 666e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR: 667e5c31af7Sopenharmony_ci vkFormat = isSemiPlanar ? VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT : VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16; 668e5c31af7Sopenharmony_ci break; 669e5c31af7Sopenharmony_ci case VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR: 670e5c31af7Sopenharmony_ci vkFormat = isSemiPlanar ? VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT : VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16; 671e5c31af7Sopenharmony_ci break; 672e5c31af7Sopenharmony_ci default: 673e5c31af7Sopenharmony_ci DE_ASSERT(false); 674e5c31af7Sopenharmony_ci } 675e5c31af7Sopenharmony_ci break; 676e5c31af7Sopenharmony_ci default: 677e5c31af7Sopenharmony_ci DE_ASSERT(false); 678e5c31af7Sopenharmony_ci } 679e5c31af7Sopenharmony_ci 680e5c31af7Sopenharmony_ci return vkFormat; 681e5c31af7Sopenharmony_ci } 682e5c31af7Sopenharmony_ci 683e5c31af7Sopenharmony_ci static StdChromaFormatIdc GetVideoChromaFormatFromVkFormat(VkFormat format) 684e5c31af7Sopenharmony_ci { 685e5c31af7Sopenharmony_ci StdChromaFormatIdc videoChromaFormat = chroma_format_idc_420; 686e5c31af7Sopenharmony_ci switch ((deUint32)format) 687e5c31af7Sopenharmony_ci { 688e5c31af7Sopenharmony_ci case VK_FORMAT_R8_UNORM: 689e5c31af7Sopenharmony_ci case VK_FORMAT_R10X6_UNORM_PACK16: 690e5c31af7Sopenharmony_ci case VK_FORMAT_R12X4_UNORM_PACK16: 691e5c31af7Sopenharmony_ci videoChromaFormat = chroma_format_idc_monochrome; 692e5c31af7Sopenharmony_ci break; 693e5c31af7Sopenharmony_ci 694e5c31af7Sopenharmony_ci case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: 695e5c31af7Sopenharmony_ci case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: 696e5c31af7Sopenharmony_ci case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: 697e5c31af7Sopenharmony_ci case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: 698e5c31af7Sopenharmony_ci case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: 699e5c31af7Sopenharmony_ci case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: 700e5c31af7Sopenharmony_ci videoChromaFormat = chroma_format_idc_420; 701e5c31af7Sopenharmony_ci break; 702e5c31af7Sopenharmony_ci 703e5c31af7Sopenharmony_ci case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM: 704e5c31af7Sopenharmony_ci case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM: 705e5c31af7Sopenharmony_ci case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: 706e5c31af7Sopenharmony_ci case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: 707e5c31af7Sopenharmony_ci case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: 708e5c31af7Sopenharmony_ci case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: 709e5c31af7Sopenharmony_ci videoChromaFormat = chroma_format_idc_422; 710e5c31af7Sopenharmony_ci break; 711e5c31af7Sopenharmony_ci 712e5c31af7Sopenharmony_ci case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM: 713e5c31af7Sopenharmony_ci case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: 714e5c31af7Sopenharmony_ci case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: 715e5c31af7Sopenharmony_ci case VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT: 716e5c31af7Sopenharmony_ci case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT: 717e5c31af7Sopenharmony_ci case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT: 718e5c31af7Sopenharmony_ci case VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT: 719e5c31af7Sopenharmony_ci videoChromaFormat = chroma_format_idc_444; 720e5c31af7Sopenharmony_ci break; 721e5c31af7Sopenharmony_ci default: 722e5c31af7Sopenharmony_ci DE_ASSERT(false); 723e5c31af7Sopenharmony_ci } 724e5c31af7Sopenharmony_ci 725e5c31af7Sopenharmony_ci return videoChromaFormat; 726e5c31af7Sopenharmony_ci } 727e5c31af7Sopenharmony_ci 728e5c31af7Sopenharmony_ci static const char* CodecToName(VkVideoCodecOperationFlagBitsKHR codec) 729e5c31af7Sopenharmony_ci { 730e5c31af7Sopenharmony_ci switch ((int32_t)codec) 731e5c31af7Sopenharmony_ci { 732e5c31af7Sopenharmony_ci case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR: 733e5c31af7Sopenharmony_ci return "decode h.264"; 734e5c31af7Sopenharmony_ci case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR: 735e5c31af7Sopenharmony_ci return "decode h.265"; 736e5c31af7Sopenharmony_ci case VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT: 737e5c31af7Sopenharmony_ci return "encode h.264"; 738e5c31af7Sopenharmony_ci case VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT: 739e5c31af7Sopenharmony_ci return "encode h.265"; 740e5c31af7Sopenharmony_ci default:; 741e5c31af7Sopenharmony_ci } 742e5c31af7Sopenharmony_ci DE_ASSERT(false && "Unknown codec"); 743e5c31af7Sopenharmony_ci return "UNKNON"; 744e5c31af7Sopenharmony_ci } 745e5c31af7Sopenharmony_ci 746e5c31af7Sopenharmony_ci static void DumpFormatProfiles(VkVideoProfileInfoKHR* pVideoProfile) 747e5c31af7Sopenharmony_ci { 748e5c31af7Sopenharmony_ci // formatProfile info based on supported chroma_format_idc 749e5c31af7Sopenharmony_ci if (pVideoProfile->chromaSubsampling & VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR) 750e5c31af7Sopenharmony_ci { 751e5c31af7Sopenharmony_ci std::cout << "MONO, "; 752e5c31af7Sopenharmony_ci } 753e5c31af7Sopenharmony_ci if (pVideoProfile->chromaSubsampling & VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR) 754e5c31af7Sopenharmony_ci { 755e5c31af7Sopenharmony_ci std::cout << " 420, "; 756e5c31af7Sopenharmony_ci } 757e5c31af7Sopenharmony_ci if (pVideoProfile->chromaSubsampling & VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR) 758e5c31af7Sopenharmony_ci { 759e5c31af7Sopenharmony_ci std::cout << " 422, "; 760e5c31af7Sopenharmony_ci } 761e5c31af7Sopenharmony_ci if (pVideoProfile->chromaSubsampling & VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR) 762e5c31af7Sopenharmony_ci { 763e5c31af7Sopenharmony_ci std::cout << " 444, "; 764e5c31af7Sopenharmony_ci } 765e5c31af7Sopenharmony_ci 766e5c31af7Sopenharmony_ci // Profile info based on max bit_depth_luma_minus8 767e5c31af7Sopenharmony_ci if (pVideoProfile->lumaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR) 768e5c31af7Sopenharmony_ci { 769e5c31af7Sopenharmony_ci std::cout << "LUMA: 8-bit, "; 770e5c31af7Sopenharmony_ci } 771e5c31af7Sopenharmony_ci if (pVideoProfile->lumaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR) 772e5c31af7Sopenharmony_ci { 773e5c31af7Sopenharmony_ci std::cout << "LUMA: 10-bit, "; 774e5c31af7Sopenharmony_ci } 775e5c31af7Sopenharmony_ci if (pVideoProfile->lumaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR) 776e5c31af7Sopenharmony_ci { 777e5c31af7Sopenharmony_ci std::cout << "LUMA: 12-bit, "; 778e5c31af7Sopenharmony_ci } 779e5c31af7Sopenharmony_ci 780e5c31af7Sopenharmony_ci // Profile info based on max bit_depth_chroma_minus8 781e5c31af7Sopenharmony_ci if (pVideoProfile->chromaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR) 782e5c31af7Sopenharmony_ci { 783e5c31af7Sopenharmony_ci std::cout << "CHROMA: 8-bit, "; 784e5c31af7Sopenharmony_ci } 785e5c31af7Sopenharmony_ci if (pVideoProfile->chromaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR) 786e5c31af7Sopenharmony_ci { 787e5c31af7Sopenharmony_ci std::cout << "CHROMA:10-bit, "; 788e5c31af7Sopenharmony_ci } 789e5c31af7Sopenharmony_ci if (pVideoProfile->chromaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR) 790e5c31af7Sopenharmony_ci { 791e5c31af7Sopenharmony_ci std::cout << "CHROMA:12-bit,"; 792e5c31af7Sopenharmony_ci } 793e5c31af7Sopenharmony_ci } 794e5c31af7Sopenharmony_ci 795e5c31af7Sopenharmony_ci static void DumpH264Profiles(VkVideoDecodeH264ProfileInfoKHR* pH264Profiles) 796e5c31af7Sopenharmony_ci { 797e5c31af7Sopenharmony_ci switch (pH264Profiles->stdProfileIdc) 798e5c31af7Sopenharmony_ci { 799e5c31af7Sopenharmony_ci case STD_VIDEO_H264_PROFILE_IDC_BASELINE: 800e5c31af7Sopenharmony_ci std::cout << "BASELINE, "; 801e5c31af7Sopenharmony_ci break; 802e5c31af7Sopenharmony_ci case STD_VIDEO_H264_PROFILE_IDC_MAIN: 803e5c31af7Sopenharmony_ci std::cout << "MAIN, "; 804e5c31af7Sopenharmony_ci break; 805e5c31af7Sopenharmony_ci case STD_VIDEO_H264_PROFILE_IDC_HIGH: 806e5c31af7Sopenharmony_ci std::cout << "HIGH, "; 807e5c31af7Sopenharmony_ci break; 808e5c31af7Sopenharmony_ci case STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE: 809e5c31af7Sopenharmony_ci std::cout << "HIGH_444_PREDICTIVE, "; 810e5c31af7Sopenharmony_ci break; 811e5c31af7Sopenharmony_ci default: 812e5c31af7Sopenharmony_ci std::cout << "UNKNOWN PROFILE, "; 813e5c31af7Sopenharmony_ci break; 814e5c31af7Sopenharmony_ci } 815e5c31af7Sopenharmony_ci } 816e5c31af7Sopenharmony_ci 817e5c31af7Sopenharmony_ci static void DumpH265Profiles(VkVideoDecodeH265ProfileInfoKHR* pH265Profiles) 818e5c31af7Sopenharmony_ci { 819e5c31af7Sopenharmony_ci switch (pH265Profiles->stdProfileIdc) 820e5c31af7Sopenharmony_ci { 821e5c31af7Sopenharmony_ci case STD_VIDEO_H265_PROFILE_IDC_MAIN: 822e5c31af7Sopenharmony_ci std::cout << "MAIN, "; 823e5c31af7Sopenharmony_ci break; 824e5c31af7Sopenharmony_ci case STD_VIDEO_H265_PROFILE_IDC_MAIN_10: 825e5c31af7Sopenharmony_ci std::cout << "MAIN_10, "; 826e5c31af7Sopenharmony_ci break; 827e5c31af7Sopenharmony_ci case STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE: 828e5c31af7Sopenharmony_ci std::cout << "MAIN_STILL_PICTURE, "; 829e5c31af7Sopenharmony_ci break; 830e5c31af7Sopenharmony_ci case STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS: 831e5c31af7Sopenharmony_ci std::cout << "FORMAT_RANGE_EXTENSIONS, "; 832e5c31af7Sopenharmony_ci break; 833e5c31af7Sopenharmony_ci case STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS: 834e5c31af7Sopenharmony_ci std::cout << "SCC_EXTENSIONS, "; 835e5c31af7Sopenharmony_ci break; 836e5c31af7Sopenharmony_ci default: 837e5c31af7Sopenharmony_ci std::cout << "UNKNOWN PROFILE, "; 838e5c31af7Sopenharmony_ci break; 839e5c31af7Sopenharmony_ci } 840e5c31af7Sopenharmony_ci } 841e5c31af7Sopenharmony_ci 842e5c31af7Sopenharmony_ciprivate: 843e5c31af7Sopenharmony_ci VkVideoProfileInfoKHR m_profile; 844e5c31af7Sopenharmony_ci VkVideoProfileListInfoKHR m_profileList; 845e5c31af7Sopenharmony_ci union 846e5c31af7Sopenharmony_ci { 847e5c31af7Sopenharmony_ci VkVideoDecodeH264ProfileInfoKHR m_h264DecodeProfile; 848e5c31af7Sopenharmony_ci VkVideoDecodeH265ProfileInfoKHR m_h265DecodeProfile; 849e5c31af7Sopenharmony_ci VkVideoEncodeH264ProfileInfoEXT m_h264EncodeProfile; 850e5c31af7Sopenharmony_ci VkVideoEncodeH265ProfileInfoEXT m_h265EncodeProfile; 851e5c31af7Sopenharmony_ci }; 852e5c31af7Sopenharmony_ci}; 853e5c31af7Sopenharmony_ci 854e5c31af7Sopenharmony_cinamespace util 855e5c31af7Sopenharmony_ci{ 856e5c31af7Sopenharmony_ciconst char* getVideoCodecString(VkVideoCodecOperationFlagBitsKHR codec); 857e5c31af7Sopenharmony_ci 858e5c31af7Sopenharmony_ciconst char* getVideoChromaFormatString(VkVideoChromaSubsamplingFlagBitsKHR chromaFormat); 859e5c31af7Sopenharmony_ci 860e5c31af7Sopenharmony_ciVkVideoCodecOperationFlagsKHR getSupportedCodecs(DeviceContext& devCtx, 861e5c31af7Sopenharmony_ci deUint32 selectedVideoQueueFamily, 862e5c31af7Sopenharmony_ci VkQueueFlags queueFlagsRequired = (VK_QUEUE_VIDEO_DECODE_BIT_KHR | VK_QUEUE_VIDEO_ENCODE_BIT_KHR), 863e5c31af7Sopenharmony_ci VkVideoCodecOperationFlagsKHR videoCodeOperations = 864e5c31af7Sopenharmony_ci (VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR | VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR | 865e5c31af7Sopenharmony_ci VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT | VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT)); 866e5c31af7Sopenharmony_ci 867e5c31af7Sopenharmony_ciVkResult getVideoFormats(DeviceContext& devCtx, 868e5c31af7Sopenharmony_ci const VkVideoCoreProfile& videoProfile, 869e5c31af7Sopenharmony_ci VkImageUsageFlags imageUsage, 870e5c31af7Sopenharmony_ci deUint32& formatCount, 871e5c31af7Sopenharmony_ci VkFormat* formats, 872e5c31af7Sopenharmony_ci bool dumpData = false); 873e5c31af7Sopenharmony_ci 874e5c31af7Sopenharmony_ciVkResult getSupportedVideoFormats(DeviceContext& devCtx, 875e5c31af7Sopenharmony_ci const VkVideoCoreProfile& videoProfile, 876e5c31af7Sopenharmony_ci VkVideoDecodeCapabilityFlagsKHR capabilityFlags, 877e5c31af7Sopenharmony_ci VkFormat& pictureFormat, 878e5c31af7Sopenharmony_ci VkFormat& referencePicturesFormat); 879e5c31af7Sopenharmony_ci 880e5c31af7Sopenharmony_ciconst char* codecToName(VkVideoCodecOperationFlagBitsKHR codec); 881e5c31af7Sopenharmony_ci 882e5c31af7Sopenharmony_ciVkResult getVideoCapabilities(DeviceContext& devCtx, 883e5c31af7Sopenharmony_ci const VkVideoCoreProfile& videoProfile, 884e5c31af7Sopenharmony_ci VkVideoCapabilitiesKHR* pVideoCapabilities); 885e5c31af7Sopenharmony_ci 886e5c31af7Sopenharmony_ciVkResult getVideoDecodeCapabilities(DeviceContext& devCtx, 887e5c31af7Sopenharmony_ci const VkVideoCoreProfile& videoProfile, 888e5c31af7Sopenharmony_ci VkVideoCapabilitiesKHR& videoCapabilities, 889e5c31af7Sopenharmony_ci VkVideoDecodeCapabilitiesKHR& videoDecodeCapabilities); 890e5c31af7Sopenharmony_ci} // namespace util 891e5c31af7Sopenharmony_ci 892e5c31af7Sopenharmony_cistd::vector<deUint8> semiplanarToYV12(const ycbcr::MultiPlaneImageData& multiPlaneImageData); 893e5c31af7Sopenharmony_ci 894e5c31af7Sopenharmony_ci} // video 895e5c31af7Sopenharmony_ci} // vkt 896e5c31af7Sopenharmony_ci 897e5c31af7Sopenharmony_ci#endif // _VKTVIDEOTESTUTILS_HPP 898