early-access version 2729

This commit is contained in:
pineappleEA 2022-05-17 21:04:11 +02:00
parent dab6a0fe35
commit c7aa528a40
49 changed files with 98614 additions and 79650 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2728. This is the source code for early-access 2729.
## Legal Notice ## Legal Notice

View File

@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Is this issue appropriate for the repository?**
Vulkan-Headers exists as a publishing mechanism for headers and related material sourced from multiple other repositories. If you have a problem with that material, it should *not* be reported here, but in the appropriate repository:
- https://github.com/KhronosGroup/Vulkan-Docs - C headers, XML, validusage.json, and generation scripts
- https://github.com/KhronosGroup/Vulkan-Hpp - C++ headers
- This repository - Repository structure, management, and build system *only*
See the repository README for more details.
**Describe the bug**
A clear and concise description of what the bug is. Please refer to specific files that are only in this repository, not copied from Vulkan-Docs or Vulkan-Hpp.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

View File

@ -17,24 +17,31 @@ import("//build_overrides/vulkan_headers.gni")
config("vulkan_headers_config") { config("vulkan_headers_config") {
include_dirs = [ "include" ] include_dirs = [ "include" ]
defines = []
if (is_win) { if (is_win) {
defines = [ "VK_USE_PLATFORM_WIN32_KHR" ] defines += [ "VK_USE_PLATFORM_WIN32_KHR" ]
} }
if (defined(vulkan_use_x11) && vulkan_use_x11) { if (defined(vulkan_use_x11) && vulkan_use_x11) {
defines = [ "VK_USE_PLATFORM_XCB_KHR" ] defines += [ "VK_USE_PLATFORM_XCB_KHR" ]
}
if (defined(vulkan_use_wayland) && vulkan_use_wayland) {
defines += [ "VK_USE_PLATFORM_WAYLAND_KHR" ]
if (defined(vulkan_wayland_include_dirs)) {
include_dirs += vulkan_wayland_include_dirs
}
} }
if (is_android) { if (is_android) {
defines = [ "VK_USE_PLATFORM_ANDROID_KHR" ] defines += [ "VK_USE_PLATFORM_ANDROID_KHR" ]
} }
if (is_fuchsia) { if (is_fuchsia) {
defines = [ "VK_USE_PLATFORM_FUCHSIA" ] defines += [ "VK_USE_PLATFORM_FUCHSIA" ]
} }
if (is_mac) { if (is_mac) {
defines = [ "VK_USE_PLATFORM_METAL_EXT" ] defines += [ "VK_USE_PLATFORM_METAL_EXT" ]
} }
if (defined(is_ggp) && is_ggp) { if (defined(is_ggp) && is_ggp) {
defines = [ "VK_USE_PLATFORM_GGP" ] defines += [ "VK_USE_PLATFORM_GGP" ]
} }
} }

View File

@ -31,6 +31,7 @@ Files in this repository originate from:
* registry/reg.py * registry/reg.py
* registry/spec_tools/util.py * registry/spec_tools/util.py
* registry/validusage.json * registry/validusage.json
* registry/video.xml
* registry/vk.xml * registry/vk.xml
* registry/vkconventions.py * registry/vkconventions.py
* All files under include/vulkan/ which are *not* listed explicitly as originating from another repository. * All files under include/vulkan/ which are *not* listed explicitly as originating from another repository.

View File

@ -1,49 +1,50 @@
#ifndef VULKAN_VIDEO_CODEC_H264STD_H_
#define VULKAN_VIDEO_CODEC_H264STD_H_ 1
/* /*
** Copyright (c) 2019-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */
#ifndef VULKAN_VIDEO_CODEC_H264STD_H_ /*
#define VULKAN_VIDEO_CODEC_H264STD_H_ 1 ** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "vk_video/vulkan_video_codecs_common.h"
// Vulkan 0.9 provisional Vulkan video H.264 encode and decode std specification version number
#define VK_STD_VULKAN_VIDEO_CODEC_H264_API_VERSION_0_9_5 VK_MAKE_VIDEO_STD_VERSION(0, 9, 5) // Patch version should always be set to 0
// Format must be in the form XX.XX where the first two digits are the major and the second two, the minor.
#define VK_STD_VULKAN_VIDEO_CODEC_H264_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_API_VERSION_0_9_5
#define VK_STD_VULKAN_VIDEO_CODEC_H264_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264"
// *************************************************
// Video H.264 common definitions:
// *************************************************
#define vulkan_video_codec_h264std 1
#include <stdint.h>
#define STD_VIDEO_H264_CPB_CNT_LIST_SIZE 32 #define STD_VIDEO_H264_CPB_CNT_LIST_SIZE 32
#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS 6 #define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS 6
#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS 16 #define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS 16
#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS 2 #define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS 2
#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS 64 #define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS 64
#define STD_VIDEO_H264_MAX_NUM_LIST_REF 32
#define STD_VIDEO_H264_MAX_CHROMA_PLANES 2
typedef enum StdVideoH264ChromaFormatIdc { typedef enum StdVideoH264ChromaFormatIdc {
STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME = 0, STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME = 0,
STD_VIDEO_H264_CHROMA_FORMAT_IDC_420 = 1, STD_VIDEO_H264_CHROMA_FORMAT_IDC_420 = 1,
STD_VIDEO_H264_CHROMA_FORMAT_IDC_422 = 2, STD_VIDEO_H264_CHROMA_FORMAT_IDC_422 = 2,
STD_VIDEO_H264_CHROMA_FORMAT_IDC_444 = 3, STD_VIDEO_H264_CHROMA_FORMAT_IDC_444 = 3,
STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_CHROMA_FORMAT_IDC_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264ChromaFormatIdc; } StdVideoH264ChromaFormatIdc;
typedef enum StdVideoH264ProfileIdc { typedef enum StdVideoH264ProfileIdc {
STD_VIDEO_H264_PROFILE_IDC_BASELINE = 66, /* Only constrained baseline is supported */ STD_VIDEO_H264_PROFILE_IDC_BASELINE = 66,
STD_VIDEO_H264_PROFILE_IDC_MAIN = 77, STD_VIDEO_H264_PROFILE_IDC_MAIN = 77,
STD_VIDEO_H264_PROFILE_IDC_HIGH = 100, STD_VIDEO_H264_PROFILE_IDC_HIGH = 100,
STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE = 244, STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE = 244,
STD_VIDEO_H264_PROFILE_IDC_INVALID = 0x7FFFFFFF STD_VIDEO_H264_PROFILE_IDC_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_PROFILE_IDC_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264ProfileIdc; } StdVideoH264ProfileIdc;
typedef enum StdVideoH264Level { typedef enum StdVideoH264Level {
@ -66,14 +67,16 @@ typedef enum StdVideoH264Level {
STD_VIDEO_H264_LEVEL_6_0 = 16, STD_VIDEO_H264_LEVEL_6_0 = 16,
STD_VIDEO_H264_LEVEL_6_1 = 17, STD_VIDEO_H264_LEVEL_6_1 = 17,
STD_VIDEO_H264_LEVEL_6_2 = 18, STD_VIDEO_H264_LEVEL_6_2 = 18,
STD_VIDEO_H264_LEVEL_INVALID = 0x7FFFFFFF STD_VIDEO_H264_LEVEL_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_LEVEL_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264Level; } StdVideoH264Level;
typedef enum StdVideoH264PocType { typedef enum StdVideoH264PocType {
STD_VIDEO_H264_POC_TYPE_0 = 0, STD_VIDEO_H264_POC_TYPE_0 = 0,
STD_VIDEO_H264_POC_TYPE_1 = 1, STD_VIDEO_H264_POC_TYPE_1 = 1,
STD_VIDEO_H264_POC_TYPE_2 = 2, STD_VIDEO_H264_POC_TYPE_2 = 2,
STD_VIDEO_H264_POC_TYPE_INVALID = 0x7FFFFFFF STD_VIDEO_H264_POC_TYPE_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_POC_TYPE_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264PocType; } StdVideoH264PocType;
typedef enum StdVideoH264AspectRatioIdc { typedef enum StdVideoH264AspectRatioIdc {
@ -95,14 +98,16 @@ typedef enum StdVideoH264AspectRatioIdc {
STD_VIDEO_H264_ASPECT_RATIO_IDC_3_2 = 15, STD_VIDEO_H264_ASPECT_RATIO_IDC_3_2 = 15,
STD_VIDEO_H264_ASPECT_RATIO_IDC_2_1 = 16, STD_VIDEO_H264_ASPECT_RATIO_IDC_2_1 = 16,
STD_VIDEO_H264_ASPECT_RATIO_IDC_EXTENDED_SAR = 255, STD_VIDEO_H264_ASPECT_RATIO_IDC_EXTENDED_SAR = 255,
STD_VIDEO_H264_ASPECT_RATIO_IDC_INVALID = 0x7FFFFFFF STD_VIDEO_H264_ASPECT_RATIO_IDC_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_ASPECT_RATIO_IDC_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264AspectRatioIdc; } StdVideoH264AspectRatioIdc;
typedef enum StdVideoH264WeightedBipredIdc { typedef enum StdVideoH264WeightedBipredIdc {
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_DEFAULT = 0, STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_DEFAULT = 0,
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT = 1, STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT = 1,
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_IMPLICIT = 2, STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_IMPLICIT = 2,
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_INVALID = 0x7FFFFFFF STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264WeightedBipredIdc; } StdVideoH264WeightedBipredIdc;
typedef enum StdVideoH264ModificationOfPicNumsIdc { typedef enum StdVideoH264ModificationOfPicNumsIdc {
@ -110,7 +115,8 @@ typedef enum StdVideoH264ModificationOfPicNumsIdc {
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_ADD = 1, STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_ADD = 1,
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_LONG_TERM = 2, STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_LONG_TERM = 2,
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_END = 3, STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_END = 3,
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_INVALID = 0x7FFFFFFF STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264ModificationOfPicNumsIdc; } StdVideoH264ModificationOfPicNumsIdc;
typedef enum StdVideoH264MemMgmtControlOp { typedef enum StdVideoH264MemMgmtControlOp {
@ -121,40 +127,41 @@ typedef enum StdVideoH264MemMgmtControlOp {
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_SET_MAX_LONG_TERM_INDEX = 4, STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_SET_MAX_LONG_TERM_INDEX = 4,
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_ALL = 5, STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_ALL = 5,
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_CURRENT_AS_LONG_TERM = 6, STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_CURRENT_AS_LONG_TERM = 6,
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_INVALID = 0x7FFFFFFF STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264MemMgmtControlOp; } StdVideoH264MemMgmtControlOp;
typedef enum StdVideoH264CabacInitIdc { typedef enum StdVideoH264CabacInitIdc {
STD_VIDEO_H264_CABAC_INIT_IDC_0 = 0, STD_VIDEO_H264_CABAC_INIT_IDC_0 = 0,
STD_VIDEO_H264_CABAC_INIT_IDC_1 = 1, STD_VIDEO_H264_CABAC_INIT_IDC_1 = 1,
STD_VIDEO_H264_CABAC_INIT_IDC_2 = 2, STD_VIDEO_H264_CABAC_INIT_IDC_2 = 2,
STD_VIDEO_H264_CABAC_INIT_IDC_INVALID = 0x7FFFFFFF STD_VIDEO_H264_CABAC_INIT_IDC_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_CABAC_INIT_IDC_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264CabacInitIdc; } StdVideoH264CabacInitIdc;
typedef enum StdVideoH264DisableDeblockingFilterIdc { typedef enum StdVideoH264DisableDeblockingFilterIdc {
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_DISABLED = 0, STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_DISABLED = 0,
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_ENABLED = 1, STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_ENABLED = 1,
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_PARTIAL = 2, STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_PARTIAL = 2,
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_INVALID = 0x7FFFFFFF STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264DisableDeblockingFilterIdc; } StdVideoH264DisableDeblockingFilterIdc;
typedef enum StdVideoH264SliceType { typedef enum StdVideoH264SliceType {
STD_VIDEO_H264_SLICE_TYPE_P = 0, STD_VIDEO_H264_SLICE_TYPE_P = 0,
STD_VIDEO_H264_SLICE_TYPE_B = 1, STD_VIDEO_H264_SLICE_TYPE_B = 1,
STD_VIDEO_H264_SLICE_TYPE_I = 2, STD_VIDEO_H264_SLICE_TYPE_I = 2,
// reserved STD_VIDEO_H264_SLICE_TYPE_SP = 3, STD_VIDEO_H264_SLICE_TYPE_INVALID = 0x7FFFFFFF,
// reserved STD_VIDEO_H264_SLICE_TYPE_SI = 4, STD_VIDEO_H264_SLICE_TYPE_MAX_ENUM = 0x7FFFFFFF
STD_VIDEO_H264_SLICE_TYPE_INVALID = 0x7FFFFFFF
} StdVideoH264SliceType; } StdVideoH264SliceType;
typedef enum StdVideoH264PictureType { typedef enum StdVideoH264PictureType {
STD_VIDEO_H264_PICTURE_TYPE_P = 0, STD_VIDEO_H264_PICTURE_TYPE_P = 0,
STD_VIDEO_H264_PICTURE_TYPE_B = 1, STD_VIDEO_H264_PICTURE_TYPE_B = 1,
STD_VIDEO_H264_PICTURE_TYPE_I = 2, STD_VIDEO_H264_PICTURE_TYPE_I = 2,
// reserved STD_VIDEO_H264_PICTURE_TYPE_SP = 3,
// reserved STD_VIDEO_H264_PICTURE_TYPE_SI = 4,
STD_VIDEO_H264_PICTURE_TYPE_IDR = 5, STD_VIDEO_H264_PICTURE_TYPE_IDR = 5,
STD_VIDEO_H264_PICTURE_TYPE_INVALID = 0x7FFFFFFF STD_VIDEO_H264_PICTURE_TYPE_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_PICTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264PictureType; } StdVideoH264PictureType;
typedef enum StdVideoH264NonVclNaluType { typedef enum StdVideoH264NonVclNaluType {
@ -165,9 +172,9 @@ typedef enum StdVideoH264NonVclNaluType {
STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_SEQUENCE = 4, STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_SEQUENCE = 4,
STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_STREAM = 5, STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_STREAM = 5,
STD_VIDEO_H264_NON_VCL_NALU_TYPE_PRECODED = 6, STD_VIDEO_H264_NON_VCL_NALU_TYPE_PRECODED = 6,
STD_VIDEO_H264_NON_VCL_NALU_TYPE_INVALID = 0x7FFFFFFF STD_VIDEO_H264_NON_VCL_NALU_TYPE_INVALID = 0x7FFFFFFF,
STD_VIDEO_H264_NON_VCL_NALU_TYPE_MAX_ENUM = 0x7FFFFFFF
} StdVideoH264NonVclNaluType; } StdVideoH264NonVclNaluType;
typedef struct StdVideoH264SpsVuiFlags { typedef struct StdVideoH264SpsVuiFlags {
uint32_t aspect_ratio_info_present_flag : 1; uint32_t aspect_ratio_info_present_flag : 1;
uint32_t overscan_info_present_flag : 1; uint32_t overscan_info_present_flag : 1;
@ -183,13 +190,13 @@ typedef struct StdVideoH264SpsVuiFlags {
uint32_t vcl_hrd_parameters_present_flag : 1; uint32_t vcl_hrd_parameters_present_flag : 1;
} StdVideoH264SpsVuiFlags; } StdVideoH264SpsVuiFlags;
typedef struct StdVideoH264HrdParameters { // hrd_parameters typedef struct StdVideoH264HrdParameters {
uint8_t cpb_cnt_minus1; uint8_t cpb_cnt_minus1;
uint8_t bit_rate_scale; uint8_t bit_rate_scale;
uint8_t cpb_size_scale; uint8_t cpb_size_scale;
uint32_t bit_rate_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; // cpb_cnt_minus1 number of valid elements uint32_t bit_rate_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE];
uint32_t cpb_size_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; // cpb_cnt_minus1 number of valid elements uint32_t cpb_size_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE];
uint8_t cbr_flag[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; // cpb_cnt_minus1 number of valid elements uint8_t cbr_flag[STD_VIDEO_H264_CPB_CNT_LIST_SIZE];
uint32_t initial_cpb_removal_delay_length_minus1; uint32_t initial_cpb_removal_delay_length_minus1;
uint32_t cpb_removal_delay_length_minus1; uint32_t cpb_removal_delay_length_minus1;
uint32_t dpb_output_delay_length_minus1; uint32_t dpb_output_delay_length_minus1;
@ -197,6 +204,7 @@ typedef struct StdVideoH264HrdParameters { // hrd_parameters
} StdVideoH264HrdParameters; } StdVideoH264HrdParameters;
typedef struct StdVideoH264SequenceParameterSetVui { typedef struct StdVideoH264SequenceParameterSetVui {
StdVideoH264SpsVuiFlags flags;
StdVideoH264AspectRatioIdc aspect_ratio_idc; StdVideoH264AspectRatioIdc aspect_ratio_idc;
uint16_t sar_width; uint16_t sar_width;
uint16_t sar_height; uint16_t sar_height;
@ -206,10 +214,9 @@ typedef struct StdVideoH264SequenceParameterSetVui {
uint8_t matrix_coefficients; uint8_t matrix_coefficients;
uint32_t num_units_in_tick; uint32_t num_units_in_tick;
uint32_t time_scale; uint32_t time_scale;
StdVideoH264HrdParameters* pHrdParameters; // must be a valid ptr to hrd_parameters, if nal_hrd_parameters_present_flag or vcl_hrd_parameters_present_flag are set const StdVideoH264HrdParameters* pHrdParameters;
uint8_t max_num_reorder_frames; uint8_t max_num_reorder_frames;
uint8_t max_dec_frame_buffering; uint8_t max_dec_frame_buffering;
StdVideoH264SpsVuiFlags flags;
} StdVideoH264SequenceParameterSetVui; } StdVideoH264SequenceParameterSetVui;
typedef struct StdVideoH264SpsFlags { typedef struct StdVideoH264SpsFlags {
@ -231,26 +238,15 @@ typedef struct StdVideoH264SpsFlags {
uint32_t vui_parameters_present_flag : 1; uint32_t vui_parameters_present_flag : 1;
} StdVideoH264SpsFlags; } StdVideoH264SpsFlags;
typedef struct StdVideoH264ScalingLists typedef struct StdVideoH264ScalingLists {
{
// scaling_list_present_mask has one bit for each
// seq_scaling_list_present_flag[i] for SPS OR
// pic_scaling_list_present_flag[i] for PPS,
// bit 0 - 5 are for each entry of ScalingList4x4
// bit 6 - 7 are for each entry plus 6 for ScalingList8x8
uint8_t scaling_list_present_mask; uint8_t scaling_list_present_mask;
// use_default_scaling_matrix_mask has one bit for each
// UseDefaultScalingMatrix4x4Flag[ i ] and
// UseDefaultScalingMatrix8x8Flag[ i - 6 ] for SPS OR PPS
// bit 0 - 5 are for each entry of ScalingList4x4
// bit 6 - 7 are for each entry plus 6 for ScalingList8x8
uint8_t use_default_scaling_matrix_mask; uint8_t use_default_scaling_matrix_mask;
uint8_t ScalingList4x4[STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS]; uint8_t ScalingList4x4[STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS];
uint8_t ScalingList8x8[STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS]; uint8_t ScalingList8x8[STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS];
} StdVideoH264ScalingLists; } StdVideoH264ScalingLists;
typedef struct StdVideoH264SequenceParameterSet typedef struct StdVideoH264SequenceParameterSet {
{ StdVideoH264SpsFlags flags;
StdVideoH264ProfileIdc profile_idc; StdVideoH264ProfileIdc profile_idc;
StdVideoH264Level level_idc; StdVideoH264Level level_idc;
uint8_t seq_parameter_set_id; uint8_t seq_parameter_set_id;
@ -270,12 +266,9 @@ typedef struct StdVideoH264SequenceParameterSet
uint32_t frame_crop_right_offset; uint32_t frame_crop_right_offset;
uint32_t frame_crop_top_offset; uint32_t frame_crop_top_offset;
uint32_t frame_crop_bottom_offset; uint32_t frame_crop_bottom_offset;
StdVideoH264SpsFlags flags; const int32_t* pOffsetForRefFrame;
// pOffsetForRefFrame is a pointer representing the offset_for_ref_frame array with num_ref_frames_in_pic_order_cnt_cycle number of elements const StdVideoH264ScalingLists* pScalingLists;
// If pOffsetForRefFrame has nullptr value, then num_ref_frames_in_pic_order_cnt_cycle must also be "0". const StdVideoH264SequenceParameterSetVui* pSequenceParameterSetVui;
int32_t* pOffsetForRefFrame;
StdVideoH264ScalingLists* pScalingLists; // Must be a valid pointer if seq_scaling_matrix_present_flag is set
StdVideoH264SequenceParameterSetVui* pSequenceParameterSetVui; // Must be a valid pointer if StdVideoH264SpsFlags:vui_parameters_present_flag is set
} StdVideoH264SequenceParameterSet; } StdVideoH264SequenceParameterSet;
typedef struct StdVideoH264PpsFlags { typedef struct StdVideoH264PpsFlags {
@ -290,8 +283,8 @@ typedef struct StdVideoH264PpsFlags {
uint32_t pic_scaling_matrix_present_flag : 1; uint32_t pic_scaling_matrix_present_flag : 1;
} StdVideoH264PpsFlags; } StdVideoH264PpsFlags;
typedef struct StdVideoH264PictureParameterSet typedef struct StdVideoH264PictureParameterSet {
{ StdVideoH264PpsFlags flags;
uint8_t seq_parameter_set_id; uint8_t seq_parameter_set_id;
uint8_t pic_parameter_set_id; uint8_t pic_parameter_set_id;
uint8_t num_ref_idx_l0_default_active_minus1; uint8_t num_ref_idx_l0_default_active_minus1;
@ -301,12 +294,12 @@ typedef struct StdVideoH264PictureParameterSet
int8_t pic_init_qs_minus26; int8_t pic_init_qs_minus26;
int8_t chroma_qp_index_offset; int8_t chroma_qp_index_offset;
int8_t second_chroma_qp_index_offset; int8_t second_chroma_qp_index_offset;
StdVideoH264PpsFlags flags; const StdVideoH264ScalingLists* pScalingLists;
StdVideoH264ScalingLists* pScalingLists; // Must be a valid pointer if StdVideoH264PpsFlags::pic_scaling_matrix_present_flag is set.
} StdVideoH264PictureParameterSet; } StdVideoH264PictureParameterSet;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // VULKAN_VIDEO_CODEC_H264STD_H_ #endif

View File

@ -1,64 +1,70 @@
#ifndef VULKAN_VIDEO_CODEC_H264STD_DECODE_H_
#define VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ 1
/* /*
** Copyright (c) 2019-2020 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */
#ifndef VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ /*
#define VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ 1 ** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "vk_video/vulkan_video_codec_h264std.h"
// *************************************************
// Video H.264 Decode related parameters:
// *************************************************
#define vulkan_video_codec_h264std_decode 1
// Vulkan 0.9 provisional Vulkan video H.264 decode std specification version number
#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_0_9_6 VK_MAKE_VIDEO_STD_VERSION(0, 9, 6) // Patch version should always be set to 0
#define STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE 2
#define STD_VIDEO_DECODE_H264_MVC_REF_LIST_SIZE 15 #define STD_VIDEO_DECODE_H264_MVC_REF_LIST_SIZE 15
#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_0_9_6
#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_decode"
typedef enum StdVideoDecodeH264FieldOrderCount { typedef enum StdVideoDecodeH264FieldOrderCount {
STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP = 0, STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP = 0,
STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_BOTTOM = 1, STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_BOTTOM = 1,
STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE = 2, STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_INVALID = 0x7FFFFFFF,
STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_INVALID = 0x7FFFFFFF STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_MAX_ENUM = 0x7FFFFFFF
} StdVideoDecodeH264FieldOrderCnt; } StdVideoDecodeH264FieldOrderCount;
typedef struct StdVideoDecodeH264PictureInfoFlags { typedef struct StdVideoDecodeH264PictureInfoFlags {
uint32_t field_pic_flag : 1; // Is field picture uint32_t field_pic_flag : 1;
uint32_t is_intra : 1; // Is intra picture uint32_t is_intra : 1;
uint32_t IdrPicFlag : 1; // instantaneous decoding refresh (IDR) picture uint32_t IdrPicFlag : 1;
uint32_t bottom_field_flag : 1; // bottom (true) or top (false) field if field_pic_flag is set. uint32_t bottom_field_flag : 1;
uint32_t is_reference : 1; // This only applies to picture info, and not to the DPB lists. uint32_t is_reference : 1;
uint32_t complementary_field_pair : 1; // complementary field pair, complementary non-reference field pair, complementary reference field pair uint32_t complementary_field_pair : 1;
} StdVideoDecodeH264PictureInfoFlags; } StdVideoDecodeH264PictureInfoFlags;
typedef struct StdVideoDecodeH264PictureInfo { typedef struct StdVideoDecodeH264PictureInfo {
uint8_t seq_parameter_set_id; // Selecting SPS from the Picture Parameters
uint8_t pic_parameter_set_id; // Selecting PPS from the Picture Parameters and the SPS
uint16_t reserved; // for structure members 32-bit packing/alignment
uint16_t frame_num; // 7.4.3 Slice header semantics
uint16_t idr_pic_id; // 7.4.3 Slice header semantics
// PicOrderCnt is based on TopFieldOrderCnt and BottomFieldOrderCnt. See 8.2.1 Decoding process for picture order count type 0 - 2
int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE]; // TopFieldOrderCnt and BottomFieldOrderCnt fields.
StdVideoDecodeH264PictureInfoFlags flags; StdVideoDecodeH264PictureInfoFlags flags;
uint8_t seq_parameter_set_id;
uint8_t pic_parameter_set_id;
uint16_t reserved;
uint16_t frame_num;
uint16_t idr_pic_id;
int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE];
} StdVideoDecodeH264PictureInfo; } StdVideoDecodeH264PictureInfo;
typedef struct StdVideoDecodeH264ReferenceInfoFlags { typedef struct StdVideoDecodeH264ReferenceInfoFlags {
uint32_t top_field_flag : 1; // Reference is used for top field reference. uint32_t top_field_flag : 1;
uint32_t bottom_field_flag : 1; // Reference is used for bottom field reference. uint32_t bottom_field_flag : 1;
uint32_t is_long_term : 1; // this is a long term reference uint32_t used_for_long_term_reference : 1;
uint32_t is_non_existing : 1; // Must be handled in accordance with 8.2.5.2: Decoding process for gaps in frame_num uint32_t is_non_existing : 1;
} StdVideoDecodeH264ReferenceInfoFlags; } StdVideoDecodeH264ReferenceInfoFlags;
typedef struct StdVideoDecodeH264ReferenceInfo { typedef struct StdVideoDecodeH264ReferenceInfo {
// FrameNum = is_long_term ? long_term_frame_idx : frame_num
uint16_t FrameNum; // 7.4.3.3 Decoded reference picture marking semantics
uint16_t reserved; // for structure members 32-bit packing/alignment
int32_t PicOrderCnt[2]; // TopFieldOrderCnt and BottomFieldOrderCnt fields.
StdVideoDecodeH264ReferenceInfoFlags flags; StdVideoDecodeH264ReferenceInfoFlags flags;
uint16_t FrameNum;
uint16_t reserved;
int32_t PicOrderCnt[2];
} StdVideoDecodeH264ReferenceInfo; } StdVideoDecodeH264ReferenceInfo;
typedef struct StdVideoDecodeH264MvcElementFlags { typedef struct StdVideoDecodeH264MvcElementFlags {
@ -71,8 +77,8 @@ typedef struct StdVideoDecodeH264MvcElement {
StdVideoDecodeH264MvcElementFlags flags; StdVideoDecodeH264MvcElementFlags flags;
uint16_t viewOrderIndex; uint16_t viewOrderIndex;
uint16_t viewId; uint16_t viewId;
uint16_t temporalId; // move out? uint16_t temporalId;
uint16_t priorityId; // move out? uint16_t priorityId;
uint16_t numOfAnchorRefsInL0; uint16_t numOfAnchorRefsInL0;
uint16_t viewIdOfAnchorRefsInL0[STD_VIDEO_DECODE_H264_MVC_REF_LIST_SIZE]; uint16_t viewIdOfAnchorRefsInL0[STD_VIDEO_DECODE_H264_MVC_REF_LIST_SIZE];
uint16_t numOfAnchorRefsInL1; uint16_t numOfAnchorRefsInL1;
@ -86,7 +92,7 @@ typedef struct StdVideoDecodeH264MvcElement {
typedef struct StdVideoDecodeH264Mvc { typedef struct StdVideoDecodeH264Mvc {
uint32_t viewId0; uint32_t viewId0;
uint32_t mvcElementCount; uint32_t mvcElementCount;
StdVideoDecodeH264MvcElement* pMvcElements; const StdVideoDecodeH264MvcElement* pMvcElements;
} StdVideoDecodeH264Mvc; } StdVideoDecodeH264Mvc;
@ -94,4 +100,4 @@ typedef struct StdVideoDecodeH264Mvc {
} }
#endif #endif
#endif // VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ #endif

View File

@ -1,28 +1,55 @@
#ifndef VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_
#define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1
/* /*
** Copyright (c) 2019-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */
#ifndef VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ /*
#define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1 ** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "vk_video/vulkan_video_codec_h264std.h"
// *************************************************
// Video H.264 Encode related parameters: #define vulkan_video_codec_h264std_encode 1
// ************************************************* // Vulkan 0.9 provisional Vulkan video H.264 encode std specification version number
#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_6 VK_MAKE_VIDEO_STD_VERSION(0, 9, 6) // Patch version should always be set to 0
#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_6
#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_encode"
typedef struct StdVideoEncodeH264WeightTableFlags {
uint32_t luma_weight_l0_flag;
uint32_t chroma_weight_l0_flag;
uint32_t luma_weight_l1_flag;
uint32_t chroma_weight_l1_flag;
} StdVideoEncodeH264WeightTableFlags;
typedef struct StdVideoEncodeH264WeightTable {
StdVideoEncodeH264WeightTableFlags flags;
uint8_t luma_log2_weight_denom;
uint8_t chroma_log2_weight_denom;
int8_t luma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF];
int8_t luma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF];
int8_t chroma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES];
int8_t chroma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES];
int8_t luma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF];
int8_t luma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF];
int8_t chroma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES];
int8_t chroma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES];
} StdVideoEncodeH264WeightTable;
typedef struct StdVideoEncodeH264SliceHeaderFlags { typedef struct StdVideoEncodeH264SliceHeaderFlags {
uint32_t idr_flag : 1; uint32_t direct_spatial_mv_pred_flag : 1;
uint32_t is_reference_flag : 1;
uint32_t num_ref_idx_active_override_flag : 1; uint32_t num_ref_idx_active_override_flag : 1;
uint32_t no_output_of_prior_pics_flag : 1; uint32_t no_output_of_prior_pics_flag : 1;
uint32_t long_term_reference_flag : 1;
uint32_t adaptive_ref_pic_marking_mode_flag : 1; uint32_t adaptive_ref_pic_marking_mode_flag : 1;
uint32_t no_prior_references_available_flag : 1; uint32_t no_prior_references_available_flag : 1;
} StdVideoEncodeH264SliceHeaderFlags; } StdVideoEncodeH264SliceHeaderFlags;
@ -30,9 +57,13 @@ typedef struct StdVideoEncodeH264SliceHeaderFlags {
typedef struct StdVideoEncodeH264PictureInfoFlags { typedef struct StdVideoEncodeH264PictureInfoFlags {
uint32_t idr_flag : 1; uint32_t idr_flag : 1;
uint32_t is_reference_flag : 1; uint32_t is_reference_flag : 1;
uint32_t long_term_reference_flag : 1; uint32_t used_for_long_term_reference : 1;
} StdVideoEncodeH264PictureInfoFlags; } StdVideoEncodeH264PictureInfoFlags;
typedef struct StdVideoEncodeH264ReferenceInfoFlags {
uint32_t used_for_long_term_reference : 1;
} StdVideoEncodeH264ReferenceInfoFlags;
typedef struct StdVideoEncodeH264RefMgmtFlags { typedef struct StdVideoEncodeH264RefMgmtFlags {
uint32_t ref_pic_list_modification_l0_flag : 1; uint32_t ref_pic_list_modification_l0_flag : 1;
uint32_t ref_pic_list_modification_l1_flag : 1; uint32_t ref_pic_list_modification_l1_flag : 1;
@ -55,27 +86,34 @@ typedef struct StdVideoEncodeH264RefPicMarkingEntry {
typedef struct StdVideoEncodeH264RefMemMgmtCtrlOperations { typedef struct StdVideoEncodeH264RefMemMgmtCtrlOperations {
StdVideoEncodeH264RefMgmtFlags flags; StdVideoEncodeH264RefMgmtFlags flags;
uint8_t refList0ModOpCount; uint8_t refList0ModOpCount;
StdVideoEncodeH264RefListModEntry* pRefList0ModOperations; const StdVideoEncodeH264RefListModEntry* pRefList0ModOperations;
uint8_t refList1ModOpCount; uint8_t refList1ModOpCount;
StdVideoEncodeH264RefListModEntry* pRefList1ModOperations; const StdVideoEncodeH264RefListModEntry* pRefList1ModOperations;
uint8_t refPicMarkingOpCount; uint8_t refPicMarkingOpCount;
StdVideoEncodeH264RefPicMarkingEntry* pRefPicMarkingOperations; const StdVideoEncodeH264RefPicMarkingEntry* pRefPicMarkingOperations;
} StdVideoEncodeH264RefMemMgmtCtrlOperations; } StdVideoEncodeH264RefMemMgmtCtrlOperations;
typedef struct StdVideoEncodeH264PictureInfo { typedef struct StdVideoEncodeH264PictureInfo {
StdVideoEncodeH264PictureInfoFlags flags; StdVideoEncodeH264PictureInfoFlags flags;
uint8_t seq_parameter_set_id;
uint8_t pic_parameter_set_id;
StdVideoH264PictureType pictureType; StdVideoH264PictureType pictureType;
uint32_t frameNum; uint32_t frame_num;
uint32_t pictureOrderCount; int32_t PicOrderCnt;
} StdVideoEncodeH264PictureInfo;
typedef struct StdVideoEncodeH264ReferenceInfo {
StdVideoEncodeH264ReferenceInfoFlags flags;
uint32_t FrameNum;
int32_t PicOrderCnt;
uint16_t long_term_pic_num; uint16_t long_term_pic_num;
uint16_t long_term_frame_idx; uint16_t long_term_frame_idx;
} StdVideoEncodeH264PictureInfo; } StdVideoEncodeH264ReferenceInfo;
typedef struct StdVideoEncodeH264SliceHeader { typedef struct StdVideoEncodeH264SliceHeader {
StdVideoEncodeH264SliceHeaderFlags flags; StdVideoEncodeH264SliceHeaderFlags flags;
uint32_t first_mb_in_slice;
StdVideoH264SliceType slice_type; StdVideoH264SliceType slice_type;
uint8_t seq_parameter_set_id;
uint8_t pic_parameter_set_id;
uint16_t idr_pic_id; uint16_t idr_pic_id;
uint8_t num_ref_idx_l0_active_minus1; uint8_t num_ref_idx_l0_active_minus1;
uint8_t num_ref_idx_l1_active_minus1; uint8_t num_ref_idx_l1_active_minus1;
@ -83,7 +121,7 @@ typedef struct StdVideoEncodeH264SliceHeader {
StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc; StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc;
int8_t slice_alpha_c0_offset_div2; int8_t slice_alpha_c0_offset_div2;
int8_t slice_beta_offset_div2; int8_t slice_beta_offset_div2;
StdVideoEncodeH264RefMemMgmtCtrlOperations* pMemMgmtCtrlOperations; const StdVideoEncodeH264WeightTable* pWeightTable;
} StdVideoEncodeH264SliceHeader; } StdVideoEncodeH264SliceHeader;
@ -91,4 +129,4 @@ typedef struct StdVideoEncodeH264SliceHeader {
} }
#endif #endif
#endif // VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ #endif

View File

@ -1,27 +1,27 @@
#ifndef VULKAN_VIDEO_CODEC_H265STD_H_
#define VULKAN_VIDEO_CODEC_H265STD_H_ 1
/* /*
** Copyright (c) 2019-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */
#ifndef VULKAN_VIDEO_CODEC_H265STD_H_ /*
#define VULKAN_VIDEO_CODEC_H265STD_H_ 1 ** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "vk_video/vulkan_video_codecs_common.h"
// Vulkan 0.5 version number WIP
#define VK_STD_VULKAN_VIDEO_CODEC_H265_API_VERSION_0_9_5 VK_MAKE_VIDEO_STD_VERSION(0, 9, 5) // Patch version should always be set to 0
// Format must be in the form XX.XX where the first two digits are the major and the second two, the minor. #define vulkan_video_codec_h265std 1
#define VK_STD_VULKAN_VIDEO_CODEC_H265_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_API_VERSION_0_9_5
#define VK_STD_VULKAN_VIDEO_CODEC_H265_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265"
#define STD_VIDEO_H265_CPB_CNT_LIST_SIZE 32
#define STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE 7 #define STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE 7
#define STD_VIDEO_H265_CPB_CNT_LIST_SIZE 32
#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS 6 #define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS 6
#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS 16 #define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS 16
#define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS 6 #define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS 6
@ -30,18 +30,21 @@ extern "C" {
#define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS 64 #define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS 64
#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS 2 #define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS 2
#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS 64 #define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS 64
#define STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE 6
#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE 19
#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE 21
#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE 3 #define STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE 3
#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE 128 #define STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE 128
#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE 19
#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE 21
#define STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE 6
#define STD_VIDEO_H265_MAX_NUM_LIST_REF 15
#define STD_VIDEO_H265_MAX_CHROMA_PLANES 2
typedef enum StdVideoH265ChromaFormatIdc { typedef enum StdVideoH265ChromaFormatIdc {
STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME = 0, STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME = 0,
STD_VIDEO_H265_CHROMA_FORMAT_IDC_420 = 1, STD_VIDEO_H265_CHROMA_FORMAT_IDC_420 = 1,
STD_VIDEO_H265_CHROMA_FORMAT_IDC_422 = 2, STD_VIDEO_H265_CHROMA_FORMAT_IDC_422 = 2,
STD_VIDEO_H265_CHROMA_FORMAT_IDC_444 = 3, STD_VIDEO_H265_CHROMA_FORMAT_IDC_444 = 3,
STD_VIDEO_H265_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF STD_VIDEO_H265_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF,
STD_VIDEO_H265_CHROMA_FORMAT_IDC_MAX_ENUM = 0x7FFFFFFF
} StdVideoH265ChromaFormatIdc; } StdVideoH265ChromaFormatIdc;
typedef enum StdVideoH265ProfileIdc { typedef enum StdVideoH265ProfileIdc {
@ -50,7 +53,8 @@ typedef enum StdVideoH265ProfileIdc {
STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE = 3, STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE = 3,
STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS = 4, STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS = 4,
STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS = 9, STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS = 9,
STD_VIDEO_H265_PROFILE_IDC_INVALID = 0x7FFFFFFF STD_VIDEO_H265_PROFILE_IDC_INVALID = 0x7FFFFFFF,
STD_VIDEO_H265_PROFILE_IDC_MAX_ENUM = 0x7FFFFFFF
} StdVideoH265ProfileIdc; } StdVideoH265ProfileIdc;
typedef enum StdVideoH265Level { typedef enum StdVideoH265Level {
@ -67,14 +71,16 @@ typedef enum StdVideoH265Level {
STD_VIDEO_H265_LEVEL_6_0 = 10, STD_VIDEO_H265_LEVEL_6_0 = 10,
STD_VIDEO_H265_LEVEL_6_1 = 11, STD_VIDEO_H265_LEVEL_6_1 = 11,
STD_VIDEO_H265_LEVEL_6_2 = 12, STD_VIDEO_H265_LEVEL_6_2 = 12,
STD_VIDEO_H265_LEVEL_INVALID = 0x7FFFFFFF STD_VIDEO_H265_LEVEL_INVALID = 0x7FFFFFFF,
STD_VIDEO_H265_LEVEL_MAX_ENUM = 0x7FFFFFFF
} StdVideoH265Level; } StdVideoH265Level;
typedef enum StdVideoH265SliceType { typedef enum StdVideoH265SliceType {
STD_VIDEO_H265_SLICE_TYPE_B = 0, STD_VIDEO_H265_SLICE_TYPE_B = 0,
STD_VIDEO_H265_SLICE_TYPE_P = 1, STD_VIDEO_H265_SLICE_TYPE_P = 1,
STD_VIDEO_H265_SLICE_TYPE_I = 2, STD_VIDEO_H265_SLICE_TYPE_I = 2,
STD_VIDEO_H265_SLICE_TYPE_INVALID = 0x7FFFFFFF STD_VIDEO_H265_SLICE_TYPE_INVALID = 0x7FFFFFFF,
STD_VIDEO_H265_SLICE_TYPE_MAX_ENUM = 0x7FFFFFFF
} StdVideoH265SliceType; } StdVideoH265SliceType;
typedef enum StdVideoH265PictureType { typedef enum StdVideoH265PictureType {
@ -82,22 +88,21 @@ typedef enum StdVideoH265PictureType {
STD_VIDEO_H265_PICTURE_TYPE_B = 1, STD_VIDEO_H265_PICTURE_TYPE_B = 1,
STD_VIDEO_H265_PICTURE_TYPE_I = 2, STD_VIDEO_H265_PICTURE_TYPE_I = 2,
STD_VIDEO_H265_PICTURE_TYPE_IDR = 3, STD_VIDEO_H265_PICTURE_TYPE_IDR = 3,
STD_VIDEO_H265_PICTURE_TYPE_INVALID = 0x7FFFFFFF STD_VIDEO_H265_PICTURE_TYPE_INVALID = 0x7FFFFFFF,
STD_VIDEO_H265_PICTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
} StdVideoH265PictureType; } StdVideoH265PictureType;
typedef struct StdVideoH265DecPicBufMgr {
typedef struct StdVideoH265DecPicBufMgr
{
uint32_t max_latency_increase_plus1[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE]; uint32_t max_latency_increase_plus1[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE];
uint8_t max_dec_pic_buffering_minus1[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE]; uint8_t max_dec_pic_buffering_minus1[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE];
uint8_t max_num_reorder_pics[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE]; uint8_t max_num_reorder_pics[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE];
} StdVideoH265DecPicBufMgr; } StdVideoH265DecPicBufMgr;
typedef struct StdVideoH265SubLayerHrdParameters { // sub_layer_hrd_parameters typedef struct StdVideoH265SubLayerHrdParameters {
uint32_t bit_rate_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; uint32_t bit_rate_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE];
uint32_t cpb_size_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; uint32_t cpb_size_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE];
uint32_t cpb_size_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; uint32_t cpb_size_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE];
uint32_t bit_rate_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; uint32_t bit_rate_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE];
uint32_t cbr_flag; // each bit represents a range of CpbCounts (bit 0 - cpb_cnt_minus1) per sub-layer uint32_t cbr_flag;
} StdVideoH265SubLayerHrdParameters; } StdVideoH265SubLayerHrdParameters;
typedef struct StdVideoH265HrdFlags { typedef struct StdVideoH265HrdFlags {
@ -105,12 +110,13 @@ typedef struct StdVideoH265HrdFlags {
uint32_t vcl_hrd_parameters_present_flag : 1; uint32_t vcl_hrd_parameters_present_flag : 1;
uint32_t sub_pic_hrd_params_present_flag : 1; uint32_t sub_pic_hrd_params_present_flag : 1;
uint32_t sub_pic_cpb_params_in_pic_timing_sei_flag : 1; uint32_t sub_pic_cpb_params_in_pic_timing_sei_flag : 1;
uint32_t fixed_pic_rate_general_flag : 8; // each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1 uint32_t fixed_pic_rate_general_flag : 8;
uint32_t fixed_pic_rate_within_cvs_flag : 8; // each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1 uint32_t fixed_pic_rate_within_cvs_flag : 8;
uint32_t low_delay_hrd_flag : 8; // each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1 uint32_t low_delay_hrd_flag : 8;
} StdVideoH265HrdFlags; } StdVideoH265HrdFlags;
typedef struct StdVideoH265HrdParameters { typedef struct StdVideoH265HrdParameters {
StdVideoH265HrdFlags flags;
uint8_t tick_divisor_minus2; uint8_t tick_divisor_minus2;
uint8_t du_cpb_removal_delay_increment_length_minus1; uint8_t du_cpb_removal_delay_increment_length_minus1;
uint8_t dpb_output_delay_du_length_minus1; uint8_t dpb_output_delay_du_length_minus1;
@ -122,9 +128,8 @@ typedef struct StdVideoH265HrdParameters {
uint8_t dpb_output_delay_length_minus1; uint8_t dpb_output_delay_length_minus1;
uint8_t cpb_cnt_minus1[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE]; uint8_t cpb_cnt_minus1[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE];
uint16_t elemental_duration_in_tc_minus1[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE]; uint16_t elemental_duration_in_tc_minus1[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE];
StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersNal[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE]; // NAL per layer ptr to sub_layer_hrd_parameters const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersNal[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE];
StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersVcl[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE]; // VCL per layer ptr to sub_layer_hrd_parameters const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersVcl[STD_VIDEO_H265_SUBLAYERS_MINUS1_LIST_SIZE];
StdVideoH265HrdFlags flags;
} StdVideoH265HrdParameters; } StdVideoH265HrdParameters;
typedef struct StdVideoH265VpsFlags { typedef struct StdVideoH265VpsFlags {
@ -134,26 +139,24 @@ typedef struct StdVideoH265VpsFlags {
uint32_t vps_poc_proportional_to_timing_flag : 1; uint32_t vps_poc_proportional_to_timing_flag : 1;
} StdVideoH265VpsFlags; } StdVideoH265VpsFlags;
typedef struct StdVideoH265VideoParameterSet typedef struct StdVideoH265VideoParameterSet {
{ StdVideoH265VpsFlags flags;
uint8_t vps_video_parameter_set_id; uint8_t vps_video_parameter_set_id;
uint8_t vps_max_sub_layers_minus1; uint8_t vps_max_sub_layers_minus1;
uint32_t vps_num_units_in_tick; uint32_t vps_num_units_in_tick;
uint32_t vps_time_scale; uint32_t vps_time_scale;
uint32_t vps_num_ticks_poc_diff_one_minus1; uint32_t vps_num_ticks_poc_diff_one_minus1;
StdVideoH265DecPicBufMgr* pDecPicBufMgr; const StdVideoH265DecPicBufMgr* pDecPicBufMgr;
StdVideoH265HrdParameters* pHrdParameters; const StdVideoH265HrdParameters* pHrdParameters;
StdVideoH265VpsFlags flags;
} StdVideoH265VideoParameterSet; } StdVideoH265VideoParameterSet;
typedef struct StdVideoH265ScalingLists typedef struct StdVideoH265ScalingLists {
{ uint8_t ScalingList4x4[STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS];
uint8_t ScalingList4x4[STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS]; // ScalingList[ 0 ][ MatrixID ][ i ] (sizeID = 0) uint8_t ScalingList8x8[STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS];
uint8_t ScalingList8x8[STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS]; // ScalingList[ 1 ][ MatrixID ][ i ] (sizeID = 1) uint8_t ScalingList16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS];
uint8_t ScalingList16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS]; // ScalingList[ 2 ][ MatrixID ][ i ] (sizeID = 2) uint8_t ScalingList32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS];
uint8_t ScalingList32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS]; // ScalingList[ 3 ][ MatrixID ][ i ] (sizeID = 3) uint8_t ScalingListDCCoef16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS];
uint8_t ScalingListDCCoef16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS]; // scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8, sizeID = 2 uint8_t ScalingListDCCoef32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS];
uint8_t ScalingListDCCoef32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS]; // scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8. sizeID = 3
} StdVideoH265ScalingLists; } StdVideoH265ScalingLists;
typedef struct StdVideoH265SpsVuiFlags { typedef struct StdVideoH265SpsVuiFlags {
@ -178,6 +181,7 @@ typedef struct StdVideoH265SpsVuiFlags {
} StdVideoH265SpsVuiFlags; } StdVideoH265SpsVuiFlags;
typedef struct StdVideoH265SequenceParameterSetVui { typedef struct StdVideoH265SequenceParameterSetVui {
StdVideoH265SpsVuiFlags flags;
uint8_t aspect_ratio_idc; uint8_t aspect_ratio_idc;
uint16_t sar_width; uint16_t sar_width;
uint16_t sar_height; uint16_t sar_height;
@ -194,17 +198,15 @@ typedef struct StdVideoH265SequenceParameterSetVui {
uint32_t vui_num_units_in_tick; uint32_t vui_num_units_in_tick;
uint32_t vui_time_scale; uint32_t vui_time_scale;
uint32_t vui_num_ticks_poc_diff_one_minus1; uint32_t vui_num_ticks_poc_diff_one_minus1;
StdVideoH265HrdParameters* pHrdParameters; const StdVideoH265HrdParameters* pHrdParameters;
uint16_t min_spatial_segmentation_idc; uint16_t min_spatial_segmentation_idc;
uint8_t max_bytes_per_pic_denom; uint8_t max_bytes_per_pic_denom;
uint8_t max_bits_per_min_cu_denom; uint8_t max_bits_per_min_cu_denom;
uint8_t log2_max_mv_length_horizontal; uint8_t log2_max_mv_length_horizontal;
uint8_t log2_max_mv_length_vertical; uint8_t log2_max_mv_length_vertical;
StdVideoH265SpsVuiFlags flags;
} StdVideoH265SequenceParameterSetVui; } StdVideoH265SequenceParameterSetVui;
typedef struct StdVideoH265PredictorPaletteEntries typedef struct StdVideoH265PredictorPaletteEntries {
{
uint16_t PredictorPaletteEntries[STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE][STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE]; uint16_t PredictorPaletteEntries[STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE][STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE];
} StdVideoH265PredictorPaletteEntries; } StdVideoH265PredictorPaletteEntries;
@ -223,8 +225,6 @@ typedef struct StdVideoH265SpsFlags {
uint32_t vui_parameters_present_flag : 1; uint32_t vui_parameters_present_flag : 1;
uint32_t sps_extension_present_flag : 1; uint32_t sps_extension_present_flag : 1;
uint32_t sps_range_extension_flag : 1; uint32_t sps_range_extension_flag : 1;
// extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS is set
uint32_t transform_skip_rotation_enabled_flag : 1; uint32_t transform_skip_rotation_enabled_flag : 1;
uint32_t transform_skip_context_enabled_flag : 1; uint32_t transform_skip_context_enabled_flag : 1;
uint32_t implicit_rdpcm_enabled_flag : 1; uint32_t implicit_rdpcm_enabled_flag : 1;
@ -234,16 +234,15 @@ typedef struct StdVideoH265SpsFlags {
uint32_t high_precision_offsets_enabled_flag : 1; uint32_t high_precision_offsets_enabled_flag : 1;
uint32_t persistent_rice_adaptation_enabled_flag : 1; uint32_t persistent_rice_adaptation_enabled_flag : 1;
uint32_t cabac_bypass_alignment_enabled_flag : 1; uint32_t cabac_bypass_alignment_enabled_flag : 1;
uint32_t sps_scc_extension_flag : 1;
// extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set
uint32_t sps_curr_pic_ref_enabled_flag : 1; uint32_t sps_curr_pic_ref_enabled_flag : 1;
uint32_t palette_mode_enabled_flag : 1; uint32_t palette_mode_enabled_flag : 1;
uint32_t sps_palette_predictor_initializer_present_flag : 1; uint32_t sps_palette_predictor_initializer_present_flag : 1;
uint32_t intra_boundary_filtering_disabled_flag : 1; uint32_t intra_boundary_filtering_disabled_flag : 1;
} StdVideoH265SpsFlags; } StdVideoH265SpsFlags;
typedef struct StdVideoH265SequenceParameterSet typedef struct StdVideoH265SequenceParameterSet {
{ StdVideoH265SpsFlags flags;
StdVideoH265ProfileIdc profile_idc; StdVideoH265ProfileIdc profile_idc;
StdVideoH265Level level_idc; StdVideoH265Level level_idc;
uint32_t pic_width_in_luma_samples; uint32_t pic_width_in_luma_samples;
@ -255,7 +254,6 @@ typedef struct StdVideoH265SequenceParameterSet
uint8_t bit_depth_luma_minus8; uint8_t bit_depth_luma_minus8;
uint8_t bit_depth_chroma_minus8; uint8_t bit_depth_chroma_minus8;
uint8_t log2_max_pic_order_cnt_lsb_minus4; uint8_t log2_max_pic_order_cnt_lsb_minus4;
uint8_t sps_max_dec_pic_buffering_minus1;
uint8_t log2_min_luma_coding_block_size_minus3; uint8_t log2_min_luma_coding_block_size_minus3;
uint8_t log2_diff_max_min_luma_coding_block_size; uint8_t log2_diff_max_min_luma_coding_block_size;
uint8_t log2_min_luma_transform_block_size_minus2; uint8_t log2_min_luma_transform_block_size_minus2;
@ -272,20 +270,16 @@ typedef struct StdVideoH265SequenceParameterSet
uint32_t conf_win_right_offset; uint32_t conf_win_right_offset;
uint32_t conf_win_top_offset; uint32_t conf_win_top_offset;
uint32_t conf_win_bottom_offset; uint32_t conf_win_bottom_offset;
StdVideoH265DecPicBufMgr* pDecPicBufMgr; const StdVideoH265DecPicBufMgr* pDecPicBufMgr;
StdVideoH265SpsFlags flags; const StdVideoH265ScalingLists* pScalingLists;
StdVideoH265ScalingLists* pScalingLists; // Must be a valid pointer if sps_scaling_list_data_present_flag is set const StdVideoH265SequenceParameterSetVui* pSequenceParameterSetVui;
StdVideoH265SequenceParameterSetVui* pSequenceParameterSetVui; // Must be a valid pointer if StdVideoH265SpsFlags:vui_parameters_present_flag is set palette_max_size;
// extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set
uint8_t palette_max_size; uint8_t palette_max_size;
uint8_t delta_palette_max_predictor_size; uint8_t delta_palette_max_predictor_size;
uint8_t motion_vector_resolution_control_idc; uint8_t motion_vector_resolution_control_idc;
uint8_t sps_num_palette_predictor_initializer_minus1; uint8_t sps_num_palette_predictor_initializer_minus1;
StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries; // Must be a valid pointer if sps_palette_predictor_initializer_present_flag is set const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries;
} StdVideoH265SequenceParameterSet; } StdVideoH265SequenceParameterSet;
typedef struct StdVideoH265PpsFlags { typedef struct StdVideoH265PpsFlags {
uint32_t dependent_slice_segments_enabled_flag : 1; uint32_t dependent_slice_segments_enabled_flag : 1;
uint32_t output_flag_present_flag : 1; uint32_t output_flag_present_flag : 1;
@ -310,12 +304,8 @@ typedef struct StdVideoH265PpsFlags {
uint32_t lists_modification_present_flag : 1; uint32_t lists_modification_present_flag : 1;
uint32_t slice_segment_header_extension_present_flag : 1; uint32_t slice_segment_header_extension_present_flag : 1;
uint32_t pps_extension_present_flag : 1; uint32_t pps_extension_present_flag : 1;
// extension PPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS is set
uint32_t cross_component_prediction_enabled_flag : 1; uint32_t cross_component_prediction_enabled_flag : 1;
uint32_t chroma_qp_offset_list_enabled_flag : 1; uint32_t chroma_qp_offset_list_enabled_flag : 1;
// extension PPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set
uint32_t pps_curr_pic_ref_enabled_flag : 1; uint32_t pps_curr_pic_ref_enabled_flag : 1;
uint32_t residual_adaptive_colour_transform_enabled_flag : 1; uint32_t residual_adaptive_colour_transform_enabled_flag : 1;
uint32_t pps_slice_act_qp_offsets_present_flag : 1; uint32_t pps_slice_act_qp_offsets_present_flag : 1;
@ -324,8 +314,8 @@ typedef struct StdVideoH265PpsFlags {
uint32_t pps_range_extension_flag : 1; uint32_t pps_range_extension_flag : 1;
} StdVideoH265PpsFlags; } StdVideoH265PpsFlags;
typedef struct StdVideoH265PictureParameterSet typedef struct StdVideoH265PictureParameterSet {
{ StdVideoH265PpsFlags flags;
uint8_t pps_pic_parameter_set_id; uint8_t pps_pic_parameter_set_id;
uint8_t pps_seq_parameter_set_id; uint8_t pps_seq_parameter_set_id;
uint8_t num_extra_slice_header_bits; uint8_t num_extra_slice_header_bits;
@ -342,10 +332,7 @@ typedef struct StdVideoH265PictureParameterSet
int8_t pps_beta_offset_div2; int8_t pps_beta_offset_div2;
int8_t pps_tc_offset_div2; int8_t pps_tc_offset_div2;
uint8_t log2_parallel_merge_level_minus2; uint8_t log2_parallel_merge_level_minus2;
StdVideoH265PpsFlags flags; const StdVideoH265ScalingLists* pScalingLists;
StdVideoH265ScalingLists* pScalingLists; // Must be a valid pointer if pps_scaling_list_data_present_flag is set
// extension PPS, valid when STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS is set
uint8_t log2_max_transform_skip_block_size_minus2; uint8_t log2_max_transform_skip_block_size_minus2;
uint8_t diff_cu_chroma_qp_offset_depth; uint8_t diff_cu_chroma_qp_offset_depth;
uint8_t chroma_qp_offset_list_len_minus1; uint8_t chroma_qp_offset_list_len_minus1;
@ -353,19 +340,18 @@ typedef struct StdVideoH265PictureParameterSet
int8_t cr_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE]; int8_t cr_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE];
uint8_t log2_sao_offset_scale_luma; uint8_t log2_sao_offset_scale_luma;
uint8_t log2_sao_offset_scale_chroma; uint8_t log2_sao_offset_scale_chroma;
// extension PPS, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set
int8_t pps_act_y_qp_offset_plus5; int8_t pps_act_y_qp_offset_plus5;
int8_t pps_act_cb_qp_offset_plus5; int8_t pps_act_cb_qp_offset_plus5;
int8_t pps_act_cr_qp_offset_plus5; int8_t pps_act_cr_qp_offset_plus5;
uint8_t pps_num_palette_predictor_initializer; uint8_t pps_num_palette_predictor_initializer;
uint8_t luma_bit_depth_entry_minus8; uint8_t luma_bit_depth_entry_minus8;
uint8_t chroma_bit_depth_entry_minus8; uint8_t chroma_bit_depth_entry_minus8;
StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries; // Must be a valid pointer if pps_palette_predictor_initializer_present_flag is set const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries;
} StdVideoH265PictureParameterSet; } StdVideoH265PictureParameterSet;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // VULKAN_VIDEO_CODEC_H265STD_H_ #endif

View File

@ -1,24 +1,31 @@
#ifndef VULKAN_VIDEO_CODEC_H265STD_DECODE_H_
#define VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ 1
/* /*
** Copyright (c) 2019-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */
#ifndef VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ /*
#define VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ 1 ** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "vk_video/vulkan_video_codec_h265std.h"
// *************************************************
// Video h265 Decode related parameters: #define vulkan_video_codec_h265std_decode 1
// ************************************************* // Vulkan 0.9 provisional Vulkan video H.265 decode std specification version number
#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_0_9_7 VK_MAKE_VIDEO_STD_VERSION(0, 9, 7) // Patch version should always be set to 0
#define STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE 8 #define STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE 8
#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_0_9_7
#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_decode"
typedef struct StdVideoDecodeH265PictureInfoFlags { typedef struct StdVideoDecodeH265PictureInfoFlags {
uint32_t IrapPicFlag : 1; uint32_t IrapPicFlag : 1;
uint32_t IdrPicFlag : 1; uint32_t IdrPicFlag : 1;
@ -27,38 +34,33 @@ typedef struct StdVideoDecodeH265PictureInfoFlags {
} StdVideoDecodeH265PictureInfoFlags; } StdVideoDecodeH265PictureInfoFlags;
typedef struct StdVideoDecodeH265PictureInfo { typedef struct StdVideoDecodeH265PictureInfo {
uint8_t vps_video_parameter_set_id; StdVideoDecodeH265PictureInfoFlags flags;
uint8_t sps_seq_parameter_set_id; uint8_t sps_video_parameter_set_id;
uint8_t pps_seq_parameter_set_id;
uint8_t pps_pic_parameter_set_id; uint8_t pps_pic_parameter_set_id;
uint8_t num_short_term_ref_pic_sets; uint8_t num_short_term_ref_pic_sets;
int32_t PicOrderCntVal; int32_t PicOrderCntVal;
uint16_t NumBitsForSTRefPicSetInSlice; // number of bits used in st_ref_pic_set() uint16_t NumBitsForSTRefPicSetInSlice;
//when short_term_ref_pic_set_sps_flag is 0; otherwise set to 0. uint8_t NumDeltaPocsOfRefRpsIdx;
uint8_t NumDeltaPocsOfRefRpsIdx; // NumDeltaPocs[ RefRpsIdx ] when short_term_ref_pic_set_sps_flag = 1, otherwise 0 uint8_t RefPicSetStCurrBefore[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE];
uint8_t RefPicSetStCurrBefore[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; // slotIndex as used in uint8_t RefPicSetStCurrAfter[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE];
// VkVideoReferenceSlotKHR structures representing uint8_t RefPicSetLtCurr[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE];
//pReferenceSlots in VkVideoDecodeInfoKHR, 0xff for invalid slotIndex
uint8_t RefPicSetStCurrAfter[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; // slotIndex as used in
// VkVideoReferenceSlotKHR structures representing
//pReferenceSlots in VkVideoDecodeInfoKHR, 0xff for invalid slotIndex
uint8_t RefPicSetLtCurr[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; // slotIndex as used in
// VkVideoReferenceSlotKHR structures representing
//pReferenceSlots in VkVideoDecodeInfoKHR, 0xff for invalid slotIndex
StdVideoDecodeH265PictureInfoFlags flags;
} StdVideoDecodeH265PictureInfo; } StdVideoDecodeH265PictureInfo;
typedef struct StdVideoDecodeH265ReferenceInfoFlags { typedef struct StdVideoDecodeH265ReferenceInfoFlags {
uint32_t is_long_term : 1; uint32_t used_for_long_term_reference : 1;
uint32_t unused_for_reference : 1;
uint32_t is_non_existing : 1; uint32_t is_non_existing : 1;
} StdVideoDecodeH265ReferenceInfoFlags; } StdVideoDecodeH265ReferenceInfoFlags;
typedef struct StdVideoDecodeH265ReferenceInfo { typedef struct StdVideoDecodeH265ReferenceInfo {
int32_t PicOrderCntVal;
StdVideoDecodeH265ReferenceInfoFlags flags; StdVideoDecodeH265ReferenceInfoFlags flags;
int32_t PicOrderCntVal;
} StdVideoDecodeH265ReferenceInfo; } StdVideoDecodeH265ReferenceInfo;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ #endif

View File

@ -1,30 +1,56 @@
#ifndef VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_
#define VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ 1
/* /*
** Copyright (c) 2019-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */
#ifndef VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ /*
#define VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ 1 ** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "vk_video/vulkan_video_codec_h265std.h"
// *************************************************
// Video h265 Encode related parameters:
// *************************************************
#define STD_VIDEO_ENCODE_H265_LUMA_LIST_SIZE 15 #define vulkan_video_codec_h265std_encode 1
#define STD_VIDEO_ENCODE_H265_CHROMA_LIST_SIZE 15 // Vulkan 0.9 provisional Vulkan video H.265 encode std specification version number
#define STD_VIDEO_ENCODE_H265_CHROMA_LISTS_NUM 2 #define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_7 VK_MAKE_VIDEO_STD_VERSION(0, 9, 7) // Patch version should always be set to 0
typedef struct StdVideoEncodeH265SliceHeaderFlags { #define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_7
#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_encode"
typedef struct StdVideoEncodeH265WeightTableFlags {
uint16_t luma_weight_l0_flag;
uint16_t chroma_weight_l0_flag;
uint16_t luma_weight_l1_flag;
uint16_t chroma_weight_l1_flag;
} StdVideoEncodeH265WeightTableFlags;
typedef struct StdVideoEncodeH265WeightTable {
StdVideoEncodeH265WeightTableFlags flags;
uint8_t luma_log2_weight_denom;
int8_t delta_chroma_log2_weight_denom;
int8_t delta_luma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF];
int8_t luma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF];
int8_t delta_chroma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES];
int8_t delta_chroma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES];
int8_t delta_luma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF];
int8_t luma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF];
int8_t delta_chroma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES];
int8_t delta_chroma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES];
} StdVideoEncodeH265WeightTable;
typedef struct StdVideoEncodeH265SliceSegmentHeaderFlags {
uint32_t first_slice_segment_in_pic_flag : 1; uint32_t first_slice_segment_in_pic_flag : 1;
uint32_t no_output_of_prior_pics_flag : 1; uint32_t no_output_of_prior_pics_flag : 1;
uint32_t dependent_slice_segment_flag : 1; uint32_t dependent_slice_segment_flag : 1;
uint32_t pic_output_flag : 1;
uint32_t short_term_ref_pic_set_sps_flag : 1; uint32_t short_term_ref_pic_set_sps_flag : 1;
uint32_t slice_temporal_mvp_enable_flag : 1; uint32_t slice_temporal_mvp_enable_flag : 1;
uint32_t slice_sao_luma_flag : 1; uint32_t slice_sao_luma_flag : 1;
@ -35,46 +61,29 @@ typedef struct StdVideoEncodeH265SliceHeaderFlags {
uint32_t slice_deblocking_filter_disable_flag : 1; uint32_t slice_deblocking_filter_disable_flag : 1;
uint32_t collocated_from_l0_flag : 1; uint32_t collocated_from_l0_flag : 1;
uint32_t slice_loop_filter_across_slices_enabled_flag : 1; uint32_t slice_loop_filter_across_slices_enabled_flag : 1;
uint32_t bLastSliceInPic : 1; } StdVideoEncodeH265SliceSegmentHeaderFlags;
uint32_t reservedBits : 18;
uint16_t luma_weight_l0_flag; // bit 0 - num_ref_idx_l0_active_minus1
uint16_t chroma_weight_l0_flag; // bit 0 - num_ref_idx_l0_active_minus1
uint16_t luma_weight_l1_flag; // bit 0 - num_ref_idx_l1_active_minus1
uint16_t chroma_weight_l1_flag; // bit 0 - num_ref_idx_l1_active_minus1
} StdVideoEncodeH265SliceHeaderFlags;
typedef struct StdVideoEncodeH265SliceHeader { typedef struct StdVideoEncodeH265SliceSegmentHeader {
StdVideoEncodeH265SliceSegmentHeaderFlags flags;
StdVideoH265SliceType slice_type; StdVideoH265SliceType slice_type;
uint8_t slice_pic_parameter_set_id;
uint8_t num_short_term_ref_pic_sets; uint8_t num_short_term_ref_pic_sets;
uint32_t slice_segment_address; uint32_t slice_segment_address;
uint8_t short_term_ref_pic_set_idx; uint8_t short_term_ref_pic_set_idx;
uint8_t num_long_term_sps; uint8_t num_long_term_sps;
uint8_t num_long_term_pics; uint8_t num_long_term_pics;
uint8_t collocated_ref_idx; uint8_t collocated_ref_idx;
uint8_t num_ref_idx_l0_active_minus1; // [0, 14] uint8_t num_ref_idx_l0_active_minus1;
uint8_t num_ref_idx_l1_active_minus1; // [0, 14] uint8_t num_ref_idx_l1_active_minus1;
uint8_t luma_log2_weight_denom; // [0, 7]
int8_t delta_chroma_log2_weight_denom;
int8_t delta_luma_weight_l0[STD_VIDEO_ENCODE_H265_LUMA_LIST_SIZE];
int8_t luma_offset_l0[STD_VIDEO_ENCODE_H265_LUMA_LIST_SIZE];
int8_t delta_chroma_weight_l0[STD_VIDEO_ENCODE_H265_CHROMA_LIST_SIZE][STD_VIDEO_ENCODE_H265_CHROMA_LISTS_NUM];
int8_t delta_chroma_offset_l0[STD_VIDEO_ENCODE_H265_CHROMA_LIST_SIZE][STD_VIDEO_ENCODE_H265_CHROMA_LISTS_NUM];
int8_t delta_luma_weight_l1[STD_VIDEO_ENCODE_H265_LUMA_LIST_SIZE];
int8_t luma_offset_l1[STD_VIDEO_ENCODE_H265_LUMA_LIST_SIZE];
int8_t delta_chroma_weight_l1[STD_VIDEO_ENCODE_H265_CHROMA_LIST_SIZE][STD_VIDEO_ENCODE_H265_CHROMA_LISTS_NUM];
int8_t delta_chroma_offset_l1[STD_VIDEO_ENCODE_H265_CHROMA_LIST_SIZE][STD_VIDEO_ENCODE_H265_CHROMA_LISTS_NUM];
uint8_t MaxNumMergeCand; uint8_t MaxNumMergeCand;
int8_t slice_qp_delta; int8_t slice_cb_qp_offset;
int8_t slice_cb_qp_offset; // [-12, 12] int8_t slice_cr_qp_offset;
int8_t slice_cr_qp_offset; // [-12, 12] int8_t slice_beta_offset_div2;
int8_t slice_beta_offset_div2; // [-6, 6] int8_t slice_tc_offset_div2;
int8_t slice_tc_offset_div2; // [-6, 6]
int8_t slice_act_y_qp_offset; int8_t slice_act_y_qp_offset;
int8_t slice_act_cb_qp_offset; int8_t slice_act_cb_qp_offset;
int8_t slice_act_cr_qp_offset; int8_t slice_act_cr_qp_offset;
StdVideoEncodeH265SliceHeaderFlags flags; const StdVideoEncodeH265WeightTable* pWeightTable;
} StdVideoEncodeH265SliceHeader; } StdVideoEncodeH265SliceSegmentHeader;
typedef struct StdVideoEncodeH265ReferenceModificationFlags { typedef struct StdVideoEncodeH265ReferenceModificationFlags {
uint32_t ref_pic_list_modification_flag_l0 : 1; uint32_t ref_pic_list_modification_flag_l0 : 1;
@ -83,40 +92,44 @@ typedef struct StdVideoEncodeH265ReferenceModificationFlags {
typedef struct StdVideoEncodeH265ReferenceModifications { typedef struct StdVideoEncodeH265ReferenceModifications {
StdVideoEncodeH265ReferenceModificationFlags flags; StdVideoEncodeH265ReferenceModificationFlags flags;
uint8_t referenceList0ModificationsCount; // num_ref_idx_l0_active_minus1 uint8_t referenceList0ModificationsCount;
uint8_t* pReferenceList0Modifications; // list_entry_l0 const uint8_t* pReferenceList0Modifications;
uint8_t referenceList1ModificationsCount; // num_ref_idx_l1_active_minus1 uint8_t referenceList1ModificationsCount;
uint8_t* pReferenceList1Modifications; // list_entry_l1 const uint8_t* pReferenceList1Modifications;
} StdVideoEncodeH265ReferenceModifications; } StdVideoEncodeH265ReferenceModifications;
typedef struct StdVideoEncodeH265PictureInfoFlags { typedef struct StdVideoEncodeH265PictureInfoFlags {
uint32_t is_reference_flag : 1; uint32_t is_reference_flag : 1;
uint32_t IrapPicFlag : 1; uint32_t IrapPicFlag : 1;
uint32_t long_term_flag : 1; uint32_t long_term_flag : 1;
uint32_t discardable_flag : 1;
uint32_t cross_layer_bla_flag : 1;
} StdVideoEncodeH265PictureInfoFlags; } StdVideoEncodeH265PictureInfoFlags;
typedef struct StdVideoEncodeH265PictureInfo { typedef struct StdVideoEncodeH265PictureInfo {
StdVideoEncodeH265PictureInfoFlags flags;
StdVideoH265PictureType PictureType; StdVideoH265PictureType PictureType;
uint8_t sps_video_parameter_set_id; uint8_t sps_video_parameter_set_id;
uint8_t pps_seq_parameter_set_id; uint8_t pps_seq_parameter_set_id;
uint8_t pps_pic_parameter_set_id;
int32_t PicOrderCntVal; int32_t PicOrderCntVal;
uint8_t TemporalId; uint8_t TemporalId;
StdVideoEncodeH265PictureInfoFlags flags;
} StdVideoEncodeH265PictureInfo; } StdVideoEncodeH265PictureInfo;
typedef struct StdVideoEncodeH265ReferenceInfoFlags { typedef struct StdVideoEncodeH265ReferenceInfoFlags {
uint32_t is_long_term : 1; uint32_t used_for_long_term_reference : 1;
uint32_t isUsedFlag : 1; uint32_t unused_for_reference : 1;
} StdVideoEncodeH265ReferenceInfoFlags; } StdVideoEncodeH265ReferenceInfoFlags;
typedef struct StdVideoEncodeH265ReferenceInfo { typedef struct StdVideoEncodeH265ReferenceInfo {
StdVideoEncodeH265ReferenceInfoFlags flags;
int32_t PicOrderCntVal; int32_t PicOrderCntVal;
uint8_t TemporalId; uint8_t TemporalId;
StdVideoEncodeH265ReferenceInfoFlags flags;
} StdVideoEncodeH265ReferenceInfo; } StdVideoEncodeH265ReferenceInfo;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ #endif

View File

@ -1,21 +1,31 @@
#ifndef VULKAN_VIDEO_CODECS_COMMON_H_
#define VULKAN_VIDEO_CODECS_COMMON_H_ 1
/* /*
** Copyright (c) 2019-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */
#ifndef VULKAN_VIDEO_CODEC_COMMON_H_ /*
#define VULKAN_VIDEO_CODEC_COMMON_H_ 1 ** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define vulkan_video_codecs_common 1
#define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \ #define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \
((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch)))
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // VULKAN_VIDEO_CODEC_COMMON_H_ #endif

View File

@ -2,7 +2,7 @@
// File: vk_platform.h // File: vk_platform.h
// //
/* /*
** Copyright 2014-2021 The Khronos Group Inc. ** Copyright 2014-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -2,7 +2,7 @@
#define VULKAN_H_ 1 #define VULKAN_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#define VULKAN_ANDROID_H_ 1 #define VULKAN_ANDROID_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */
@ -44,7 +44,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
#define VK_ANDROID_external_memory_android_hardware_buffer 1 #define VK_ANDROID_external_memory_android_hardware_buffer 1
struct AHardwareBuffer; struct AHardwareBuffer;
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 4 #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer" #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
typedef struct VkAndroidHardwareBufferUsageANDROID { typedef struct VkAndroidHardwareBufferUsageANDROID {
VkStructureType sType; VkStructureType sType;
@ -95,7 +95,7 @@ typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID {
void* pNext; void* pNext;
VkFormat format; VkFormat format;
uint64_t externalFormat; uint64_t externalFormat;
VkFormatFeatureFlags2KHR formatFeatures; VkFormatFeatureFlags2 formatFeatures;
VkComponentMapping samplerYcbcrConversionComponents; VkComponentMapping samplerYcbcrConversionComponents;
VkSamplerYcbcrModelConversion suggestedYcbcrModel; VkSamplerYcbcrModelConversion suggestedYcbcrModel;
VkSamplerYcbcrRange suggestedYcbcrRange; VkSamplerYcbcrRange suggestedYcbcrRange;

View File

@ -2,7 +2,7 @@
#define VULKAN_BETA_H_ 1 #define VULKAN_BETA_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */
@ -22,7 +22,7 @@ extern "C" {
#define VK_KHR_video_queue 1 #define VK_KHR_video_queue 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionKHR) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionKHR)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionParametersKHR) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionParametersKHR)
#define VK_KHR_VIDEO_QUEUE_SPEC_VERSION 2 #define VK_KHR_VIDEO_QUEUE_SPEC_VERSION 3
#define VK_KHR_VIDEO_QUEUE_EXTENSION_NAME "VK_KHR_video_queue" #define VK_KHR_VIDEO_QUEUE_EXTENSION_NAME "VK_KHR_video_queue"
typedef enum VkQueryResultStatusKHR { typedef enum VkQueryResultStatusKHR {
@ -99,6 +99,12 @@ typedef enum VkVideoCodingQualityPresetFlagBitsKHR {
VK_VIDEO_CODING_QUALITY_PRESET_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF VK_VIDEO_CODING_QUALITY_PRESET_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoCodingQualityPresetFlagBitsKHR; } VkVideoCodingQualityPresetFlagBitsKHR;
typedef VkFlags VkVideoCodingQualityPresetFlagsKHR; typedef VkFlags VkVideoCodingQualityPresetFlagsKHR;
typedef struct VkQueueFamilyQueryResultStatusProperties2KHR {
VkStructureType sType;
void* pNext;
VkBool32 supported;
} VkQueueFamilyQueryResultStatusProperties2KHR;
typedef struct VkVideoQueueFamilyProperties2KHR { typedef struct VkVideoQueueFamilyProperties2KHR {
VkStructureType sType; VkStructureType sType;
void* pNext; void* pNext;
@ -132,6 +138,7 @@ typedef struct VkVideoCapabilitiesKHR {
VkExtent2D maxExtent; VkExtent2D maxExtent;
uint32_t maxReferencePicturesSlotsCount; uint32_t maxReferencePicturesSlotsCount;
uint32_t maxReferencePicturesActiveCount; uint32_t maxReferencePicturesActiveCount;
VkExtensionProperties stdHeaderVersion;
} VkVideoCapabilitiesKHR; } VkVideoCapabilitiesKHR;
typedef struct VkPhysicalDeviceVideoFormatInfoKHR { typedef struct VkPhysicalDeviceVideoFormatInfoKHR {
@ -190,6 +197,7 @@ typedef struct VkVideoSessionCreateInfoKHR {
VkFormat referencePicturesFormat; VkFormat referencePicturesFormat;
uint32_t maxReferencePicturesSlotsCount; uint32_t maxReferencePicturesSlotsCount;
uint32_t maxReferencePicturesActiveCount; uint32_t maxReferencePicturesActiveCount;
const VkExtensionProperties* pStdHeaderVersion;
} VkVideoSessionCreateInfoKHR; } VkVideoSessionCreateInfoKHR;
typedef struct VkVideoSessionParametersCreateInfoKHR { typedef struct VkVideoSessionParametersCreateInfoKHR {
@ -307,21 +315,33 @@ VKAPI_ATTR void VKAPI_CALL vkCmdControlVideoCodingKHR(
#define VK_KHR_video_decode_queue 1 #define VK_KHR_video_decode_queue 1
#define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 2 #define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 4
#define VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME "VK_KHR_video_decode_queue" #define VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME "VK_KHR_video_decode_queue"
typedef enum VkVideoDecodeCapabilityFlagBitsKHR {
VK_VIDEO_DECODE_CAPABILITY_DEFAULT_KHR = 0,
VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR = 0x00000001,
VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR = 0x00000002,
VK_VIDEO_DECODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoDecodeCapabilityFlagBitsKHR;
typedef VkFlags VkVideoDecodeCapabilityFlagsKHR;
typedef enum VkVideoDecodeFlagBitsKHR { typedef enum VkVideoDecodeFlagBitsKHR {
VK_VIDEO_DECODE_DEFAULT_KHR = 0, VK_VIDEO_DECODE_DEFAULT_KHR = 0,
VK_VIDEO_DECODE_RESERVED_0_BIT_KHR = 0x00000001, VK_VIDEO_DECODE_RESERVED_0_BIT_KHR = 0x00000001,
VK_VIDEO_DECODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF VK_VIDEO_DECODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoDecodeFlagBitsKHR; } VkVideoDecodeFlagBitsKHR;
typedef VkFlags VkVideoDecodeFlagsKHR; typedef VkFlags VkVideoDecodeFlagsKHR;
typedef struct VkVideoDecodeCapabilitiesKHR {
VkStructureType sType;
void* pNext;
VkVideoDecodeCapabilityFlagsKHR flags;
} VkVideoDecodeCapabilitiesKHR;
typedef struct VkVideoDecodeInfoKHR { typedef struct VkVideoDecodeInfoKHR {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
VkVideoDecodeFlagsKHR flags; VkVideoDecodeFlagsKHR flags;
VkOffset2D codedOffset;
VkExtent2D codedExtent;
VkBuffer srcBuffer; VkBuffer srcBuffer;
VkDeviceSize srcBufferOffset; VkDeviceSize srcBufferOffset;
VkDeviceSize srcBufferRange; VkDeviceSize srcBufferRange;
@ -372,7 +392,7 @@ typedef struct VkPhysicalDevicePortabilitySubsetPropertiesKHR {
#define VK_KHR_video_encode_queue 1 #define VK_KHR_video_encode_queue 1
#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 3 #define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 5
#define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue" #define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue"
typedef enum VkVideoEncodeFlagBitsKHR { typedef enum VkVideoEncodeFlagBitsKHR {
@ -382,12 +402,12 @@ typedef enum VkVideoEncodeFlagBitsKHR {
} VkVideoEncodeFlagBitsKHR; } VkVideoEncodeFlagBitsKHR;
typedef VkFlags VkVideoEncodeFlagsKHR; typedef VkFlags VkVideoEncodeFlagsKHR;
typedef enum VkVideoEncodeRateControlFlagBitsKHR { typedef enum VkVideoEncodeCapabilityFlagBitsKHR {
VK_VIDEO_ENCODE_RATE_CONTROL_DEFAULT_KHR = 0, VK_VIDEO_ENCODE_CAPABILITY_DEFAULT_KHR = 0,
VK_VIDEO_ENCODE_RATE_CONTROL_RESERVED_0_BIT_KHR = 0x00000001, VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001,
VK_VIDEO_ENCODE_RATE_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeRateControlFlagBitsKHR; } VkVideoEncodeCapabilityFlagBitsKHR;
typedef VkFlags VkVideoEncodeRateControlFlagsKHR; typedef VkFlags VkVideoEncodeCapabilityFlagsKHR;
typedef enum VkVideoEncodeRateControlModeFlagBitsKHR { typedef enum VkVideoEncodeRateControlModeFlagBitsKHR {
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR = 0, VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR = 0,
@ -396,12 +416,18 @@ typedef enum VkVideoEncodeRateControlModeFlagBitsKHR {
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeRateControlModeFlagBitsKHR; } VkVideoEncodeRateControlModeFlagBitsKHR;
typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR;
typedef enum VkVideoEncodeRateControlFlagBitsKHR {
VK_VIDEO_ENCODE_RATE_CONTROL_DEFAULT_KHR = 0,
VK_VIDEO_ENCODE_RATE_CONTROL_RESERVED_0_BIT_KHR = 0x00000001,
VK_VIDEO_ENCODE_RATE_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeRateControlFlagBitsKHR;
typedef VkFlags VkVideoEncodeRateControlFlagsKHR;
typedef struct VkVideoEncodeInfoKHR { typedef struct VkVideoEncodeInfoKHR {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
VkVideoEncodeFlagsKHR flags; VkVideoEncodeFlagsKHR flags;
uint32_t qualityLevel; uint32_t qualityLevel;
VkExtent2D codedExtent;
VkBuffer dstBitstreamBuffer; VkBuffer dstBitstreamBuffer;
VkDeviceSize dstBitstreamBufferOffset; VkDeviceSize dstBitstreamBufferOffset;
VkDeviceSize dstBitstreamBufferMaxRange; VkDeviceSize dstBitstreamBufferMaxRange;
@ -412,6 +438,16 @@ typedef struct VkVideoEncodeInfoKHR {
uint32_t precedingExternallyEncodedBytes; uint32_t precedingExternallyEncodedBytes;
} VkVideoEncodeInfoKHR; } VkVideoEncodeInfoKHR;
typedef struct VkVideoEncodeCapabilitiesKHR {
VkStructureType sType;
void* pNext;
VkVideoEncodeCapabilityFlagsKHR flags;
VkVideoEncodeRateControlModeFlagsKHR rateControlModes;
uint8_t rateControlLayerCount;
uint8_t qualityLevelCount;
VkExtent2D inputImageDataFillAlignment;
} VkVideoEncodeCapabilitiesKHR;
typedef struct VkVideoEncodeRateControlLayerInfoKHR { typedef struct VkVideoEncodeRateControlLayerInfoKHR {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
@ -444,22 +480,35 @@ VKAPI_ATTR void VKAPI_CALL vkCmdEncodeVideoKHR(
#define VK_EXT_video_encode_h264 1 #define VK_EXT_video_encode_h264 1
#include "vk_video/vulkan_video_codec_h264std.h" #include "vk_video/vulkan_video_codec_h264std.h"
#include "vk_video/vulkan_video_codec_h264std_encode.h" #include "vk_video/vulkan_video_codec_h264std_encode.h"
#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 2 #define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 7
#define VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_EXT_video_encode_h264" #define VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_EXT_video_encode_h264"
typedef enum VkVideoEncodeH264CapabilityFlagBitsEXT { typedef enum VkVideoEncodeH264CapabilityFlagBitsEXT {
VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT = 0x00000001, VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_ENABLED_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT = 0x00000002, VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_DISABLED_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BI_PRED_IMPLICIT_BIT_EXT = 0x00000004, VK_VIDEO_ENCODE_H264_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT = 0x00000008, VK_VIDEO_ENCODE_H264_CAPABILITY_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_BIT_EXT = 0x00000008,
VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT = 0x00000010, VK_VIDEO_ENCODE_H264_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000010,
VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT = 0x00000020, VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020,
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT = 0x00000040, VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT = 0x00000040,
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT = 0x00000080, VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT = 0x00000080,
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT = 0x00000100, VK_VIDEO_ENCODE_H264_CAPABILITY_PIC_INIT_QP_MINUS26_BIT_EXT = 0x00000100,
VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT = 0x00000200, VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00000200,
VK_VIDEO_ENCODE_H264_CAPABILITY_EVENLY_DISTRIBUTED_SLICE_SIZE_BIT_EXT = 0x00000400, VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_EXPLICIT_BIT_EXT = 0x00000400,
VK_VIDEO_ENCODE_H264_CAPABILITY_OPTIONAL_RC_EXTENSION_STRUCT_BIT_EXT = 0x00000800, VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_IMPLICIT_BIT_EXT = 0x00000800,
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00001000,
VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT = 0x00002000,
VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT = 0x00004000,
VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT = 0x00008000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT = 0x00010000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT = 0x00020000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT = 0x00040000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DISABLE_DIRECT_SPATIAL_MV_PRED_BIT_EXT = 0x00080000,
VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT = 0x00100000,
VK_VIDEO_ENCODE_H264_CAPABILITY_SLICE_MB_COUNT_BIT_EXT = 0x00200000,
VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_EXT = 0x00400000,
VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x00800000,
VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x01000000,
VK_VIDEO_ENCODE_H264_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF VK_VIDEO_ENCODE_H264_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH264CapabilityFlagBitsEXT; } VkVideoEncodeH264CapabilityFlagBitsEXT;
typedef VkFlags VkVideoEncodeH264CapabilityFlagsEXT; typedef VkFlags VkVideoEncodeH264CapabilityFlagsEXT;
@ -480,13 +529,6 @@ typedef enum VkVideoEncodeH264OutputModeFlagBitsEXT {
} VkVideoEncodeH264OutputModeFlagBitsEXT; } VkVideoEncodeH264OutputModeFlagBitsEXT;
typedef VkFlags VkVideoEncodeH264OutputModeFlagsEXT; typedef VkFlags VkVideoEncodeH264OutputModeFlagsEXT;
typedef enum VkVideoEncodeH264CreateFlagBitsEXT {
VK_VIDEO_ENCODE_H264_CREATE_DEFAULT_EXT = 0,
VK_VIDEO_ENCODE_H264_CREATE_RESERVED_0_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H264_CREATE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH264CreateFlagBitsEXT;
typedef VkFlags VkVideoEncodeH264CreateFlagsEXT;
typedef enum VkVideoEncodeH264RateControlStructureFlagBitsEXT { typedef enum VkVideoEncodeH264RateControlStructureFlagBitsEXT {
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0, VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0,
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_FLAT_BIT_EXT = 0x00000001, VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_FLAT_BIT_EXT = 0x00000001,
@ -496,28 +538,20 @@ typedef enum VkVideoEncodeH264RateControlStructureFlagBitsEXT {
typedef VkFlags VkVideoEncodeH264RateControlStructureFlagsEXT; typedef VkFlags VkVideoEncodeH264RateControlStructureFlagsEXT;
typedef struct VkVideoEncodeH264CapabilitiesEXT { typedef struct VkVideoEncodeH264CapabilitiesEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; void* pNext;
VkVideoEncodeH264CapabilityFlagsEXT flags; VkVideoEncodeH264CapabilityFlagsEXT flags;
VkVideoEncodeH264InputModeFlagsEXT inputModeFlags; VkVideoEncodeH264InputModeFlagsEXT inputModeFlags;
VkVideoEncodeH264OutputModeFlagsEXT outputModeFlags; VkVideoEncodeH264OutputModeFlagsEXT outputModeFlags;
VkExtent2D minPictureSizeInMbs; uint8_t maxPPictureL0ReferenceCount;
VkExtent2D maxPictureSizeInMbs; uint8_t maxBPictureL0ReferenceCount;
VkExtent2D inputImageDataAlignment; uint8_t maxL1ReferenceCount;
uint8_t maxNumL0ReferenceForP; VkBool32 motionVectorsOverPicBoundariesFlag;
uint8_t maxNumL0ReferenceForB; uint32_t maxBytesPerPicDenom;
uint8_t maxNumL1Reference; uint32_t maxBitsPerMbDenom;
uint8_t qualityLevelCount; uint32_t log2MaxMvLengthHorizontal;
VkExtensionProperties stdExtensionVersion; uint32_t log2MaxMvLengthVertical;
} VkVideoEncodeH264CapabilitiesEXT; } VkVideoEncodeH264CapabilitiesEXT;
typedef struct VkVideoEncodeH264SessionCreateInfoEXT {
VkStructureType sType;
const void* pNext;
VkVideoEncodeH264CreateFlagsEXT flags;
VkExtent2D maxPictureSizeInMbs;
const VkExtensionProperties* pStdExtensionVersion;
} VkVideoEncodeH264SessionCreateInfoEXT;
typedef struct VkVideoEncodeH264SessionParametersAddInfoEXT { typedef struct VkVideoEncodeH264SessionParametersAddInfoEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
@ -539,30 +573,34 @@ typedef struct VkVideoEncodeH264DpbSlotInfoEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
int8_t slotIndex; int8_t slotIndex;
const StdVideoEncodeH264PictureInfo* pStdPictureInfo; const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo;
} VkVideoEncodeH264DpbSlotInfoEXT; } VkVideoEncodeH264DpbSlotInfoEXT;
typedef struct VkVideoEncodeH264ReferenceListsEXT {
VkStructureType sType;
const void* pNext;
uint8_t referenceList0EntryCount;
const VkVideoEncodeH264DpbSlotInfoEXT* pReferenceList0Entries;
uint8_t referenceList1EntryCount;
const VkVideoEncodeH264DpbSlotInfoEXT* pReferenceList1Entries;
const StdVideoEncodeH264RefMemMgmtCtrlOperations* pMemMgmtCtrlOperations;
} VkVideoEncodeH264ReferenceListsEXT;
typedef struct VkVideoEncodeH264NaluSliceEXT { typedef struct VkVideoEncodeH264NaluSliceEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
const StdVideoEncodeH264SliceHeader* pSliceHeaderStd;
uint32_t mbCount; uint32_t mbCount;
uint8_t refFinalList0EntryCount; const VkVideoEncodeH264ReferenceListsEXT* pReferenceFinalLists;
const VkVideoEncodeH264DpbSlotInfoEXT* pRefFinalList0Entries; const StdVideoEncodeH264SliceHeader* pSliceHeaderStd;
uint8_t refFinalList1EntryCount;
const VkVideoEncodeH264DpbSlotInfoEXT* pRefFinalList1Entries;
} VkVideoEncodeH264NaluSliceEXT; } VkVideoEncodeH264NaluSliceEXT;
typedef struct VkVideoEncodeH264VclFrameInfoEXT { typedef struct VkVideoEncodeH264VclFrameInfoEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
uint8_t refDefaultFinalList0EntryCount; const VkVideoEncodeH264ReferenceListsEXT* pReferenceFinalLists;
const VkVideoEncodeH264DpbSlotInfoEXT* pRefDefaultFinalList0Entries;
uint8_t refDefaultFinalList1EntryCount;
const VkVideoEncodeH264DpbSlotInfoEXT* pRefDefaultFinalList1Entries;
uint32_t naluSliceEntryCount; uint32_t naluSliceEntryCount;
const VkVideoEncodeH264NaluSliceEXT* pNaluSliceEntries; const VkVideoEncodeH264NaluSliceEXT* pNaluSliceEntries;
const VkVideoEncodeH264DpbSlotInfoEXT* pCurrentPictureInfo; const StdVideoEncodeH264PictureInfo* pCurrentPictureInfo;
} VkVideoEncodeH264VclFrameInfoEXT; } VkVideoEncodeH264VclFrameInfoEXT;
typedef struct VkVideoEncodeH264EmitPictureParametersEXT { typedef struct VkVideoEncodeH264EmitPictureParametersEXT {
@ -587,6 +625,7 @@ typedef struct VkVideoEncodeH264RateControlInfoEXT {
uint32_t idrPeriod; uint32_t idrPeriod;
uint32_t consecutiveBFrameCount; uint32_t consecutiveBFrameCount;
VkVideoEncodeH264RateControlStructureFlagBitsEXT rateControlStructure; VkVideoEncodeH264RateControlStructureFlagBitsEXT rateControlStructure;
uint8_t temporalLayerCount;
} VkVideoEncodeH264RateControlInfoEXT; } VkVideoEncodeH264RateControlInfoEXT;
typedef struct VkVideoEncodeH264QpEXT { typedef struct VkVideoEncodeH264QpEXT {
@ -620,13 +659,43 @@ typedef struct VkVideoEncodeH264RateControlLayerInfoEXT {
#define VK_EXT_video_encode_h265 1 #define VK_EXT_video_encode_h265 1
#include "vk_video/vulkan_video_codec_h265std.h" #include "vk_video/vulkan_video_codec_h265std.h"
#include "vk_video/vulkan_video_codec_h265std_encode.h" #include "vk_video/vulkan_video_codec_h265std_encode.h"
#define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 2 #define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 7
#define VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_EXT_video_encode_h265" #define VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_EXT_video_encode_h265"
typedef enum VkVideoEncodeH265CapabilityFlagBitsEXT {
VK_VIDEO_ENCODE_H265_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H265_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H265_CAPABILITY_SAMPLE_ADAPTIVE_OFFSET_ENABLED_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H265_CAPABILITY_PCM_ENABLE_BIT_EXT = 0x00000008,
VK_VIDEO_ENCODE_H265_CAPABILITY_SPS_TEMPORAL_MVP_ENABLED_BIT_EXT = 0x00000010,
VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020,
VK_VIDEO_ENCODE_H265_CAPABILITY_INIT_QP_MINUS26_BIT_EXT = 0x00000040,
VK_VIDEO_ENCODE_H265_CAPABILITY_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_EXT = 0x00000080,
VK_VIDEO_ENCODE_H265_CAPABILITY_SIGN_DATA_HIDING_ENABLED_BIT_EXT = 0x00000100,
VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_ENABLED_BIT_EXT = 0x00000200,
VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_DISABLED_BIT_EXT = 0x00000400,
VK_VIDEO_ENCODE_H265_CAPABILITY_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_BIT_EXT = 0x00000800,
VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00001000,
VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_BIPRED_BIT_EXT = 0x00002000,
VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00004000,
VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSQUANT_BYPASS_ENABLED_BIT_EXT = 0x00008000,
VK_VIDEO_ENCODE_H265_CAPABILITY_ENTROPY_CODING_SYNC_ENABLED_BIT_EXT = 0x00010000,
VK_VIDEO_ENCODE_H265_CAPABILITY_DEBLOCKING_FILTER_OVERRIDE_ENABLED_BIT_EXT = 0x00020000,
VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_FRAME_BIT_EXT = 0x00040000,
VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_PER_TILE_BIT_EXT = 0x00080000,
VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_SLICE_BIT_EXT = 0x00100000,
VK_VIDEO_ENCODE_H265_CAPABILITY_SLICE_SEGMENT_CTB_COUNT_BIT_EXT = 0x00200000,
VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_EXT = 0x00400000,
VK_VIDEO_ENCODE_H265_CAPABILITY_DEPENDENT_SLICE_SEGMENT_BIT_EXT = 0x00800000,
VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x01000000,
VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x02000000,
VK_VIDEO_ENCODE_H265_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH265CapabilityFlagBitsEXT;
typedef VkFlags VkVideoEncodeH265CapabilityFlagsEXT; typedef VkFlags VkVideoEncodeH265CapabilityFlagsEXT;
typedef enum VkVideoEncodeH265InputModeFlagBitsEXT { typedef enum VkVideoEncodeH265InputModeFlagBitsEXT {
VK_VIDEO_ENCODE_H265_INPUT_MODE_FRAME_BIT_EXT = 0x00000001, VK_VIDEO_ENCODE_H265_INPUT_MODE_FRAME_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_BIT_EXT = 0x00000002, VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H265_INPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF VK_VIDEO_ENCODE_H265_INPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH265InputModeFlagBitsEXT; } VkVideoEncodeH265InputModeFlagBitsEXT;
@ -634,22 +703,29 @@ typedef VkFlags VkVideoEncodeH265InputModeFlagsEXT;
typedef enum VkVideoEncodeH265OutputModeFlagBitsEXT { typedef enum VkVideoEncodeH265OutputModeFlagBitsEXT {
VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FRAME_BIT_EXT = 0x00000001, VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FRAME_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_BIT_EXT = 0x00000002, VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH265OutputModeFlagBitsEXT; } VkVideoEncodeH265OutputModeFlagBitsEXT;
typedef VkFlags VkVideoEncodeH265OutputModeFlagsEXT; typedef VkFlags VkVideoEncodeH265OutputModeFlagsEXT;
typedef VkFlags VkVideoEncodeH265CreateFlagsEXT;
typedef enum VkVideoEncodeH265CtbSizeFlagBitsEXT { typedef enum VkVideoEncodeH265CtbSizeFlagBitsEXT {
VK_VIDEO_ENCODE_H265_CTB_SIZE_8_BIT_EXT = 0x00000001, VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT = 0x00000002, VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT = 0x00000004, VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT = 0x00000008,
VK_VIDEO_ENCODE_H265_CTB_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF VK_VIDEO_ENCODE_H265_CTB_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH265CtbSizeFlagBitsEXT; } VkVideoEncodeH265CtbSizeFlagBitsEXT;
typedef VkFlags VkVideoEncodeH265CtbSizeFlagsEXT; typedef VkFlags VkVideoEncodeH265CtbSizeFlagsEXT;
typedef enum VkVideoEncodeH265TransformBlockSizeFlagBitsEXT {
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_EXT = 0x00000001,
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_EXT = 0x00000002,
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_EXT = 0x00000004,
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_EXT = 0x00000008,
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH265TransformBlockSizeFlagBitsEXT;
typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsEXT;
typedef enum VkVideoEncodeH265RateControlStructureFlagBitsEXT { typedef enum VkVideoEncodeH265RateControlStructureFlagBitsEXT {
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0, VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0,
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_FLAT_BIT_EXT = 0x00000001, VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_FLAT_BIT_EXT = 0x00000001,
@ -659,27 +735,29 @@ typedef enum VkVideoEncodeH265RateControlStructureFlagBitsEXT {
typedef VkFlags VkVideoEncodeH265RateControlStructureFlagsEXT; typedef VkFlags VkVideoEncodeH265RateControlStructureFlagsEXT;
typedef struct VkVideoEncodeH265CapabilitiesEXT { typedef struct VkVideoEncodeH265CapabilitiesEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; void* pNext;
VkVideoEncodeH265CapabilityFlagsEXT flags; VkVideoEncodeH265CapabilityFlagsEXT flags;
VkVideoEncodeH265InputModeFlagsEXT inputModeFlags; VkVideoEncodeH265InputModeFlagsEXT inputModeFlags;
VkVideoEncodeH265OutputModeFlagsEXT outputModeFlags; VkVideoEncodeH265OutputModeFlagsEXT outputModeFlags;
VkVideoEncodeH265CtbSizeFlagsEXT ctbSizes; VkVideoEncodeH265CtbSizeFlagsEXT ctbSizes;
VkExtent2D inputImageDataAlignment; VkVideoEncodeH265TransformBlockSizeFlagsEXT transformBlockSizes;
uint8_t maxNumL0ReferenceForP; uint8_t maxPPictureL0ReferenceCount;
uint8_t maxNumL0ReferenceForB; uint8_t maxBPictureL0ReferenceCount;
uint8_t maxNumL1Reference; uint8_t maxL1ReferenceCount;
uint8_t maxNumSubLayers; uint8_t maxSubLayersCount;
uint8_t qualityLevelCount; uint8_t minLog2MinLumaCodingBlockSizeMinus3;
VkExtensionProperties stdExtensionVersion; uint8_t maxLog2MinLumaCodingBlockSizeMinus3;
uint8_t minLog2MinLumaTransformBlockSizeMinus2;
uint8_t maxLog2MinLumaTransformBlockSizeMinus2;
uint8_t minMaxTransformHierarchyDepthInter;
uint8_t maxMaxTransformHierarchyDepthInter;
uint8_t minMaxTransformHierarchyDepthIntra;
uint8_t maxMaxTransformHierarchyDepthIntra;
uint8_t maxDiffCuQpDeltaDepth;
uint8_t minMaxNumMergeCand;
uint8_t maxMaxNumMergeCand;
} VkVideoEncodeH265CapabilitiesEXT; } VkVideoEncodeH265CapabilitiesEXT;
typedef struct VkVideoEncodeH265SessionCreateInfoEXT {
VkStructureType sType;
const void* pNext;
VkVideoEncodeH265CreateFlagsEXT flags;
const VkExtensionProperties* pStdExtensionVersion;
} VkVideoEncodeH265SessionCreateInfoEXT;
typedef struct VkVideoEncodeH265SessionParametersAddInfoEXT { typedef struct VkVideoEncodeH265SessionParametersAddInfoEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
@ -717,20 +795,20 @@ typedef struct VkVideoEncodeH265ReferenceListsEXT {
const StdVideoEncodeH265ReferenceModifications* pReferenceModifications; const StdVideoEncodeH265ReferenceModifications* pReferenceModifications;
} VkVideoEncodeH265ReferenceListsEXT; } VkVideoEncodeH265ReferenceListsEXT;
typedef struct VkVideoEncodeH265NaluSliceEXT { typedef struct VkVideoEncodeH265NaluSliceSegmentEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
uint32_t ctbCount; uint32_t ctbCount;
const VkVideoEncodeH265ReferenceListsEXT* pReferenceFinalLists; const VkVideoEncodeH265ReferenceListsEXT* pReferenceFinalLists;
const StdVideoEncodeH265SliceHeader* pSliceHeaderStd; const StdVideoEncodeH265SliceSegmentHeader* pSliceSegmentHeaderStd;
} VkVideoEncodeH265NaluSliceEXT; } VkVideoEncodeH265NaluSliceSegmentEXT;
typedef struct VkVideoEncodeH265VclFrameInfoEXT { typedef struct VkVideoEncodeH265VclFrameInfoEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
const VkVideoEncodeH265ReferenceListsEXT* pReferenceFinalLists; const VkVideoEncodeH265ReferenceListsEXT* pReferenceFinalLists;
uint32_t naluSliceEntryCount; uint32_t naluSliceSegmentEntryCount;
const VkVideoEncodeH265NaluSliceEXT* pNaluSliceEntries; const VkVideoEncodeH265NaluSliceSegmentEXT* pNaluSliceSegmentEntries;
const StdVideoEncodeH265PictureInfo* pCurrentPictureInfo; const StdVideoEncodeH265PictureInfo* pCurrentPictureInfo;
} VkVideoEncodeH265VclFrameInfoEXT; } VkVideoEncodeH265VclFrameInfoEXT;
@ -758,6 +836,7 @@ typedef struct VkVideoEncodeH265RateControlInfoEXT {
uint32_t idrPeriod; uint32_t idrPeriod;
uint32_t consecutiveBFrameCount; uint32_t consecutiveBFrameCount;
VkVideoEncodeH265RateControlStructureFlagBitsEXT rateControlStructure; VkVideoEncodeH265RateControlStructureFlagBitsEXT rateControlStructure;
uint8_t subLayerCount;
} VkVideoEncodeH265RateControlInfoEXT; } VkVideoEncodeH265RateControlInfoEXT;
typedef struct VkVideoEncodeH265QpEXT { typedef struct VkVideoEncodeH265QpEXT {
@ -790,7 +869,7 @@ typedef struct VkVideoEncodeH265RateControlLayerInfoEXT {
#define VK_EXT_video_decode_h264 1 #define VK_EXT_video_decode_h264 1
#include "vk_video/vulkan_video_codec_h264std_decode.h" #include "vk_video/vulkan_video_codec_h264std_decode.h"
#define VK_EXT_VIDEO_DECODE_H264_SPEC_VERSION 3 #define VK_EXT_VIDEO_DECODE_H264_SPEC_VERSION 5
#define VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME "VK_EXT_video_decode_h264" #define VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME "VK_EXT_video_decode_h264"
typedef enum VkVideoDecodeH264PictureLayoutFlagBitsEXT { typedef enum VkVideoDecodeH264PictureLayoutFlagBitsEXT {
@ -800,7 +879,6 @@ typedef enum VkVideoDecodeH264PictureLayoutFlagBitsEXT {
VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoDecodeH264PictureLayoutFlagBitsEXT; } VkVideoDecodeH264PictureLayoutFlagBitsEXT;
typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsEXT; typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsEXT;
typedef VkFlags VkVideoDecodeH264CreateFlagsEXT;
typedef struct VkVideoDecodeH264ProfileEXT { typedef struct VkVideoDecodeH264ProfileEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
@ -811,18 +889,10 @@ typedef struct VkVideoDecodeH264ProfileEXT {
typedef struct VkVideoDecodeH264CapabilitiesEXT { typedef struct VkVideoDecodeH264CapabilitiesEXT {
VkStructureType sType; VkStructureType sType;
void* pNext; void* pNext;
uint32_t maxLevel; StdVideoH264Level maxLevel;
VkOffset2D fieldOffsetGranularity; VkOffset2D fieldOffsetGranularity;
VkExtensionProperties stdExtensionVersion;
} VkVideoDecodeH264CapabilitiesEXT; } VkVideoDecodeH264CapabilitiesEXT;
typedef struct VkVideoDecodeH264SessionCreateInfoEXT {
VkStructureType sType;
const void* pNext;
VkVideoDecodeH264CreateFlagsEXT flags;
const VkExtensionProperties* pStdExtensionVersion;
} VkVideoDecodeH264SessionCreateInfoEXT;
typedef struct VkVideoDecodeH264SessionParametersAddInfoEXT { typedef struct VkVideoDecodeH264SessionParametersAddInfoEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
@ -864,9 +934,8 @@ typedef struct VkVideoDecodeH264DpbSlotInfoEXT {
#define VK_EXT_video_decode_h265 1 #define VK_EXT_video_decode_h265 1
#include "vk_video/vulkan_video_codec_h265std_decode.h" #include "vk_video/vulkan_video_codec_h265std_decode.h"
#define VK_EXT_VIDEO_DECODE_H265_SPEC_VERSION 1 #define VK_EXT_VIDEO_DECODE_H265_SPEC_VERSION 3
#define VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME "VK_EXT_video_decode_h265" #define VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME "VK_EXT_video_decode_h265"
typedef VkFlags VkVideoDecodeH265CreateFlagsEXT;
typedef struct VkVideoDecodeH265ProfileEXT { typedef struct VkVideoDecodeH265ProfileEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
@ -876,20 +945,14 @@ typedef struct VkVideoDecodeH265ProfileEXT {
typedef struct VkVideoDecodeH265CapabilitiesEXT { typedef struct VkVideoDecodeH265CapabilitiesEXT {
VkStructureType sType; VkStructureType sType;
void* pNext; void* pNext;
uint32_t maxLevel; StdVideoH265Level maxLevel;
VkExtensionProperties stdExtensionVersion;
} VkVideoDecodeH265CapabilitiesEXT; } VkVideoDecodeH265CapabilitiesEXT;
typedef struct VkVideoDecodeH265SessionCreateInfoEXT {
VkStructureType sType;
const void* pNext;
VkVideoDecodeH265CreateFlagsEXT flags;
const VkExtensionProperties* pStdExtensionVersion;
} VkVideoDecodeH265SessionCreateInfoEXT;
typedef struct VkVideoDecodeH265SessionParametersAddInfoEXT { typedef struct VkVideoDecodeH265SessionParametersAddInfoEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
uint32_t vpsStdCount;
const StdVideoH265VideoParameterSet* pVpsStd;
uint32_t spsStdCount; uint32_t spsStdCount;
const StdVideoH265SequenceParameterSet* pSpsStd; const StdVideoH265SequenceParameterSet* pSpsStd;
uint32_t ppsStdCount; uint32_t ppsStdCount;
@ -899,6 +962,7 @@ typedef struct VkVideoDecodeH265SessionParametersAddInfoEXT {
typedef struct VkVideoDecodeH265SessionParametersCreateInfoEXT { typedef struct VkVideoDecodeH265SessionParametersCreateInfoEXT {
VkStructureType sType; VkStructureType sType;
const void* pNext; const void* pNext;
uint32_t maxVpsStdCount;
uint32_t maxSpsStdCount; uint32_t maxSpsStdCount;
uint32_t maxPpsStdCount; uint32_t maxPpsStdCount;
const VkVideoDecodeH265SessionParametersAddInfoEXT* pParametersAddInfo; const VkVideoDecodeH265SessionParametersAddInfoEXT* pParametersAddInfo;

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#define VULKAN_DIRECTFB_H_ 1 #define VULKAN_DIRECTFB_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#define VULKAN_FUCHSIA_H_ 1 #define VULKAN_FUCHSIA_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#define VULKAN_GGP_H_ 1 #define VULKAN_GGP_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#define VULKAN_IOS_H_ 1 #define VULKAN_IOS_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -2,7 +2,7 @@
#define VULKAN_MACOS_H_ 1 #define VULKAN_MACOS_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -2,7 +2,7 @@
#define VULKAN_METAL_H_ 1 #define VULKAN_METAL_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#define VULKAN_SCREEN_H_ 1 #define VULKAN_SCREEN_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#define VULKAN_VI_H_ 1 #define VULKAN_VI_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -2,7 +2,7 @@
#define VULKAN_WAYLAND_H_ 1 #define VULKAN_WAYLAND_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -2,7 +2,7 @@
#define VULKAN_WIN32_H_ 1 #define VULKAN_WIN32_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -2,7 +2,7 @@
#define VULKAN_XCB_H_ 1 #define VULKAN_XCB_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -2,7 +2,7 @@
#define VULKAN_XLIB_H_ 1 #define VULKAN_XLIB_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -2,7 +2,7 @@
#define VULKAN_XLIB_XRANDR_H_ 1 #define VULKAN_XLIB_XRANDR_H_ 1
/* /*
** Copyright 2015-2021 The Khronos Group Inc. ** Copyright 2015-2022 The Khronos Group Inc.
** **
** SPDX-License-Identifier: Apache-2.0 ** SPDX-License-Identifier: Apache-2.0
*/ */

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i #!/usr/bin/python3 -i
# #
# Copyright 2021 The Khronos Group Inc. # Copyright 2021-2022 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Generic alias for working group-specific API conventions interface. # Generic alias for working group-specific API conventions interface.

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i #!/usr/bin/python3 -i
# #
# Copyright 2013-2021 The Khronos Group Inc. # Copyright 2013-2022 The Khronos Group Inc.
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -234,7 +234,11 @@ class COutputGenerator(OutputGenerator):
def appendSection(self, section, text): def appendSection(self, section, text):
"Append a definition to the specified section" "Append a definition to the specified section"
# self.sections[section].append('SECTION: ' + section + '\n')
if section is None:
self.logMsg('error', 'Missing section in appendSection (probably a <type> element missing its \'category\' attribute. Text:', text)
exit(1)
self.sections[section].append(text) self.sections[section].append(text)
self.feature_not_empty = True self.feature_not_empty = True

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i #!/usr/bin/python3 -i
# #
# Copyright 2013-2021 The Khronos Group Inc. # Copyright 2013-2022 The Khronos Group Inc.
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i #!/usr/bin/python3 -i
# #
# Copyright 2013-2021 The Khronos Group Inc. # Copyright 2013-2022 The Khronos Group Inc.
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
"""Base class for source/header/doc generators, as well as some utility functions.""" """Base class for source/header/doc generators, as well as some utility functions."""
@ -55,10 +55,13 @@ def regSortCategoryKey(feature):
Sorts by category of the feature name string: Sorts by category of the feature name string:
- Core API features (those defined with a `<feature>` tag) - Core API features (those defined with a `<feature>` tag)
- (sort VKSC after VK)
- ARB/KHR/OES (Khronos extensions) - ARB/KHR/OES (Khronos extensions)
- other (EXT/vendor extensions)""" - other (EXT/vendor extensions)"""
if feature.elem.tag == 'feature': if feature.elem.tag == 'feature':
if feature.name.startswith('VKSC'):
return 0.5
return 0 return 0
if (feature.category == 'ARB' if (feature.category == 'ARB'
or feature.category == 'KHR' or feature.category == 'KHR'
@ -580,7 +583,10 @@ class OutputGenerator:
# Work around this by chasing the aliases to get the actual value. # Work around this by chasing the aliases to get the actual value.
while numVal is None: while numVal is None:
alias = self.registry.tree.find("enums/enum[@name='" + strVal + "']") alias = self.registry.tree.find("enums/enum[@name='" + strVal + "']")
if alias is not None:
(numVal, strVal) = self.enumToValue(alias, True, bitwidth, True) (numVal, strVal) = self.enumToValue(alias, True, bitwidth, True)
else:
self.logMsg('error', 'No such alias {} for enum {}'.format(strVal, name))
decl += "static const {} {} = {};\n".format(flagTypeName, name, strVal) decl += "static const {} {} = {};\n".format(flagTypeName, name, strVal)
if numVal is not None: if numVal is not None:
@ -1063,7 +1069,8 @@ class OutputGenerator:
return False return False
info = self.registry.typedict.get(structname) info = self.registry.typedict.get(structname)
assert(info is not None) if info is None:
self.logMsg('error', f'isStructAlwaysValid({structname}) - structure not found in typedict')
members = info.getMembers() members = info.getMembers()

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
# #
# Copyright 2013-2021 The Khronos Group Inc. # Copyright 2013-2022 The Khronos Group Inc.
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -22,7 +22,7 @@ from hostsyncgenerator import HostSynchronizationOutputGenerator
from formatsgenerator import FormatsOutputGenerator from formatsgenerator import FormatsOutputGenerator
from pygenerator import PyOutputGenerator from pygenerator import PyOutputGenerator
from rubygenerator import RubyOutputGenerator from rubygenerator import RubyOutputGenerator
from reflib import logDiag, logWarn, setLogFile from reflib import logDiag, logWarn, logErr, setLogFile
from reg import Registry from reg import Registry
from validitygenerator import ValidityOutputGenerator from validitygenerator import ValidityOutputGenerator
from apiconventions import APIConventions from apiconventions import APIConventions
@ -116,7 +116,7 @@ def makeGenOpts(args):
# The SPDX formatting below works around constraints of the 'reuse' tool # The SPDX formatting below works around constraints of the 'reuse' tool
prefixStrings = [ prefixStrings = [
'/*', '/*',
'** Copyright 2015-2021 The Khronos Group Inc.', '** Copyright 2015-2022 The Khronos Group Inc.',
'**', '**',
'** SPDX' + '-License-Identifier: Apache-2.0', '** SPDX' + '-License-Identifier: Apache-2.0',
'*/', '*/',
@ -511,6 +511,83 @@ def makeGenOpts(args):
misracppstyle = misracppstyle) misracppstyle = misracppstyle)
] ]
# Video header target - combines all video extension dependencies into a
# single header, at present.
genOpts['vk_video.h'] = [
COutputGenerator,
CGeneratorOptions(
conventions = conventions,
filename = 'vk_video.h',
directory = directory,
genpath = None,
apiname = 'vulkan',
profile = None,
versions = None,
emitversions = None,
defaultExtensions = defaultExtensions,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
prefixText = prefixStrings + vkPrefixStrings,
genFuncPointers = True,
protectFile = protectFile,
protectFeature = False,
protectProto = '#ifndef',
protectProtoStr = 'VK_NO_PROTOTYPES',
apicall = '',
apientry = '',
apientryp = '',
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
]
# Video extension 'Std' interfaces, each in its own header files
# These are not Vulkan extensions, or a part of the Vulkan API at all,
# but are treated in a similar fashion for generation purposes.
#
# Each element of the videoStd[] array is an 'extension' name defining
# an iterface, and is also the basis for the generated header file name.
videoStd = [
'vulkan_video_codecs_common',
'vulkan_video_codec_h264std',
'vulkan_video_codec_h264std_decode',
'vulkan_video_codec_h264std_encode',
'vulkan_video_codec_h265std',
'vulkan_video_codec_h265std_decode',
'vulkan_video_codec_h265std_encode',
]
addExtensionRE = makeREstring(videoStd)
for codec in videoStd:
headername = f'{codec}.h'
# Consider all of the codecs 'extensions', but only emit this one
emitExtensionRE = makeREstring([codec])
opts = CGeneratorOptions(
conventions = conventions,
filename = headername,
directory = directory,
genpath = None,
apiname = defaultAPIName,
profile = None,
versions = None,
emitversions = None,
defaultExtensions = None,
addExtensions = addExtensionRE,
removeExtensions = None,
emitExtensions = emitExtensionRE,
prefixText = prefixStrings + vkPrefixStrings,
genFuncPointers = False,
protectFile = protectFile,
protectFeature = False,
alignFuncParam = 48,
)
genOpts[headername] = [ COutputGenerator, opts ]
# Unused - vulkan11.h target. # Unused - vulkan11.h target.
# It is possible to generate a header with just the Vulkan 1.0 + # It is possible to generate a header with just the Vulkan 1.0 +
# extension interfaces defined, but since the promoted KHR extensions # extension interfaces defined, but since the promoted KHR extensions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i #!/usr/bin/python3 -i
# #
# Copyright 2013-2021 The Khronos Group Inc. # Copyright 2013-2022 The Khronos Group Inc.
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -104,13 +104,14 @@ def stripNonmatchingAPIs(tree, apiName, actuallyDelete = True):
for child in parent.findall('*'): for child in parent.findall('*'):
api = child.get('api') api = child.get('api')
if api:
if not apiNameMatch(apiName, api): if apiNameMatch(apiName, api):
if actuallyDelete:
parent.remove(child)
else:
# Add child to the queue # Add child to the queue
stack.append(child) stack.append(child)
elif not apiNameMatch(apiName, api):
# Child does not match requested api. Remove it.
if actuallyDelete:
parent.remove(child)
class BaseInfo: class BaseInfo:
@ -294,8 +295,10 @@ class SpirvInfo(BaseInfo):
class FormatInfo(BaseInfo): class FormatInfo(BaseInfo):
"""Registry information about an API <format>.""" """Registry information about an API <format>."""
def __init__(self, elem): def __init__(self, elem, condition):
BaseInfo.__init__(self, elem) BaseInfo.__init__(self, elem)
# Need to save the condition here when it is known
self.condition = condition
class Registry: class Registry:
"""Object representing an API registry, loaded from an XML file.""" """Object representing an API registry, loaded from an XML file."""
@ -399,26 +402,19 @@ class Registry:
Intended for internal use only. Intended for internal use only.
- elem - `<type>`/`<enums>`/`<enum>`/`<command>`/`<feature>`/`<extension>`/`<spirvextension>`/`<spirvcapability>`/`<format>` Element - elem - `<type>`/`<enums>`/`<enum>`/`<command>`/`<feature>`/`<extension>`/`<spirvextension>`/`<spirvcapability>`/`<format>` Element
- info - corresponding {Type|Group|Enum|Cmd|Feature|Spirv}Info object - info - corresponding {Type|Group|Enum|Cmd|Feature|Spirv|Format}Info object
- infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension' / 'spirvextension' / 'spirvcapability' / 'format' - infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension' / 'spirvextension' / 'spirvcapability' / 'format'
- dictionary - self.{type|group|enum|cmd|api|ext|format|spirvext|spirvcap}dict - dictionary - self.{type|group|enum|cmd|api|ext|format|spirvext|spirvcap}dict
If the Element has an 'api' attribute, the dictionary key is the The dictionary key is the element 'name' attribute."""
tuple (name,api). If not, the key is the name. 'name' is an
attribute of the Element"""
# self.gen.logMsg('diag', 'Adding ElementInfo.required =', # self.gen.logMsg('diag', 'Adding ElementInfo.required =',
# info.required, 'name =', elem.get('name')) # info.required, 'name =', elem.get('name'))
api = elem.get('api')
if api:
key = (elem.get('name'), api)
else:
key = elem.get('name') key = elem.get('name')
if key in dictionary: if key in dictionary:
if not dictionary[key].compareElem(info, infoName): if not dictionary[key].compareElem(info, infoName):
self.gen.logMsg('warn', 'Attempt to redefine', key, self.gen.logMsg('warn', 'Attempt to redefine', key,
'(this should not happen)') '(this should not happen)')
else:
True
else: else:
dictionary[key] = info dictionary[key] = info
@ -459,7 +455,7 @@ class Registry:
# overlapping api attributes, or where one element has an api # overlapping api attributes, or where one element has an api
# attribute and the other does not. # attribute and the other does not.
stripNonmatchingAPIs(self.reg, self.genOpts.apiname) stripNonmatchingAPIs(self.reg, self.genOpts.apiname, actuallyDelete = True)
# Create dictionary of registry types from toplevel <types> tags # Create dictionary of registry types from toplevel <types> tags
# and add 'name' attribute to each <type> tag (where missing) # and add 'name' attribute to each <type> tag (where missing)
@ -547,6 +543,7 @@ class Registry:
# Create dictionaries of API and extension interfaces # Create dictionaries of API and extension interfaces
# from toplevel <api> and <extension> tags. # from toplevel <api> and <extension> tags.
self.apidict = {} self.apidict = {}
format_condition = dict()
for feature in self.reg.findall('feature'): for feature in self.reg.findall('feature'):
featureInfo = FeatureInfo(feature) featureInfo = FeatureInfo(feature)
self.addElementInfo(feature, featureInfo, 'feature', self.apidict) self.addElementInfo(feature, featureInfo, 'feature', self.apidict)
@ -583,6 +580,11 @@ class Registry:
else: else:
self.gen.logMsg('warn', 'NO matching group', self.gen.logMsg('warn', 'NO matching group',
groupName, 'for enum', enum.get('name'), 'found.') groupName, 'for enum', enum.get('name'), 'found.')
if groupName == "VkFormat":
format_name = enum.get('name')
if enum.get('alias'):
format_name = enum.get('alias')
format_condition[format_name] = featureInfo.name
addEnumInfo = True addEnumInfo = True
elif enum.get('value') or enum.get('bitpos') or enum.get('alias'): elif enum.get('value') or enum.get('bitpos') or enum.get('alias'):
# self.gen.logMsg('diag', 'Adding extension constant "enum"', # self.gen.logMsg('diag', 'Adding extension constant "enum"',
@ -630,6 +632,14 @@ class Registry:
else: else:
self.gen.logMsg('warn', 'NO matching group', self.gen.logMsg('warn', 'NO matching group',
groupName, 'for enum', enum.get('name'), 'found.') groupName, 'for enum', enum.get('name'), 'found.')
if groupName == "VkFormat":
format_name = enum.get('name')
if enum.get('alias'):
format_name = enum.get('alias')
if format_name in format_condition:
format_condition[format_name] += "," + featureInfo.name
else:
format_condition[format_name] = featureInfo.name
addEnumInfo = True addEnumInfo = True
elif enum.get('value') or enum.get('bitpos') or enum.get('alias'): elif enum.get('value') or enum.get('bitpos') or enum.get('alias'):
# self.gen.logMsg('diag', 'Adding extension constant "enum"', # self.gen.logMsg('diag', 'Adding extension constant "enum"',
@ -666,7 +676,11 @@ class Registry:
self.addElementInfo(spirv, spirvInfo, 'spirvcapability', self.spirvcapdict) self.addElementInfo(spirv, spirvInfo, 'spirvcapability', self.spirvcapdict)
for format in self.reg.findall('formats/format'): for format in self.reg.findall('formats/format'):
formatInfo = FormatInfo(format) condition = None
format_name = format.get('name')
if format_name in format_condition:
condition = format_condition[format_name]
formatInfo = FormatInfo(format, condition)
self.addElementInfo(format, formatInfo, 'format', self.formatsdict) self.addElementInfo(format, formatInfo, 'format', self.formatsdict)
def dumpReg(self, maxlen=120, filehandle=sys.stdout): def dumpReg(self, maxlen=120, filehandle=sys.stdout):
@ -720,6 +734,7 @@ class Registry:
- required - boolean (to tag features as required or not) - required - boolean (to tag features as required or not)
""" """
self.gen.logMsg('diag', 'tagging type:', typename, '-> required =', required) self.gen.logMsg('diag', 'tagging type:', typename, '-> required =', required)
# Get TypeInfo object for <type> tag corresponding to typename # Get TypeInfo object for <type> tag corresponding to typename
typeinfo = self.lookupElementInfo(typename, self.typedict) typeinfo = self.lookupElementInfo(typename, self.typedict)
if typeinfo is not None: if typeinfo is not None:
@ -774,20 +789,18 @@ class Registry:
- enumname - name of enum - enumname - name of enum
- required - boolean (to tag features as required or not)""" - required - boolean (to tag features as required or not)"""
self.gen.logMsg('diag', 'tagging enum:', enumname, '-> required =', required) self.gen.logMsg('diag', 'markEnumRequired: tagging enum:', enumname, '-> required =', required)
enum = self.lookupElementInfo(enumname, self.enumdict) enum = self.lookupElementInfo(enumname, self.enumdict)
if enum is not None: if enum is not None:
# If the enum is part of a group, and is being removed, then # If the enum is part of a group, and is being removed, then
# look it up in that <group> tag and remove it there, so that it # look it up in that <enums> tag and remove the Element there,
# is not visible to generators (which traverse the <group> tag # so that it is not visible to generators (which traverse the
# elements themselves). # <enums> tag elements rather than using the dictionaries).
# This is not the most robust way of doing this, since a removed if not required:
# enum that is later required again will no longer have a group
# element, but it makes the change non-intrusive on generator
# code.
if required is False:
groupName = enum.elem.get('extends') groupName = enum.elem.get('extends')
if groupName is not None: if groupName is not None:
self.gen.logMsg('diag', f'markEnumRequired: Removing extending enum {enum.elem.get("name")}')
# Look up the Info with matching groupName # Look up the Info with matching groupName
if groupName in self.groupdict: if groupName in self.groupdict:
gi = self.groupdict[groupName] gi = self.groupdict[groupName]
@ -796,23 +809,42 @@ class Registry:
# Remove copy of this enum from the group # Remove copy of this enum from the group
gi.elem.remove(gienum) gi.elem.remove(gienum)
else: else:
self.gen.logMsg('warn', 'Cannot remove enum', self.gen.logMsg('warn', 'markEnumRequired: Cannot remove enum',
enumname, 'not found in group', enumname, 'not found in group',
groupName) groupName)
else: else:
self.gen.logMsg('warn', 'Cannot remove enum', self.gen.logMsg('warn', 'markEnumRequired: Cannot remove enum',
enumname, 'from nonexistent group', enumname, 'from nonexistent group',
groupName) groupName)
else:
# This enum is not an extending enum.
# The XML tree must be searched for all <enums> that
# might have it, so we know the parent to delete from.
enumName = enum.elem.get('name')
self.gen.logMsg('diag', f'markEnumRequired: Removing non-extending enum {enumName}')
count = 0
for enums in self.reg.findall('enums'):
for thisEnum in enums.findall('enum'):
if thisEnum.get('name') == enumName:
# Actually remove it
count = count + 1
enums.remove(thisEnum)
if count == 0:
self.gen.logMsg('warn', f'markEnumRequired: {enumName}) not found in any <enums> tag')
enum.required = required enum.required = required
# Tag enum dependencies in 'alias' attribute as required # Tag enum dependencies in 'alias' attribute as required
depname = enum.elem.get('alias') depname = enum.elem.get('alias')
if depname: if depname:
self.gen.logMsg('diag', 'Generating dependent enum', self.gen.logMsg('diag', 'markEnumRequired: Generating dependent enum',
depname, 'for alias', enumname, 'required =', enum.required) depname, 'for alias', enumname, 'required =', enum.required)
self.markEnumRequired(depname, required) self.markEnumRequired(depname, required)
else: else:
self.gen.logMsg('warn', 'enum:', enumname, 'IS NOT DEFINED') self.gen.logMsg('warn', f'markEnumRequired: {enumname} IS NOT DEFINED')
def markCmdRequired(self, cmdname, required): def markCmdRequired(self, cmdname, required):
"""Mark a command as required or not. """Mark a command as required or not.
@ -869,6 +901,7 @@ class Registry:
self.markTypeRequired(typeElem.get('name'), required) self.markTypeRequired(typeElem.get('name'), required)
for enumElem in feature.findall('enum'): for enumElem in feature.findall('enum'):
self.markEnumRequired(enumElem.get('name'), required) self.markEnumRequired(enumElem.get('name'), required)
for cmdElem in feature.findall('command'): for cmdElem in feature.findall('command'):
self.markCmdRequired(cmdElem.get('name'), required) self.markCmdRequired(cmdElem.get('name'), required)
@ -1009,11 +1042,11 @@ class Registry:
else: else:
self.gen.logMsg('warn', 'fillFeatureDictionary: NOT filling for {}'.format(typename)) self.gen.logMsg('warn', 'fillFeatureDictionary: NOT filling for {}'.format(typename))
def requireAndRemoveFeatures(self, interface, featurename, api, profile): def requireFeatures(self, interface, featurename, api, profile):
"""Process `<require>` and `<remove>` tags for a `<version>` or `<extension>`. """Process `<require>` tags for a `<version>` or `<extension>`.
- interface - Element for `<version>` or `<extension>`, containing - interface - Element for `<version>` or `<extension>`, containing
`<require>` and `<remove>` tags `<require>` tags
- featurename - name of the feature - featurename - name of the feature
- api - string specifying API name being generated - api - string specifying API name being generated
- profile - string specifying API profile being generated""" - profile - string specifying API profile being generated"""
@ -1023,6 +1056,15 @@ class Registry:
if matchAPIProfile(api, profile, feature): if matchAPIProfile(api, profile, feature):
self.markRequired(featurename, feature, True) self.markRequired(featurename, feature, True)
def removeFeatures(self, interface, featurename, api, profile):
"""Process `<remove>` tags for a `<version>` or `<extension>`.
- interface - Element for `<version>` or `<extension>`, containing
`<remove>` tags
- featurename - name of the feature
- api - string specifying API name being generated
- profile - string specifying API profile being generated"""
# <remove> marks things that are removed by this version/profile # <remove> marks things that are removed by this version/profile
for feature in interface.findall('remove'): for feature in interface.findall('remove'):
if matchAPIProfile(api, profile, feature): if matchAPIProfile(api, profile, feature):
@ -1038,6 +1080,7 @@ class Registry:
if v.get('struct'): if v.get('struct'):
self.typedict[v.get('struct')].additionalValidity.append(copy.deepcopy(v)) self.typedict[v.get('struct')].additionalValidity.append(copy.deepcopy(v))
def removeAdditionalValidity(self, interface, api, profile):
# Loop over all usage inside all <remove> tags. # Loop over all usage inside all <remove> tags.
for feature in interface.findall('remove'): for feature in interface.findall('remove'):
if matchAPIProfile(api, profile, feature): if matchAPIProfile(api, profile, feature):
@ -1165,7 +1208,8 @@ class Registry:
if extname is not None: if extname is not None:
# 'supported' attribute was injected when the <enum> element was # 'supported' attribute was injected when the <enum> element was
# moved into the <enums> group in Registry.parseTree() # moved into the <enums> group in Registry.parseTree()
if self.genOpts.defaultExtensions == elem.get('supported'): supported_list = elem.get('supported').split(",")
if self.genOpts.defaultExtensions in supported_list:
required = True required = True
elif re.match(self.genOpts.addExtensions, extname) is not None: elif re.match(self.genOpts.addExtensions, extname) is not None:
required = True required = True
@ -1353,7 +1397,7 @@ class Registry:
# Get all matching extensions, in order by their extension number, # Get all matching extensions, in order by their extension number,
# and add to the list of features. # and add to the list of features.
# Start with extensions tagged with 'api' pattern matching the API # Start with extensions whose 'supported' attributes match the API
# being generated. Add extensions matching the pattern specified in # being generated. Add extensions matching the pattern specified in
# regExtensions, then remove extensions matching the pattern # regExtensions, then remove extensions matching the pattern
# specified in regRemoveExtensions # specified in regRemoveExtensions
@ -1435,22 +1479,25 @@ class Registry:
self.genOpts.sortProcedure(features) self.genOpts.sortProcedure(features)
# print('sortProcedure ->', [f.name for f in features]) # print('sortProcedure ->', [f.name for f in features])
# Pass 1: loop over requested API versions and extensions tagging # Passes 1+2: loop over requested API versions and extensions tagging
# types/commands/features as required (in an <require> block) or no # types/commands/features as required (in an <require> block) or no
# longer required (in an <remove> block). It is possible to remove # longer required (in an <remove> block). <remove>s are processed
# a feature in one version and restore it later by requiring it in # after all <require>s, so removals win.
# a later version.
# If a profile other than 'None' is being generated, it must # If a profile other than 'None' is being generated, it must
# match the profile attribute (if any) of the <require> and # match the profile attribute (if any) of the <require> and
# <remove> tags. # <remove> tags.
self.gen.logMsg('diag', 'PASS 1: TAG FEATURES') self.gen.logMsg('diag', 'PASS 1: TAG FEATURES')
for f in features: for f in features:
self.gen.logMsg('diag', 'PASS 1: Tagging required and removed features for', self.gen.logMsg('diag', 'PASS 1: Tagging required and features for', f.name)
f.name)
self.fillFeatureDictionary(f.elem, f.name, self.genOpts.apiname, self.genOpts.profile) self.fillFeatureDictionary(f.elem, f.name, self.genOpts.apiname, self.genOpts.profile)
self.requireAndRemoveFeatures(f.elem, f.name, self.genOpts.apiname, self.genOpts.profile) self.requireFeatures(f.elem, f.name, self.genOpts.apiname, self.genOpts.profile)
self.assignAdditionalValidity(f.elem, self.genOpts.apiname, self.genOpts.profile) self.assignAdditionalValidity(f.elem, self.genOpts.apiname, self.genOpts.profile)
for f in features:
self.gen.logMsg('diag', 'PASS 2: Tagging removed features for', f.name)
self.removeFeatures(f.elem, f.name, self.genOpts.apiname, self.genOpts.profile)
self.removeAdditionalValidity(f.elem, self.genOpts.apiname, self.genOpts.profile)
# Now, strip references to APIs that are not required. # Now, strip references to APIs that are not required.
# At present such references may occur in: # At present such references may occur in:
# Structs in <type category="struct"> 'structextends' attributes # Structs in <type category="struct"> 'structextends' attributes
@ -1466,17 +1513,17 @@ class Registry:
# <enable extension="VK_KHR_shader_draw_parameters"/> # <enable extension="VK_KHR_shader_draw_parameters"/>
# <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderDenormPreserveFloat16" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/> # <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderDenormPreserveFloat16" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
# Pass 2: loop over specified API versions and extensions printing # Pass 3: loop over specified API versions and extensions printing
# declarations for required things which have not already been # declarations for required things which have not already been
# generated. # generated.
self.gen.logMsg('diag', 'PASS 2: GENERATE INTERFACES FOR FEATURES') self.gen.logMsg('diag', 'PASS 3: GENERATE INTERFACES FOR FEATURES')
self.gen.beginFile(self.genOpts) self.gen.beginFile(self.genOpts)
for f in features: for f in features:
self.gen.logMsg('diag', 'PASS 2: Generating interface for', self.gen.logMsg('diag', 'PASS 3: Generating interface for',
f.name) f.name)
emit = self.emitFeatures = f.emit emit = self.emitFeatures = f.emit
if not emit: if not emit:
self.gen.logMsg('diag', 'PASS 2: NOT declaring feature', self.gen.logMsg('diag', 'PASS 3: NOT declaring feature',
f.elem.get('name'), 'because it is not tagged for emission') f.elem.get('name'), 'because it is not tagged for emission')
# Generate the interface (or just tag its elements as having been # Generate the interface (or just tag its elements as having been
# emitted, if they have not been). # emitted, if they have not been).

View File

@ -1,6 +1,6 @@
"""Utility functions not closely tied to other spec_tools types.""" """Utility functions not closely tied to other spec_tools types."""
# Copyright 2018-2019 Collabora, Ltd. # Copyright 2018-2019 Collabora, Ltd.
# Copyright 2013-2021 The Khronos Group Inc. # Copyright 2013-2022 The Khronos Group Inc.
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0

File diff suppressed because one or more lines are too long

1111
externals/Vulkan-Headers/registry/video.xml vendored Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i #!/usr/bin/python3 -i
# #
# Copyright 2013-2021 The Khronos Group Inc. # Copyright 2013-2022 The Khronos Group Inc.
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -22,6 +22,8 @@ CATEGORIES_REQUIRING_VALIDATION = set(('handle', 'enum', 'bitmask'))
# Ideally these would be listed in the spec as exceptions, as OpenXR does. # Ideally these would be listed in the spec as exceptions, as OpenXR does.
SPECIAL_WORDS = set(( SPECIAL_WORDS = set((
'16Bit', # VkPhysicalDevice16BitStorageFeatures '16Bit', # VkPhysicalDevice16BitStorageFeatures
'2D', # VkPhysicalDeviceImage2DViewOf3DFeaturesEXT
'3D', # VkPhysicalDeviceImage2DViewOf3DFeaturesEXT
'8Bit', # VkPhysicalDevice8BitStorageFeaturesKHR '8Bit', # VkPhysicalDevice8BitStorageFeaturesKHR
'AABB', # VkGeometryAABBNV 'AABB', # VkGeometryAABBNV
'ASTC', # VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT 'ASTC', # VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT
@ -173,7 +175,7 @@ class VulkanConventions(ConventionsBase):
instead. N.b. this may need to change on a per-refpage basis if instead. N.b. this may need to change on a per-refpage basis if
there are multiple documents involved. there are multiple documents involved.
""" """
return 'https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html' return 'https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html'
@property @property
def xml_api_name(self): def xml_api_name(self):

View File

@ -325,6 +325,8 @@ const char* ToString(VkResult result) noexcept {
return "VK_PIPELINE_COMPILE_REQUIRED_EXT"; return "VK_PIPELINE_COMPILE_REQUIRED_EXT";
case VkResult::VK_RESULT_MAX_ENUM: case VkResult::VK_RESULT_MAX_ENUM:
return "VK_RESULT_MAX_ENUM"; return "VK_RESULT_MAX_ENUM";
case VkResult::VK_ERROR_COMPRESSION_EXHAUSTED_EXT:
return "VK_ERROR_COMPRESSION_EXHAUSTED_EXT";
} }
return "Unknown"; return "Unknown";
} }